/* =========================================================
   ZLT Co. Account — shared design system
   Minimal, flat, dark. One stylesheet for every account page.
========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root{
  --bg:        #0a0a0d;
  --panel:     #121317;
  --panel-2:   #16171c;
  --border:    rgba(255,255,255,.07);
  --border-2:  rgba(255,255,255,.12);
  --text:      #f2f2f3;
  --text-dim:  #9497a0;
  --text-mute: #64666f;
  --brand:     #ff2056;
  --brand-2:   #e11d48;
  --green:     #3ddc84;
  --blue:      #5b9dff;
  --yellow:    #f5b93d;
  --red:       #ff5c5c;
  --radius:    14px;
  --radius-sm: 10px;
}

body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  line-height:1.55;
  min-height:100vh;
}

a{ color:inherit; }

/* ── shell / layout ── */
.shell{
  display:flex;
  max-width:1320px;
  margin:0 auto;
  padding:32px 32px 64px;
  gap:24px;
  align-items:flex-start;
}

/* ── sidebar ── */
.sidebar{ width:240px; flex-shrink:0; position:sticky; top:24px; }
.sidebar-inner{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px 16px;
}
.logo{
  display:flex; align-items:center; gap:9px;
  font-weight:700; font-size:15px; letter-spacing:-.01em;
  color:var(--text); text-decoration:none;
  padding:6px 8px 18px;
}
.logo-mark{
  width:26px; height:26px; border-radius:8px; flex-shrink:0;
  background:var(--brand);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:13px; color:white;
}
.nav-label{
  color:var(--text-mute); margin:18px 0 6px; padding:0 8px;
  font-size:10.5px; letter-spacing:.09em; text-transform:uppercase; font-weight:600;
}
.nav-label:first-of-type{ margin-top:0; }
.nav-link{
  display:flex; align-items:center; gap:10px;
  padding:9px 10px; border-radius:9px; margin-bottom:1px;
  color:var(--text-dim); text-decoration:none;
  font-size:13.5px; font-weight:500;
  transition:background .15s,color .15s;
}
.nav-link svg{ width:16px; height:16px; flex-shrink:0; opacity:.85; }
.nav-link:hover{ background:rgba(255,255,255,.05); color:var(--text); }
.nav-link.active{ background:rgba(255,32,86,.12); color:var(--text); }
.nav-link.active svg{ opacity:1; color:var(--brand); }
.nav-link.external svg{ margin-left:auto; width:13px; height:13px; opacity:.5; }

/* ── main column ── */
.main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:16px; }

.page-head h1{ font-size:22px; font-weight:700; letter-spacing:-.02em; }
.page-head p{ color:var(--text-mute); font-size:13.5px; margin-top:4px; }

/* ── cards ── */
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px 24px;
}
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card-head-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.card-icon{
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  background:rgba(255,255,255,.05);
  display:flex; align-items:center; justify-content:center;
}
.card-icon svg{ width:16px; height:16px; color:var(--text-dim); }
.card-head h2{ font-size:14.5px; font-weight:600; letter-spacing:-.01em; }
.card-head p{ font-size:12px; color:var(--text-mute); margin-top:1px; }
.card-divider{ height:1px; background:var(--border); margin:18px 0; }

/* ── badges ── */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:100px; font-size:11.5px; font-weight:600;
  border:1px solid transparent;
}
.badge-dot{ width:5px; height:5px; border-radius:50%; flex-shrink:0; }
.badge-green{ background:rgba(61,220,132,.1); color:var(--green); border-color:rgba(61,220,132,.18); }
.badge-green .badge-dot{ background:var(--green); }
.badge-blue{ background:rgba(91,157,255,.1); color:var(--blue); border-color:rgba(91,157,255,.18); }
.badge-blue .badge-dot{ background:var(--blue); }
.badge-yellow{ background:rgba(245,185,61,.1); color:var(--yellow); border-color:rgba(245,185,61,.18); }
.badge-yellow .badge-dot{ background:var(--yellow); }
.badge-red{ background:rgba(255,92,92,.1); color:var(--red); border-color:rgba(255,92,92,.18); }
.badge-red .badge-dot{ background:var(--red); }
.badge-neutral{ background:rgba(255,255,255,.06); color:var(--text-dim); }
.badge-neutral .badge-dot{ background:var(--text-dim); }

