:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --border: #d9e0ea;
  --primary: #2563eb;
  --primary-soft: #eaf1ff;
  --danger: #b42318;
  --success: #0f9f6e;
  --warning: #c77700;
  --red: #e74032;
  --gold: #ffc94a;
  --ink: #552013;
  --teal: #159a8c;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

a {
  color: inherit;
}

.front-body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 219, 109, .78), transparent 22%),
    radial-gradient(circle at 82% 18%, rgba(21, 154, 140, .2), transparent 24%),
    linear-gradient(180deg, #e74032 0%, #f66a38 34%, #fff3da 70%, #fffaf0 100%);
}

.phone-page {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.front-hero {
  position: relative;
  min-height: 300px;
  padding: 20px 18px 40px;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.front-hero::before,
.front-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 236, 145, .22);
  pointer-events: none;
}

.front-hero::before {
  width: 210px;
  height: 210px;
  right: -86px;
  top: -56px;
}

.front-hero::after {
  width: 160px;
  height: 160px;
  left: -80px;
  bottom: 18px;
}

.front-links {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.front-links a {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  background: rgba(88, 18, 9, .18);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  line-height: 28px;
}

.front-tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  background: rgba(95, 25, 14, .2);
  font-size: 13px;
}

.front-hero h1 {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  font-size: 38px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 8px 18px rgba(105, 24, 12, .26);
}

.front-hero p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
}

.front-user {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.front-user label {
  min-width: 0;
  text-align: left;
}

.front-user span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
}

.front-user input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  outline: none;
  font-size: 13px;
}

.front-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.front-stats div {
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(100, 24, 14, .2);
}

.front-stats strong,
.front-stats span {
  display: block;
}

.front-stats strong {
  font-size: 18px;
  line-height: 1.15;
}

.front-stats span {
  margin-top: 4px;
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
}

.wheel-section {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  margin-top: -24px;
}

.grid-shell {
  position: relative;
  width: min(390px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe07a, #ee9a23);
  box-shadow: 0 22px 42px rgba(126, 39, 17, .28), inset 0 -10px 0 rgba(125, 62, 8, .16);
}

.grid-shell::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  pointer-events: none;
}

.lottery-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.lottery-cell,
.grid-draw-btn {
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 12px;
}

.lottery-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 6px;
  border: 2px solid #fff4c5;
  background: linear-gradient(180deg, #fffdf5, #fff1cf);
  box-shadow: inset 0 -4px 0 rgba(154, 75, 18, .08);
  text-align: center;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.lottery-cell.has-image {
  padding: 0;
  border-color: #fff4c5;
}

.lottery-cell.has-image::after {
  display: none;
}

.lottery-cell::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd65a;
  box-shadow: 0 0 9px rgba(255, 214, 90, .75);
}

.lottery-cell.active {
  transform: translateY(-2px);
  border-color: #e74032;
  background: linear-gradient(180deg, #fff6bd, #ffd662);
  box-shadow: 0 0 0 4px rgba(231, 64, 50, .18), inset 0 -4px 0 rgba(154, 75, 18, .12);
}

.lottery-cell.disabled {
  opacity: .55;
}

.grid-prize-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #e74032, #f7a621);
  font-size: 17px;
  font-weight: 900;
}

.grid-prize-name {
  width: 100%;
  margin-top: 8px;
  color: #642515;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.grid-prize-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.grid-prize-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prize-img-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.prize-img-preview {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.prize-img-placeholder {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 11px;
}

.prize-img-upload-btn {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}

.prize-img-upload-btn:hover {
  background: var(--primary-soft);
}

.prize-img-remove {
  padding: 2px 6px;
  border: 1px solid var(--danger);
  border-radius: 4px;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  cursor: pointer;
}

.prize-img-remove:hover {
  background: #fef3f2;
}

