/* =========================================================
   六合账本 · Design System
   ========================================================= */
:root {
  --bg: #f2efe7;
  --bg-deep: #eae5d9;
  --surface: #fffdf8;
  --surface-2: #f8f5ec;
  --surface-3: #f1ecdf;
  --ink: #14231f;
  --ink-2: #33443e;
  --muted: #7b8781;
  --muted-2: #9ca59f;
  --line: #e6e0d3;
  --line-strong: #d8d0bf;
  --jade: #0f5c4a;
  --jade-2: #187a62;
  --jade-3: #23977a;
  --jade-soft: #e1f0e9;
  --jade-pale: #f0f7f3;
  --gold: #b8892b;
  --gold-2: #d0a347;
  --gold-soft: #f7ecd3;
  --red: #c24c46;
  --red-soft: #fae9e6;
  --blue: #3d6fd8;
  --blue-soft: #e9eefb;
  --sidebar: #0e2923;
  --sidebar-2: #12352c;
  --shadow-sm: 0 1px 2px rgba(20, 35, 31, .05);
  --shadow: 0 8px 30px rgba(20, 35, 31, .07);
  --shadow-lg: 0 24px 70px rgba(11, 31, 26, .2);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
::selection { background: #c8e6da; color: var(--ink); }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: #c9c2b2 transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: #c9c2b2; border-radius: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Boot
   ========================================================= */
.boot-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(35, 151, 122, .2), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(184, 137, 43, .12), transparent 40%),
    var(--sidebar);
  color: #f3ead3; z-index: 100;
}
.boot-mark {
  width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 38px; font-weight: 700; color: #f4e4bf;
  border: 1px solid rgba(214, 177, 92, .55);
  background: linear-gradient(145deg, #176651, #0b3b30);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.boot-name { margin-top: 16px; letter-spacing: .32em; font-size: 14px; color: rgba(245, 235, 212, .8); }
.boot-bar { width: 130px; height: 2px; background: rgba(255, 255, 255, .12); margin-top: 24px; overflow: hidden; border-radius: 2px; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--gold-2); animation: bootSlide 1.1s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* =========================================================
   Generic buttons / inputs
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; letter-spacing: .01em;
  border: 1px solid transparent; transition: all .18s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--jade); color: #fff; box-shadow: 0 4px 14px rgba(15, 92, 74, .18); }
.btn-primary:hover { background: #0c4d3e; box-shadow: 0 7px 20px rgba(15, 92, 74, .25); }
.btn-gold { background: linear-gradient(135deg, #c59a3c, #ae7d22); color: #fff; box-shadow: 0 4px 14px rgba(184, 137, 43, .22); }
.btn-gold:hover { filter: brightness(1.04); }
.btn-soft { background: var(--jade-soft); color: var(--jade); }
.btn-soft:hover { background: #d3e9df; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: #c9c0ad; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #f6d9d5; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { min-height: 31px; padding: 5px 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs { min-height: 26px; padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.btn-lg { min-height: 46px; padding: 11px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn-link { color: var(--jade); font-weight: 600; padding: 0; background: none; }
.btn-link:hover { text-decoration: underline; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.input, .select, .textarea {
  width: 100%; min-height: 39px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  outline: none; transition: border-color .16s, box-shadow .16s;
  font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--jade-2); box-shadow: 0 0 0 3px rgba(24, 122, 98, .11);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8781' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid { display: grid; gap: 15px; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.input-affix .input { padding-left: 27px; }
.input-affix .affix-suffix { left: auto; right: 12px; }
.input-affix .has-suffix { padding-right: 34px; padding-left: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--jade); width: 15px; height: 15px; }

.search-box { position: relative; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 36px; }

/* =========================================================
   Common surfaces
   ========================================================= */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 20px 22px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.card-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.card-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 22px 22px; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.text-jade { color: var(--jade); }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Shell
   ========================================================= */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 40;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 15% 0%, rgba(38, 133, 110, .28), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(184, 137, 43, .12), transparent 40%),
    linear-gradient(180deg, var(--sidebar), #0a211c);
  color: #dce8e3; padding: 22px 16px 16px;
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 22px 22px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 0; position: relative; }
.brand-mark {
  width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 25px; font-weight: 700; color: #f3e3bc;
  background: linear-gradient(145deg, #1b725b, #0c4236);
  border: 1px solid rgba(208, 163, 71, .5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.brand-text strong { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: .14em; color: #f5ecd7; font-weight: 700; }
.brand-text span { display: block; margin-top: 1px; font-size: 8.5px; letter-spacing: .28em; color: rgba(220, 232, 227, .45); }
.shop-chip {
  margin: 20px 6px 10px; padding: 10px 12px; display: flex; align-items: center; gap: 9px;
  border-radius: 11px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px; color: rgba(233, 241, 237, .78);
}
.shop-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #52d1a6; box-shadow: 0 0 0 4px rgba(82, 209, 166, .12); flex: none; }
.shop-chip .truncate { flex: 1; }
.shop-chip .live { font-size: 10px; color: #77dcb8; letter-spacing: .08em; }
.nav-label { margin: 20px 14px 8px; font-size: 10px; letter-spacing: .2em; color: rgba(220, 232, 227, .32); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 3px; position: relative; }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 13px; border-radius: 11px;
  color: rgba(224, 235, 230, .72); font-size: 13.5px; font-weight: 500;
  transition: background .16s, color .16s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(100deg, rgba(60, 171, 140, .24), rgba(60, 171, 140, .09));
  color: #f4fbf8; box-shadow: inset 0 0 0 1px rgba(110, 219, 185, .14);
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: #7adbbd;
}
.nav-icon { width: 19px; height: 19px; opacity: .78; }
.nav-item.active .nav-icon { opacity: 1; color: #8ce5c8; }
.nav-badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: rgba(208, 163, 71, .18); color: #e4bd6b; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; position: relative; }
.help-card {
  margin: 8px 4px 12px; padding: 13px; border-radius: 13px;
  background: linear-gradient(140deg, rgba(208, 163, 71, .13), rgba(255, 255, 255, .03));
  border: 1px solid rgba(208, 163, 71, .16);
}
.help-card strong { display: block; font-size: 12px; color: #ecd8a8; font-weight: 600; }
.help-card p { margin-top: 4px; font-size: 11px; line-height: 1.5; color: rgba(224, 235, 230, .52); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 11px 9px 5px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-mini .avatar { width: 33px; height: 33px; font-size: 13px; background: rgba(255, 255, 255, .1); color: #e9f4ef; border-color: rgba(255, 255, 255, .12); }
.user-mini strong { display: block; font-size: 12.5px; color: #e7f1ec; font-weight: 600; }
.user-mini span { display: block; font-size: 10.5px; color: rgba(220, 232, 227, .45); }
.user-mini .icon { margin-left: auto; color: rgba(220, 232, 227, .4); }

.main { flex: 1; min-width: 0; margin-left: 252px; }
.topbar {
  height: 80px; padding: 0 30px; display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(242, 239, 231, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 208, 191, .6);
}
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.topbar-title p { margin-top: 1px; font-size: 12px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.date-chip {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .7);
  color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.date-chip .icon { color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink-2); background: rgba(255, 253, 248, .7); border: 1px solid var(--line);
  transition: all .16s;
}
.icon-btn:hover { background: #fff; color: var(--jade); }
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 9px 0 6px;
  border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 253, 248, .8);
}
.user-trigger:hover { background: #fff; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jade-soft); color: var(--jade); font-weight: 700; font-size: 13px;
  border: 1px solid rgba(15, 92, 74, .12); flex: none;
}
.avatar-sm { width: 29px; height: 29px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: 19px; border-radius: 16px; }
.user-trigger .chev { color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 196px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 18px 50px rgba(20, 35, 31, .16); z-index: 60;
  animation: dropIn .16s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-head { padding: 9px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown-head strong { display: block; font-size: 13px; }
.dropdown-head span { display: block; font-size: 11px; color: var(--muted); }
.dropdown-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 13px; text-align: left; color: var(--ink-2); }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-soft); }

.page { max-width: 1440px; margin: 0 auto; padding: 26px 30px 50px; animation: pageIn .28s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.mobile-nav { display: none; }
.overlay { display: none; }

/* =========================================================
   Login
   ========================================================= */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; background: var(--sidebar); }
.login-visual {
  position: relative; overflow: hidden; padding: 52px 58px; color: #eef5f1;
  background:
    radial-gradient(circle at 16% 12%, rgba(37, 151, 121, .32), transparent 42%),
    radial-gradient(circle at 90% 86%, rgba(184, 137, 43, .18), transparent 40%),
    linear-gradient(150deg, #0e2e26, #09201b);
  display: flex; flex-direction: column;
}
.login-visual::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 40% 40%, black, transparent 72%);
}
.login-brand { position: relative; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 46px; height: 46px; }
.login-brand strong { font-family: var(--serif); font-size: 19px; letter-spacing: .18em; }
.login-brand span { display: block; font-size: 8.5px; letter-spacing: .3em; color: rgba(238, 245, 241, .4); }
.login-headline { position: relative; margin-top: 10vh; max-width: 560px; }
.login-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .22em; color: #d8b265; font-weight: 600; }
.login-eyebrow::before { content: ""; width: 24px; height: 1px; background: #d8b265; }
.login-headline h1 { margin-top: 17px; font-family: var(--serif); font-size: clamp(38px, 4.3vw, 58px); line-height: 1.18; letter-spacing: .05em; font-weight: 700; color: #f7f0df; }
.login-headline h1 em { font-style: normal; color: #e0b968; }
.login-headline p { margin-top: 18px; font-size: 14.5px; line-height: 1.9; color: rgba(231, 242, 237, .6); max-width: 440px; }
.login-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.feature-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  background: rgba(255, 255, 255, .045); font-size: 11.5px; color: rgba(235, 244, 240, .72);
}
.feature-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: #6bd6b5; }
.login-preview {
  position: relative; margin-top: auto; width: min(480px, 90%); padding: 17px 18px;
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  backdrop-filter: blur(8px); box-shadow: 0 24px 50px rgba(0, 0, 0, .2);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: rgba(235, 244, 240, .55); letter-spacing: .05em; }
.preview-head .live-dot { display: inline-flex; align-items: center; gap: 6px; color: #8be2c4; }
.preview-head .live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6bd6b5; box-shadow: 0 0 0 4px rgba(107, 214, 181, .13); }
.preview-balls { display: flex; gap: 7px; margin: 14px 0 15px; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .09); }
.preview-stat span { display: block; font-size: 10px; color: rgba(235, 244, 240, .45); }
.preview-stat strong { display: block; margin-top: 3px; font-size: 17px; font-weight: 700; color: #f3ecd9; font-variant-numeric: tabular-nums; }
.preview-stat strong.gold { color: #e0b968; }
.floating-ball { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none; }
.floating-ball.b1 { width: 260px; height: 260px; right: -80px; top: -70px; background: radial-gradient(circle at 35% 30%, rgba(76, 189, 156, .2), transparent 65%); animation: float 9s ease-in-out infinite; }
.floating-ball.b2 { width: 130px; height: 130px; right: 20%; bottom: -50px; background: radial-gradient(circle at 35% 30%, rgba(208, 163, 71, .16), transparent 65%); animation: float 11s ease-in-out infinite reverse; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.login-panel {
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: 38px; position: relative;
}
.login-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 80% 10%, rgba(184, 137, 43, .08), transparent 32%);
}
.login-card { width: min(390px, 100%); position: relative; }
.login-card-head .eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--gold); font-weight: 700; }
.login-card-head h2 { margin-top: 9px; font-family: var(--serif); font-size: 31px; letter-spacing: .04em; }
.login-card-head p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.login-form { margin-top: 30px; display: flex; flex-direction: column; gap: 17px; }
.login-form .input { min-height: 47px; background: rgba(255, 253, 248, .8); border-radius: 12px; padding: 10px 14px 10px 42px; }
.login-form .input-affix .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-form .btn-primary { min-height: 48px; margin-top: 3px; border-radius: 12px; font-size: 14.5px; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin-top: -4px; }
.form-error {
  display: none; padding: 10px 12px; border-radius: 10px; background: var(--red-soft);
  color: var(--red); font-size: 12.5px; border: 1px solid #f1d2ce;
}
.form-error.show { display: flex; align-items: center; gap: 7px; animation: shake .3s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.demo-box {
  margin-top: 23px; padding: 13px 14px; border: 1px dashed var(--line-strong); border-radius: 12px;
  background: rgba(255, 253, 248, .5); display: flex; align-items: center; gap: 10px;
}
.demo-box .demo-icon { width: 31px; height: 31px; border-radius: 9px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.demo-box p { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.demo-box p strong { color: var(--ink-2); font-weight: 600; }
.demo-box .btn { margin-left: auto; flex: none; }
.login-foot { margin-top: 28px; font-size: 11px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.login-foot .icon { width: 13px; height: 13px; }

/* =========================================================
   Balls / tags
   ========================================================= */
.ball {
  --ball-bg: #c24c46;
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 32% 25%, rgba(255, 255, 255, .38), transparent 33%), var(--ball-bg);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18), 0 2px 6px rgba(20, 35, 31, .13);
  flex: none; position: relative; letter-spacing: .02em;
}
.ball-red { --ball-bg: #c34c47; }
.ball-blue { --ball-bg: #3f6cc7; }
.ball-green { --ball-bg: #2d8b61; }
.ball-sm { width: 27px; height: 27px; font-size: 11px; }
.ball-lg { width: 46px; height: 46px; font-size: 18px; }
.ball-xl { width: 52px; height: 52px; font-size: 20px; }
.ball-special { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gold-2), 0 4px 12px rgba(184, 137, 43, .22); }
.ball-placeholder { background: #eee9dd; color: #b4ad9e; box-shadow: inset 0 0 0 1px var(--line); }
.ball-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ball-row .plus { color: var(--muted-2); font-size: 12px; font-weight: 700; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1.65; white-space: nowrap;
}
.tag-jade { background: var(--jade-soft); color: var(--jade); }
.tag-gold { background: var(--gold-soft); color: #946a18; }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-gray { background: #f0ede5; color: #7d786c; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending, .status-open { color: #a4771a; }
.status-settled, .status-won, .status-active { color: var(--jade); }
.status-drawn { color: var(--blue); }
.status-void, .status-lost, .status-disabled { color: var(--muted-2); }
.status-lost { color: #a09a8e; }
.status-void { color: #a09a8e; }

/* =========================================================
   Page heads / filters / stats
   ========================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; letter-spacing: .01em; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.filter-card { padding: 14px 16px; margin-bottom: 18px; }
.filter-row { display: flex; align-items: flex-end; gap: 11px; flex-wrap: wrap; }
.filter-item { min-width: 130px; }
.filter-item.grow { flex: 1; min-width: 190px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.filter-item label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.filter-item .input, .filter-item .select { min-height: 36px; font-size: 12.5px; }
.filter-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 15px; }
.filter-chip {
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; color: var(--muted); transition: all .16s;
}
.filter-chip:hover { border-color: var(--line-strong); color: var(--ink-2); }
.filter-chip.active { background: var(--jade); border-color: var(--jade); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative; overflow: hidden; padding: 18px 19px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -38px; top: -42px;
  background: var(--tone-bg, var(--jade-soft)); opacity: .55;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-icon { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-bg, var(--jade-soft)); color: var(--tone, var(--jade)); }
.stat-value { margin-top: 13px; font-size: 27px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-meta { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; position: relative; z-index: 1; }
.stat-meta strong { color: var(--ink-2); font-weight: 600; }
.tone-jade { --tone: var(--jade); --tone-bg: var(--jade-soft); }
.tone-gold { --tone: #9a711d; --tone-bg: var(--gold-soft); }
.tone-red { --tone: var(--red); --tone-bg: var(--red-soft); }
.tone-blue { --tone: var(--blue); --tone-bg: var(--blue-soft); }
.tone-ink { --tone: var(--ink-2); --tone-bg: #eeebe2; }

.mini-stats { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.mini-stat { flex: 1; padding: 11px 15px; border-right: 1px solid var(--line); }
.mini-stat:last-child { border-right: 0; }
.mini-stat span { display: block; font-size: 10.5px; color: var(--muted); }
.mini-stat strong { display: block; margin-top: 2px; font-size: 15px; font-variant-numeric: tabular-nums; }

/* =========================================================
   Dashboard
   ========================================================= */
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.welcome-eyebrow { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.welcome-eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.welcome h2 { margin-top: 7px; font-family: var(--serif); font-size: 30px; letter-spacing: .03em; font-weight: 700; }
.welcome h2 span { color: var(--jade); }
.welcome p { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.welcome-actions { display: flex; gap: 9px; align-items: center; }
.announcement {
  display: flex; align-items: center; gap: 9px; padding: 10px 15px; margin-bottom: 18px;
  border-radius: 12px; border: 1px solid #eedfbf; background: linear-gradient(90deg, #fbf4e4, #fdfaf2);
  color: #806221; font-size: 12.5px;
}
.announcement .icon { color: var(--gold); }
.announcement strong { font-weight: 700; margin-right: 2px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 16px; margin-bottom: 16px; }
.dash-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid .span-2 { grid-column: span 2; }
.chart-card .card-body { padding-top: 8px; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-line { width: 15px; height: 3px; border-radius: 3px; }
.legend-line.jade { background: var(--jade-2); }
.legend-line.gold { background: var(--gold-2); }

.draw-feature { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: linear-gradient(150deg, #123c32, #0c2923); color: #eaf3ee; padding: 20px; border: 1px solid rgba(255, 255, 255, .07); }
.draw-feature::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(66, 179, 147, .28), transparent 66%); right: -50px; top: -60px; }
.draw-feature-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: rgba(234, 243, 238, .55); position: relative; }
.draw-feature-top .issue { color: #f4ecd8; font-weight: 700; letter-spacing: .06em; }
.draw-feature .ball-row { margin: 17px 0 13px; position: relative; }
.draw-feature .ball { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18), 0 3px 10px rgba(0, 0, 0, .22); }
.draw-feature .ball-special { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18), 0 0 0 2px #123c32, 0 0 0 3.5px #d0a347; }
.draw-meta { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: rgba(234, 243, 238, .58); }
.draw-meta b { color: #f0d89e; font-weight: 600; }
.draw-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 11.5px; }
.draw-footer .link { color: #8be2c4; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.open-draw-strip { margin-top: 12px; padding: 11px 13px; border-radius: 11px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.open-draw-strip .pulse { width: 7px; height: 7px; border-radius: 50%; background: #e4bd6b; animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(228, 189, 107, .35); } 50% { box-shadow: 0 0 0 6px rgba(228, 189, 107, 0); } }
.open-draw-strip strong { color: #f3e5c4; }
.open-draw-strip .btn { margin-left: auto; }

.pending-list { display: flex; flex-direction: column; gap: 9px; }
.pending-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.pending-item .issue-box { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: #8b6316; font-size: 10px; font-weight: 700; line-height: 1.15; text-align: center; flex: none; }
.pending-item .issue-box b { display: block; font-size: 13px; }
.pending-item strong { display: block; font-size: 12.5px; }
.pending-item span { display: block; font-size: 11px; color: var(--muted); }
.pending-item .amount { margin-left: auto; text-align: right; }
.pending-item .amount b { display: block; font-size: 13px; }
.pending-item .amount span { font-size: 10.5px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); transition: all .16s; }
.quick-link:hover { border-color: #cfc6b4; background: #fff; transform: translateY(-1px); }
.quick-link .qi { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; background: var(--jade-soft); color: var(--jade); flex: none; }
.quick-link strong { display: block; font-size: 12px; }
.quick-link span { display: block; font-size: 10.5px; color: var(--muted); }

.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-item:first-child { padding-top: 0; }
.tx-icon { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; background: var(--jade-soft); color: var(--jade); flex: none; }
.tx-icon.out { background: var(--red-soft); color: var(--red); }
.tx-icon.gold { background: var(--gold-soft); color: #99701b; }
.recent-item .tx-main { min-width: 0; flex: 1; }
.recent-item .tx-main strong { display: block; font-size: 12.5px; font-weight: 600; }
.recent-item .tx-main span { display: block; font-size: 10.5px; color: var(--muted); }
.recent-item .tx-amount { text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-item .tx-amount span { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }

.rank-table td { padding-top: 10px; padding-bottom: 10px; }
.rank-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rank-name > div { min-width: 0; }
.rank-name strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rank-name > div span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rank-name .avatar { flex: none; }
.rank-bar { width: 92px; }
.progress { height: 5px; border-radius: 4px; background: #eee9dd; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--jade-2), #52b596); }

/* =========================================================
   Tables
   ========================================================= */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; padding: 10px 12px; font-size: 10.5px; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.table th:first-child { border-radius: 9px 0 0 9px; }
.table th:last-child { border-radius: 0 9px 9px 0; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: #fbf8f0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.cell-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.cell-customer { display: flex; align-items: center; gap: 9px; }
.cell-customer strong { display: block; font-weight: 600; font-size: 12.5px; }
.cell-customer span { display: block; font-size: 10.5px; color: var(--muted); }
.money-pos { color: var(--jade); font-weight: 700; }
.money-neg { color: var(--red); font-weight: 700; }
.ticket-summary { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mobile-ticket-list { display: none; }
.mobile-ticket-card { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 8px; }
.mobile-ticket-card:active { background: var(--surface-2); }
.mt-head { display: flex; align-items: center; gap: 8px; }
.mt-customer { flex: 1; min-width: 0; }
.mt-customer strong { display: block; font-size: 12.5px; font-weight: 600; }
.mt-customer span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-summary { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 9.5px; color: var(--muted); }
.mt-money { text-align: right; white-space: nowrap; }
.mt-money b { color: var(--ink); font-size: 12px; }
.ticket-no { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.table-total { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 0; font-size: 12px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-top: 15px; }
.page-btn { min-width: 31px; height: 31px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--ink-2); }
.page-btn:hover { border-color: var(--line-strong); background: #fff; }
.page-btn.active { background: var(--jade); border-color: var(--jade); color: #fff; }
.page-btn:disabled { opacity: .4; }
.page-info { font-size: 11.5px; color: var(--muted); margin-right: 6px; }

.summary-ribbon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.summary-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 7px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.summary-chip b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.summary-chip.jade b { color: var(--jade); }
.summary-chip.red b { color: var(--red); }
.summary-chip.gold b { color: #956b18; }

/* =========================================================
   Draws
   ========================================================= */
.draw-list { display: flex; flex-direction: column; gap: 11px; }
.draw-card {
  display: flex; align-items: center; gap: 20px; padding: 17px 19px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color .16s, box-shadow .16s;
}
.draw-card:hover { border-color: #d6cdbb; box-shadow: var(--shadow); }
.draw-card.is-open { border-style: dashed; border-color: #d8bd87; background: linear-gradient(90deg, #fdf9ef, var(--surface)); }
.draw-card-main { min-width: 155px; }
.draw-card-main .issue { font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.draw-card-main .date { margin-top: 3px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.draw-card-balls { flex: 1; min-width: 270px; }
.draw-card-balls .ball-row { gap: 7px; }
.draw-card-stats { display: flex; gap: 22px; padding: 0 6px; }
.draw-card-stats div span { display: block; font-size: 10px; color: var(--muted); }
.draw-card-stats div strong { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.draw-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 128px; }
.draw-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.draw-note { font-size: 10.5px; color: var(--muted); }
.meta-line { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.meta-line b { font-weight: 600; color: var(--ink-2); }
.tag-color-red { background: var(--red-soft); color: var(--red); }
.tag-color-blue { background: var(--blue-soft); color: var(--blue); }
.tag-color-green { background: var(--jade-soft); color: var(--jade); }

.draw-result-grid { display: flex; flex-direction: column; gap: 15px; }
.slot-row { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.slot {
  width: 52px; height: 62px; border-radius: 13px; border: 1.5px dashed var(--line-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--surface-2); color: var(--muted); font-size: 10px; transition: all .16s;
}
.slot:hover { border-color: var(--jade-2); }
.slot.filled { border-style: solid; border-color: var(--line); background: #fff; }
.slot.active { border-color: var(--jade); background: var(--jade-pale); box-shadow: 0 0 0 3px rgba(24, 122, 98, .1); }
.slot.special { width: 58px; height: 66px; }
.slot.special.active { border-color: var(--gold); background: #fdf8eb; box-shadow: 0 0 0 3px rgba(184, 137, 43, .12); }
.slot .slot-label { font-size: 9px; letter-spacing: .04em; color: var(--muted-2); }
.slot .ball { width: 30px; height: 30px; font-size: 12px; }
.slot.special .ball { width: 36px; height: 36px; font-size: 14px; }
.result-preview { padding: 13px 15px; border-radius: 12px; background: var(--jade-pale); border: 1px solid #d5e9e0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.preview-attrs { display: flex; gap: 7px; flex-wrap: wrap; }
.attr { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 7px; background: #fff; border: 1px solid #dcebe4; font-size: 11px; color: var(--ink-2); }
.attr b { color: var(--jade); font-weight: 700; }
.number-picker { max-height: 380px; overflow-y: auto; padding: 3px 2px 5px; }
.number-picker .grid-label { font-size: 10.5px; color: var(--muted); margin: 7px 2px 6px; }

/* =========================================================
   Modal
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(9, 24, 20, .44);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 22px;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  width: min(540px, 100%); max-height: calc(100vh - 44px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .55); animation: modalIn .22s cubic-bezier(.2, .8, .25, 1);
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-lg { width: min(760px, 100%); }
.modal-xl { width: min(1040px, 100%); }
.modal-head { padding: 20px 24px 15px; display: flex; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--line); flex: none; }
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.modal-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.modal-close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); flex: none; }
.modal-close:hover { background: #eee9dd; color: var(--ink); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-body.flush { padding: 0; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex: none; background: var(--surface); }
.modal-foot .left { margin-right: auto; font-size: 12px; color: var(--muted); }
.modal-section + .modal-section { margin-top: 20px; }
.modal-section-title { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.modal-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--gold-2); }

/* =========================================================
   Bet slip
   ========================================================= */
.bet-modal .modal-body { padding: 0; overflow: hidden; }
.bet-layout { display: grid; grid-template-columns: minmax(0, 1fr) 335px; min-height: 520px; }
.bet-main { padding: 18px 22px 22px; overflow-y: auto; max-height: calc(100vh - 210px); }
.bet-side { background: var(--surface-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 210px); }
.bet-step { margin-bottom: 17px; }
.step-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 9px; }
.step-num { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; }
.bet-select-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.credit-hint { margin-top: 8px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.credit-hint b { color: var(--jade); font-weight: 700; }
.credit-hint.warn b { color: var(--red); }
.group-tabs { display: flex; gap: 5px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 11px; }
.group-tab { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.group-tab.active { background: #fff; color: var(--jade); box-shadow: var(--shadow-sm); }
.type-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.type-chip { padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; color: var(--muted); }
.type-chip:hover { border-color: var(--line-strong); color: var(--ink-2); }
.type-chip.active { background: var(--jade); border-color: var(--jade); color: #fff; }
.picker { border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 13px; }
.picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.picker-head strong { font-size: 12.5px; }
.picker-head span { font-size: 10.5px; color: var(--muted); }
.picker-head .odds-tag { background: var(--gold-soft); color: #8d6415; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.number-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.num-cell {
  position: relative; height: 47px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; transition: all .13s;
}
.num-cell:hover { border-color: var(--jade-2); background: #fff; }
.num-cell .n { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.num-cell .z { font-size: 8.5px; color: var(--muted); line-height: 1; }
.num-cell .color-dot { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; }
.num-cell.red .n { color: var(--red); }
.num-cell.blue .n { color: var(--blue); }
.num-cell.green .n { color: var(--jade-2); }
.num-cell.red .color-dot { background: var(--red); }
.num-cell.blue .color-dot { background: var(--blue); }
.num-cell.green .color-dot { background: var(--jade-2); }
.num-cell.selected { border-color: var(--jade); background: var(--jade-pale); box-shadow: 0 0 0 2px rgba(24, 122, 98, .09); }
.num-cell.selected::after { content: "✓"; position: absolute; bottom: 3px; right: 5px; font-size: 8px; color: var(--jade); font-weight: 700; }
.num-cell:disabled { opacity: .3; }
.choice-grid { display: flex; gap: 9px; flex-wrap: wrap; }
.choice-btn { min-width: 82px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; }
.choice-btn:hover { border-color: var(--jade-2); }
.choice-btn.selected { background: var(--jade); border-color: var(--jade); color: #fff; }
.choice-btn .sub { display: block; font-size: 9.5px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.choice-btn.selected .sub { color: rgba(255, 255, 255, .7); }
.zodiac-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.zodiac-card { padding: 8px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: center; }
.zodiac-card:hover { border-color: var(--jade-2); }
.zodiac-card.selected { background: var(--jade); border-color: var(--jade); color: #fff; }
.zodiac-card strong { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.3; }
.zodiac-card span { display: block; font-size: 8.5px; line-height: 1.4; color: var(--muted); word-break: break-all; }
.zodiac-card.selected span { color: rgba(255, 255, 255, .72); }
.tail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.tail-btn { padding: 10px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 13px; font-weight: 700; }
.tail-btn:hover { border-color: var(--jade-2); }
.tail-btn.selected { background: var(--jade); border-color: var(--jade); color: #fff; }
.add-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.add-row .field { flex: 1; min-width: 120px; }
.add-row .amount-field { max-width: 150px; }
.quick-amounts { display: flex; gap: 5px; flex-wrap: wrap; }
.quick-amount { padding: 3px 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.quick-amount:hover { border-color: var(--jade-2); color: var(--jade); }
.add-preview { margin-top: 10px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.add-preview b { color: var(--ink-2); }
.selection-preview-empty { color: var(--muted-2); }
.bet-side-head { padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); flex: none; }
.bet-side-head strong { font-size: 13px; }
.bet-side-head span { font-size: 10.5px; color: var(--muted); }
.cart-list { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 130px; }
.cart-empty { text-align: center; padding: 34px 15px; color: var(--muted-2); font-size: 11.5px; line-height: 1.7; }
.cart-empty .icon { width: 30px; height: 30px; margin: 0 auto 8px; opacity: .45; }
.cart-item { display: flex; gap: 8px; padding: 9px 8px; border-radius: 9px; background: #fff; border: 1px solid var(--line); margin-bottom: 6px; }
.cart-item-main { min-width: 0; flex: 1; }
.cart-item-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.cart-item-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.cart-item-meta { text-align: right; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.cart-item-meta span { display: block; font-size: 9.5px; color: var(--muted); font-weight: 400; }
.cart-remove { align-self: center; color: var(--muted-2); width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.cart-remove:hover { background: var(--red-soft); color: var(--red); }
.cart-summary { padding: 13px 18px; border-top: 1px solid var(--line); background: #fff; flex: none; }
.cart-line { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.cart-line b { color: var(--ink-2); font-weight: 600; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 8px; margin-top: 7px; border-top: 1px dashed var(--line); }
.cart-total span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.cart-total b { font-size: 22px; color: var(--jade); font-variant-numeric: tabular-nums; }
.cart-note { margin-top: 9px; }
.cart-note .input { min-height: 34px; font-size: 11.5px; }
.cart-submit { padding: 0 18px 16px; flex: none; }
.credit-line { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 7px; }
.credit-line b { color: var(--jade); }

/* 粘贴识别 */
.paste-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 20px; }
.paste-textarea { min-height: 270px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; resize: vertical; }
.paste-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.paste-hint { display: flex; gap: 7px; margin-top: 11px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.paste-hint .icon { flex: none; margin-top: 1px; }
.paste-right { min-width: 0; }
.paste-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.paste-items { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
.paste-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.paste-item-main { flex: 1; min-width: 0; }
.paste-item-main strong { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste-item-main span { display: block; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste-amount-wrap { width: 96px; flex: none; }
.paste-amount-wrap .input { min-height: 31px; padding-left: 22px; font-size: 11.5px; text-align: right; }
.paste-amount-wrap .affix { left: 8px; font-size: 11px; }
.paste-warnings { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.paste-warning { display: flex; gap: 6px; padding: 7px 9px; border-radius: 8px; background: var(--gold-soft); color: #7d5a18; font-size: 10.5px; line-height: 1.5; }
.paste-warning .icon { flex: none; margin-top: 1px; }
.paste-unparsed { margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.paste-unparsed strong { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.paste-unparsed span { display: block; font-size: 10.5px; color: var(--ink-2); line-height: 1.6; word-break: break-all; }

/* =========================================================
   Receipt / ticket detail
   ========================================================= */
.receipt { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px; }
.receipt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 13px; border-bottom: 1px dashed var(--line-strong); }
.receipt-brand { display: flex; align-items: center; gap: 9px; }
.receipt-brand .brand-mark { width: 34px; height: 34px; font-size: 19px; border-radius: 9px; }
.receipt-brand strong { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .1em; }
.receipt-brand span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .1em; }
.receipt-no { text-align: right; font-size: 10.5px; color: var(--muted); }
.receipt-no b { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink); margin-top: 2px; }
.receipt-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 13px 0; border-bottom: 1px dashed var(--line-strong); }
.receipt-info span { display: block; font-size: 9.5px; color: var(--muted); }
.receipt-info strong { display: block; font-size: 11.5px; margin-top: 2px; }
.receipt-lines { padding: 8px 0; }
.receipt-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 7px 0; font-size: 11.5px; border-bottom: 1px solid #f2eee5; }
.receipt-line:last-child { border-bottom: 0; }
.receipt-line strong { display: block; font-weight: 600; }
.receipt-line span { display: block; font-size: 10px; color: var(--muted); }
.receipt-line .amt { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-line .amt b { display: block; }
.receipt-line .amt span { font-size: 9.5px; }
.receipt-total { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.receipt-total span { font-size: 12px; color: var(--muted); }
.receipt-total b { font-size: 22px; color: var(--jade); font-variant-numeric: tabular-nums; }
.receipt-foot { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line-strong); text-align: center; font-size: 9.5px; color: var(--muted-2); line-height: 1.6; }
.ticket-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ticket-info-grid > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.detail-label { font-size: 9.5px; color: var(--muted); }
.detail-value { font-size: 12px; font-weight: 600; margin-top: 2px; }
.line-status { font-size: 10.5px; font-weight: 600; }
.line-status.won { color: var(--jade); }
.line-status.lost { color: var(--muted-2); }
.line-status.pending { color: #a4771a; }
.line-payout { color: var(--jade); font-weight: 700; }

/* =========================================================
   Customers
   ========================================================= */
.customer-hero { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.customer-hero .avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.customer-hero h3 { font-size: 18px; }
.customer-hero p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.customer-hero .customer-actions { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.customer-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 15px 0; }
.customer-stat { padding: 10px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.customer-stat span { display: block; font-size: 9.5px; color: var(--muted); }
.customer-stat strong { display: block; margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.customer-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.customer-tab { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.customer-tab.active { color: var(--jade); border-bottom-color: var(--jade); font-weight: 600; }
.ledger-list { max-height: 280px; overflow-y: auto; }
.ledger-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ledger-item:last-child { border-bottom: 0; }
.ledger-item .tx-main { flex: 1; min-width: 0; }
.ledger-item .tx-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.ledger-item .tx-main span { display: block; font-size: 9.5px; color: var(--muted); }
.ledger-item .tx-amt { text-align: right; font-size: 11.5px; font-weight: 700; }
.ledger-item .tx-amt span { display: block; font-size: 9px; color: var(--muted); font-weight: 400; }
.customer-table-balance { font-weight: 700; font-variant-numeric: tabular-nums; }
.mobile-customer-list { display: none; }
.mobile-customer-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.mc-balance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--surface-2); }
.mc-balance span { display: block; font-size: 9.5px; color: var(--muted); }
.mc-balance b { display: block; margin-top: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mc-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mc-credit { margin-left: auto; font-size: 9.5px; color: var(--muted); }
.mobile-tx-list { display: none; }
.mobile-tx-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 7px; }
.mobile-tx-card .mt-head { align-items: flex-start; }
.mobile-tx-card .mt-head > b { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mobile-tx-card .mt-foot span:first-child { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Reports / settings
   ========================================================= */
.report-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.report-layout.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.report-card { padding: 16px 18px; }
.report-card .stat-value { font-size: 23px; }
.bar-cell { display: flex; align-items: center; gap: 9px; min-width: 110px; }
.bar-cell .bar { flex: 1; height: 5px; border-radius: 4px; background: #eee9dd; overflow: hidden; }
.bar-cell .bar span { display: block; height: 100%; border-radius: 4px; background: var(--jade-2); }
.report-table td, .report-table th { padding-left: 9px; padding-right: 9px; }
.scroll-hint { display: none; font-size: 10px; color: var(--muted); }
.zodiac-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.zodiac-stat { position: relative; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.zodiac-stat.is-top { border-color: #dcc58f; background: linear-gradient(140deg, #fdf8ea, var(--surface-2)); box-shadow: 0 6px 18px rgba(184, 137, 43, .09); }
.zs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.zs-char { display: block; font-family: var(--serif); font-size: 25px; font-weight: 700; line-height: 1.1; color: var(--jade); }
.zodiac-stat.is-top .zs-char { color: #9a711d; }
.zs-numbers { display: block; margin-top: 3px; font-size: 9px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zs-share { font-size: 10px; color: var(--muted); white-space: nowrap; }
.zs-value { margin-top: 10px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zs-meta { margin-top: 1px; font-size: 9.5px; color: var(--muted); }
.zodiac-stat .progress { margin-top: 9px; }
.zs-split { display: flex; justify-content: space-between; gap: 6px; margin-top: 7px; font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.statement-toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.statement-sheet { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
.statement-sheet h3 { font-family: var(--serif); font-size: 20px; letter-spacing: .1em; text-align: center; }
.statement-sheet .statement-sub { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 2px; margin-bottom: 14px; }
.statement-meta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.statement-table { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-top: 8px; }
.statement-table th { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.statement-table td { padding: 7px 6px; border-bottom: 1px solid #f1ede3; }
.statement-table .num { text-align: right; }
.statement-total { display: flex; justify-content: flex-end; gap: 25px; padding-top: 12px; font-size: 11px; }
.statement-total b { font-size: 15px; }

.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 105px; align-self: start; }
.settings-nav button { text-align: left; padding: 10px 13px; border-radius: 9px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.settings-nav button:hover { background: var(--surface-2); color: var(--ink-2); }
.settings-nav button.active { background: var(--surface); color: var(--jade); font-weight: 700; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.settings-section { padding: 20px 22px; }
.settings-section + .settings-section { margin-top: 14px; }
.settings-section h3 { font-size: 14px; margin-bottom: 3px; }
.settings-section > p { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.odds-group { margin-bottom: 18px; }
.odds-group h4 { font-size: 11px; letter-spacing: .1em; color: var(--gold); margin-bottom: 8px; }
.odds-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; }
.odds-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.odds-row label { flex: 1; font-size: 12px; }
.odds-row .input { width: 82px; min-height: 31px; font-size: 12px; text-align: right; padding: 5px 8px; }
.odds-row .unit { font-size: 10px; color: var(--muted); }
.settings-note { display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; background: var(--gold-soft); color: #7d5a18; font-size: 11.5px; line-height: 1.55; }
.settings-note .icon { flex: none; margin-top: 1px; }
.network-list { display: flex; flex-direction: column; gap: 7px; }
.network-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.network-row.is-lan { border-color: #d4e7df; background: var(--jade-pale); }
.network-label { display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 2px; }
.network-row code { font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-all; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.user-row .user-main { flex: 1; }
.user-row .user-main strong { display: block; font-size: 12.5px; }
.user-row .user-main span { display: block; font-size: 10.5px; color: var(--muted); }
.user-row .btn { flex: none; }
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); margin-top: 6px; flex: none; }
.audit-item .audit-main { flex: 1; min-width: 0; }
.audit-item .audit-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.audit-item .audit-main span { display: block; font-size: 10px; color: var(--muted); word-break: break-all; }
.audit-item time { font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }

/* =========================================================
   Empty / loading / toast
   ========================================================= */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-icon { width: 50px; height: 50px; margin: 0 auto 11px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted-2); border: 1px solid var(--line); }
.empty strong { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.empty p { font-size: 11.5px; margin-top: 4px; }
.empty .btn { margin-top: 13px; }
.loading { padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.spinner { width: 27px; height: 27px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--jade); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eee9dd 25%, #f7f3ea 37%, #eee9dd 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 7px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton-page { display: flex; flex-direction: column; gap: 14px; }
.skeleton-line { height: 13px; }
.skeleton-card { height: 105px; border-radius: var(--radius-lg); }
.toast-root { position: fixed; top: 19px; right: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; min-width: 240px; max-width: 360px; padding: 11px 14px;
  border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(20, 35, 31, .16);
  font-size: 12.5px; color: var(--ink-2); animation: toastIn .25s ease; pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: none; } }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
.toast-icon { width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.toast-success .toast-icon { background: var(--jade-soft); color: var(--jade); }
.toast-error .toast-icon { background: var(--red-soft); color: var(--red); }
.toast-info .toast-icon { background: var(--blue-soft); color: var(--blue); }
.toast .toast-close { margin-left: auto; color: var(--muted-2); flex: none; }

.error-state { text-align: center; padding: 70px 20px; }
.error-state .error-code { font-family: var(--serif); font-size: 52px; color: var(--line-strong); }
.error-state h3 { margin-top: 6px; font-size: 16px; }
.error-state p { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .span-2 { grid-column: span 1; }
  .report-layout { grid-template-columns: 1fr; }
  .report-layout.equal { grid-template-columns: 1fr; }
  .zodiac-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .draw-card-stats { gap: 14px; }
  .bet-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; width: 262px; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; place-items: center; }
  .topbar { height: 68px; padding: 0 18px; }
  .topbar-title h1 { font-size: 17px; }
  .date-chip { display: none; }
  .page { padding: 20px 18px 88px; }
  .overlay { display: block; position: fixed; inset: 0; background: rgba(9, 24, 20, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .overlay.show { opacity: 1; pointer-events: auto; }
  .mobile-nav {
    display: flex; position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45;
    width: min(96%, 560px); padding: 7px; border-radius: 18px; background: rgba(14, 41, 35, .95);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .25); backdrop-filter: blur(12px);
    justify-content: space-around; border: 1px solid rgba(255, 255, 255, .08);
  }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 11px; color: rgba(232, 241, 237, .6); font-size: 9px; min-width: 0; flex: 1; white-space: nowrap; }
  .mobile-nav-item.active { color: #9be8cf; background: rgba(60, 171, 140, .18); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 22px; }
  .bet-layout { grid-template-columns: 1fr; }
  .bet-main { max-height: none; overflow: visible; }
  .bet-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .bet-modal .modal-body { overflow-y: auto; max-height: calc(100vh - 180px); }
  .paste-layout { grid-template-columns: 1fr; }
  .paste-textarea { min-height: 180px; }
  .paste-items { max-height: 260px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 2px; }
  .settings-nav button { white-space: nowrap; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
  .customer-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .draw-card { flex-wrap: wrap; gap: 13px; }
  .draw-card-main { min-width: 120px; }
  .draw-card-balls { order: 3; width: 100%; flex-basis: 100%; }
  .draw-card-stats { margin-left: auto; }
  .draw-card-side { min-width: 0; }
  .table { min-width: 700px; }
  .rank-table { min-width: 0; }
  .report-table { min-width: 560px; }
  .rank-table th:nth-child(3), .rank-table td:nth-child(3) { display: none; }
  .number-picker { max-height: 330px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 13px; gap: 10px; }
  .topbar-title p { display: none; }
  .user-trigger .user-name { display: none; }
  .page { padding: 16px 13px calc(92px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; }
  .page-head h2 { font-size: 21px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 14px; border-radius: 15px; }
  .stat-value { font-size: 21px; margin-top: 10px; }
  .stat-label { font-size: 11px; }
  .stat-icon { width: 28px; height: 28px; }
  .stat-meta { font-size: 10px; }
  .welcome h2 { font-size: 24px; }
  .welcome-actions { width: 100%; }
  .welcome-actions .btn { flex: 1; }
  .dash-grid.three { grid-template-columns: 1fr; }
  .mini-stats { flex-wrap: wrap; }
  .mini-stat { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
  .filter-item { min-width: calc(50% - 6px); flex: 1; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .btn { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-panel { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 17px; padding-right: 17px; }
  .modal-foot .btn { flex: 1; }
  .bet-main { padding: 15px 15px 18px; }
  .bet-side-head, .cart-list, .cart-summary, .cart-submit { padding-left: 14px; padding-right: 14px; }
  .number-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .num-cell { height: 42px; }
  .num-cell .n { font-size: 12px; }
  .num-cell .z { font-size: 8px; }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
  .ticket-info-grid { grid-template-columns: 1fr 1fr; }
  .receipt-info { grid-template-columns: 1fr 1fr; }
  .customer-hero { align-items: flex-start; flex-wrap: wrap; }
  .customer-hero .customer-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .draw-card-stats { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
  .draw-card-side { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .draw-actions { justify-content: flex-start; }
  .slot { width: 40px; height: 52px; }
  .slot.special { width: 45px; height: 55px; }
  .slot .ball { width: 25px; height: 25px; font-size: 10px; }
  .slot.special .ball { width: 29px; height: 29px; font-size: 11px; }
  .slot-row { gap: 6px; }
  .summary-chip { flex: 1 1 calc(50% - 5px); justify-content: space-between; }
  .desktop-ticket-table { display: none; }
  .mobile-ticket-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .desktop-customer-table { display: none; }
  .mobile-customer-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .desktop-tx-table { display: none; }
  .mobile-tx-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .toast-root { top: auto; bottom: 84px; right: 12px; left: 12px; }
  .toast { max-width: none; width: 100%; }
  .report-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .report-type-table, .report-daily-table { min-width: 0 !important; }
  .report-customer-table { min-width: 620px !important; }
  .scroll-hint { display: inline; }
  .zodiac-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .zodiac-stat { padding: 11px; }
  .zs-value { font-size: 15px; }
  .settings-section { padding: 16px; }
  .odds-grid { grid-template-columns: 1fr; }
  .login-panel { padding: 24px 18px; }
  .login-card-head h2 { font-size: 27px; }
  .login-form .input { min-height: 45px; }
  .tab-scroll { overflow-x: auto; }
}
