:root {
  --ink: #122033;
  --muted: #66758a;
  --line: #dce4ec;
  --paper: #ffffff;
  --canvas: #f3f6f9;
  --navy: #102a43;
  --blue: #1769e0;
  --cyan: #13b5a4;
  --green: #087d61;
  --green-bg: #e7f7f1;
  --red: #b9384b;
  --red-bg: #fff0f1;
  --amber: #a56108;
  --amber-bg: #fff6df;
  --shadow: 0 18px 55px rgba(17, 42, 67, .09);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 95% 0, rgba(19,181,164,.08), transparent 28rem), var(--canvas); font-size: 16px; line-height: 1.55; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1440px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--navy), #174e7a 58%, var(--cyan)); box-shadow: 0 7px 18px rgba(16,42,67,.2); }
.top-actions { display: flex; align-items: center; gap: 16px; }
.top-actions > a { text-decoration: none; color: var(--muted); font-weight: 700; }
.identity { display: grid; line-height: 1.25; text-align: right; }
.identity small { color: var(--muted); }
.top-actions form, .actions form { margin: 0; }
.page { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.workspace-head.compact { align-items: start; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.05em; line-height: 1.05; margin-bottom: 10px; color: var(--navy); }
h2 { font-size: 1.25rem; letter-spacing: -.02em; margin-bottom: 4px; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: .75rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); margin-bottom: 0; }
.back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-weight: 700; text-decoration: none; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--blue); box-shadow: 0 8px 22px rgba(23,105,224,.2); }
.button.success { color: var(--green); background: var(--green-bg); border-color: #bee8db; }
.button.danger { color: var(--red); background: var(--red-bg); border-color: #f5cbd1; }
.button.ghost { color: var(--navy); background: #fff; border-color: var(--line); }
.button.danger-text { color: var(--red); }
.button.small { min-height: 34px; padding: 6px 10px; font-size: .875rem; }
.button.full { width: 100%; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-heading p, .panel-heading h2 { margin-bottom: 0; }
.add-panel { margin-bottom: 26px; overflow: hidden; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; padding: 24px 26px 26px; }
.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; }
.form-grid.bulk-form { padding-top: 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
label { display: grid; gap: 7px; color: var(--navy); font-size: .875rem; font-weight: 800; }
label small { color: var(--muted); font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid #cbd6e2; border-radius: 10px; padding: 11px 13px; background: #fbfcfe; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); background: #fff; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 12px; border: 1px solid #cbd6e2; border-radius: 10px; background: #fbfcfe; }
.check-list label { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: .875rem; font-weight: 700; cursor: pointer; }
.check-list input[type="checkbox"], .inline-form .check-list input[type="checkbox"] { width: 1rem; min-width: 0; height: 1rem; padding: 0; margin: 0; accent-color: var(--blue); }
.check-list.compact { max-width: 340px; padding: 8px; gap: 6px; }
.check-list.compact label { min-height: 28px; padding: 3px 7px; font-size: .82rem; }
textarea { resize: vertical; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.bulk-divider { display: flex; align-items: center; gap: 12px; padding: 0 26px; color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .06em; }
.bulk-divider::before, .bulk-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-stack { padding: 28px; display: grid; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.stat { min-height: 105px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 15px; text-decoration: none; display: flex; align-items: flex-end; justify-content: space-between; overflow: hidden; position: relative; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #8ca0b4; }
.stat.pending::before { background: #d28a1a; }.stat.approved::before { background: var(--green); }.stat.rejected::before { background: var(--red); }
.stat.active { border-color: #a7bed9; box-shadow: 0 10px 28px rgba(17,42,67,.09); }
.stat span { color: var(--muted); font-weight: 800; }.stat strong { color: var(--navy); font-size: 2.15rem; line-height: 1; letter-spacing: -.05em; }
.table-panel { overflow: hidden; }
.record-count { color: var(--muted); font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; text-align: left; background: #f7f9fb; color: var(--muted); font-size: .78rem; letter-spacing: .06em; white-space: nowrap; }
td { padding: 18px; border-top: 1px solid #e8edf2; vertical-align: top; }
tbody tr:hover { background: #fbfdff; }
.link-row { scroll-margin-top: 92px; }
.link-cell { max-width: 520px; display: grid; gap: 3px; }
.link-url-row { display: flex; align-items: center; gap: 8px; min-width: 0; }.link-url-row a { min-width: 0; }.copy-link { flex: 0 0 auto; border: 1px solid #cbdced; border-radius: 7px; padding: 3px 7px; color: var(--blue); background: #f5f9ff; font-size: .75rem; font-weight: 800; cursor: pointer; }.copy-link:hover, .copy-link.copied { color: var(--green); border-color: #bee8db; background: var(--green-bg); }
.link-cell strong { color: var(--navy); }.link-cell a { color: var(--blue); overflow-wrap: anywhere; font-size: .9rem; }.link-cell small { color: var(--muted); margin-top: 4px; }
.number { color: var(--muted); font: 700 .76rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.chip { padding: 5px 9px; border-radius: 999px; display: inline-block; white-space: nowrap; font-size: .78rem; font-weight: 900; }
.chip.yes { color: var(--green); background: var(--green-bg); }.chip.no { color: var(--red); background: var(--red-bg); }.chip.wait { color: var(--amber); background: var(--amber-bg); }
.meta { display: grid; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 180px; }
.locked { align-self: center; color: var(--muted); font-size: .8rem; font-weight: 800; }
.empty { padding: 75px 24px; text-align: center; color: var(--muted); }
.empty > span { display: block; color: #a8b6c5; font-size: 2rem; font-weight: 900; }.empty h3 { margin-bottom: 4px; color: var(--navy); }.empty p { margin-bottom: 0; }
.empty.standalone { padding-top: 15vh; }.empty.standalone > span { font-size: 5rem; color: var(--navy); }.empty.standalone h1 { font-size: 1.7rem; margin: 10px 0 24px; }
.edit-panel { max-width: 850px; overflow: hidden; }
.notice { padding: 14px 28px; color: var(--amber); background: var(--amber-bg); border-bottom: 1px solid #f0dca7; font-weight: 700; }
.messages { position: fixed; top: 88px; right: 24px; z-index: 50; width: min(410px,calc(100% - 48px)); display: grid; gap: 10px; }
.message { padding: 13px 16px; border: 1px solid; border-radius: 11px; box-shadow: var(--shadow); background: #fff; font-weight: 700; }.message.success { color: var(--green); border-color: #bee8db; }.message.error { color: var(--red); border-color: #f5cbd1; }
.login-page { width: 100%; min-height: 100vh; padding: 0; display: grid; place-items: center; background: linear-gradient(118deg, var(--navy) 0 48%, var(--canvas) 48%); }
.login-shell { width: min(1120px,calc(100% - 48px)); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(50px,9vw,130px); }
.login-intro { color: white; max-width: 520px; }.login-brand { color: white; margin-bottom: 68px; }.login-intro h1 { color: white; font-size: clamp(2.8rem,6vw,5rem); max-width: 500px; }.login-intro > p { color: #bed0e0; max-width: 460px; }
.login-points { list-style: none; padding: 0; margin: 45px 0 0; display: grid; gap: 14px; }.login-points li { color: #dce8f1; display: flex; gap: 12px; align-items: center; }.login-points span { color: #75e0d4; font: 800 .75rem ui-monospace,monospace; }
.login-card { display: grid; gap: 22px; padding: 38px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(10,30,50,.18); }.login-card h2 { font-size: 1.8rem; color: var(--navy); }
.admin-grid { display: grid; grid-template-columns: minmax(300px,.7fr) minmax(500px,1.3fr); gap: 22px; align-items: start; }
.user-list { padding: 0 24px; }.user-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 2px; border-bottom: 1px solid var(--line); }.user-row:last-child { border-bottom: 0; }.user-row > div:first-child { display: grid; }.user-row span { color: var(--muted); font-size: .85rem; }.user-summary { gap: 5px; min-width: 230px; }.sk-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 4px; }.sk-line span { font-weight: 900; color: var(--blue); }.sk-line code { max-width: min(420px, 100%); padding: 5px 7px; overflow-wrap: anywhere; border-radius: 7px; background: #f5f9ff; color: var(--navy); font: 700 .78rem ui-monospace, SFMono-Regular, Consolas, monospace; }.sk-line em { color: var(--muted); font-size: .82rem; font-style: normal; }
.inline-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; }.inline-form input, .inline-form select { width: auto; min-width: 130px; padding: 7px 9px; }.inline-form select[multiple] { min-height: 76px; min-width: 150px; }.group-assign-form { align-items: flex-start; }.groups-panel { margin-top: 22px; overflow: hidden; }.group-create { padding: 20px 26px; border-bottom: 1px solid var(--line); }.group-list { padding: 0 26px; }.group-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }.group-row:last-child { border-bottom: 0; }.group-row > div { display: grid; }.group-row span { color: var(--muted); font-size: .85rem; }
.secret-box { display: flex; align-items: center; gap: 22px; padding: 22px 25px; margin-bottom: 22px; color: white; background: var(--navy); border-radius: 16px; box-shadow: var(--shadow); }.secret-box div { min-width: 120px; }.secret-box h2,.secret-box p { margin: 0; color: white; }.secret-box code { flex: 1; padding: 12px 14px; overflow-wrap: anywhere; background: rgba(255,255,255,.1); border-radius: 9px; color: #8de4da; }
@media (max-width: 900px) {
  .page { width: min(100% - 28px, 760px); padding-top: 28px; }
  .login-page { background: var(--navy); padding: 28px 0; }
  .login-shell { grid-template-columns: 1fr; gap: 32px; width: min(560px,calc(100% - 32px)); }.login-intro { max-width: none; }.login-brand { margin-bottom: 30px; }.login-intro h1 { font-size: 2.7rem; }.login-points { display: none; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }.span-2,.span-3 { grid-column: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .secret-box { align-items: stretch; flex-direction: column; }.secret-box div { min-width: 0; }
  table, tbody, tr, td { display: block; } thead { display: none; } tr { padding: 8px 16px; border-top: 1px solid var(--line); } td { display: grid; grid-template-columns: 100px 1fr; gap: 12px; border: 0; padding: 8px 0; } td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 800; } .actions { min-width: 0; }
}
@media (max-width: 600px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 15px; }.top-actions { gap: 8px; }.top-actions > a,.identity small { display: none; }.identity strong { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-head { align-items: stretch; flex-direction: column; gap: 18px; }.workspace-head .button { align-self: stretch; }
  .stats { gap: 9px; }.stat { min-height: 86px; padding: 14px; }.stat strong { font-size: 1.7rem; }
  td { grid-template-columns: 82px 1fr; }.actions { gap: 6px; }
  .login-card { padding: 26px 22px; }.login-intro h1 { font-size: 2.25rem; }
  .user-row { align-items: flex-start; flex-direction: column; }.user-row .actions { width: 100%; }.group-row { align-items: flex-start; flex-direction: column; }.group-row .inline-form { width: 100%; }.group-row .inline-form input { flex: 1; min-width: 0; }
  .messages { top: 78px; right: 14px; width: calc(100% - 28px); }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; } }
