/* Operations console: low-glare dark surfaces, persistent navigation, compact data. */
.ops-detail-dialog { width: min(1080px,94vw); max-height: 88dvh; margin: auto; overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); }
.ops-detail-dialog::backdrop { background: #050912b8; }
.ops-detail-dialog h3, .funnel-project h3 { margin: 24px 0 14px; font-size: 14px; }
.ops-detail-dialog .detail-head { position: sticky; top: -24px; padding: 16px 0; background: var(--surface); z-index: 2; }
.ops-detail-dialog .detail-email { font-size: 18px; overflow-wrap: anywhere; }
.ops-detail-dialog td, #tab-audit td { max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.ops-detail-dialog .num { font-size: 21px; overflow-wrap: anywhere; }
#user-delete-area input { display: block; max-width: 480px; margin: 8px 0 16px; }
.cleanup-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.funnel-project { margin: 20px 0; padding: 0 0 12px; border-bottom: 1px solid var(--border); }
#mobile-logout-btn { display: none; }
@media(max-width:900px) { body.signed-in #mobile-logout-btn { display: inline-block; min-height: 36px; padding: 6px 10px; } }
:root {
  --bg: #11151c; --surface: #191f29; --surface-raised: #202938; --surface-muted: #151b24;
  --border: #303b4d; --border-soft: #293241; --text: #dce3ef;
  --muted: #9aa8bd; --accent: #a2adf5; --accent-dim: #293456; --primary: #4c5cbd;
  --success: #7dcabb; --danger: #ef9aa7;
  color-scheme: dark;
}
body { font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; }
.wrap { max-width: 1600px; padding: 32px 40px 48px; }
body.signed-in .wrap { margin-left: 232px; max-width: none; }
.app-header { min-height: 62px; margin-bottom: 28px; }
.page-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); margin-bottom: 7px; }
.app-header h1 { font-size: 26px; font-weight: 650; letter-spacing: -.6px; }
.header-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.header-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #28314b; color: #bbc5f4; font-weight: 700; }
.timezone { font-size: 11px; color: var(--muted); text-align: right; }
.tabs { position: fixed; inset: 0 auto 0 0; width: 232px; height: 100dvh; display: flex; flex-direction: column; gap: 7px;
  padding: 30px 16px 20px; margin: 0; border: 0; border-right: 1px solid #263044; border-radius: 0; background: #101620; overflow-y: auto; z-index: 30; }
.nav-brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 32px; color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 37px; height: 40px; border-radius: 12px; color: #eef0ff;
  background: var(--primary); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -2px; }
