:root {
  color-scheme: dark;
  --bg: #020b0f;
  --bg-deep: #01070a;
  --panel: rgba(6, 28, 35, 0.82);
  --panel-solid: #061c23;
  --panel-soft: rgba(11, 42, 50, 0.64);
  --line: rgba(69, 240, 202, 0.14);
  --line-strong: rgba(45, 245, 193, 0.38);
  --mint: #2df5c1;
  --mint-2: #19bfa3;
  --cyan: #42cfff;
  --blue: #4e7cff;
  --purple: #ad75ff;
  --pink: #ff6bb4;
  --yellow: #ffd64a;
  --orange: #ff9848;
  --red: #ff5e70;
  --green: #4be58c;
  --text: #eefbf8;
  --muted: #78959a;
  --muted-2: #4d6c72;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); }
body { margin: 0; min-height: 100vh; color: var(--text); background:
  radial-gradient(circle at 70% -20%, rgba(21, 192, 162, 0.14), transparent 37%),
  radial-gradient(circle at 10% 90%, rgba(25, 112, 140, 0.11), transparent 30%),
  var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.noise { position: fixed; inset: 0; z-index: -1; opacity: .22; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); }

.login-screen { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 28px; }
.login-orbit { position: absolute; border: 1px solid rgba(45,245,193,.16); border-radius: 50%; box-shadow: inset 0 0 90px rgba(45,245,193,.03); }
.orbit-one { width: 720px; height: 720px; left: -330px; top: -280px; }
.orbit-two { width: 560px; height: 560px; right: -260px; bottom: -280px; }
.login-card { width: min(430px, 100%); padding: 42px; position: relative; background: linear-gradient(145deg, rgba(9,37,44,.94), rgba(3,18,23,.96)); border: 1px solid var(--line-strong); border-radius: 26px; box-shadow: var(--shadow), 0 0 80px rgba(45,245,193,.06); }
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, rgba(45,245,193,.18), transparent 33%, transparent 70%, rgba(66,207,255,.11)); mask: linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); mask-composite: exclude; padding: 1px; }
.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 24px; background: rgba(45,245,193,.08); border: 1px solid rgba(45,245,193,.32); border-radius: 22px; box-shadow: 0 0 38px rgba(45,245,193,.13); }
.brand-mark svg { width: 46px; fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg .brand-window { fill: var(--mint); stroke: none; }
.eyebrow { color: var(--mint-2); letter-spacing: .2em; font-weight: 800; font-size: 10px; margin: 0 0 7px; }
.login-card .eyebrow, .login-card h1, .login-subtitle { text-align: center; }
.login-card h1 { margin: 0; font-size: 38px; letter-spacing: -.04em; }
.login-subtitle { color: var(--muted); font-weight: 700; letter-spacing: .12em; font-size: 10px; margin: 7px 0 32px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span, .input-label { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.field input, .field textarea, .field select, .input, .select, .textarea { width: 100%; color: var(--text); background: rgba(0,8,11,.48); border: 1px solid rgba(116,161,168,.18); border-radius: 13px; padding: 13px 14px; outline: none; transition: .18s ease; }
.field textarea, .textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus, .select:focus, .textarea:focus { border-color: var(--mint-2); box-shadow: 0 0 0 3px rgba(45,245,193,.08); }
.form-error { color: var(--red); min-height: 18px; font-size: 12px; }
.primary-button, .secondary-button, .danger-button, .ghost-button { border: 0; border-radius: 13px; min-height: 44px; padding: 0 16px; font-weight: 900; font-size: 11px; letter-spacing: .06em; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .16s ease, filter .16s ease, opacity .16s ease; }
.primary-button { color: #00110d; background: linear-gradient(135deg, var(--mint), #17cba6); box-shadow: 0 10px 30px rgba(45,245,193,.13); }
.secondary-button { color: var(--text); background: rgba(45,245,193,.1); border: 1px solid rgba(45,245,193,.28); }
.danger-button { color: white; background: rgba(255,94,112,.82); }
.ghost-button { color: var(--muted); background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .ghost-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
button:disabled { cursor: not-allowed; opacity: .42; transform: none !important; }
.login-card .primary-button { width: 100%; min-height: 52px; justify-content: space-between; padding: 0 19px; }
.security-note { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted-2); margin-top: 18px; font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(75,229,140,.72); flex: none; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { height: 100vh; position: sticky; top: 0; border-right: 1px solid var(--line); background: rgba(2,13,17,.92); backdrop-filter: blur(18px); padding: 24px 16px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 10px 18px; border-bottom: 1px solid var(--line); font-weight: 900; letter-spacing: .07em; font-size: 13px; }
.sidebar-brand svg { width: 30px; fill: none; stroke: var(--mint); stroke-width: 3; }
.sidebar-brand .brand-window { fill: var(--mint); stroke: none; }
.main-nav { display: grid; gap: 7px; margin-top: 22px; }
.nav-item { min-height: 48px; border: 1px solid transparent; border-radius: 13px; padding: 0 12px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 7px; color: var(--muted); background: transparent; text-align: left; font-size: 12px; font-weight: 750; transition: .18s ease; }
.nav-item:hover { color: var(--text); background: rgba(45,245,193,.05); }
.nav-item.active { color: var(--mint); background: linear-gradient(90deg, rgba(45,245,193,.12), rgba(45,245,193,.025)); border-color: rgba(45,245,193,.16); box-shadow: inset 3px 0 var(--mint); }
.nav-icon { font-size: 18px; text-align: center; }
.nav-badge { min-width: 24px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 8px; color: var(--mint); background: rgba(45,245,193,.09); font-size: 9px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.api-indicator { display: flex; align-items: center; gap: 10px; padding: 0 9px; }
.api-indicator div { display: grid; gap: 2px; }
.api-indicator b { font-size: 9px; letter-spacing: .09em; }
.api-indicator small { color: var(--muted-2); font-size: 9px; }
.logout-button { color: var(--muted); background: transparent; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; min-height: 42px; text-align: left; padding: 0 14px; }

.workspace { min-width: 0; }
.topbar { min-height: 92px; border-bottom: 1px solid var(--line); background: rgba(2,13,17,.64); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 17px 32px; position: sticky; top: 0; z-index: 15; }
.topbar h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { width: min(310px, 28vw); display: flex; align-items: center; gap: 10px; padding: 0 13px; height: 42px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; color: var(--muted); }
.global-search input { width: 100%; color: var(--text); background: none; border: 0; outline: 0; font-size: 11px; }
.icon-button { width: 42px; height: 42px; color: var(--mint); border: 1px solid var(--line); border-radius: 12px; background: rgba(45,245,193,.05); font-size: 18px; }
.icon-button.loading { animation: spin .75s linear infinite; }
.admin-chip { display: flex; align-items: center; gap: 10px; margin-left: 5px; padding: 5px 10px 5px 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: rgba(255,255,255,.03); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #00120d; background: linear-gradient(135deg,var(--mint),var(--cyan)); font-weight: 950; }
.admin-chip div { display: grid; gap: 1px; }
.admin-chip b { font-size: 9px; letter-spacing: .08em; }
.admin-chip small { color: var(--muted-2); font-size: 8px; }
.page-content { padding: 26px 32px 48px; }
.alert-region { padding: 0 32px; }
.alert-banner { margin-top: 18px; padding: 12px 15px; border-radius: 12px; background: rgba(255,94,112,.1); border: 1px solid rgba(255,94,112,.24); color: #ff9ca7; font-size: 11px; }

.loading-panel { min-height: 420px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(45,245,193,.1); border-top-color: var(--mint); animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grid { display: grid; gap: 16px; }
.grid.metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.metric-card, .panel { background: linear-gradient(145deg, rgba(8,33,40,.82), rgba(3,18,23,.82)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 42px rgba(0,0,0,.14); }
.metric-card { padding: 18px; position: relative; overflow: hidden; min-height: 132px; }
.metric-card::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -60px; top: -70px; background: var(--accent,var(--mint)); opacity: .09; filter: blur(2px); }
.metric-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.metric-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--accent,var(--mint)); background: color-mix(in srgb, var(--accent,var(--mint)) 12%, transparent); }
.metric-value { display: block; font-size: clamp(25px,3vw,36px); font-weight: 900; letter-spacing: -.05em; margin-top: 15px; }
.metric-foot { color: var(--muted-2); font-size: 9px; margin-top: 4px; }
.panel { padding: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-header h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.panel-header p { color: var(--muted); margin: 4px 0 0; font-size: 10px; }
.section-gap { margin-top: 16px; }
.overview-main { grid-template-columns: minmax(0,1.7fr) minmax(280px,.8fr); margin-top: 16px; }
.chart-wrap { height: 270px; position: relative; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: rgba(89,145,151,.11); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--mint); stroke-width: 3; filter: drop-shadow(0 0 7px rgba(45,245,193,.4)); }
.chart-area { fill: url(#chartFill); }
.chart-point { fill: var(--panel-solid); stroke: var(--mint); stroke-width: 2; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 8px; margin-top: -10px; }
.donut { width: 148px; aspect-ratio: 1; margin: 6px auto 18px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--mint) var(--progress,0%), rgba(45,245,193,.08) 0); position: relative; }
.donut::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--panel-solid); border: 1px solid var(--line); }
.donut strong, .donut small { position: relative; z-index: 1; }
.donut div { display: grid; text-align: center; position: relative; z-index: 2; }
.donut strong { font-size: 26px; }
.donut small { color: var(--muted); font-size: 9px; }
.status-list { display: grid; gap: 10px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; font-size: 10px; }
.status-row span:first-child { color: var(--muted); }
.status-pill, .badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.badge.online, .status-pill.pass { color: var(--green); background: rgba(75,229,140,.1); }
.badge.offline, .status-pill.ready { color: var(--muted); background: rgba(120,149,154,.1); }
.badge.banned, .status-pill.fail { color: var(--red); background: rgba(255,94,112,.11); }
.badge.lead, .status-pill.running { color: var(--yellow); background: rgba(255,214,74,.1); }
.status-pill.manual { color: var(--purple); background: rgba(173,117,255,.11); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-box { min-width: min(340px,100%); position: relative; }
.search-box input { padding-left: 36px; }
.search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; background: rgba(255,255,255,.025); }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 900; }
.segmented button.active { color: #00110d; background: var(--mint); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { color: var(--muted); font-size: 8px; letter-spacing: .1em; text-align: left; padding: 13px 14px; background: rgba(3,18,23,.96); position: sticky; top: 0; z-index: 2; }
td { padding: 13px 14px; border-top: 1px solid rgba(255,255,255,.045); white-space: nowrap; }
tbody tr { background: rgba(7,29,35,.5); transition: background .14s ease; }
tbody tr:hover { background: rgba(45,245,193,.045); }
.player-name { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.mini-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--mint); background: rgba(45,245,193,.08); border: 1px solid rgba(45,245,193,.16); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 9px; }
.link-button { color: var(--mint); background: transparent; border: 0; font-weight: 900; font-size: 9px; }
.empty-state { min-height: 280px; display: grid; place-items: center; text-align: center; color: var(--muted); }

.mode-grid, .catalog-grid, .qa-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.mode-card, .catalog-card, .qa-card { position: relative; background: rgba(7,31,38,.62); border: 1px solid var(--line); border-radius: 16px; padding: 17px; }
.mode-card { cursor: pointer; transition: .18s ease; min-height: 150px; }
.mode-card:hover, .mode-card.selected { border-color: var(--mode-color,var(--mint)); box-shadow: 0 0 34px color-mix(in srgb,var(--mode-color,var(--mint)) 10%,transparent); transform: translateY(-2px); }
.mode-card input { position: absolute; opacity: 0; }
.mode-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--mode-color,var(--mint)); background: color-mix(in srgb,var(--mode-color,var(--mint)) 12%,transparent); font-size: 21px; }
.mode-card h4 { margin: 16px 0 5px; font-size: 13px; }
.mode-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.warning-box, .info-box { padding: 13px 15px; border-radius: 13px; font-size: 10px; line-height: 1.5; }
.warning-box { color: #ffb1ba; background: rgba(255,94,112,.08); border: 1px solid rgba(255,94,112,.18); }
.info-box { color: #9eead8; background: rgba(45,245,193,.065); border: 1px solid rgba(45,245,193,.15); }

.catalog-card { min-height: 174px; display: flex; flex-direction: column; gap: 12px; }
.catalog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.catalog-symbol { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(66,207,255,.08); color: var(--cyan); font-size: 21px; }
.catalog-card h4 { margin: 0; font-size: 12px; }
.catalog-card p { margin: 4px 0 0; color: var(--muted-2); font-size: 8px; }
.catalog-meta { display: flex; justify-content: space-between; gap: 9px; margin-top: auto; color: var(--muted); font-size: 9px; }
.catalog-actions { display: flex; gap: 7px; }
.catalog-actions button { flex: 1; }

.event-status { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; background: linear-gradient(120deg,rgba(173,117,255,.1),rgba(255,152,72,.04)); border: 1px solid rgba(173,117,255,.2); }
.event-orb { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: rgba(173,117,255,.12); color: var(--purple); font-size: 26px; }
.event-status h3 { margin: 0 0 5px; }
.event-status p { color: var(--muted); margin: 0; font-size: 10px; }
.mission-list { display: grid; gap: 10px; }
.mission-row { display: grid; grid-template-columns: 50px 1fr 120px 120px; gap: 10px; align-items: center; padding: 12px; border: 1px solid rgba(255,255,255,.055); border-radius: 13px; background: rgba(255,255,255,.022); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: #173039; border-radius: 999px; transition: .2s; }
.switch-slider::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #6f8d92; transition: .2s; }
.switch input:checked + .switch-slider { background: rgba(45,245,193,.32); }
.switch input:checked + .switch-slider::after { transform: translateX(16px); background: var(--mint); }

.qa-summary { grid-template-columns: repeat(5,minmax(0,1fr)); margin-bottom: 16px; }
.qa-card { padding: 15px; display: grid; gap: 10px; }
.qa-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.qa-id { color: var(--muted-2); font-family: ui-monospace,monospace; font-size: 8px; }
.qa-card h4 { margin: 4px 0 0; font-size: 11px; line-height: 1.35; }
.qa-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.qa-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.qa-tag { padding: 4px 6px; border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 7px; font-weight: 900; letter-spacing: .06em; }
.qa-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.progress-track { height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); }
.progress-fill { height: 100%; width: var(--value,0%); background: linear-gradient(90deg,var(--mint-2),var(--mint)); transition: width .25s ease; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 26px; display: grid; place-items: center; background: rgba(0,7,10,.82); backdrop-filter: blur(12px); }
.modal { width: min(980px,100%); max-height: calc(100vh - 52px); overflow: auto; background: #051920; border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow); }
.modal.small { width: min(520px,100%); }
.modal-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; background: rgba(5,25,32,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; }
.modal-body { padding: 20px; }
.close-button { width: 38px; height: 38px; border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); font-size: 19px; }
.profile-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px; border-radius: 17px; background: linear-gradient(120deg,rgba(45,245,193,.075),rgba(66,207,255,.025)); border: 1px solid var(--line); }
.profile-avatar { width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; overflow: hidden; color: var(--mint); background: rgba(45,245,193,.08); border: 1px solid rgba(45,245,193,.2); font-size: 24px; font-weight: 900; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h3 { margin: 0 0 5px; }
.profile-hero p { margin: 0; }
.profile-score { text-align: right; }
.profile-score b { display: block; font-size: 22px; color: var(--yellow); }
.profile-score small { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 14px 0; }
.stat-tile { padding: 12px; border-radius: 13px; background: rgba(255,255,255,.032); border: 1px solid rgba(255,255,255,.055); }
.stat-tile b { display: block; font-size: 17px; }
.stat-tile span { color: var(--muted); font-size: 8px; }
.tabs { display: flex; gap: 6px; overflow: auto; margin: 18px 0 14px; padding-bottom: 3px; }
.tab-button { border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 9px 12px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 9px; font-weight: 900; white-space: nowrap; }
.tab-button.active { color: #00110d; background: var(--mint); border-color: var(--mint); }
.control-stack { display: grid; gap: 12px; }
.control-card { padding: 15px; border: 1px solid rgba(255,255,255,.055); border-radius: 14px; background: rgba(255,255,255,.025); }
.control-card h4 { margin: 0 0 12px; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: end; }
.inline-form > * { flex: 1; }
.item-control-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: 430px; overflow: auto; }
.item-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid rgba(255,255,255,.05); border-radius: 12px; background: rgba(255,255,255,.02); }
.item-control b { font-size: 10px; }
.item-control small { display: block; color: var(--muted-2); font-size: 7px; margin-top: 3px; }
.tiny-button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 9px; color: white; background: rgba(45,245,193,.18); font-size: 8px; font-weight: 900; }
.tiny-button.remove { background: rgba(255,94,112,.18); color: #ff9ca7; }
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 12px; color: var(--text); background: rgba(7,31,38,.96); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 10px; animation: toast-in .22s ease; }
.toast.error { border-color: rgba(255,94,112,.42); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .grid.metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-main { grid-template-columns: 1fr; }
  .mode-grid, .catalog-grid, .qa-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .qa-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 72px 1fr; }
  .sidebar { padding: 18px 10px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand span, .nav-item > span:not(.nav-icon), .nav-badge, .api-indicator div, .logout-button span { display: none; }
  .main-nav { justify-items: center; }
  .nav-item { width: 50px; grid-template-columns: 1fr; padding: 0; text-align: center; }
  .api-indicator { justify-content: center; }
  .logout-button { text-align: center; padding: 0; }
  .topbar { padding: 15px 18px; }
  .page-content { padding: 20px 18px 40px; }
  .alert-region { padding: 0 18px; }
  .global-search { display: none; }
  .form-grid, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .mission-row { grid-template-columns: 42px 1fr; }
  .mission-row > :nth-child(3), .mission-row > :nth-child(4) { grid-column: span 1; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .app-shell { grid-template-columns: 1fr; padding-bottom: 70px; }
  .sidebar { width: 100%; height: 64px; position: fixed; top: auto; bottom: 0; padding: 7px 10px; border-right: 0; border-top: 1px solid var(--line); flex-direction: row; }
  .sidebar-brand, .sidebar-footer { display: none; }
  .main-nav { width: 100%; grid-template-columns: repeat(7,1fr); margin: 0; gap: 3px; }
  .nav-item { width: auto; min-height: 48px; }
  .nav-icon { font-size: 16px; }
  .topbar h2 { font-size: 20px; }
  .admin-chip { display: none; }
  .grid.metrics, .mode-grid, .catalog-grid, .qa-grid, .qa-summary { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .profile-score { grid-column: span 2; text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .item-control-list { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .inline-form { align-items: stretch; flex-direction: column; }
}