.grid-draw-btn {
  border: 0;
  background: linear-gradient(180deg, #fff6b8, #ffc733 56%, #ee961a);
  color: #9d2a12;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.18;
  box-shadow: 0 8px 0 #b84a13, 0 14px 24px rgba(96, 28, 11, .24);
}

.chance-tip {
  margin-top: 12px;
  color: #8d4b23;
  font-size: 14px;
  text-align: center;
}

.front-panel {
  margin: 18px 14px 0;
  padding: 16px;
  border: 1px solid rgba(122, 52, 25, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 42px rgba(123, 45, 18, .16);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 4px 0 0;
  color: #93694f;
  font-size: 12px;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-item {
  min-height: 56px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff9ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-item strong,
.record-item span {
  display: block;
}

.record-item strong {
  font-size: 14px;
}

.record-item span {
  margin-top: 3px;
  color: #a17b64;
  font-size: 12px;
}

.record-item button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #ffe8b8;
  color: #b35416;
  font-size: 12px;
}

.record-item button.done {
  background: #e8f7f0;
  color: var(--success);
}

.rules-panel p {
  margin: 8px 0 0;
  color: #7d533f;
  font-size: 13px;
  line-height: 1.65;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(74, 22, 10, .58);
}

.modal-mask.show {
  display: flex;
}

.modal {
  position: relative;
  width: min(360px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 42px 22px 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf0, #fff2ce);
  text-align: center;
  box-shadow: 0 28px 70px rgba(53, 16, 7, .38);
}

.modal-ribbon {
  position: absolute;
  left: 50%;
  top: 12px;
  min-width: 126px;
  height: 32px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 32px;
}

.modal-icon {
  width: 68px;
  height: 68px;
  margin: 22px auto 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffdb62, #ef5d37);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.modal h3 {
  margin: 14px 0 0;
  color: #532013;
  font-size: 25px;
}

.modal p {
  margin: 8px 0 0;
  color: #8d5c3d;
  font-size: 14px;
  line-height: 1.6;
}

.claim-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  text-align: left;
}

.claim-phone-display {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff9ed;
  border: 1px solid #e9c999;
}

.claim-phone-display span {
  display: block;
  margin-bottom: 4px;
  color: #7d533f;
  font-size: 12px;
}

.claim-phone-display strong {
  font-size: 18px;
  color: #532013;
  letter-spacing: 1px;
}

.claim-form span {
  display: block;
  margin-bottom: 5px;
  color: #7d533f;
  font-size: 12px;
}

.claim-form input {
  width: 100%;
  height: 36px;
  border: 1px solid #e9c999;
  border-radius: 6px;
  padding: 0 10px;
  outline: none;
  color: #532013;
  background: #fff;
}

.verify-row {
  display: flex;
  gap: 8px;
}

.verify-row input {
  flex: 1;
  min-width: 0;
}

.verify-row button {
  flex: 0 0 104px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: #fff0cd;
  color: #b35416;
  font-size: 13px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  flex: 1;
  height: 42px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
}

.modal-actions .secondary {
  background: #fff;
  color: #9b5c38;
}

.modal-actions .primary {
  background: linear-gradient(180deg, #ffdf61, #f7a824);
  color: #8e2c12;
}

.admin-modal {
  background: #fff;
  text-align: left;
}

.admin-modal .modal-ribbon {
  background: var(--primary);
}

.admin-modal .modal-actions .primary {
  background: var(--primary);
  color: #fff;
}

.account-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.account-form span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.account-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  outline: none;
}

.account-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.empty {
  padding: 18px 0;
  color: #9b725a;
  text-align: center;
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translateX(-50%) translateY(20px);
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(44, 28, 19, .88);
  color: #fff;
  text-align: center;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(74, 22, 10, .58);
}

.verify-card {
  width: min(380px, 100%);
  padding: 36px 24px 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 70px rgba(53, 16, 7, .25);
  text-align: center;
  position: relative;
}

.verify-close {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8d5c3d;
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
}

.verify-close:hover {
  background: rgba(0, 0, 0, .06);
}

.verify-card .verify-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: linear-gradient(135deg, #ffdb62, #ef5d37);
}

.verify-card h2 {
  margin: 16px 0 6px;
  font-size: 22px;
  color: #532013;
}

.verify-card > p {
  margin: 0 0 20px;
  color: #8d5c3d;
  font-size: 14px;
}

.verify-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.verify-form label span {
  display: block;
  margin-bottom: 6px;
  color: #7d533f;
  font-size: 13px;
}

.verify-form input {
  width: 100%;
  height: 40px;
  border: 1px solid #e9c999;
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  color: #532013;
  background: #fff;
  font-size: 14px;
}

.verify-form input:focus {
  border-color: #e74032;
  box-shadow: 0 0 0 3px rgba(231, 64, 50, .12);
}

.verify-form .verify-row {
  display: flex;
  gap: 8px;
}

.verify-form .verify-row input {
  flex: 1;
  min-width: 0;
}

.verify-form .verify-row button {
  flex: 0 0 110px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #fff0cd;
  color: #b35416;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.verify-form .verify-row button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.verify-btn {
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffdf61, #f7a824);
  color: #8e2c12;
  font-size: 16px;
  font-weight: 900;
  margin-top: 4px;
}

.verify-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.logout-btn {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  background: rgba(88, 18, 9, .18);
  color: #fff;
  font-size: 13px;
  line-height: 28px;
  cursor: pointer;
}

.switch-phone-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12px;
  line-height: 30px;
  cursor: pointer;
  white-space: nowrap;
}

.switch-phone-btn:active {
  background: rgba(255, 255, 255, .3);
}

.login-trigger-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 34px;
  cursor: pointer;
  white-space: nowrap;
}

.login-trigger-btn:active {
  background: rgba(255, 255, 255, .4);
}

@keyframes loginPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.bound-phone {
  text-align: left;
}

.bound-phone span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
}

