:root {
  color-scheme: light;
  --primary: #4f8cff;
  --primary-d: #2f6bf0;
  --primary-soft: rgba(79, 140, 255, .13);
  --ink: #1d2230;
  --ink-2: #59617a;
  --ink-3: #98a0af;
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .65);
  --line: rgba(29, 34, 48, .09);
  --line-strong: rgba(29, 34, 48, .16);
  --success: #168457;
  --success-soft: rgba(36, 174, 119, .13);
  --warning: #9a6411;
  --warning-soft: rgba(184, 115, 40, .14);
  --danger: #c33c45;
  --danger-soft: rgba(195, 60, 69, .11);
  --focus: rgba(79, 140, 255, .45);
  --sidebar-width: 232px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-md: 0 10px 32px rgba(60, 80, 140, .10), inset 0 1px 0 rgba(255, 255, 255, .5);
  --shadow-lg: 0 18px 48px rgba(60, 80, 140, .16), inset 0 1px 0 rgba(255, 255, 255, .6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #e8ecf5; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #e8ecf5; font-size: 15px; line-height: 1.5; position: relative; overflow-x: hidden; }
/* ===== 流线极光背景（与控制台一致） ===== */
body::before {
  content: ''; position: fixed; inset: -10%; z-index: -2;
  background:
    radial-gradient(640px 520px at 12% 8%, rgba(110, 145, 255, .6), transparent 65%),
    radial-gradient(720px 620px at 88% 18%, rgba(255, 150, 200, .45), transparent 65%),
    radial-gradient(680px 580px at 78% 88%, rgba(100, 220, 255, .5), transparent 65%),
    radial-gradient(520px 470px at 18% 85%, rgba(150, 255, 205, .45), transparent 65%),
    linear-gradient(160deg, #eef1f8, #e4e9f4);
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after {
  content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 120deg at 50% 40%, transparent 0deg, rgba(120, 160, 255, .08) 90deg, transparent 180deg, rgba(255, 170, 210, .07) 270deg, transparent 360deg);
  animation: swirl 40s linear infinite;
}
@keyframes aurora {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 1.5%) scale(1.04); }
  100% { transform: translate(2%, -1.5%) scale(1.02); }
}
@keyframes swirl { to { transform: rotate(360deg); } }

button, input, select, textarea { font: inherit; }
button, a, select, input[type="checkbox"] { -webkit-tap-highlight-color: transparent; }
button, a { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100vh; }