.nav-brand strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.nav-brand small { color: #8e9ab5; display: block; font-size: 10px; letter-spacing: 1.5px; margin-top: 3px; }
.nav-caption { color: #8794aa; font-size: 10px; letter-spacing: 1.5px; padding: 0 14px; margin: 5px 0 10px; }
.tab-btn { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 46px; padding: 12px 15px;
  border-radius: 8px; margin: 0; color: #9ba8c0; font-size: 13px; font-weight: 500; text-align: left; }
.tab-btn:hover { background: #ffffff09; color: #e3e9fa; filter: none; }
.tab-btn.active { color: #eef0ff; background: var(--primary); box-shadow: 0 4px 14px #060d2140; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav-footer { margin-top: auto; border-top: 1px solid #ffffff12; padding: 22px 13px 0; color: #8e9ab5; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.nav-footer .header-avatar { background: #25324c; color: #bac5ee; }
.nav-footer small { display: block; color: #8794aa; font-size: 10px; margin-top: 3px; }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 22px; box-shadow: 0 4px 18px #00000018; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; margin-bottom: 20px; }
.section-head { margin-bottom: 20px; }
.section-title { font-size: 13px; margin-top: 24px; }
label { font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
input, select { background: var(--surface-muted); border: 1px solid var(--border); padding: 9px 12px; font-size: 12px; min-height: 39px; border-radius: 7px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #4b5971; }
input:focus, select:focus { border-color: #8e9be7; outline: none; box-shadow: 0 0 0 3px #7f8ee826; }
input::placeholder { color: #8490a4; }
input[type="date"], input[type="datetime-local"] { color-scheme: dark; }
button { border-radius: 7px; font-size: 12px; background: var(--primary); border-color: var(--primary); color: #eef0ff; }
button.btn-sm { padding: 9px 14px; min-height: 39px; font-size: 12px; }
button.secondary { background: var(--surface-raised); color: #b5c1d5; border-color: var(--border); }
button.secondary:hover { color: #c4ccff; background: #2a3550; border-color: #6574ad; filter: none; }
button.danger { color: var(--danger); border-color: #68404c; }
button.danger:hover { background: #39252e; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { gap: 12px; }
.row > div { max-width: 260px; }
.row > div[style*="flex:2"] { max-width: 360px; }
.stats-grid { gap: 14px; margin: 15px 0 22px; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.stat-box { padding: 18px 20px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-muted); gap: 10px; }
.stat-box .num { font-size: 27px; font-weight: 650; letter-spacing: -.8px; line-height: 1.15; }
.stat-box .lbl { font-size: 11px; color: var(--muted); margin: 0; }
#summary .stat-box:first-child { background: #1b2b40; border-color: #2e435e; }
#summary .stat-box:first-child .num { color: #90b9ec; }
#summary .stat-box:nth-child(2) { background: #172f30; border-color: #2b4948; }
#summary .stat-box:nth-child(2) .num { color: #7dcabb; }
#summary .stat-box:nth-child(3) { background: #282339; border-color: #413653; }
#summary .stat-box:nth-child(3) .num { color: #b6a0e1; }
#summary .stat-box:last-child { background: #293460; border-color: #414f7c; color: #d9e1ff; }
#summary .stat-box:last-child .lbl { color: #b6c1e6; }
.period-label, .inline-note { font-size: 11px; color: var(--muted); }
.registrations-scroll { max-height: 320px; }
table { font-size: 12px; }
thead, thead th { background: var(--surface-raised); }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border-soft); }
th { font-size: 11px; color: var(--muted); font-weight: 500; }
.registrations-table thead th, .disclosure thead th { background: var(--surface-raised); }
.registrations-table tbody th { font-size: 12px; font-weight: 500; }
.registrations-table tr.is-today { background: var(--accent-dim); }
.registrations-table .platform-m { color: #90b9ec; }
.registrations-table .platform-v { color: #7dcabb; }
.registrations-table .platform-s { color: #b6a0e1; }
tbody tr:hover td, tbody tr:hover th { background: #243044; }
tbody tr:last-child th { border-bottom: none; }
.table-scroll { scrollbar-width: thin; scrollbar-color: #4a5870 transparent; }
.quota-columns { gap: 20px; }
.quota-columns > section { padding: 19px; background: var(--surface-muted); border-color: var(--border-soft); }
.quota-columns h3 { font-size: 12px; }
.quota-head { font-size: 11px; }
.quota-bar { height: 6px; border: 0; background: #303b4d; }
.quota-fill { background: #8591ed; }
.quota-fill.warn { background: #dcad5a; }
.quota-fill.danger { background: #db7b89; }
.badge { border: 0; border-radius: 5px; padding: 4px 8px; font-size: 10px; background: #2b3545; color: #b2bed1; }
.badge.ok { background: #1d3935; color: #8bd7c2; }
.badge.warn { background: #3b3223; color: #e5c186; }
.disclosure { margin-top: 16px; border-top-color: var(--border-soft); }
.disclosure > summary { font-size: 12px; color: #b2bed1; padding: 15px 0; }
.disclosure > summary::marker, .help > summary::marker { color: #a7b1c3; font-size: 10px; }
.help { font-size: 11px; margin-top: 18px; color: var(--muted); }
.help p { color: var(--muted); }
.pager { padding-top: 15px; margin-top: 10px; border-top: 1px solid var(--border-soft); font-size: 11px; }
.pager .btn-sm { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.platform-toolbar { background: var(--surface-raised); width: fit-content; padding: 5px 7px 5px 15px; border-radius: 9px; margin-bottom: 20px; gap: 14px; }
.platform-toolbar label { color: var(--muted); font-size: 11px; }
.platform-toolbar select { border: 0; box-shadow: 0 2px 5px #00000018; min-width: 220px; }
.actions-menu > summary { background: var(--surface-raised); border-color: var(--border); font-size: 12px; padding: 9px 12px; }
.actions-menu > div { box-shadow: 0 12px 32px #00000040; }
.edit-panel, .segment-item { background: var(--surface-muted); border-color: var(--border-soft); }
.segment-zh { color: #96b4df; }
.ledger-min-minus { color: var(--danger); }
.error { padding: 10px 13px; background: #34232d; border: 1px solid #61404e; border-radius: 7px; font-size: 12px; }
.success-note { color: #8bd7c2; background: #1d3935; padding: 10px 14px; border-radius: 7px; margin-bottom: 12px; }
.muted, .detail-meta { font-size: 11px; }
#login-card { padding: 36px; margin-top: 13vh; box-shadow: 0 12px 60px #00000030; }
.login-heading { font-size: 21px; margin-bottom: 8px; }
.login-sub { color: var(--muted); margin-bottom: 28px; font-size: 12px; }
.market-users-table { min-width: 960px; }
.market-users-table td, .market-users-table th { padding: 13px 10px; }
.cell-date { display: inline-block; white-space: nowrap; }
.cell-date small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.market-users-table td:last-child, .market-users-table th:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -6px 0 12px -10px #000; }
.market-users-table th:last-child { background: var(--surface-raised); }
.market-users-table .mu-adjust-btn { background: var(--accent-dim); color: #c2caff; border: 0; font-size: 11px; min-height: 30px; padding: 5px 11px; }
dialog.membership-dialog { width: min(510px, calc(100vw - 32px)); margin: auto; padding: 0; border: 1px solid #3d4960; border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 24px 100px #00000070; }
dialog.membership-dialog::backdrop { background: #060b14b3; backdrop-filter: blur(3px); }
.modal-head { padding: 25px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--border-soft); }
.modal-head h2 { font-size: 18px; margin: 0 0 6px; }
.modal-head p { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.modal-close { color: #b2bed1; background: var(--surface-raised); border: 0; width: 30px; height: 30px; padding: 0; font-size: 20px; }
.modal-body { padding: 22px 26px; }
.modal-body > label { margin-top: 18px; }
.current-membership { border: 1px solid var(--border-soft); background: var(--surface-muted); border-radius: 9px; padding: 13px; font-size: 12px; margin-bottom: 18px; }
.current-membership span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.quick-days { display: flex; gap: 8px; margin-top: 10px; }
.quick-days button { flex: 1; background: var(--surface-raised); border: 1px solid var(--border); color: #b5c1d5; padding: 6px; font-size: 11px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 18px 26px; background: var(--surface-muted); border-top: 1px solid var(--border-soft); }
.modal-notice { font-size: 11px; color: var(--muted); margin-top: 16px; line-height: 1.7; }
.confirm-change { margin-top: 16px; padding: 13px; border: 1px solid #665335; border-radius: 8px; background: #352e23; font-size: 12px; color: #e5c186; }
@media (min-width: 1500px) { body.signed-in .wrap { padding-left: 52px; padding-right: 52px; } }
@media (max-width: 1100px) and (min-width: 901px) {
  .tabs { width: 200px; padding-left: 12px; padding-right: 12px; }
  body.signed-in .wrap { margin-left: 200px; padding-left: 24px; padding-right: 24px; }
  .nav-brand { gap: 9px; padding-left: 8px; }
}
@media (max-width: 900px) {
  body.signed-in .wrap, .wrap { margin-left: 0; padding: 20px; }
  .app-header { margin-bottom: 20px; }
  .app-header h1 { font-size: 22px; }
  .tabs { position: sticky; inset: auto; top: 0; flex-direction: row; height: auto; width: 100%; padding: 6px; border-radius: 10px;
    overflow-x: auto; overflow-y: hidden; margin-bottom: 20px; gap: 3px; scrollbar-width: none; }
  .nav-brand, .nav-caption, .nav-footer { display: none; }
  .tab-btn { width: auto; min-height: 39px; gap: 7px; padding: 10px 12px; font-size: 12px; }
  .nav-icon { width: 15px; height: 15px; flex-basis: 15px; }
  .card { padding: 20px; }
  .quota-columns { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  body.signed-in .wrap, .wrap { padding: 18px 12px 36px; }
  .app-header { min-height: 48px; }
  .page-eyebrow { font-size: 8px; letter-spacing: 1.5px; margin-bottom: 5px; }
  .app-header h1 { font-size: 21px; }
  .header-meta { gap: 8px; }
  .header-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
  .timezone { font-size: 9px; }
  #header-date { display: none; }
  .tabs { border-radius: 9px; margin-bottom: 16px; }
  .card { padding: 18px 15px; border-radius: 12px; margin-bottom: 16px; }
  h2 { font-size: 14px; margin-bottom: 17px; }
  .row { gap: 10px; }
  .row > div, .row > div[style*="flex:2"], .row > div[style*="flex:3"] { max-width: none; }
  input, select { font-size: 16px; min-height: 44px; }
  label { font-size: 10px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
  .stat-box { padding: 15px 13px; gap: 10px; }
  .stat-box .num { font-size: 22px; }
  .stat-box .lbl { font-size: 10px; }
  .period-label, .inline-note { font-size: 10px; line-height: 1.7; }
  th, td { padding: 12px 11px; }
  .platform-toolbar { width: 100%; padding-left: 12px; }
  .platform-toolbar select { min-width: 0; font-size: 13px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 19px; padding-right: 19px; }
  .modal-body { max-height: 60dvh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
