:root {
  --blue-50: #eff7ff;
  --blue-100: #dceeff;
  --blue-200: #b9dcff;
  --blue-500: #2495f2;
  --blue-600: #1677ff;
  --blue-700: #0b61d8;
  --blue-900: #0a2857;
  --navy: #10213d;
  --text: #17233b;
  --muted: #64748b;
  --soft: #94a3b8;
  --line: #e7edf5;
  --surface: #ffffff;
  --canvas: #f5f8fc;
  --success: #11a36a;
  --success-bg: #eaf9f2;
  --warning: #d97706;
  --warning-bg: #fff7e7;
  --danger: #e5484d;
  --danger-bg: #fff0f0;
  --purple: #7c5cff;
  --shadow-sm: 0 1px 2px rgba(15, 35, 70, .04), 0 4px 16px rgba(15, 35, 70, .04);
  --shadow-md: 0 14px 42px rgba(15, 42, 82, .12);
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 252px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-width: 320px; background: var(--canvas); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.is-hidden { display: none !important; }

.global-progress { position: fixed; z-index: 1000; inset: 0 0 auto; height: 3px; pointer-events: none; opacity: 0; transition: opacity .18s; overflow: hidden; }
.global-progress.is-active { opacity: 1; }
.global-progress span { display: block; width: 38%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--blue-500), #62c8ff); animation: progress 1s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-110%); } to { transform: translateX(365%); } }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.04fr) minmax(460px, .96fr); background: #fff; }
.login-visual { position: relative; min-height: 100vh; overflow: hidden; padding: clamp(50px, 7vw, 96px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(145deg, #075fd8 0%, #1688ee 52%, #36b9f4 100%); isolation: isolate; }
.login-visual::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: radial-gradient(circle at 16% 16%, rgba(255,255,255,.18) 0 2px, transparent 2px), linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 42px 42px, 76px 76px, 76px 76px; mask-image: linear-gradient(to bottom, #000, transparent 88%); }
.login-visual::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -180px; z-index: -1; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.04), 0 0 0 130px rgba(255,255,255,.03); }
.visual-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 230px; height: 230px; right: 12%; top: 8%; background: rgba(255,255,255,.08); }
.orb-two { width: 100px; height: 100px; left: 8%; bottom: 17%; background: rgba(0,51,145,.14); }
.visual-copy { max-width: 660px; }
.visual-kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 12px; font-weight: 700; letter-spacing: .2em; opacity: .8; }
.visual-kicker::before { content: ""; width: 36px; height: 2px; background: #fff; border-radius: 2px; }
.visual-copy h1 { margin: 0; font-size: clamp(42px, 4.5vw, 72px); line-height: 1.18; letter-spacing: -.03em; text-shadow: 0 12px 36px rgba(0,41,110,.16); }
.visual-copy p { margin: 28px 0 0; font-size: 18px; letter-spacing: .08em; opacity: .82; }
.visual-metrics { position: absolute; left: clamp(50px, 7vw, 96px); right: clamp(50px, 7vw, 96px); bottom: 8%; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 610px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 25px; }
.visual-metrics div { display: grid; gap: 3px; }
.visual-metrics strong { font-size: 17px; }
.visual-metrics span { font-size: 12px; opacity: .7; }
.login-panel { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 50px clamp(28px, 6vw, 100px); }
.login-card { width: min(440px, 100%); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 62px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px 15px 15px 5px; color: #fff; background: linear-gradient(145deg, var(--blue-600), #39aef4); font-size: 22px; font-weight: 800; box-shadow: 0 10px 25px rgba(22,119,255,.28); }
.login-brand div { display: grid; gap: 1px; }
.login-brand strong { font-size: 19px; letter-spacing: .04em; }
.login-brand span { color: var(--soft); font-size: 12px; }
.login-heading { margin-bottom: 34px; }
.eyebrow { color: var(--blue-600); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.login-heading h2 { margin: 8px 0 4px; font-size: 34px; letter-spacing: -.03em; }
.login-heading p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field-label { font-size: 13px; font-weight: 650; color: #334155; }
.input-shell { min-height: 48px; display: flex; align-items: center; gap: 10px; border: 1px solid #dbe3ee; border-radius: 11px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input-shell:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(22,119,255,.11); }
.input-shell.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(229,72,77,.09); }
.input-shell input { min-width: 0; flex: 1; height: 46px; border: 0; outline: 0; padding: 0 14px 0 0; color: var(--text); background: transparent; }
.input-shell input::placeholder, input::placeholder, textarea::placeholder { color: #a7b1c2; }
.input-icon { width: 36px; height: 28px; display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--blue-600); font-size: 11px; font-weight: 700; }
.password-toggle { margin-right: 8px; padding: 6px; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.field-error { min-height: 0; color: var(--danger); font-size: 12px; }
.field-error:not(:empty) { margin-top: -3px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 7px 16px; font-weight: 650; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .58; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); box-shadow: 0 8px 18px rgba(22,119,255,.18); }
.button-primary:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(22,119,255,.27); }
.button-secondary { color: var(--blue-700); border-color: var(--blue-200); background: var(--blue-50); }
.button-ghost { color: var(--muted); border-color: var(--line); background: #fff; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger-ghost { color: var(--danger); border-color: #ffd1d3; background: var(--danger-bg); }
.button-sm { min-height: 32px; padding: 4px 11px; border-radius: 7px; font-size: 12px; }
.button-login { width: 100%; min-height: 50px; margin-top: 8px; justify-content: space-between; padding-inline: 20px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 24px 0 0; color: var(--soft); font-size: 11px; }
.login-note span { color: var(--success); font-size: 8px; }
.login-footer { position: absolute; bottom: 24px; color: #a3afbf; font-size: 11px; }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; color: #d5e1f2; background: linear-gradient(180deg, #112747 0%, #0d1d36 100%); box-shadow: 8px 0 28px rgba(15,30,55,.08); }
.sidebar-brand { height: 74px; display: flex; align-items: center; gap: 11px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark-small { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px 11px 11px 4px; font-size: 17px; box-shadow: 0 8px 18px rgba(11,116,255,.22); }
.sidebar-brand div { display: grid; line-height: 1.25; }
.sidebar-brand strong { color: #fff; font-size: 17px; letter-spacing: .08em; }
.sidebar-brand span:not(.brand-mark) { color: #8195b2; font-size: 10px; letter-spacing: .18em; }
.main-nav { flex: 1; overflow: auto; padding: 18px 12px; scrollbar-width: thin; scrollbar-color: #314563 transparent; }
.nav-group + .nav-group { margin-top: 21px; }
.nav-group-title { display: block; margin: 0 12px 7px; color: #68809f; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.nav-item { position: relative; width: 100%; min-height: 43px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; margin: 3px 0; padding: 6px 12px; color: #aebed3; background: transparent; text-align: left; cursor: pointer; transition: color .15s, background .15s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(37,139,255,.3), rgba(37,139,255,.12)); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: #4aa8ff; }
.nav-icon { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; color: #8eabc9; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 800; }
.nav-item.is-active .nav-icon { color: #fff; background: rgba(64,166,255,.26); }
.nav-badge { min-width: 20px; height: 19px; display: grid; place-items: center; margin-left: auto; border-radius: 10px; padding: 0 6px; color: #fff; background: var(--danger); font-size: 10px; }
.sidebar-footer { min-height: 66px; display: flex; align-items: center; gap: 10px; margin: 10px 12px 14px; padding: 12px; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; background: rgba(255,255,255,.035); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 4px rgba(57,217,138,.1); }
.sidebar-footer div { display: grid; }
.sidebar-footer strong { color: #d8e4f3; font-size: 11px; font-weight: 600; }
.sidebar-footer span { color: #6d83a1; font-size: 9px; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar-scrim { display: none; }
.workspace { grid-column: 2; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; z-index: 40; top: 0; height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title > div { display: grid; }
.breadcrumb { color: var(--soft); font-size: 10px; }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.3; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 0; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.icon-button:hover { border-color: var(--blue-200); background: var(--blue-50); }
.menu-button { display: none; }
.refresh-button { color: var(--muted); font-size: 19px; }
.admin-profile { display: flex; align-items: center; gap: 9px; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--blue-600), #43b2f4); font-weight: 750; }
.admin-profile div { display: grid; }
.admin-profile strong { font-size: 12px; }
.admin-profile span { color: var(--soft); font-size: 10px; }
.logout-button { min-height: 34px; padding-inline: 12px; font-size: 12px; }
.main-content { flex: 1; width: 100%; max-width: 1640px; margin: 0 auto; padding: 25px 28px 40px; outline: none; }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; padding: 15px 28px; border-top: 1px solid var(--line); color: var(--soft); background: #fff; font-size: 10px; }

/* Pages and cards */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.card-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-heading { display: grid; gap: 2px; }
.card-heading h3 { margin: 0; font-size: 16px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 20px; }
.card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 132px; overflow: hidden; padding: 20px; }
.stat-card::after { content: ""; position: absolute; right: -20px; top: -28px; width: 100px; height: 100px; border-radius: 50%; background: var(--stat-bg, var(--blue-50)); }
.stat-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--stat-color, var(--blue-600)); background: var(--stat-bg, var(--blue-50)); font-weight: 800; }
.stat-value { position: relative; z-index: 1; display: block; margin-top: 12px; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; }
.stat-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--soft); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 10px; min-height: 68px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; text-align: left; cursor: pointer; }
.quick-action:hover { border-color: var(--blue-200); background: var(--blue-50); }
.quick-action .quick-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--blue-700); background: var(--blue-100); font-weight: 800; }
.quick-action div { display: grid; }
.quick-action strong { font-size: 12px; }
.quick-action span { color: var(--soft); font-size: 10px; }
.system-list { display: grid; gap: 14px; }
.system-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.system-row:last-child { padding: 0; border: 0; }
.system-row span:first-child { color: var(--muted); }
.system-row strong { font-size: 12px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-group { display: grid; align-content: start; gap: 7px; }
.form-label { display: flex; align-items: center; gap: 5px; color: #334155; font-size: 12px; font-weight: 650; }
.required { color: var(--danger); }
.form-help { margin: 0; color: var(--soft); font-size: 10px; }
.control { width: 100%; min-height: 40px; border: 1px solid #dbe3ee; border-radius: 8px; padding: 8px 11px; outline: 0; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.control:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(22,119,255,.1); }
.control:disabled { color: var(--soft); background: #f7f9fc; cursor: not-allowed; }
textarea.control { min-height: 96px; resize: vertical; }
.secret-control { -webkit-text-security: disc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
select.control { appearance: auto; }
.control-prefix { display: flex; align-items: stretch; }
.control-prefix span { min-width: 44px; display: grid; place-items: center; border: 1px solid #dbe3ee; border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); background: #f8fafc; }
.control-prefix .control { border-radius: 0 8px 8px 0; }
.secret-status { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px dashed var(--blue-200); border-radius: 8px; padding: 7px 10px; color: var(--muted); background: var(--blue-50); font-size: 11px; }
.secret-mask { color: var(--blue-700); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.switch-row { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; }
.switch-copy { display: grid; }
.switch-copy strong { font-size: 12px; }
.switch-copy span { color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; display: inline-flex; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 100%; height: 100%; border-radius: 14px; background: #cbd5e1; cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15,35,70,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(22,119,255,.18); }
.notice-box { display: flex; gap: 11px; border: 1px solid var(--blue-200); border-radius: 10px; padding: 13px; color: #285379; background: var(--blue-50); font-size: 11px; }
.notice-box.warning { border-color: #f7d8a3; color: #7b5317; background: var(--warning-bg); }
.notice-box.danger { border-color: #ffd0d2; color: #8c3134; background: var(--danger-bg); }
.notice-icon { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue-600); font-size: 11px; font-weight: 800; }
.notice-box.warning .notice-icon { background: var(--warning); }
.notice-box.danger .notice-icon { background: var(--danger); }
.code-box { border: 1px solid var(--line); border-radius: 9px; padding: 12px; color: #3d4d63; background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; white-space: pre-wrap; word-break: break-word; }

/* Tables and data */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filters { flex: 1; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; }
.filter-item { display: grid; gap: 4px; min-width: 140px; }
.filter-item.search { min-width: min(260px, 100%); }
.filter-item label { color: var(--muted); font-size: 10px; }
.filter-item .control { min-height: 36px; padding-block: 6px; }
.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { height: 44px; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfe; font-size: 10px; font-weight: 700; text-align: left; letter-spacing: .04em; }
.data-table td { height: 54px; padding: 10px 14px; border-bottom: 1px solid #edf1f6; color: #334155; font-size: 12px; }
.data-table tbody tr:hover { background: #fafdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-title { display: grid; gap: 1px; white-space: normal; min-width: 150px; }
.table-title strong { color: var(--text); font-size: 12px; }
.table-title span { max-width: 310px; overflow: hidden; color: var(--soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; gap: 5px; }
.link-button { border: 0; padding: 4px; color: var(--blue-600); background: transparent; font-size: 11px; cursor: pointer; }
.link-button:hover { color: var(--blue-700); text-decoration: underline; }
.link-button.danger { color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; border-radius: 12px; padding: 2px 8px; color: var(--muted); background: #f0f3f7; font-size: 10px; font-weight: 650; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-blue { color: var(--blue-700); background: var(--blue-50); }
.badge-purple { color: var(--purple); background: #f2efff; }
.tag { display: inline-flex; align-items: center; min-height: 22px; border-radius: 5px; padding: 2px 7px; color: var(--blue-700); background: var(--blue-50); font-size: 10px; }
.pagination { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.pagination-info { color: var(--muted); font-size: 11px; }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.page-number { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; cursor: pointer; }
.page-number:hover:not(:disabled) { border-color: var(--blue-200); color: var(--blue-600); }
.page-number.is-current { border-color: var(--blue-600); color: #fff; background: var(--blue-600); }
.page-number:disabled { opacity: .45; cursor: not-allowed; }
.empty-state { min-height: 260px; display: grid; place-items: center; padding: 35px; text-align: center; }
.empty-state-inner { max-width: 340px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px dashed var(--blue-200); border-radius: 20px; color: var(--blue-600); background: var(--blue-50); font-size: 22px; font-weight: 800; }
.empty-state h3 { margin: 0 0 5px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.error-state .empty-icon { border-color: #ffd0d2; color: var(--danger); background: var(--danger-bg); }
.inline-loader { min-height: 260px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-skeleton { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.page-skeleton span { height: 130px; border-radius: var(--radius); background: linear-gradient(90deg, #edf2f8 20%, #f7f9fc 45%, #edf2f8 70%); background-size: 250% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }

/* Config and detail layouts */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
.aside-stack { display: grid; align-content: start; gap: 18px; }
.aside-stack .card + .card { margin: 0; }
.setting-summary { display: grid; gap: 13px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-row span { color: var(--muted); font-size: 11px; }
.summary-row strong { font-size: 12px; text-align: right; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.service-card { position: relative; overflow: hidden; }
.service-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--service-color, var(--blue-600)); }
.service-card .card-body { display: grid; gap: 16px; padding-left: 24px; }
.service-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.service-name { display: flex; align-items: center; gap: 10px; }
.service-name span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--service-color, var(--blue-600)); background: var(--service-bg, var(--blue-50)); font-weight: 800; }
.service-name div { display: grid; }
.service-name strong { font-size: 14px; }
.service-name small { color: var(--soft); font-size: 9px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.price-input { display: flex; align-items: baseline; gap: 7px; }
.price-input .control { max-width: 135px; font-size: 19px; font-weight: 750; }
.price-input span { color: var(--muted); font-size: 11px; }
.mode-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mode-option { position: relative; display: block; }
.mode-option input { position: absolute; opacity: 0; }
.mode-option-content { min-height: 92px; display: grid; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.mode-option-content strong { font-size: 13px; }
.mode-option-content span { color: var(--muted); font-size: 10px; }
.mode-option input:checked + .mode-option-content { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 2px rgba(22,119,255,.08); }
.mode-option input:focus-visible + .mode-option-content { outline: 3px solid rgba(22,119,255,.15); }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 28px; }
.detail-row { min-height: 52px; display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--muted); font-size: 11px; }
.detail-row dd { margin: 0; color: var(--text); font-size: 12px; word-break: break-word; }
.timeline { position: relative; display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.timeline-dot { width: 13px; height: 13px; margin-top: 3px; border: 3px solid #fff; border-radius: 50%; background: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-200); }
.timeline-copy { display: grid; gap: 2px; }
.timeline-copy span { color: var(--soft); font-size: 10px; }
.timeline-copy strong { font-size: 11px; }

/* Modal and toast */
.modal-backdrop { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(8,21,40,.52); backdrop-filter: blur(3px); }
.modal { width: min(680px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.5); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 24px 80px rgba(9,29,59,.28); animation: modal-in .18s ease-out; }
.modal.modal-sm { width: min(450px, 100%); }
.modal.modal-lg { width: min(920px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.modal-header > div { display: grid; }
.modal-eyebrow { color: var(--blue-600); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.modal-header h2 { margin: 2px 0 0; font-size: 18px; }
.modal-close { color: var(--muted); font-size: 20px; }
.modal-body { overflow: auto; padding: 22px; }
.modal-footer { min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 22px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.toast-region { position: fixed; z-index: 400; top: 18px; right: 18px; width: min(360px, calc(100vw - 36px)); display: grid; gap: 9px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 27px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: rgba(255,255,255,.97); box-shadow: var(--shadow-md); pointer-events: auto; animation: toast-in .22s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--success); font-size: 12px; font-weight: 800; }
.toast.is-error .toast-icon { background: var(--danger); }
.toast.is-warning .toast-icon { background: var(--warning); }
.toast-copy { display: grid; }
.toast-copy strong { font-size: 11px; }
.toast-copy span { color: var(--muted); font-size: 10px; }
.toast-close { border: 0; padding: 4px; color: var(--soft); background: transparent; cursor: pointer; }
.noscript { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 30px; color: #fff; background: var(--navy); font-size: 18px; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .service-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .login-screen { grid-template-columns: minmax(0,1fr); }
  .login-visual { display: none; }
  .login-panel { background: radial-gradient(circle at top right, var(--blue-100), transparent 40%), #fff; }
  .app-shell { grid-template-columns: minmax(0,1fr); }
  .workspace { grid-column: 1; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 55; inset: 0; display: none; background: rgba(8,21,40,.42); }
  .sidebar-scrim.is-open { display: block; }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-close { color: #b9c9dc; border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.04); }
  .settings-layout { grid-template-columns: 1fr; }
  .aside-stack { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 14px; }
  .breadcrumb, .admin-profile div, .password-button { display: none; }
  .admin-profile { padding-left: 10px; }
  .topbar h1 { font-size: 17px; }
  .main-content { padding: 18px 14px 30px; }
  .workspace-footer { padding-inline: 14px; }
  .workspace-footer span:last-child { display: none; }
  .page-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .page-actions .button { flex: 1; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 120px; padding: 16px; }
  .stat-value { font-size: 24px; }
  .dashboard-grid, .form-grid, .detail-list { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .aside-stack { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; padding: 12px; }
  .filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-item, .filter-item.search { min-width: 0; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.modal-sm, .modal.modal-lg { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-footer { padding-bottom: max(13px, env(safe-area-inset-bottom)); border-radius: 0; }
  .mode-options { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-panel { align-content: center; padding: 30px 22px; }
  .login-brand { margin-bottom: 45px; }
  .login-footer { bottom: 14px; }
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .card-header, .card-body { padding-inline: 15px; }
  .toolbar { padding-inline: 10px; }
  .page-skeleton { grid-template-columns: 1fr; }
  .page-skeleton span:nth-child(n+3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:focus-visible { outline: 3px solid rgba(22,119,255,.24); outline-offset: 2px; }
