:root {
  --bg: #080b15;
  --surface: rgba(19, 24, 40, .78);
  --surface-strong: #151b2d;
  --surface-soft: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .085);
  --text: #f5f7ff;
  --muted: #8e97ae;
  --violet: #8b5cf6;
  --violet-bright: #a879ff;
  --cyan: #22d3ee;
  --green: #35e6a1;
  --red: #ff5c7c;
  --amber: #ffbf5c;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); min-height: 100%; }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(139, 92, 246, .16), transparent 38%),
    radial-gradient(circle at 100% 30%, rgba(34, 211, 238, .07), transparent 34%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, .file-button { -webkit-tap-highlight-color: transparent; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.ambient { position: fixed; pointer-events: none; filter: blur(1px); z-index: 0; }
.ambient-one { width: 290px; height: 290px; top: -180px; left: -110px; background: rgba(139,92,246,.18); border-radius: 50%; filter: blur(70px); }
.ambient-two { width: 240px; height: 240px; top: 340px; right: -170px; background: rgba(34,211,238,.11); border-radius: 50%; filter: blur(72px); }

.boot-screen, .auth-error {
  min-height: 100vh;
  padding: calc(32px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 3;
}
.boot-logo, .brand-mark {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--violet-bright), #6146e8 60%, #3a2d9c);
  box-shadow: 0 14px 34px rgba(111, 76, 234, .38), inset 0 1px 0 rgba(255,255,255,.28);
}
.boot-logo { width: 78px; height: 78px; border-radius: 25px; margin-bottom: 22px; }
.boot-logo svg { width: 48px; height: 48px; stroke-width: 2.4; }
.boot-logo svg path:first-child, .brand-mark svg path:first-child { fill: rgba(255,255,255,.08); }
.boot-title { font-weight: 800; font-size: 28px; letter-spacing: -.04em; }
.boot-subtitle { margin-top: 7px; color: var(--muted); font-size: 14px; }
.loader { width: 130px; height: 3px; margin-top: 34px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.07); }
.loader span { display: block; width: 50%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); animation: loading 1.15s ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

.auth-error .auth-icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 24px; color: var(--violet-bright); background: rgba(139,92,246,.12); border: 1px solid rgba(168,121,255,.22); }
.auth-error .auth-icon svg { width: 38px; height: 38px; }
.auth-error h1 { margin: 23px 0 8px; font-size: 24px; }
.auth-error p { color: var(--muted); max-width: 340px; line-height: 1.55; margin: 0 0 24px; }

.app-shell { position: relative; z-index: 1; width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: calc(13px + var(--safe-top)) 16px calc(26px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 53px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 15px; }
.brand-mark svg { width: 27px; height: 27px; stroke-width: 2.4; }
.eyebrow, .section-label { color: var(--violet-bright); font-weight: 750; font-size: 12px; letter-spacing: .13em; }
.brand-name { font-size: 18px; line-height: 1.08; margin-top: 3px; font-weight: 780; letter-spacing: -.025em; }
.icon-button { border: 1px solid var(--line); background: var(--surface-soft); width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; cursor: pointer; transition: .2s ease; }
.icon-button:active { transform: scale(.94); background: rgba(139,92,246,.18); }
.icon-button svg { width: 20px; height: 20px; }
.icon-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 25px; }
.welcome-title { font-size: 25px; font-weight: 790; letter-spacing: -.045em; }
.welcome-copy { margin-top: 5px; color: var(--muted); font-size: 14px; }
.live-pill { flex: none; display: flex; align-items: center; gap: 6px; height: 29px; padding: 0 10px; color: var(--green); background: rgba(53,230,161,.08); border: 1px solid rgba(53,230,161,.18); border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .11em; }
.live-pill span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(53,230,161,.09); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; box-shadow: 0 0 0 7px rgba(53,230,161,0); } }

.tabs { display: flex; gap: 4px; margin: 25px -2px 18px; padding: 4px; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); background: rgba(15,19,32,.72); border-radius: 16px; backdrop-filter: blur(18px); }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 1 1 0; min-width: 0; border: 0; height: 42px; padding: 0 6px; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 680; cursor: pointer; transition: .22s ease; white-space: nowrap; }
.tab span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 3px; padding: 0 4px; border-radius: 6px; background: rgba(255,255,255,.06); font-size: 12px; }
.tab.active { color: white; background: linear-gradient(135deg, rgba(139,92,246,.92), rgba(102,75,207,.92)); box-shadow: 0 8px 22px rgba(99,71,195,.24); }
.tab.active span { background: rgba(255,255,255,.17); }

