:root {
  color-scheme: dark;
  --bg: #071512;
  --bg-deep: #04100d;
  --surface: rgba(16, 40, 34, .82);
  --surface-strong: #102c25;
  --surface-soft: rgba(29, 65, 54, .55);
  --line: rgba(183, 235, 208, .15);
  --line-strong: rgba(183, 235, 208, .28);
  --text: #f3faf6;
  --muted: #9bb7aa;
  --muted-strong: #c2d4ca;
  --brand: #58d58e;
  --brand-strong: #1cab64;
  --brand-glow: rgba(88, 213, 142, .20);
  --amber: #f4bd61;
  --red: #ff7d78;
  --blue: #8bb8ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, .27);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg-deep); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 9% 5%, rgba(40, 128, 86, .18), transparent 28rem), radial-gradient(circle at 92% 19%, rgba(74, 170, 132, .12), transparent 34rem), linear-gradient(135deg, #071512 0%, #0a1d18 46%, #061310 100%); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-noise { position: fixed; inset: 0; pointer-events: none; opacity: .34; background-image: radial-gradient(rgba(229,255,240,.08) .5px, transparent .75px); background-size: 6px 6px; mask-image: linear-gradient(to bottom, #000, transparent 80%); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; }
.login-grid { width: min(1080px, 100%); display: grid; grid-template-columns: 1.12fr .88fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 30px; background: rgba(8, 28, 23, .77); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-intro { min-height: 585px; padding: 54px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, rgba(28, 102, 69, .43), rgba(8, 39, 30, .1)); }
.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); }
.login-intro::before { width: 310px; height: 310px; background: rgba(113, 255, 177, .12); top: -120px; right: -100px; }
.login-intro::after { width: 230px; height: 230px; background: rgba(74, 162, 255, .1); bottom: -100px; left: -90px; }
.brand-lockup, .top-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-seal { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #062016; font-weight: 900; font-size: 20px; background: linear-gradient(145deg, #a7fbc8, #45cd84); box-shadow: 0 10px 24px rgba(35, 197, 112, .3); }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.login-copy { position: relative; z-index: 1; max-width: 520px; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-weight: 750; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.login-copy h1 { margin: 0; max-width: 500px; font-size: clamp(34px, 4.2vw, 57px); letter-spacing: -.055em; line-height: 1.08; }
.login-copy h1 em { color: #a9f8ca; font-style: normal; }
.login-copy p:last-child { max-width: 420px; margin: 21px 0 0; color: var(--muted-strong); font-size: 15px; line-height: 1.85; }
.security-pill { position: relative; z-index: 1; display: inline-flex; gap: 10px; align-items: center; width: fit-content; padding: 10px 13px; color: #c9f6d8; border: 1px solid rgba(169, 248, 202, .2); background: rgba(5, 32, 23, .34); border-radius: 999px; font-size: 12px; }
.login-card { padding: 52px 46px; display: flex; flex-direction: column; justify-content: center; background: rgba(5, 20, 16, .42); }
.login-card h2 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.login-card .intro { margin: 10px 0 29px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted-strong); font-size: 13px; font-weight: 680; }
input, select, textarea { min-width: 0; width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; outline: none; color: var(--text); background: rgba(8, 29, 23, .78); padding: 12px 13px; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
textarea { min-height: 102px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: rgba(9, 38, 29, .94); box-shadow: 0 0 0 3px rgba(88, 213, 142, .14); }
input::placeholder, textarea::placeholder { color: #739286; }
input[type="file"] { padding: 10px; }
select option { background: #112b23; color: var(--text); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 12px; font-weight: 780; font-size: 13px; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #062017; background: linear-gradient(135deg, #a3f6c4, #49cf87); box-shadow: 0 9px 22px rgba(31, 188, 102, .17); }
.button-secondary { color: #d6f5e2; border-color: var(--line-strong); background: rgba(17, 55, 44, .7); }
.button-danger { color: #ffe1df; border-color: rgba(255, 125, 120, .3); background: rgba(139, 43, 42, .35); }
.button-quiet { color: var(--muted-strong); border-color: transparent; background: transparent; }
.full { width: 100%; }
.login-note { margin: 19px 0 0; color: #79958a; font-size: 12px; line-height: 1.7; }

.admin-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line); background: rgba(5, 21, 17, .62); backdrop-filter: blur(18px); }
.sidebar .brand-lockup { padding: 0 11px 30px; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); text-align: left; background: transparent; font-size: 14px; font-weight: 690; transition: color .15s, background .15s, border-color .15s; }
.nav-item span { width: 19px; color: #79e8a5; font-size: 16px; text-align: center; }
.nav-item:hover { color: var(--text); background: rgba(90, 216, 143, .06); }
.nav-item.active { color: #eafff2; border-color: rgba(117, 234, 162, .16); background: linear-gradient(90deg, rgba(86, 206, 132, .18), rgba(86, 206, 132, .045)); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-footer { position: absolute; right: 16px; bottom: 18px; left: 16px; padding: 15px 12px; border-top: 1px solid var(--line); }
.operator { display: grid; gap: 2px; padding: 0 0 13px; }
.operator b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.operator small { color: var(--muted); font-size: 12px; }
.logout-button { color: var(--muted); }
.main-area { min-width: 0; padding: 0 30px 42px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar .top-brand { display: none; }
.live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-status i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px rgba(88, 213, 142, .1); animation: pulse 1.8s ease-in-out infinite; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.content { width: min(1440px, 100%); margin: 0 auto; padding-top: 34px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 25px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 3vw, 39px); letter-spacing: -.05em; line-height: 1.1; }
.page-head p { max-width: 680px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.page-head-meta { padding: 10px 12px; color: #b4e9c7; border: 1px solid var(--line); border-radius: 12px; background: rgba(24, 58, 47, .38); font-size: 12px; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 132px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(27, 62, 51, .8), rgba(10, 33, 27, .72)); box-shadow: 0 13px 34px rgba(0, 0, 0, .12); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card strong { display: block; margin-top: 19px; color: #ecfff3; font-size: 34px; letter-spacing: -.055em; }
.metric-card small { display: block; margin-top: 4px; color: #75a58b; font-size: 11px; }
.metric-card.brand strong { color: #9ef1bd; }
.metric-card.amber strong { color: #ffd98f; }
.metric-card.blue strong { color: #c5dcff; }
.metric-card.muted strong { color: #bbd0c4; }
.grid-2, .grid-3 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 16px 38px rgba(0, 0, 0, .13); }
.panel + .panel { margin-top: 16px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 17px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.028em; }
.panel-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.compact-list { display: grid; gap: 2px; padding: 0; margin: 0; list-style: none; }
.compact-list li { display: grid; grid-template-columns: 124px 1fr auto; gap: 12px; align-items: center; min-height: 57px; border-top: 1px solid var(--line); }
.compact-list time { color: #7e9e90; font-size: 11px; }
.compact-list b { font-size: 12px; }
.compact-list p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.compact-list em { font-style: normal; color: #bceccb; font-size: 11px; }
.quick-grid { display: grid; gap: 11px; }
.quick-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17, 53, 43, .36); text-align: left; }
.quick-card:hover { border-color: rgba(129, 238, 171, .35); }
.quick-card i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(90, 219, 141, .13); color: #a6f7c7; font-style: normal; }
.quick-card strong { display: block; font-size: 13px; }
.quick-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.quick-card b { color: var(--brand); }
.security-card { padding: 16px; border: 1px solid rgba(117, 234, 162, .15); border-radius: 15px; background: linear-gradient(135deg, rgba(28, 89, 61, .35), rgba(10, 38, 29, .3)); }
.security-card b { display: block; color: #c8fad7; font-size: 13px; }
.security-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.security-card + .security-card { margin-top: 10px; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 5px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(9, 31, 25, .5); }
.section-tab { padding: 9px 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 760; }
.section-tab.active { color: #022316; background: #a8f5c4; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin: 0 0 15px; }
.toolbar .input-wrap { flex: 1; min-width: 180px; max-width: 370px; }
.toolbar input { padding-block: 10px; }
.toolbar-actions { display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
thead { background: rgba(39, 77, 65, .42); }
th { color: #a6c3b5; font-size: 11px; font-weight: 780; letter-spacing: .04em; white-space: nowrap; }
td { color: #d9eae1; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(92, 211, 139, .04); }
td strong, td b { display: block; color: #f4fff8; font-size: 13px; }
td small { display: block; margin-top: 3px; color: #86a898; font-size: 11px; }
code { padding: 3px 6px; border: 1px solid rgba(153, 218, 177, .16); border-radius: 6px; color: #bff4d0; background: rgba(86, 196, 128, .1); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.code-used td { color: #789187; background: rgba(130, 146, 139, .06); }
.code-used code { color: #8fa69c; border-color: rgba(163, 178, 170, .13); background: rgba(163, 178, 170, .07); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 760; white-space: nowrap; }
.status.available, .status.published, .status.open, .status.active { color: #baf7d0; border-color: rgba(96, 222, 145, .22); background: rgba(96, 222, 145, .11); }
.status.allocated, .status.upcoming, .status.draft { color: #ffe2a2; border-color: rgba(244, 189, 97, .24); background: rgba(244, 189, 97, .1); }
.status.used, .status.archived, .status.disabled, .status.closed { color: #b4c1ba; border-color: rgba(183, 198, 189, .18); background: rgba(183, 198, 189, .08); }
.status.danger { color: #ffc0bd; border-color: rgba(255, 125, 120, .25); background: rgba(255, 125, 120, .11); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.inline-button { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; color: #c9eed7; background: rgba(18, 57, 45, .62); font-size: 11px; font-weight: 700; }
.inline-button:hover { border-color: var(--brand); }
.inline-button.danger { color: #ffb4ae; border-color: rgba(255, 125, 120, .3); background: rgba(139, 43, 42, .22); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 3px; }
.form-actions small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: auto; }
.data-boundary { display: grid; gap: 11px; }
.boundary-row { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(11, 35, 28, .55); }
.boundary-row i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #a9f8c9; background: rgba(90, 216, 143, .14); font-style: normal; }
.boundary-row b { display: block; font-size: 13px; }
.boundary-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.empty { padding: 35px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.denied { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.denied-card { width: min(460px, 100%); padding: 36px; border: 1px solid rgba(255, 125, 120, .27); border-radius: 24px; background: rgba(41, 24, 24, .75); box-shadow: var(--shadow); text-align: center; }
.denied-card i { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 17px; border-radius: 18px; color: #ffb3ae; background: rgba(255, 125, 120, .14); font-style: normal; font-size: 23px; }
.denied-card h1 { margin: 0; font-size: 25px; }
.denied-card p { margin: 12px 0 23px; color: var(--muted-strong); font-size: 14px; line-height: 1.7; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: min(420px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 12px; color: #eafff1; background: rgba(12, 43, 34, .96); box-shadow: var(--shadow); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255, 125, 120, .42); background: rgba(87, 30, 29, .96); }
.modal-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.modal-layer.open { pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 12, 8, .72); backdrop-filter: blur(6px); }
.modal { position: relative; width: min(570px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 32px)); margin: 8vh auto 0; overflow: auto; padding: 26px; border: 1px solid var(--line-strong); border-radius: 20px; background: #102a22; box-shadow: var(--shadow); }
.modal h2 { margin: 0; font-size: 22px; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.generated-codes { min-height: 250px; margin-top: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(119, 157, 140, .12); font-size: 20px; }
.helper { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.8); } }
@media (max-width: 1120px) { .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .admin-shell { display: block; } .sidebar { position: static; height: auto; padding: 14px 15px 0; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar .brand-lockup { padding: 0 5px 12px; } .sidebar-nav { display: flex; overflow-x: auto; padding-bottom: 11px; } .nav-item { flex: 0 0 auto; width: auto; padding: 8px 10px; font-size: 12px; } .nav-item span { display: none; } .sidebar-footer { display: none; } .main-area { padding: 0 16px 34px; } .topbar { height: 64px; } .topbar .top-brand { display: flex; } .topbar .top-brand .brand-copy { display: none; } .topbar-actions .button-secondary { display: none; } .page-head { align-items: flex-start; flex-direction: column; } .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric-card { min-height: 108px; } .metric-card strong { margin-top: 13px; font-size: 29px; } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .login-page { padding: 14px; } .login-grid { grid-template-columns: 1fr; border-radius: 22px; } .login-intro { min-height: 0; padding: 31px 28px; gap: 44px; } .login-intro h1 { font-size: 35px; } .login-card { padding: 30px 28px; } .content { padding-top: 25px; } .page-head h1 { font-size: 29px; } .page-head-meta { white-space: normal; } .metric-grid { gap: 10px; } .panel { padding: 16px; border-radius: 16px; } .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } .form-actions { align-items: flex-start; flex-direction: column; } .compact-list li { grid-template-columns: 86px 1fr; gap: 8px; } .compact-list em { display: none; } }