/* ── buttons ── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:10px 18px; border:none; border-radius:var(--radius-sm);
  font-family:inherit; font-weight:600; font-size:13px;
  cursor:pointer; transition:background .15s,border-color .15s,opacity .15s;
  white-space:nowrap;
}
.btn svg{ width:15px; height:15px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-primary{ background:var(--brand); color:white; }
.btn-primary:hover:not(:disabled){ background:var(--brand-2); }
.btn-ghost{ background:rgba(255,255,255,.05); color:var(--text-dim); border:1px solid var(--border-2); }
.btn-ghost:hover{ background:rgba(255,255,255,.09); color:var(--text); }
.btn-danger{ background:rgba(255,92,92,.1); color:var(--red); border:1px solid rgba(255,92,92,.18); }
.btn-danger:hover{ background:rgba(255,92,92,.16); }
.btn-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:6px; }
.btn-note{ font-size:11.5px; color:var(--text-mute); line-height:1.5; }

.spinner{ width:13px; height:13px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; display:none; }
.btn.loading .spinner{ display:block; }
.btn.loading .btn-txt{ display:none; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* icon-only toggle button (expand/collapse) */
.icon-btn{
  width:28px; height:28px; border-radius:8px; flex-shrink:0;
  background:rgba(255,255,255,.05); border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-dim);
  transition:background .15s,color .15s,transform .25s ease;
}
.icon-btn svg{ width:15px; height:15px; transition:transform .25s ease; }
.icon-btn.open{ background:rgba(255,32,86,.14); color:var(--brand); }
.icon-btn.open svg{ transform:rotate(45deg); }

/* ── collapsible ── */
.collapse{ overflow:hidden; max-height:0; transition:max-height .35s ease; }
.collapse.open{ max-height:1000px; }
.collapse-inner{ padding-top:20px; }

/* ── forms ── */
.form{ display:flex; flex-direction:column; gap:14px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12.5px; font-weight:600; color:#d7d8de; }
.field-note{ font-size:11px; color:var(--text-mute); font-weight:400; }
.field-wrap{ position:relative; }

.input{
  width:100%;
  background:rgba(255,255,255,.035);
  border:1px solid var(--border-2);
  border-radius:var(--radius-sm);
  padding:10px 13px;
  color:var(--text);
  font-family:inherit; font-size:13.5px;
  outline:none;
  transition:border-color .15s,background .15s;
}
.input::placeholder{ color:var(--text-mute); opacity:.7; }
.input:focus{ border-color:rgba(255,32,86,.5); background:rgba(255,255,255,.05); }
.input.err{ border-color:rgba(255,92,92,.55); }
.input.ok{ border-color:rgba(61,220,132,.5); }
.input.has-icon{ padding-right:40px; }

.static-field{
  padding:10px 13px;
  background:rgba(255,255,255,.02);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:13.5px; color:var(--text-dim); font-weight:500;
}

.eye-btn{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--text-mute); cursor:pointer;
  padding:4px; display:flex; align-items:center;
}
.eye-btn:hover{ color:var(--text-dim); }
.eye-btn svg{ width:16px; height:16px; }

/* password strength */
.strength{ margin-top:6px; display:none; }
.strength.show{ display:block; }
.strength-bars{ display:flex; gap:4px; margin-bottom:5px; }
.strength-bar{ height:3px; flex:1; border-radius:2px; background:rgba(255,255,255,.08); transition:background .2s; }
.strength-text{ font-size:11px; font-weight:500; color:var(--text-mute); }