.bound-phone strong {
  font-size: 16px;
  letter-spacing: 1px;
}

.admin-body {
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #edf4ff, #f8fafc 45%, #fff8e8);
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(16, 24, 40, .12);
}

.login-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}

.login-card h1 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.login-card label {
  display: block;
  margin-top: 12px;
}

.login-card span,
.form-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input,
.form-grid input,
.form-grid select,
.inline-form input,
td input,
td select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 13px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

.login-card input:focus,
.form-grid input:focus,
.form-grid select:focus,
.inline-form input:focus,
td input:focus,
td select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.login-tip {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 16px 0 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
}

.login-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.login-tabs button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.admin-shell {
  min-height: 100vh;
  display: none;
  grid-template-columns: 232px 1fr;
}

.admin-shell aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #172033;
  color: #fff;
}

.admin-brand {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  margin-bottom: 16px;
}

.admin-brand div {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--primary);
}

.admin-shell nav a,
.front-entry {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 3px 0;
  padding: 0 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  font-size: 14px;
}

.admin-shell nav a.active,
.admin-shell nav a:hover,
.front-entry:hover {
  color: #fff;
  background: rgba(37, 99, 235, .28);
}

.front-entry {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 66px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 20px;
}

.admin-topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions,
.row-actions,
.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-content {
  padding: 22px 24px 38px;
  display: grid;
  gap: 16px;
}

.admin-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-panel-head {
  min-height: 62px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.admin-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
}

.inline-form {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.winner-filters {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.winner-filters label {
  min-width: 0;
}

.winner-filters span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.winner-filters input,
.winner-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 13px;
}

.winner-filters input:focus,
.winner-filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.inline-form input {
  max-width: 220px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.table-wrap.compact table {
  min-width: 520px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--soft);
  color: #465064;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

tr:hover td {
  background: #fbfdff;
}

tr.editing-row td {
  background: #fff8e6;
}

tr.editing-row:hover td {
  background: #fff2c7;
}

td input,
td select {
  min-width: 92px;
}

.primary,
.outline,
.danger {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  border: 1px solid transparent;
  font-size: 13px;
  white-space: nowrap;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.outline {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.danger {
  background: #fff2f0;
  color: var(--danger);
  border-color: #ffd5cf;
}

.wide {
  width: 100%;
  margin-top: 18px;
}

.summary-row {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.summary-row div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--soft);
}

.summary-row strong,
.summary-row span {
  display: block;
}

.summary-row strong {
  font-size: 24px;
}

.summary-row span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status.done {
  color: var(--success);
  background: #e8f7f0;
}

.status.pending {
  color: var(--warning);
  background: #fff4dd;
}

.pagination {
  min-height: 58px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination > div,
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
}

.pagination select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

@keyframes ringPulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-shell aside {
    position: static;
    height: auto;
  }

  .admin-shell nav {
    display: flex;
    gap: 6px;
    overflow: auto;
  }

  .admin-shell nav a {
    flex: 0 0 auto;
  }

  .front-entry {
    display: inline-flex;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .front-user,
  .form-grid,
  .summary-row {
    grid-template-columns: 1fr;
  }

  .admin-topbar,
  .admin-panel-head,
  .inline-form,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .winner-filters {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: stretch;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button,
  .inline-form input,
  .inline-form button,
  .filter-actions button {
    width: 100%;
    max-width: none;
  }

  .admin-content {
    padding: 14px;
  }
}
