:root {
  --bg: #070a10;
  --bg-raised: #0b111b;
  --surface: rgba(15, 23, 36, .86);
  --surface-solid: #101925;
  --surface-high: #162235;
  --line: rgba(126, 153, 184, .18);
  --line-strong: rgba(126, 153, 184, .32);
  --text: #edf5ff;
  --muted: #8b9bb0;
  --faint: #5e7088;
  --cyan: #5ce6df;
  --cyan-soft: rgba(92, 230, 223, .12);
  --violet: #ad91ff;
  --green: #72e4a1;
  --yellow: #f6cf62;
  --red: #ff7f96;
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .36);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 84% -12%, rgba(46, 112, 148, .32), transparent 34rem), radial-gradient(circle at -8% 50%, rgba(90, 64, 160, .12), transparent 30rem);
}
a { color: inherit; }
button, input, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex: 0 0 254px; flex-direction: column; width: 254px; height: 100vh; padding: 28px 17px 20px; background: rgba(6, 10, 17, .86); border-right: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-size: 1.02rem; font-weight: 760; letter-spacing: -.035em; }
.brand-mark { display: grid; width: 43px; height: 33px; place-items: center; color: var(--cyan); border: 1px solid rgba(92, 230, 223, .7); border-radius: 10px; box-shadow: 0 0 28px rgba(92, 230, 223, .12), inset 0 0 14px rgba(92, 230, 223, .08); font-size: .63rem; font-weight: 800; letter-spacing: .08em; }
.accent { color: var(--cyan); }
.workspace-label, .eyebrow { color: var(--faint); font-size: .66rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.workspace-label { margin: 55px 12px 12px; }
.nav { gap: 4px !important; }
.nav-link { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: var(--muted); border: 1px solid transparent; border-radius: var(--radius-sm); transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.nav-link:hover { color: var(--text); background: rgba(22, 34, 53, .62); border-color: var(--line); transform: translateX(2px); }
.nav-link.active { color: var(--text); background: linear-gradient(90deg, rgba(92, 230, 223, .12), rgba(92, 230, 223, .02)); border-color: rgba(92, 230, 223, .2); box-shadow: inset 2px 0 var(--cyan); }
.sidebar-footer { margin-top: auto; padding: 13px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(15, 23, 36, .55); font-size: .72rem; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px var(--green); }

.main-content { width: min(1240px, 100%); margin: 0 auto; padding: 36px 44px 82px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.topbar { align-items: flex-start; margin-bottom: 34px; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
h1, h2, h3, h4 { color: var(--text); }
h1 { margin: 7px 0 0; font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 720; letter-spacing: -.055em; }
h2 { margin: 15px 0; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 740; line-height: .98; letter-spacing: -.07em; }
h3 { margin: 6px 0 0; font-size: 1.35rem; font-weight: 710; letter-spacing: -.035em; }
h4 { margin: 0 0 7px; font-size: 1rem; }
p { margin: 0; color: var(--muted); line-height: 1.65; }
.workspace-id { margin-top: 8px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .68rem; }
.language-select { padding: 8px 30px 8px 10px; color: var(--text); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 9px; font-size: .75rem; cursor: pointer; }

.btn { border-radius: 9px; font-size: .78rem; font-weight: 650; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-cyan { padding: 11px 17px; color: #061014; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 8px 24px rgba(92, 230, 223, .14); }
.btn-cyan:hover { color: #061014; background: #9af7f0; border-color: #9af7f0; box-shadow: 0 12px 30px rgba(92, 230, 223, .24); }
.btn-outline-cyan { color: var(--cyan); border-color: rgba(92, 230, 223, .46); }
.btn-outline-cyan:hover { color: #061014; background: var(--cyan); border-color: var(--cyan); }
.btn-outline-secondary { color: var(--muted); border-color: var(--line-strong); }
.btn-outline-secondary:hover { color: var(--text); background: var(--surface-high); border-color: var(--line-strong); }
.install-button { display: none; }.install-button.is-visible { display: inline-flex; }

.hero-panel { position: relative; display: flex; justify-content: space-between; gap: 34px; overflow: hidden; padding: 38px; background: linear-gradient(125deg, rgba(22, 34, 53, .96), rgba(10, 25, 37, .72)); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.hero-panel::before { position: absolute; top: -200px; right: 18%; width: 400px; height: 400px; content: ""; border: 1px solid rgba(92, 230, 223, .13); border-radius: 50%; box-shadow: 0 0 0 34px rgba(92, 230, 223, .025), 0 0 0 70px rgba(92, 230, 223, .018); }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel > div:first-child { max-width: 650px; }
.hero-panel p { max-width: 590px; font-size: .94rem; }
.hero-grid { display: grid; align-self: flex-end; min-width: 350px; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 13px; }
.hero-grid div { min-width: 0; padding: 17px; background: rgba(7, 10, 16, .62); }
.hero-grid strong { display: block; color: var(--cyan); font-size: 1.55rem; font-weight: 720; }
.hero-grid small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.process-rail { display: grid; grid-template-columns: 1fr 48px 1fr 48px 1fr; align-items: center; margin-top: 19px; padding: 16px 19px; background: rgba(11, 17, 27, .6); border: 1px solid var(--line); border-radius: var(--radius-md); }
.process-rail article { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.process-rail article > span { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; color: var(--cyan); background: var(--cyan-soft); border: 1px solid rgba(92, 230, 223, .22); border-radius: 8px; font: .68rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.process-rail strong { display: block; margin-bottom: 3px; font-size: .78rem; }.process-rail p { font-size: .7rem; line-height: 1.45; }.process-rail i { display: block; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.ai-planner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 22px; align-items: center; padding: 22px; background: linear-gradient(110deg, rgba(173,145,255,.09), rgba(16,25,37,.65)); border: 1px solid rgba(173,145,255,.22); border-radius: var(--radius-md); }.ai-planner h3 { margin-bottom: 6px; }.ai-planner-form { display: flex; gap: 9px; }.ai-planner-form input { color: var(--text); background: var(--bg-raised); border-color: var(--line); }.ai-planner-form input:focus { color: var(--text); background: var(--bg-raised); border-color: var(--violet); box-shadow: 0 0 0 .2rem rgba(173,145,255,.11); }.ai-result { grid-column: 1 / -1; max-height: 230px; margin: 0; padding: 16px; overflow: auto; color: #cbd5e1; background: rgba(7,10,16,.8); border: 1px solid var(--line); border-radius: 10px; font-size: .72rem; }
.content-section { margin-top: 54px; }
.section-heading { align-items: flex-end; }
.section-heading > .eyebrow, .section-heading .live-pill { flex-shrink: 0; }
.live-pill, .badge-soft { padding: 7px 11px; color: var(--green); background: rgba(114, 228, 161, .08); border: 1px solid rgba(114, 228, 161, .2); border-radius: 999px; font-size: .68rem; font-weight: 700; }
.row { margin-top: 19px; }

.device-card, .backup-card, .job-row { background: linear-gradient(145deg, rgba(16, 25, 37, .92), rgba(11, 17, 27, .88)); border: 1px solid var(--line); box-shadow: 0 12px 35px rgba(0, 0, 0, .12); }
.device-card { height: 100%; padding: 20px; border-radius: var(--radius-md); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.device-card:hover { border-color: rgba(92, 230, 223, .34); transform: translateY(-3px); box-shadow: 0 18px 45px rgba(0, 0, 0, .24); }
.device-top { display: flex; align-items: center; justify-content: space-between; }
.device-kind { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.device-name { margin: 10px 0 18px; font-size: 1.04rem; font-weight: 720; letter-spacing: -.02em; word-break: break-word; }
.device-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-meta span { display: block; color: var(--faint); font-size: .68rem; }
.device-meta strong { display: block; margin-top: 4px; overflow: hidden; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.backup-card { display: flex; align-items: center; gap: 16px; margin-top: 19px; padding: 21px; border-radius: var(--radius-md); }
.backup-card .badge { margin-left: auto; }
.backup-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; color: var(--violet); background: rgba(173, 145, 255, .1); border: 1px solid rgba(173, 145, 255, .17); border-radius: 13px; font-size: 1.35rem; }
.jobs-list { margin-top: 19px; }
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 9px; padding: 14px 17px; border-radius: 11px; }
.job-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }
.empty-state { width: 100%; padding: 38px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: rgba(11, 17, 27, .36); }
.text-success-custom { color: var(--green); }.text-warning-custom { color: var(--yellow); }

.admin-form { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(160px, 1fr) auto auto; align-items: end; }
.admin-form label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .75rem; }
.admin-form .form-select { color: var(--text); background: var(--bg-raised); border-color: var(--line); }
.admin-form small { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); line-height: 1.45; }
.admin-form .form-check { color: var(--muted); white-space: nowrap; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 26px; }
.auth-shell { width: min(1000px, 100%); }
.back-button { margin-bottom: 18px; padding: 7px 0; color: var(--muted); background: transparent; border: 0; font-size: .75rem; transition: color .2s ease, transform .2s ease; }.back-button:hover { color: var(--cyan); transform: translateX(-3px); }.back-button span { color: var(--cyan); margin-right: 5px; font-size: 1rem; }
.auth-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: stretch; }
.auth-pitch { position: relative; overflow: hidden; padding: 36px; background: linear-gradient(145deg, rgba(22,34,53,.98), rgba(10,24,37,.82)); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }.auth-pitch::after { position: absolute; right: -130px; bottom: -160px; width: 340px; height: 340px; content: ''; border: 1px solid rgba(92,230,223,.16); border-radius: 50%; box-shadow: 0 0 0 28px rgba(92,230,223,.03), 0 0 0 56px rgba(92,230,223,.02); }.auth-pitch > * { position: relative; z-index: 1; }.auth-pitch .brand { margin-bottom: 70px; }.auth-eyebrow { color: var(--cyan); }.auth-pitch h1 { margin: 14px 0 20px; font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: .92; letter-spacing: -.08em; }.auth-lead { max-width: 520px; font-size: .95rem; }.auth-benefits { display: grid; gap: 14px; margin-top: 39px; }.auth-benefits > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 11px; }.auth-benefits span { grid-row: span 2; color: var(--cyan); font: .68rem ui-monospace, SFMono-Regular, Consolas, monospace; }.auth-benefits strong { font-size: .8rem; }.auth-benefits small { color: var(--muted); font-size: .72rem; line-height: 1.45; }.auth-trust { display: inline-block; margin-top: 36px; padding: 10px 12px; color: var(--muted); background: rgba(92,230,223,.06); border: 1px solid rgba(92,230,223,.16); border-radius: 9px; font-size: .7rem; }
.auth-card { padding: 36px; background: rgba(16, 25, 37, .92); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-card h1 { margin-top: 12px; font-size: 1.85rem; }
.auth-card label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; }
.auth-card input { color: var(--text); background: var(--bg-raised); border-color: var(--line); }
.auth-card input:focus { color: var(--text); background: var(--bg-raised); border-color: var(--cyan); box-shadow: 0 0 0 .2rem rgba(92, 230, 223, .12); }
.auth-toggle { display: block; margin: 22px auto 0; color: var(--cyan); background: transparent; border: 0; font-size: .82rem; }
.auth-error { min-height: 20px; margin-top: 18px; color: #ffadb9; font-size: .82rem; }
.auth-note { margin-top: 18px; color: var(--muted); text-align: center; font-size: .72rem; }
.slider-check { margin: 22px 0 17px; padding: 13px 14px; background: rgba(92,230,223,.045); border: 1px solid var(--line); border-radius: 11px; }.slider-check-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.slider-check-head label { margin: 0; color: var(--text); font-size: .73rem; font-weight: 650; }.slider-check-head span { color: var(--muted); font: .65rem ui-monospace, SFMono-Regular, Consolas, monospace; }.slider-check-head span.verified { color: var(--green); }.slider-check input[type="range"] { width: 100%; height: 5px; margin: 13px 0 7px; accent-color: var(--cyan); cursor: grab; }.slider-check input[type="range"]:active { cursor: grabbing; }.slider-check small { color: var(--faint); font-size: .65rem; }.auth-card .btn:disabled { color: #607182; background: #263546; border-color: #263546; box-shadow: none; cursor: not-allowed; transform: none; }

@media (max-width: 980px) {
  .sidebar { flex-basis: 220px; width: 220px; }
  .main-content { padding-right: 28px; padding-left: 28px; }
  .hero-panel { display: block; }
  .hero-grid { min-width: 0; margin-top: 28px; }
}
@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 17px 16px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-label, .sidebar-footer { display: none; }
  .nav { display: flex; flex-direction: row !important; margin-top: 17px; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; padding: 9px 11px; white-space: nowrap; }
  .main-content { padding: 25px 16px 54px; }
  .topbar { display: block; margin-bottom: 25px; }
  .topbar-actions { justify-content: flex-start; margin-top: 17px; }
  .topbar-actions .btn { flex: 1 1 auto; }
  .language-select { flex: 1 1 100%; }
  .hero-panel { padding: 25px 21px; border-radius: var(--radius-md); }
  .hero-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid div { padding: 12px 10px; }
  .hero-grid strong { font-size: 1.2rem; }
  .hero-grid small { font-size: .62rem; }
  .process-rail { display: block; padding: 15px; }.process-rail article { padding: 9px 0; }.process-rail i { width: 1px; height: 15px; margin-left: 14px; background: var(--line-strong); }
  .ai-planner { display: block; }.ai-planner-form { display: block; margin-top: 17px; }.ai-planner-form button { width: 100%; margin-top: 9px; }
  .content-section { margin-top: 39px; }
  .section-heading { align-items: flex-start; }
  .backup-card { align-items: flex-start; }
  .backup-card .badge { display: none; }
  .admin-form { display: block; }
  .admin-form > div, .admin-form > button { width: 100%; margin-top: 13px; }
  .admin-form > div:first-child { margin-top: 0; }
  .admin-form small { display: block; }
}
@media (max-width: 780px) { .auth-layout { grid-template-columns: 1fr; }.auth-pitch { padding: 27px; }.auth-pitch .brand { margin-bottom: 44px; }.auth-pitch h1 { font-size: 3rem; }.auth-card { padding: 27px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
