:root {
  --black: #08090b;
  --ink: #111318;
  --muted: #6d7380;
  --line: #e5e7eb;
  --soft: #f5f7fa;
  --white: #ffffff;
  --blue: #1769ff;
  --blue-dark: #0c4dd5;
  --blue-soft: #eaf1ff;
  --green: #0a9b63;
  --green-soft: #e8f8f1;
  --orange: #d97008;
  --orange-soft: #fff4e8;
  --red: #d83a48;
  --red-soft: #fff0f1;
  --shadow: 0 16px 48px rgba(17, 24, 39, .10);
  --radius: 14px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--soft); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mobile-only { display: none; }

.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--black); font-size: 22px; font-weight: 850; letter-spacing: -.8px; }
.wordmark b { display: grid; place-items: center; min-width: 36px; height: 28px; padding: 0 7px; border-radius: 5px; color: white; background: var(--blue); font-size: 14px; letter-spacing: .5px; }
.wordmark-light { color: white; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.08fr) minmax(420px, .92fr); background: white; }
.login-brand { position: relative; overflow: hidden; display: flex; min-height: 100vh; padding: 54px 64px; color: white; background: var(--black); }
.login-brand::before { content: ""; position: absolute; width: 520px; height: 520px; right: -170px; bottom: -190px; border: 110px solid rgba(23, 105, 255, .15); border-radius: 50%; }
.login-brand::after { content: ""; position: absolute; width: 1px; height: 45%; right: 26%; top: 17%; background: linear-gradient(transparent, rgba(255,255,255,.2), transparent); transform: rotate(24deg); }
.login-brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(620px, 100%); }
.login-brand .eyebrow { margin-top: auto; }
.eyebrow { margin: 0 0 14px; font-size: 11px; font-weight: 800; letter-spacing: 2.3px; text-transform: uppercase; color: #989ca7; }
.eyebrow.blue { color: var(--blue); }
.login-brand h1 { margin: 0; font-size: clamp(48px, 5vw, 78px); line-height: 1.03; letter-spacing: -4px; font-weight: 780; }
.login-copy { max-width: 520px; margin: 30px 0 48px; color: #b9bdc7; font-size: 16px; line-height: 1.8; }
.login-points { display: flex; gap: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); color: #d5d7dd; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-form { width: min(420px, 100%); }
.mobile-wordmark { display: none; margin-bottom: 70px; }
.login-form h2 { margin: 0 0 10px; font-size: 36px; letter-spacing: -1.5px; }
.login-form > .muted { margin: 0 0 34px; }
.login-help { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span { font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #d8dce3; border-radius: 9px; color: var(--ink); background: white; outline: none; transition: border .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 255, .11); }
.form-note { margin: -4px 0 18px; padding: 11px 13px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 12px; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.check-row b { display: block; margin-bottom: 4px; font-size: 14px; }
.check-row small { color: var(--muted); line-height: 1.5; }
.switch { position: relative; flex: 0 0 auto; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #c8ccd3; border-radius: 99px; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(18px); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 750; transition: transform .12s, background .15s; }
.button:active { transform: translateY(1px); }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.secondary:hover { background: var(--soft); }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.ghost { color: var(--blue); background: var(--blue-soft); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.button.wide { width: 100%; min-height: 48px; margin-top: 8px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 22px; }
.icon-button:hover { background: rgba(127,127,127,.10); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: 250px; padding: 25px 18px 20px; color: white; background: var(--black); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 28px; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-section { margin: 22px 11px 8px; color: #6f7480; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; color: #aeb3bd; background: transparent; text-align: left; font-size: 13px; font-weight: 650; }
.nav-button:hover { color: white; background: #15171b; }
.nav-button.active { color: white; background: var(--blue); }
.nav-mark { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 2px; transform: rotate(45deg); }
.nav-button.active .nav-mark { background: white; border-color: white; }
.sidebar-foot { margin-top: auto; padding: 18px 11px 0; border-top: 1px solid #25272d; }
.sidebar-foot p { margin: 12px 0 0; color: #636873; font-size: 10px; }
.status-dot { display: flex; align-items: center; gap: 8px; color: #adb2bc; font-size: 11px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #2bd895; box-shadow: 0 0 0 4px rgba(43,216,149,.10); }

.workspace { min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 80px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.page-kicker { margin: 0 0 3px; color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 1.3px; text-transform: uppercase; }
.topbar h2 { margin: 0; font-size: 19px; letter-spacing: -.4px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.expiry-badge { padding: 8px 11px; border-radius: 7px; color: var(--orange); background: var(--orange-soft); font-size: 11px; font-weight: 750; }
.user-menu { position: relative; }
.user-button { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); }
.user-button:hover { background: var(--soft); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: white; background: var(--black); font-weight: 800; }
.user-meta { display: grid; min-width: 95px; text-align: left; }
.user-meta b { font-size: 12px; }
.user-meta small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 150px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow); }
.dropdown button { width: 100%; padding: 9px; border: 0; border-radius: 6px; background: white; text-align: left; font-size: 12px; }
.dropdown button:hover { background: var(--soft); }

.page-content { padding: 28px 32px 50px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 7px; font-size: 29px; letter-spacing: -1.2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-actions { display: flex; gap: 9px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { min-height: 128px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 18px; font-size: 28px; letter-spacing: -1.1px; }
.stat-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 20px; }
.quick-list { display: grid; gap: 11px; }
.quick-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.quick-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 850; }
.quick-item b { display: block; font-size: 13px; }
.quick-item small { color: var(--muted); font-size: 10px; }
.quick-item.done .quick-number { color: var(--green); background: var(--green-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 16px; color: var(--muted); background: #fafbfc; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
td b { font-size: 12px; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.table-actions { display: flex; gap: 6px; white-space: nowrap; }
.site-credentials { display: grid; gap: 8px; min-width: 330px; }
.site-credentials > div { display: grid; grid-template-columns: 70px minmax(150px, 1fr) auto; align-items: center; gap: 8px; }
.site-credentials span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.site-credentials code { overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }
.button.tiny { min-height: 27px; padding: 4px 8px; font-size: 9px; }
.muted-text { color: var(--muted); font-size: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--green); background: var(--green-soft); }
.badge.warning { color: var(--orange); background: var(--orange-soft); }
.badge.danger { color: var(--red); background: var(--red-soft); }
.badge.info { color: var(--blue); background: var(--blue-soft); }
.badge.neutral { color: #6e7580; background: #eef0f3; }
.empty { display: grid; place-items: center; min-height: 260px; padding: 40px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 15px; border: 1px solid #d9dce2; border-radius: 14px; color: var(--blue); background: var(--soft); font-size: 22px; }
.empty h3 { margin: 0 0 8px; font-size: 16px; }
.empty p { max-width: 370px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.secret-box { margin-top: 15px; padding: 14px; border: 1px solid #c9dafd; border-radius: 9px; background: var(--blue-soft); }
.secret-box code { display: block; margin-top: 7px; overflow-wrap: anywhere; color: var(--blue-dark); font-size: 12px; }
.credential-box { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.credential-box span { color: var(--muted); font-size: 10px; font-weight: 800; }
.credential-box code { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.account-choice { display: grid; gap: 8px; max-height: 230px; overflow: auto; }
.account-option { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.account-option input { accent-color: var(--blue); }
.account-option b { font-size: 12px; }
.account-option small { margin-left: auto; color: var(--muted); font-size: 10px; }
.notice { margin-bottom: 18px; padding: 13px 15px; border: 1px solid #cfe0ff; border-radius: 10px; color: #244b91; background: #f2f6ff; font-size: 12px; line-height: 1.6; }

.modal { width: min(610px, calc(100vw - 28px)); max-height: calc(100vh - 34px); padding: 0; border: 0; border-radius: 16px; background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(7, 9, 12, .58); backdrop-filter: blur(3px); }
.modal-card { max-height: calc(100vh - 34px); overflow: auto; border-radius: 16px; background: white; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: white; }
.modal-head h3 { margin: 0; font-size: 21px; letter-spacing: -.7px; }
.modal-head .eyebrow { margin-bottom: 6px; }
.modal-body { padding: 22px 24px 25px; }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 390px; padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 9px; background: white; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .credential-box { grid-template-columns: 1fr auto; }
  .credential-box span { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .mobile-only { display: grid; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
  .mobile-wordmark { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; display: none; background: rgba(0,0,0,.45); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 70px; padding: 12px 16px; }
  .user-meta, .expiry-badge { display: none !important; }
  .page-content { padding: 22px 16px 38px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 112px; padding: 16px; }
  .stat-card strong { font-size: 23px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 460px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-form h2 { font-size: 30px; }
  .modal-body, .modal-head { padding-left: 18px; padding-right: 18px; }
}
