:root{
  color-scheme:dark;
  --bg:#080b10;
  --surface:#0d1219;
  --surface2:#121923;
  --surface3:#18212d;
  --border:#202b38;
  --border2:#2b3948;
  --text:#f2f5f8;
  --muted:#8e9cab;
  --dim:#65717f;
  --accent:#5ca8ff;
  --accent2:#2b7fff;
  --green:#42d392;
  --yellow:#f8bd4f;
  --red:#ff525f;
  --red2:#cc2433;
  --radius:18px;
  --shadow:0 16px 50px rgba(0,0,0,.32);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body{
  min-height:100vh;
  min-height:100dvh;
}

button,input,textarea,select{font:inherit}

button{color:inherit}

svg.icon{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.hidden{display:none!important}

.login-shell{
  min-height:100vh;
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 20% 0%,rgba(45,126,255,.13),transparent 38%),
    radial-gradient(circle at 100% 100%,rgba(255,82,95,.08),transparent 34%),
    var(--bg);
}

.login-card{
  width:min(440px,100%);
  background:rgba(13,18,25,.94);
  border:1px solid var(--border);
  border-radius:24px;
  padding:32px;
  box-shadow:var(--shadow);
}

.brand-mark{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--surface3);
  border:1px solid var(--border2);
  margin-bottom:20px;
}

.brand-mark svg{width:27px;height:27px}

.login-card h1{
  margin:0 0 6px;
  font-size:28px;
  letter-spacing:-.04em;
}

.login-card .subtitle{
  color:var(--muted);
  margin-bottom:28px;
}

.field{margin:14px 0}

.field label{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-weight:650;
  margin:0 0 7px;
}

.field input,.field textarea,.field select{
  width:100%;
  background:#0a0f15;
  color:var(--text);
  border:1px solid var(--border2);
  border-radius:12px;
  padding:13px 14px;
  outline:none;
}

.field textarea{min-height:120px;resize:vertical}

.field input:focus,.field textarea:focus,.field select:focus{
  border-color:#4f98ed;
  box-shadow:0 0 0 3px rgba(79,152,237,.12);
}