.field-msg{ font-size:11.5px; font-weight:500; display:none; align-items:center; gap:5px; }
.field-msg.show{ display:flex; }
.field-msg svg{ width:12px; height:12px; }
.field-msg.msg-ok{ color:var(--green); }
.field-msg.msg-err{ color:var(--red); }
.field-msg.msg-hint{ color:var(--text-mute); }

.rules-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px 20px; }

/* ── alerts ── */
.alert{
  padding:11px 14px; border-radius:var(--radius-sm);
  font-size:12.5px; font-weight:500;
  display:none; align-items:flex-start; gap:9px; line-height:1.55;
}
.alert.show{ display:flex; }
.alert svg{ width:15px; height:15px; flex-shrink:0; margin-top:1px; }
.alert-ok{ background:rgba(61,220,132,.08); border:1px solid rgba(61,220,132,.18); color:var(--green); }
.alert-err{ background:rgba(255,92,92,.08); border:1px solid rgba(255,92,92,.18); color:#ff8a8a; }
.alert-warn{ background:rgba(245,185,61,.08); border:1px solid rgba(245,185,61,.18); color:var(--yellow); }

/* ── info grid ── */
.info-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.info-item{
  background:rgba(255,255,255,.02);
  border:1px solid var(--border);
  border-radius:11px; padding:12px 14px;
}
.info-item .lbl{ font-size:10.5px; color:var(--text-mute); font-weight:600; text-transform:uppercase; letter-spacing:.06em; margin-bottom:5px; }
.info-item .val{ font-size:13px; color:var(--text); font-weight:600; }

/* ── profile row ── */
.profile-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.avatar{
  width:46px; height:46px; border-radius:50%;
  background:var(--brand);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:18px; color:white; flex-shrink:0;
}
.badge-row{ display:flex; gap:7px; flex-wrap:wrap; margin-top:7px; }

/* ── security score ring ── */
.score-wrap{ display:flex; align-items:center; gap:14px; margin-left:auto; }
.ring-outer{ position:relative; width:64px; height:64px; flex-shrink:0; }
.ring-svg{ transform:rotate(-90deg); display:block; }
.ring-bg{ fill:none; stroke:rgba(255,255,255,.06); stroke-width:5; }
.ring-arc{ fill:none; stroke:var(--green); stroke-width:5; stroke-linecap:round; transition:stroke-dashoffset .8s ease,stroke .3s; }
.ring-label{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; font-weight:700; font-size:15px; color:var(--text); line-height:1; }
.ring-label span{ font-size:8.5px; font-weight:500; color:var(--text-mute); margin-top:2px; }
.score-list{ display:flex; flex-direction:column; gap:7px; }
.score-row{ display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-dim); }
.dot{ width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.dot-g{ background:var(--green); } .dot-y{ background:var(--yellow); } .dot-r{ background:var(--red); }

/* ── session row ── */
.session-row{
  display:flex; align-items:center; gap:13px;
  background:rgba(255,255,255,.02); border:1px solid var(--border);
  border-radius:11px; padding:13px 15px; margin-bottom:14px;
}
.session-icon{
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  background:rgba(255,255,255,.05); display:flex; align-items:center; justify-content:center;
}
.session-icon svg{ width:16px; height:16px; color:var(--text-dim); }
.session-info{ flex:1; min-width:0; }
.session-info .si-name{ font-size:13.5px; font-weight:600; color:var(--text); }
.session-info .si-sub{ font-size:11.5px; color:var(--text-mute); margin-top:2px; }

/* ── activity list ── */
.activity-list{ display:flex; flex-direction:column; gap:8px; max-height:520px; overflow-y:auto; }
.activity-item{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:11px;
  background:rgba(255,255,255,.02); border:1px solid var(--border);
}
.activity-icon{
  width:30px; height:30px; border-radius:8px; flex-shrink:0;
  background:rgba(255,255,255,.05); display:flex; align-items:center; justify-content:center;
}
.activity-icon svg{ width:14px; height:14px; color:var(--text-dim); }
.activity-text{ flex:1; min-width:0; font-size:13px; color:var(--text); }
.activity-time{ font-size:11.5px; color:var(--text-mute); flex-shrink:0; white-space:nowrap; }
.state-row{ display:flex; align-items:center; gap:10px; padding:14px 4px; color:var(--text-mute); font-size:13px; }
.state-row svg{ width:16px; height:16px; flex-shrink:0; }

/* ── toggle switch (notification preferences) ── */
.pref-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; }
.pref-row + .pref-row{ border-top:1px solid var(--border); }
.pref-info .pf-name{ font-size:13.5px; font-weight:600; color:var(--text); }
.pref-info .pf-sub{ font-size:12px; color:var(--text-mute); margin-top:2px; }
.toggle{ position:relative; width:40px; height:23px; flex-shrink:0; }
.toggle input{ opacity:0; width:0; height:0; position:absolute; }
.toggle-track{
  position:absolute; inset:0; border-radius:100px; cursor:pointer;
  background:rgba(255,255,255,.1); border:1px solid var(--border-2);
  transition:background .2s,border-color .2s;
}
.toggle-track::before{
  content:""; position:absolute; top:2px; left:2px; width:17px; height:17px;
  border-radius:50%; background:#cfd0d5; transition:transform .2s, background .2s;
}
.toggle input:checked + .toggle-track{ background:var(--brand); border-color:var(--brand); }
.toggle input:checked + .toggle-track::before{ transform:translateX(17px); background:white; }
.toggle input:disabled + .toggle-track{ opacity:.4; cursor:not-allowed; }