/* ===== 侧边栏（深色毛玻璃，与控制台一致） ===== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 20;
  display: flex; flex-direction: column; padding: 20px 16px;
  background: rgba(18, 22, 32, .78); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-right: 1px solid rgba(255, 255, 255, .09); color: #aab2c2;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 8px; color: #eef1f7; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #4f8cff, #6a5cff); color: #fff; box-shadow: 0 8px 20px rgba(79, 140, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.brand-mark svg { width: 26px; height: 26px; stroke-width: 1.7; }
.brand-mark.large { width: 52px; height: 52px; border-radius: 15px; }
.brand-mark.large svg { width: 32px; height: 32px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-copy strong { font-size: 16px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 1px; color: #7d8698; font-size: 10px; letter-spacing: .14em; }
.nav-list { display: grid; gap: 5px; margin-top: 30px; }
.nav-list a {
  position: relative; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  color: #aab2c2; text-decoration: none; border-radius: 10px; transition: background-color .18s ease, color .18s ease;
}
.nav-list a:hover { color: #eef1f7; background: rgba(255, 255, 255, .07); }
.nav-list a.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(79, 140, 255, .4), rgba(79, 140, 255, .22));
}
.nav-list a.active::before {
  content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #4f8cff, #6a5cff);
}
.nav-list a b { min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #f4bd62; color: #4a2f04; font-size: 11px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255, 255, 255, .09); }
.mini-status { display: flex; align-items: center; gap: 8px; color: #aab2c2; font-size: 12px; }
.subtle-link { display: inline-flex; min-height: 44px; align-items: center; color: #7d8698; font-size: 12px; text-decoration: none; }
.subtle-link:hover { color: #eef1f7; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(20px, 3vw, 44px); border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .55);
  position: sticky; top: 0; z-index: 15; backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
}
.topbar h1 { margin: 0; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; letter-spacing: -.025em; }
.topbar p { margin: 5px 0 0; color: var(--ink-3); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sync-time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--glass-border); border-radius: 12px; color: var(--ink-2); background: var(--glass); transition: color .18s, border-color .18s, background-color .18s, box-shadow .18s; }
.icon-button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .9); background: var(--glass-strong); box-shadow: 0 6px 16px rgba(60, 80, 140, .12); }
.icon-button.loading svg { animation: spin .8s linear infinite; }
.icon-button svg { width: 22px; height: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

#main-content { max-width: 1500px; margin: 0 auto; padding: 28px clamp(20px, 3vw, 44px) 64px; }
#main-content:focus { outline: none; }
.view { animation: view-in .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes view-in { from { opacity: .55; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.status-ribbon { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 82px; padding: 16px 20px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.status-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.status-main > div { min-width: 0; }
.status-main strong { display: block; font-size: 16px; }
.status-main span:not(.signal-dot) { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.signal-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 4px rgba(152, 160, 175, .18); }
.signal-dot.online { background: #24ae77; box-shadow: 0 0 0 4px rgba(36, 174, 119, .18); }
.signal-dot.offline { background: #d64550; box-shadow: 0 0 0 4px rgba(214, 69, 80, .16); }
.status-facts { display: flex; align-items: center; gap: 0; }
.status-facts > span { min-width: 108px; padding: 0 18px; border-left: 1px solid var(--line); }
.status-facts small, .status-facts b { display: block; }
.status-facts small { color: var(--ink-3); font-size: 11px; }
.status-facts b { margin-top: 3px; color: var(--ink-2); font-size: 13px; font-weight: 600; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 20px; margin-top: 20px; }
.command-stage { min-width: 0; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-lg); color: var(--ink); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: 18px; letter-spacing: -.018em; }
.section-heading p, .panel-intro { margin: 5px 0 0; max-width: 68ch; color: var(--ink-3); font-size: 13px; }
.safe-tag, .count-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.safe-tag { color: var(--success); background: var(--success-soft); }
.safe-tag svg { width: 16px; height: 16px; }
.count-chip { color: var(--ink-2); background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-border); }
.command-form { margin-top: 28px; }
label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
input, textarea, select {
  width: 100%; min-height: 44px; padding: 10px 14px; color: var(--ink); background: rgba(255, 255, 255, .55); border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 14px; outline: none; transition: border-color .18s, box-shadow .18s, background-color .18s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); background: rgba(255, 255, 255, .8); box-shadow: 0 0 0 4px rgba(79, 140, 255, .15); }
textarea { min-height: 86px; resize: vertical; }
.command-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 8px; }
.command-input-row input { min-height: 50px; font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 650; color: var(--ink); text-decoration: none; transition: background-color .18s, border-color .18s, color .18s, opacity .18s, box-shadow .18s, transform .18s; }
.button.primary { background: linear-gradient(135deg, #4f8cff, #6a5cff); color: #fff; box-shadow: 0 6px 16px rgba(79, 140, 255, .4), inset 0 1px 0 rgba(255, 255, 255, .25); }
.button.primary:hover { box-shadow: 0 8px 22px rgba(79, 140, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .25); transform: translateY(-1px); }
.button.secondary { background: var(--glass); border: 1px solid var(--glass-border); color: var(--ink-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.button.secondary:hover { background: var(--glass-strong); color: var(--ink); border-color: rgba(255, 255, 255, .9); }
.button.danger { background: linear-gradient(135deg, #e0565f, #c33c45); color: #fff; box-shadow: 0 6px 16px rgba(195, 60, 69, .35), inset 0 1px 0 rgba(255, 255, 255, .2); }
.button.danger:hover { box-shadow: 0 8px 22px rgba(195, 60, 69, .45), inset 0 1px 0 rgba(255, 255, 255, .2); transform: translateY(-1px); }
.button.compact { min-height: 40px; padding: 7px 13px; font-size: 13px; }
.button.full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; transform: none; }
.preview-result { min-height: 84px; display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .45); }
.preview-result strong { display: block; }
.preview-result p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.preview-result.valid { border-color: rgba(36, 174, 119, .45); background: rgba(36, 174, 119, .1); }
.preview-result.invalid { border-color: rgba(195, 60, 69, .45); background: rgba(195, 60, 69, .08); }
.preview-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--primary-d); background: var(--primary-soft); }
.preview-result.valid .preview-icon { color: var(--success); background: var(--success-soft); }
.preview-result.invalid .preview-icon { color: var(--danger); background: var(--danger-soft); }
.quick-commands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quick-commands button { min-height: 38px; padding: 7px 13px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass); color: var(--ink-2); transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s; }
.quick-commands button:hover { background: var(--glass-strong); color: var(--ink); border-color: rgba(255, 255, 255, .9); box-shadow: 0 4px 12px rgba(60, 80, 140, .1); }

.today-panel { padding: 22px; border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.today-head h2 { margin: 0; font-size: 18px; }
.today-head span { color: var(--ink-3); font-size: 11px; }
.metric-list { margin: 18px 0 20px; }
.metric-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 56px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.metric-list dt { color: var(--ink-2); }
.metric-list dd { margin: 0; }
.metric-list dd strong { font-size: 24px; letter-spacing: -.025em; }
.metric-list dd span { margin-left: 4px; color: var(--ink-3); font-size: 12px; }
.panel { margin-top: 20px; padding: 20px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.text-link { min-height: 40px; display: inline-flex; align-items: center; color: var(--primary-d); text-decoration: none; font-size: 13px; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.activity-list { margin-top: 14px; }
.activity-row { min-height: 54px; display: grid; grid-template-columns: 150px minmax(110px, .7fr) minmax(120px, .8fr) 90px minmax(160px, 1.4fr); align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.activity-row:first-child { border-top: 0; }
.activity-row time, .activity-row .detail { color: var(--ink-3); }
.loading-block { min-height: 120px; position: relative; overflow: hidden; }
.loading-block::before { content: ""; display: block; height: 12px; margin-top: 22px; border-radius: 6px; background: linear-gradient(90deg, rgba(152, 160, 175, .18), rgba(152, 160, 175, .38), rgba(152, 160, 175, .18)); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.loading-block::after { content: ""; display: block; height: 12px; width: 70%; margin-top: 18px; border-radius: 6px; background: rgba(152, 160, 175, .2); }
@keyframes shimmer { to { background-position: -200% 0; } }

.page-section-heading { align-items: center; margin-bottom: 18px; }
.page-section-heading h2 { font-size: 22px; }
.request-list { display: grid; gap: 12px; }
.request-card { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, .9fr) auto; align-items: end; gap: 18px; padding: 18px 20px; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.request-card h3 { margin: 0; font-size: 16px; }
.request-card p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; }
.request-card label { display: grid; gap: 6px; }
.request-actions { display: flex; gap: 8px; }
.empty-state { min-height: 240px; display: grid; place-items: center; text-align: center; padding: 32px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-2); background: rgba(255, 255, 255, .3); }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 8px; color: #24ae77; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 5px 0 0; max-width: 50ch; color: var(--ink-3); font-size: 13px; }
.compact-empty { min-height: 140px; }
.empty-row { padding: 40px; color: var(--ink-3); text-align: center; }
.muted-small { color: var(--ink-3); }

.search-field { width: min(280px, 100%); position: relative; }
.search-field svg { width: 17px; height: 17px; position: absolute; left: 13px; top: 14px; color: var(--ink-3); }
.search-field input { padding-left: 38px; }
.table-wrap { overflow-x: auto; }
.panel-table { border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { min-height: 52px; padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-size: 11px; font-weight: 650; white-space: nowrap; background: rgba(255, 255, 255, .4); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(79, 140, 255, .05); }
.align-right { text-align: right; }
.member-name { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.member-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--primary-d); background: var(--primary-soft); font-weight: 700; }
.member-name strong, .member-name small { display: block; }
.member-name small { margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(255, 255, 255, .5); color: var(--ink-2); font-size: 12px; transition: background-color .18s, color .18s, border-color .18s; }
.row-button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .9); background: var(--glass-strong); }
.row-button.danger { color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.info { color: var(--primary-d); background: var(--primary-soft); }
.role-label { color: var(--ink-2); }
.mobile-cards { display: none; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .75fr); gap: 20px; align-items: start; }
.settings-layout .panel { margin-top: 0; }
.command-library h3, .settings-form h3 { margin: 0; font-size: 17px; }
.command-list { margin-top: 18px; }
.command-item { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(180px, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 0; border-top: 1px solid var(--line); }
.command-item:first-child { border-top: 0; }
.command-code { width: fit-content; padding: 7px 9px; border-radius: 8px; color: var(--primary-d); background: rgba(79, 140, 255, .1); border: 1px solid rgba(79, 140, 255, .18); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-size: 12px; }
.command-item p { margin: 0; color: var(--ink-2); }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.settings-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; }
.save-state { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.save-state.dirty { color: var(--warning); }
.save-state.saved { color: var(--success); }
.toggle-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row strong, .toggle-row span { display: block; }
.toggle-row span { margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.switch { position: relative; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { width: 48px; height: 28px; display: block; padding: 3px; border-radius: 999px; background: #c3c9d6; transition: background-color .18s, background-image .18s; }
.switch > span::after { content: ""; width: 22px; height: 22px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(29, 34, 48, .25); transition: transform .18s cubic-bezier(.16, 1, .3, 1); }
.switch input:checked + span { background: linear-gradient(135deg, #4f8cff, #6a5cff); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.form-grid label, .full-label, .dialog label:not(.checkbox-row) { display: grid; gap: 6px; }
label small { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.full-label { margin: 16px 0; }

.audit-filters { display: flex; gap: 8px; align-items: center; }
.audit-filters select { width: 130px; }
.audit-filters input { width: 180px; }
.status-text { font-weight: 600; }
.status-text.success { color: var(--success); }
.status-text.denied { color: var(--warning); }
.status-text.failed { color: var(--danger); }
.status-text.info { color: var(--primary-d); }
.pager { min-height: 60px; display: flex; justify-content: center; align-items: center; gap: 14px; color: var(--ink-3); font-size: 12px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(440px, 100%); padding: clamp(24px, 5vw, 36px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-strong); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.login-brand { display: flex; align-items: center; gap: 16px; }
.login-brand h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.login-brand p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.login-panel form { margin-top: 30px; }
.login-panel form label { display: block; margin-bottom: 7px; }
.login-panel form .button { margin-top: 14px; }
.form-error { margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.login-note { display: flex; gap: 8px; margin: 22px 0 0; color: var(--ink-3); font-size: 11px; }
.login-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: #24ae77; }

.dialog { width: min(480px, calc(100% - 32px)); padding: 0; color: var(--ink); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-strong); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.dialog::backdrop { background: rgba(29, 34, 48, .32); backdrop-filter: blur(6px); }
.dialog form { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog p { margin: 5px 0 0; color: var(--ink-2); font-size: 13px; }
.dialog form > label:not(.checkbox-row) { margin-top: 14px; }
.checkbox-row { min-height: 44px; display: flex; align-items: center; gap: 9px; margin-top: 12px; cursor: pointer; }
.checkbox-row input { width: 19px; min-height: 19px; accent-color: var(--primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.confirm-dialog { width: min(420px, calc(100% - 32px)); text-align: center; }
.danger-symbol { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; color: var(--danger); background: var(--danger-soft); }
.danger-symbol svg { width: 26px; height: 26px; }
.confirm-dialog .dialog-actions { justify-content: center; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 40px)); padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 12px; color: var(--ink); background: var(--glass-strong); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); animation: toast-in .22s cubic-bezier(.16, 1, .3, 1); }
.toast.success { border-color: rgba(36, 174, 119, .5); }
.toast.error { border-color: rgba(195, 60, 69, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .overview-grid, .settings-layout { grid-template-columns: 1fr; }
  .today-panel { display: grid; grid-template-columns: 1fr 2fr; gap: 0 24px; align-items: start; }
  .today-panel .button { grid-column: 1 / -1; }
  .status-facts > span { min-width: 92px; padding: 0 12px; }
  .request-card { grid-template-columns: minmax(170px, .8fr) minmax(220px, 1fr); }
  .request-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 800px) {
  :root { --mobile-nav-height: 72px; }
  .sidebar { inset: auto 0 0 0; width: auto; height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); border-top: 1px solid rgba(255, 255, 255, .09); border-right: 0; }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav-list { height: 100%; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 0; }
  .nav-list a { min-height: 58px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; border-radius: 8px; font-size: 10px; }
  .nav-list a.active::before { left: 12%; right: 12%; top: auto; bottom: 2px; width: auto; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, #4f8cff, #6a5cff); }
  .nav-list a svg { width: 21px; height: 21px; }
  .nav-list a b { position: absolute; top: 3px; right: calc(50% - 23px); min-width: 17px; height: 17px; padding: 0 4px; font-size: 9px; }
  .workspace { margin-left: 0; padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .topbar { min-height: 76px; padding: 12px 16px; }
  .topbar p, .sync-time, #logout-button { display: none; }
  .topbar h1 { font-size: 21px; }
  #main-content { padding: 18px 14px 36px; }
  .status-ribbon { align-items: flex-start; flex-direction: column; gap: 16px; }
  .status-facts { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .status-facts > span { min-width: 0; padding: 0 10px; }
  .status-facts > span:first-child { padding-left: 0; border-left: 0; }
  .status-facts > span:last-child { padding-right: 0; }
  .command-stage { padding: 20px 16px; }
  .section-heading { gap: 12px; }
  .safe-tag { display: none; }
  .command-input-row { grid-template-columns: 1fr; }
  .command-input-row .button { width: 100%; }
  .today-panel { display: block; }
  .activity-row { grid-template-columns: 110px 1fr 84px; }
  .activity-row .actor, .activity-row .detail { display: none; }
  .page-section-heading { align-items: flex-start; flex-direction: column; }
  .search-field { width: 100%; }
  .request-card { grid-template-columns: 1fr; gap: 12px; }
  .request-actions { grid-column: auto; }
  .request-actions .button { flex: 1; }
  .panel-table { display: none; }
  .mobile-cards { display: grid; gap: 10px; }
  .mobile-card { padding: 16px; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass); box-shadow: var(--shadow-md); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
  .mobile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .mobile-card h3 { margin: 0; font-size: 15px; }
  .mobile-card p { margin: 3px 0 0; color: var(--ink-3); font-size: 11px; }
  .mobile-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
  .mobile-card dt { color: var(--ink-3); font-size: 10px; }
  .mobile-card dd { margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }
  .mobile-card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mobile-card-actions .row-button { min-height: 42px; }
  .command-item { grid-template-columns: 1fr auto; }
  .command-item p { grid-column: 1 / -1; grid-row: 2; }
  .audit-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .audit-filters select, .audit-filters input { width: 100%; }
  .audit-filters .button { grid-column: 1 / -1; }
  .toast-region { right: 12px; bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 10px); }
}

@media (max-width: 460px) {
  .status-facts b { font-size: 11px; }
  .today-head { align-items: flex-start; flex-direction: column; }
  .metric-list > div { min-height: 50px; }
  .quick-commands { display: grid; grid-template-columns: 1fr 1fr; }
  .quick-commands button { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .login-shell { padding: 16px; }
  .login-panel { padding: 24px 20px; }
}

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