.btn{
  min-height:44px;
  border:1px solid var(--border2);
  background:var(--surface2);
  border-radius:12px;
  padding:10px 15px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.btn:hover{background:var(--surface3)}

.btn.primary{
  background:var(--accent2);
  border-color:var(--accent2);
}

.btn.danger{
  background:#43151b;
  border-color:#76232e;
}

.btn.green{
  background:#123728;
  border-color:#245b45;
}

.btn.block{width:100%}

.login-error{
  color:#ff9ba4;
  min-height:20px;
  font-size:13px;
  margin-top:10px;
}

.shell{
  min-height:100vh;
  min-height:100dvh;
  display:grid;
  grid-template-columns:250px minmax(0,1fr);
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  border-right:1px solid var(--border);
  background:#090d13;
  padding:19px 14px;
  display:flex;
  flex-direction:column;
  z-index:20;
}

.side-brand{
  display:flex;
  gap:11px;
  align-items:center;
  padding:7px 8px 20px;
}

.side-brand .brand-mark{
  margin:0;
  width:38px;
  height:38px;
  border-radius:12px;
}

.side-brand strong{font-size:16px}
.side-brand small{display:block;color:var(--muted);margin-top:2px}

.nav{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.nav button,.bottom-nav button{
  border:0;
  color:var(--muted);
  background:transparent;
  cursor:pointer;
}

.nav button{
  width:100%;
  min-height:44px;
  border-radius:11px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:0 12px;
  text-align:left;
  font-weight:650;
}

.nav button:hover,.nav button.active{
  color:var(--text);
  background:var(--surface2);
}

.sidebar-footer{
  margin-top:auto;
  border-top:1px solid var(--border);
  padding:16px 8px 6px;
}

.user-name{font-weight:700}
.user-role{color:var(--muted);font-size:12px;margin-top:3px}

.main{
  min-width:0;
  padding:0 30px 50px;
}

.topbar{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
  margin-bottom:26px;
}

.page-title{
  font-size:20px;
  font-weight:750;
  letter-spacing:-.025em;
}

.live{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 4px rgba(66,211,146,.1);
}

.dot.off{background:var(--red);box-shadow:0 0 0 4px rgba(255,82,95,.1)}
.dot.warn{background:var(--yellow)}

.content{
  width:min(1180px,100%);
  margin:0 auto;
}

.hero{
  border:1px solid var(--border);
  background:
    radial-gradient(circle at 100% 0%,rgba(66,211,146,.08),transparent 34%),
    var(--surface);
  border-radius:22px;
  padding:28px;
  margin-bottom:18px;
}

.hero.alert{
  border-color:#7e2631;
  background:
    radial-gradient(circle at 100% 0%,rgba(255,82,95,.17),transparent 40%),
    #160d11;
}

.eyebrow{
  text-transform:uppercase;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.13em;
  font-weight:800;
}

.hero h2{
  margin:9px 0 7px;
  font-size:34px;
  letter-spacing:-.05em;
}

.hero p{color:var(--muted);margin:0;max-width:680px}

.grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:16px;
}

.card{
  grid-column:span 4;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:var(--radius);
  padding:19px;
}

.card.span8{grid-column:span 8}
.card.span12{grid-column:span 12}
.card.span6{grid-column:span 6}

.card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.card-head h3{
  margin:0;
  font-size:15px;
}

.metric{
  font-size:30px;
  font-weight:780;
  letter-spacing:-.05em;
}

.muted{color:var(--muted)}

.status-row{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-top:1px solid var(--border);
}

.status-row:first-child{border-top:0}

.status-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--border2);
  border-radius:999px;
  padding:4px 8px;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.pill.active,.pill.raid{color:#ff9fa7;border-color:#6f2932;background:#321219}
.pill.resolved{color:#8ee7bb;border-color:#24583f;background:#10291e}
.pill.general{color:#abd2ff}
.pill.security{color:#ffd591}
.pill.network_outage,.pill.pbx_outage{color:#ffd591}

.incident-list{display:flex;flex-direction:column}

.incident{
  padding:15px 0;
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  border-top:1px solid var(--border);
  cursor:pointer;
}

.incident:first-child{border-top:0}

.incident-title{
  font-weight:730;
  margin:4px 0 4px;
}

.incident-meta{
  color:var(--muted);
  font-size:12px;
}

.activation-types{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.type-button{
  text-align:left;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface2);
  padding:15px;
  cursor:pointer;
}

.type-button:hover,.type-button.selected{
  border-color:#4c83c4;
  background:#142337;
}

.type-button strong{display:block;margin-bottom:4px}
.type-button small{color:var(--muted)}

.type-button.raid.selected{
  border-color:#8f303c;
  background:#2b1117;
}

.readiness{
  display:flex;
  flex-direction:column;
}

.readiness-item{
  min-height:49px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-top:1px solid var(--border);
}

.readiness-item:first-child{border:0}

.ready{color:var(--green);font-weight:750}
.not-ready{color:var(--yellow);font-weight:750}

.empty{
  padding:28px;
  color:var(--muted);
  text-align:center;
}

.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.toolbar input{
  flex:1;
  min-width:180px;
  border:1px solid var(--border2);
  background:var(--surface);
  color:var(--text);
  border-radius:11px;
  padding:11px 13px;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  display:grid;
  place-items:center;
  padding:20px;
  z-index:100;
}

.modal{
  width:min(620px,100%);
  max-height:88vh;
  overflow:auto;
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:20px;
  padding:22px;
  box-shadow:var(--shadow);
}

.modal h2{margin:0 0 6px}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:20px;
}

.timeline{
  margin-top:20px;
  border-left:1px solid var(--border2);
  padding-left:16px;
}

.timeline-item{
  margin:0 0 17px;
}

.timeline-item strong{display:block;font-size:13px}
.timeline-item small{color:var(--muted)}

.bottom-nav{display:none}

.toast-stack{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:200;
  display:flex;
  flex-direction:column;
  gap:9px;
}

.toast{
  background:#111923;
  border:1px solid var(--border2);
  border-radius:13px;
  padding:12px 15px;
  box-shadow:var(--shadow);
  max-width:360px;
}

.toast.danger{border-color:#74303a}

.critical-banner{
  border:1px solid #6f2832;
  background:#2b1117;
  border-radius:16px;
  padding:17px;
  margin-bottom:18px;
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
}

.critical-banner strong{font-size:17px}

.hold-button{
  position:relative;
  overflow:hidden;
  min-height:56px;
  width:100%;
  border:1px solid #8a303c;
  background:#3a131a;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
  user-select:none;
}

.hold-progress{
  position:absolute;
  inset:0 auto 0 0;
  width:0%;
  background:#842735;
  pointer-events:none;
}

.hold-label{
  position:relative;
  z-index:2;
}

.section-title{
  margin:0 0 16px;
  font-size:22px;
  letter-spacing:-.035em;
}

.mobile-only{display:none}

@media(max-width:900px){
  .shell{display:block}

  .sidebar{display:none}

  .main{
    padding:
      max(12px,env(safe-area-inset-top))
      14px
      calc(88px + env(safe-area-inset-bottom));
  }

  .topbar{
    min-height:61px;
    margin-bottom:17px;
  }

  .topbar .page-title{font-size:18px}

  .content{width:100%}

  .hero{padding:20px;border-radius:18px}
  .hero h2{font-size:28px}

  .grid{gap:12px}

  .card,.card.span6,.card.span8{
    grid-column:span 12;
    padding:16px;
  }

  .activation-types{grid-template-columns:1fr}

  .bottom-nav{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    position:fixed;
    z-index:50;
    bottom:0;
    left:0;
    right:0;
    min-height:66px;
    padding-bottom:env(safe-area-inset-bottom);
    background:rgba(9,13,19,.94);
    backdrop-filter:blur(18px);
    border-top:1px solid var(--border);
  }

  .bottom-nav button{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    font-size:10px;
    font-weight:700;
  }

  .bottom-nav button.active{color:var(--text)}
  .bottom-nav .icon{width:21px;height:21px}

  .mobile-only{display:initial}

  .critical-banner{
    align-items:flex-start;
    flex-direction:column;
  }

  .modal-backdrop{
    align-items:end;
    padding:0;
  }

  .modal{
    width:100%;
    max-height:88dvh;
    border-radius:22px 22px 0 0;
    padding:21px 18px calc(21px + env(safe-area-inset-bottom));
  }

  .toast-stack{
    left:12px;
    right:12px;
    bottom:82px;
  }

  .toast{max-width:none}
}

@media(max-width:430px){
  .hero h2{font-size:25px}
  .metric{font-size:27px}
}