.panel { display: none; animation: panelIn .28s ease; }
.panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero-card { position: relative; min-height: 170px; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 23px; border: 1px solid rgba(168,121,255,.18); border-radius: 24px; background: linear-gradient(140deg, rgba(29,27,57,.94), rgba(16,22,38,.94)); box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(168,121,255,.09); border-radius: 50%; right: -86px; top: -96px; box-shadow: 0 0 70px rgba(139,92,246,.11); }
.hero-card::after { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, black, transparent); }
.hero-copy, .health-ring { position: relative; z-index: 1; }
.hero-title { max-width: 190px; margin-top: 13px; font-size: 24px; line-height: 1.08; font-weight: 800; letter-spacing: -.045em; }
.hero-subtitle { max-width: 210px; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.health-ring { --value: 0deg; flex: 0 0 105px; width: 105px; height: 105px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--value), rgba(255,255,255,.07) 0); box-shadow: 0 0 38px rgba(53,230,161,.08); }
.health-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #15192a; border: 1px solid rgba(255,255,255,.06); }
.health-ring div { z-index: 1; text-align: center; }
.health-ring strong { display: block; font-size: 22px; line-height: 1; letter-spacing: -.05em; }
.health-ring span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 11px; }
.metric-card { min-height: 84px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); backdrop-filter: blur(16px); }
.metric-icon { flex: none; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; }
.metric-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.healthy-card .metric-icon { color: var(--green); background: rgba(53,230,161,.09); }
.danger-card .metric-icon { color: var(--red); background: rgba(255,92,124,.09); }
.bot-card .metric-icon { color: var(--violet-bright); background: rgba(139,92,246,.11); }
.assigned-card .metric-icon { color: var(--cyan); background: rgba(34,211,238,.09); }
.metric-card strong { display: block; font-size: 21px; line-height: 1.05; letter-spacing: -.04em; }
.metric-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 29px 2px 12px; }
.section-head h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.2; letter-spacing: -.025em; }
.recent-head { margin-top: 31px; }
.text-button { border: 0; padding: 8px; background: transparent; color: var(--violet-bright); font-size: 14px; cursor: pointer; }
.action-grid { display: grid; gap: 9px; }
.action-card { width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; transition: .2s ease; }
.action-card:active { transform: scale(.985); border-color: rgba(168,121,255,.22); }
.action-card > span:nth-child(2) { flex: 1; min-width: 0; }
.action-card strong, .action-card small { display: block; }
.action-card strong { font-size: 15px; }
.action-card small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.action-icon { flex: none; width: 41px; height: 41px; display: grid; place-items: center; border-radius: 13px; }
.action-icon svg { width: 20px; height: 20px; }
.action-icon.violet { color: var(--violet-bright); background: rgba(139,92,246,.11); }
.action-icon.cyan { color: var(--cyan); background: rgba(34,211,238,.09); }
.chevron { width: 17px; height: 17px; color: #5d6579; }

.button { border: 1px solid transparent; min-height: 43px; padding: 0 18px; border-radius: 14px; font-weight: 730; font-size: 14px; cursor: pointer; transition: .2s ease; }
.button:active { transform: scale(.97); }
.button.primary { color: white; background: linear-gradient(135deg, var(--violet-bright), #6b4adb); box-shadow: 0 9px 24px rgba(111,75,217,.24); }
.button.small { min-height: 39px; padding: 0 13px; border-radius: 12px; font-size: 13px; }
.button.wide { width: 100%; min-height: 50px; margin-top: 9px; }
.button.ghost { color: var(--text); background: rgba(255,255,255,.055); border-color: var(--line); }
.button.danger { color: white; background: linear-gradient(135deg, #ff5c7c, #d93b60); }
.button:disabled, .action-card:disabled { opacity: .48; pointer-events: none; }

.filter-row { display: flex; gap: 7px; margin: 0 0 13px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: 37px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.025); font-size: 13px; font-weight: 670; cursor: pointer; }
.filter.active { color: white; border-color: rgba(139,92,246,.28); background: rgba(139,92,246,.14); }
.card-list { display: grid; gap: 10px; }
.entity-card { position: relative; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); backdrop-filter: blur(16px); }
.entity-card.disabled { opacity: .6; }
.entity-card-head { display: flex; align-items: flex-start; gap: 11px; }
.entity-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--violet-bright); background: rgba(139,92,246,.1); }
.entity-icon svg { width: 21px; height: 21px; }
.entity-main { flex: 1; min-width: 0; }
.entity-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 730; font-size: 15px; }
.entity-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 5px; color: var(--muted); font-size: 13px; }
.status-badge { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 27px; padding: 0 9px; border-radius: 9px; font-size: 12px; font-weight: 750; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-healthy, .status-connected { color: var(--green); background: rgba(53,230,161,.08); }
.status-unhealthy { color: var(--red); background: rgba(255,92,124,.09); }
.status-checking { color: var(--amber); background: rgba(255,191,92,.09); }
.status-disabled, .status-waiting { color: var(--muted); background: rgba(142,151,174,.09); }
.status-stack { flex: none; display: grid; justify-items: end; gap: 5px; }
.monitor-badge { min-height: 22px; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 760; }
.monitor-stable { color: var(--green); background: rgba(53,230,161,.08); }
.monitor-warning { color: var(--amber); background: rgba(255,191,92,.1); }
.monitor-critical { color: var(--red); background: rgba(255,92,124,.11); }
.monitor-unknown { color: var(--muted); background: rgba(142,151,174,.09); }
.bot-monitor-warning { border-color: rgba(255,191,92,.24); }
.bot-monitor-critical { border-color: rgba(255,92,124,.3); box-shadow: 0 0 28px rgba(255,92,124,.06); }
.entity-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.entity-stat { min-width: 0; padding: 9px 8px; border-radius: 12px; background: rgba(255,255,255,.035); }
.entity-stat strong { display: block; overflow: hidden; text-overflow: ellipsis; color: #e9ecf8; font-size: 13px; }
.entity-stat span { display: block; margin-top: 4px; color: #6f7890; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.entity-error { margin-top: 11px; padding: 10px 11px; color: #f3a8b7; background: rgba(255,92,124,.065); border-radius: 11px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.telemetry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.telemetry-stat { min-width: 0; padding: 10px 8px; border: 1px solid rgba(255,255,255,.045); border-radius: 12px; background: rgba(4,7,15,.24); }
.telemetry-stat strong { display: block; color: #edf0fb; font-size: 15px; letter-spacing: -.02em; }
.telemetry-stat span { display: block; margin-top: 4px; color: #707991; font-size: 10px; line-height: 1.25; text-transform: uppercase; letter-spacing: .045em; }
.monitor-note { margin-top: 8px; padding: 9px 10px; border-radius: 11px; color: #96a0b7; background: rgba(255,255,255,.028); font-size: 12px; line-height: 1.4; }
.monitor-note-warning { color: #ffd28b; background: rgba(255,191,92,.065); }
.monitor-note-critical { color: #ff9eb1; background: rgba(255,92,124,.075); }
.entity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.055); }
.mini-button { min-height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 13px; font-weight: 680; cursor: pointer; }
.mini-button.danger-text { color: #ff839a; }
.switch { position: relative; width: 42px; height: 24px; margin-right: auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #30364a; transition: .2s ease; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #929ab0; transition: .2s ease; }
.switch input:checked + span { background: rgba(53,230,161,.28); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--green); box-shadow: 0 0 10px rgba(53,230,161,.35); }

.info-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; padding: 13px; border: 1px solid rgba(34,211,238,.14); border-radius: 15px; color: #a8dfe7; background: rgba(34,211,238,.055); font-size: 13px; line-height: 1.45; }
.info-banner svg { flex: none; width: 18px; height: 18px; color: var(--cyan); }
.bot-workspace { display: grid; gap: 13px; }
.folder-sidebar { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,19,32,.68); backdrop-filter: blur(16px); }
.folder-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.folder-sidebar-head strong { display: block; margin-top: 4px; font-size: 15px; }
.folder-add { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(168,121,255,.2); border-radius: 11px; color: var(--violet-bright); background: rgba(139,92,246,.09); font-size: 20px; cursor: pointer; }
.folder-list { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.folder-list::-webkit-scrollbar { display: none; }
.folder-entry { flex: none; display: flex; align-items: center; gap: 4px; }
.folder-select { min-height: 37px; max-width: 210px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.025); cursor: pointer; }
.folder-select svg { flex: none; width: 16px; height: 16px; }
.folder-select-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 680; }
.folder-count { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 7px; color: #aeb6ca; background: rgba(255,255,255,.055); font-size: 11px; }
.folder-entry.active .folder-select { color: white; border-color: rgba(168,121,255,.32); background: rgba(139,92,246,.16); }
.folder-controls { display: flex; gap: 3px; }
.folder-control { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #778198; background: transparent; cursor: pointer; }
.folder-control:hover { color: white; background: rgba(255,255,255,.06); }
.folder-control.danger-text:hover { color: var(--red); background: rgba(255,92,124,.07); }
.folder-control svg { width: 15px; height: 15px; }
.bot-workspace-main { min-width: 0; }
.bot-folder-title { margin: 2px 2px 11px; color: #cbd1df; font-size: 13px; font-weight: 720; }
.bot-folder-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 4px 8px; border-radius: 8px; color: #bca4ff; background: rgba(139,92,246,.09); font-size: 11px; font-weight: 700; }
.provider-card { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; padding: 13px; border: 1px solid rgba(168,121,255,.16); border-radius: 16px; background: rgba(139,92,246,.055); }
.provider-main { flex: 1; min-width: 0; }
.provider-main > div { display: flex; align-items: center; gap: 9px; }
.provider-main strong { font-size: 14px; }
.provider-main small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-logo { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #a879ff, #6245d5); font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.provider-actions { display: grid; gap: 6px; }
.entity-actions { flex-wrap: wrap; }
.expiry-note { margin-top: 9px; color: var(--amber); font-size: 12px; }
.sheet-copy { margin: -2px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.diagnostics-content { display: grid; gap: 11px; padding-bottom: 14px; }
.diagnostic-summary { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); }
.diagnostic-summary strong { display: block; font-size: 17px; }
.diagnostic-summary span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.diagnostic-stat { padding: 11px; border-radius: 13px; background: rgba(255,255,255,.035); }
.diagnostic-stat strong { display: block; font-size: 16px; }
.diagnostic-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.recommendation-list { display: grid; gap: 8px; }
.recommendation { padding: 11px 12px; border-radius: 12px; color: #cbd1e1; background: rgba(34,211,238,.055); font-size: 13px; line-height: 1.45; }
#enrollment-command { min-height: 130px; color: #dfe7ff; font-size: 12px; }

.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.event { position: relative; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; }
.event-dot { z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; color: var(--violet-bright); background: #171b2c; border: 1px solid rgba(168,121,255,.16); }
.event-dot svg { width: 12px; height: 12px; }
.event-main { min-width: 0; padding-top: 2px; }
.event-title { font-size: 14px; font-weight: 680; }
.event-copy { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.event-time { padding-top: 3px; color: #697188; font-size: 12px; white-space: nowrap; }
.empty-state { padding: 34px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 19px; color: var(--muted); }
.empty-state svg { width: 32px; height: 32px; margin: 0 auto 11px; color: #5f6880; }
.empty-state strong { display: block; color: #d6daea; font-size: 15px; }
.empty-state span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; }

.footer-safe { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 31px 0 5px; color: #687188; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.secure-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(53,230,161,.4); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-top: var(--safe-top); background: rgba(2,4,10,.72); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: min(100%, 760px); max-height: calc(100vh - 25px - var(--safe-top)); overflow-y: auto; padding: 10px 18px calc(22px + var(--safe-bottom)); border: 1px solid rgba(255,255,255,.1); border-bottom: 0; border-radius: 27px 27px 0 0; background: #121727; box-shadow: 0 -25px 80px rgba(0,0,0,.45); animation: sheetUp .27s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 5px; background: rgba(255,255,255,.16); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.sheet-head h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.035em; }
.close-sheet { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 22px; line-height: 1; cursor: pointer; }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; margin: 0 2px 7px; color: #b9c0d2; font-size: 14px; font-weight: 680; }
.field input, .field textarea, .field select { width: 100%; outline: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: rgba(5,8,17,.55); transition: .2s ease; }
.field input, .field select { height: 47px; padding: 0 13px; }
.field select { color-scheme: dark; cursor: pointer; }
.field textarea { padding: 12px 13px; resize: vertical; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(168,121,255,.48); box-shadow: 0 0 0 3px rgba(139,92,246,.09); }
.field input::placeholder, .field textarea::placeholder { color: #4f586e; }
.field small { display: block; margin: 7px 2px 0; color: #7d869d; font-size: 12px; line-height: 1.4; }
.file-row { margin: -5px 0 16px; }
.file-button { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 13px; font-weight: 680; cursor: pointer; }
.file-button input { display: none; }
.file-button svg { width: 15px; height: 15px; }
.stepper { width: 137px; display: grid; grid-template-columns: 42px 53px 42px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.stepper button, .stepper input { height: 42px; border: 0; border-radius: 0; text-align: center; color: var(--text); background: rgba(5,8,17,.5); }
.stepper button { color: var(--violet-bright); cursor: pointer; font-size: 18px; }
.stepper input { padding: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-wrap button { position: absolute; top: 4px; right: 4px; width: 39px; height: 39px; display: grid; place-items: center; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.password-wrap svg { width: 19px; height: 19px; }
.security-note { display: flex; align-items: center; gap: 9px; margin: -1px 0 15px; padding: 11px; border-radius: 12px; color: #9aa7bc; background: rgba(255,255,255,.03); font-size: 12px; line-height: 1.4; }
.security-note svg { flex: none; width: 18px; height: 18px; color: var(--green); }

.confirm-box { width: calc(100% - 34px); max-width: 370px; margin: auto; padding: 24px; text-align: center; border: 1px solid var(--line); border-radius: 25px; background: #151a2a; box-shadow: var(--shadow); animation: confirmIn .22s ease; }
@keyframes confirmIn { from { opacity: 0; transform: scale(.95); } }
.confirm-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 18px; color: var(--red); background: rgba(255,92,124,.09); }
.confirm-icon svg { width: 26px; height: 26px; }
.confirm-box h2 { margin: 0; font-size: 19px; }
.confirm-box p { margin: 9px 0 21px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.toast-region { position: fixed; z-index: 40; left: 50%; bottom: calc(18px + var(--safe-bottom)); width: min(calc(100% - 30px), 520px); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; color: #e8ebf7; background: rgba(23,28,45,.96); box-shadow: 0 16px 40px rgba(0,0,0,.35); backdrop-filter: blur(18px); font-size: 13px; animation: toastIn .25s ease; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(53,230,161,.4); }
.toast.error::before { background: var(--red); box-shadow: 0 0 9px rgba(255,92,124,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.busy-label::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 7px; vertical-align: -1px; border: 2px solid rgba(255,255,255,.25); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }

@media (min-width: 600px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .metric-card { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 122px; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-card { min-height: 190px; padding: 28px; }
  .hero-title { max-width: none; font-size: 29px; }
  .hero-subtitle { max-width: 280px; }
  .health-ring { width: 125px; height: 125px; flex-basis: 125px; }
  .health-ring strong { font-size: 26px; }
  .sheet { padding-left: 28px; padding-right: 28px; }
}

@media (min-width: 960px) {
  .app-shell { width: min(100%, 1440px); padding: calc(22px + var(--safe-top)) 32px calc(38px + var(--safe-bottom)); }
  .topbar { min-height: 60px; }
  .brand-mark { width: 48px; height: 48px; }
  .welcome { margin-top: 28px; }
  .welcome-title { font-size: 31px; }
  .tabs { position: sticky; z-index: 8; top: 14px; width: min(760px, 100%); margin: 28px auto 22px; box-shadow: 0 16px 38px rgba(0,0,0,.2); }
  #panel-overview.active { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); column-gap: 18px; align-items: start; }
  #panel-overview > .hero-card { grid-column: 1; grid-row: 1; min-height: 230px; }
  #panel-overview > .metric-grid { grid-column: 2; grid-row: 1; grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  #panel-overview > .section-head:not(.recent-head) { grid-column: 1; grid-row: 2; }
  #panel-overview > .action-grid { grid-column: 1; grid-row: 3; }
  #panel-overview > .recent-head { grid-column: 2; grid-row: 2; }
  #panel-overview > #overview-events { grid-column: 2; grid-row: 3; }
  .metric-card { min-height: 110px; }
  #panel-proxies .card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bot-workspace { grid-template-columns: 235px minmax(0, 1fr); align-items: start; }
  .folder-sidebar { position: sticky; top: 88px; padding: 16px; }
  .folder-list { display: grid; overflow: visible; }
  .folder-entry { width: 100%; }
  .folder-select { flex: 1; max-width: none; justify-content: flex-start; }
  .folder-entry:not(:hover):not(.active) .folder-controls { opacity: 0; }
  .folder-controls { transition: opacity .18s ease; }
  .bot-workspace-main .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { align-items: center; padding: 28px; }
  .sheet { max-width: 760px; max-height: calc(100vh - 56px); border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 25px; padding-bottom: 28px; animation: confirmIn .22s ease; }
  .sheet.compact-sheet { max-width: 520px; }
  .sheet-handle { display: none; }
  .toast-region { bottom: 28px; }
}

@media (min-width: 1280px) {
  .hero-title { font-size: 34px; }
  .action-card { min-height: 78px; padding: 16px; }
  .entity-card { padding: 18px; }
}

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