/* ── toasts ── */
#toast-shelf{
  position:fixed; bottom:22px; right:22px;
  display:flex; flex-direction:column-reverse; gap:8px;
  z-index:99999; pointer-events:none;
}
.toast{
  background:#1a1b21; border:1px solid var(--border-2); border-radius:11px;
  padding:12px 15px; font-size:13px; font-weight:500; color:var(--text);
  display:flex; align-items:center; gap:9px;
  min-width:270px; max-width:340px;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
  animation:toast-in .2s ease forwards;
  pointer-events:auto;
}
.toast.out{ animation:toast-out .2s ease forwards; }
.toast-pip{ width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.toast.t-ok .toast-pip{ background:var(--green); }
.toast.t-err .toast-pip{ background:var(--red); }
.toast.t-info .toast-pip{ background:var(--blue); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }
@keyframes toast-out{ to{ opacity:0; transform:translateY(6px); } }

/* ── quick actions (dashboard) ── */
.quick-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }
.quick-card{
  background:rgba(255,255,255,.02); border:1px solid var(--border);
  border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:10px;
}
.quick-card .qc-top{ display:flex; align-items:center; gap:10px; }
.quick-card .qc-icon{
  width:30px; height:30px; border-radius:8px; flex-shrink:0;
  background:rgba(255,255,255,.05); display:flex; align-items:center; justify-content:center;
}
.quick-card .qc-icon svg{ width:15px; height:15px; color:var(--text-dim); }
.quick-card h4{ font-size:13.5px; font-weight:600; }
.quick-card p{ font-size:12px; color:var(--text-mute); }
.quick-card .btn{ align-self:flex-start; padding:7px 14px; font-size:12.5px; }

/* ── responsive ── */
@media (max-width: 1000px){
  .info-grid{ grid-template-columns:repeat(2,1fr); }
  .score-wrap{ display:none; }
}
@media (max-width: 860px){
  .shell{ flex-direction:column; padding:16px; gap:16px; }
  .sidebar{ width:100%; position:static; }
  .form-row{ grid-template-columns:1fr; }
}
@media (max-width: 560px){
  .card{ padding:18px; }
  .info-grid{ grid-template-columns:1fr; }
}
