/* ATWS Console — style.css © 2026 Cognito Intelligence Services */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #E1E6EA;
  --surface:    #F4F6F8;
  --surface2:   #ffffff;
  --border:     #CDD3D9;
  --border2:    #B8BFC6;
  --text:       #292D38;
  --text2:      #5A6072;
  --text3:      #8B92A5;
  --accent:     #FFA700;
  --accent-lt:  #FFF3D6;
  --accent-dk:  #7A4F00;
  --green:      #2E7D32;
  --green-lt:   #E8F5E9;
  --red:        #C62828;
  --red-lt:     #FFEBEE;
  --blue:       #1565C0;
  --blue-lt:    #E3F2FD;
  --sidebar-w:  224px;
  --topbar-h:   52px;
  --radius:     6px;
  --radius-lg:  8px;
  font-size:    13px;
}

body {
  font-family: 'Google Sans', Roboto, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; height: 100vh; }
.body-wrap  { display: flex; flex: 1; overflow: hidden; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 0;
  flex-shrink: 0; z-index: 100;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; width: var(--sidebar-w); flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.hamburger { background: none; border: none; cursor: pointer; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text2); border-radius: 1px; transition: .2s; }

.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--text); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 16px; height: 16px; }
.logo-text { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -.2px; }
.logo-text span { font-weight: 400; color: var(--text2); }

.topbar-icon-btn {
  position: relative; background: none; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--bg); }
.topbar-icon-btn i { font-size: 18px; }
.notif-badge {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); display: none;
}
.notif-badge.visible { display: block; }

/* Account widget */
.acct-wrap { position: relative; }
.acct-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px 4px 5px;
  cursor: pointer; color: var(--text2); font-size: 12px;
  font-family: inherit; transition: background .15s;
}
.acct-btn:hover { background: var(--bg); }
.acct-btn i { font-size: 14px; color: var(--text3); }
.acct-name { font-size: 12px; color: var(--text); font-weight: 500; }

.av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--text); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.av-lg { width: 36px; height: 36px; font-size: 14px; }

.acct-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 240px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  display: none; z-index: 200;
}
.acct-panel.open { display: block; }
.acct-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px; }
.acct-panel-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.acct-panel-email { font-size: 11px; color: var(--text3); }
.acct-panel-sep   { border-top: 1px solid var(--border); }
.acct-panel-item  {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 12px; color: var(--text2);
  text-decoration: none; transition: background .1s;
}
.acct-panel-item:hover { background: var(--bg); }
.acct-panel-item i { font-size: 16px; }
.acct-panel-item--danger { color: var(--red); }
.acct-panel-item--danger:hover { background: var(--red-lt); }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
  transition: transform .2s;
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section { padding: 4px 0; }
.nav-section--sep { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.nav-label {
  font-size: 10px; font-weight: 600; color: var(--text3);
  letter-spacing: .8px; text-transform: uppercase;
  padding: 4px 16px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; color: var(--text2); font-size: 13px;
  text-decoration: none; cursor: pointer;
  transition: background .1s; position: relative;
  border-radius: 0;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-lt); color: var(--text); font-weight: 500; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.nav-item i { font-size: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: var(--accent); color: var(--text);
  padding: 1px 6px; border-radius: 10px;
}
.sidebar-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
}
.sidebar-footer-version { font-size: 10px; color: var(--text3); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 90;
}

/* ── Main ───────────────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; padding: 24px 28px; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 22px;
}
.page-title { font-size: 20px; font-weight: 500; color: var(--text); letter-spacing: -.3px; }
.page-sub   { font-size: 12px; color: var(--text3); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  font-family: inherit; text-decoration: none;
}
.btn i { font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { background: #1a1f2e; }
.btn-outline { background: transparent; color: var(--text2); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); color: var(--text); }
.btn-accent { background: var(--accent); color: var(--text); border-color: var(--accent); }
.btn-accent:hover { background: #e09600; }
.btn-danger { background: transparent; color: var(--red); border-color: #FFCDD2; }
.btn-danger:hover { background: var(--red-lt); }
.btn-full { width: 100%; justify-content: center; }

/* ── Metrics / Tiles ────────────────────────────────────────── */
.metric-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 12px; margin-bottom: 22px;
}
.metric-grid-3 { grid-template-columns: repeat(3,1fr); }
.metric {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.metric-label { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.metric-val   { font-size: 24px; font-weight: 500; color: var(--text); letter-spacing: -.5px; }
.metric-sub   { font-size: 11px; color: var(--text3); margin-top: 3px; }
.metric-dot   { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--accent); }
.dot-gray  { background: var(--text3); }
.dot-red   { background: var(--red); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 500; color: var(--text); }
.card-action {
  font-size: 11px; color: var(--text3); cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; transition: background .15s; font-family: inherit;
}
.card-action:hover { background: var(--bg); color: var(--text2); }
.card-body { padding: 14px 16px; }
.card-foot {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}

/* ── Grid helpers ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.gap-16 { gap: 16px; }

/* ── Table ──────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 11px; color: var(--text3); font-weight: 500;
  text-align: left; padding: 9px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td {
  padding: 10px 14px; border-bottom: 1px solid var(--bg);
  font-size: 12px; color: var(--text); vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #F6F8FA; }
.tbl-name { font-weight: 500; }
.tbl-sub  { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 500;
}
.badge-green  { background: var(--green-lt); color: var(--green); }
.badge-amber  { background: var(--accent-lt); color: var(--accent-dk); }
.badge-gray   { background: #EBEBEB; color: var(--text2); }
.badge-red    { background: var(--red-lt); color: var(--red); }
.badge-blue   { background: var(--blue-lt); color: var(--blue); }

/* ── Lager Split ────────────────────────────────────────────── */
.lager-split { display: grid; grid-template-columns: 1fr 1fr; }
.lager-half  { padding: 12px 16px; }
.lager-half + .lager-half { border-left: 1px solid var(--border); }
.lager-half-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lager-half-name { font-size: 12px; font-weight: 600; color: var(--text); }
.lager-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 10px;
  background: var(--bg); color: var(--text3);
}
.lager-chip-shared { background: var(--accent-lt); color: var(--accent-dk); }
.lager-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--bg);
  font-size: 12px;
}
.lager-row:last-child { border-bottom: none; }
.lager-row-name  { color: var(--text2); }
.lager-row-count { font-weight: 500; color: var(--text); }

/* ── Plan items ─────────────────────────────────────────────── */
.plan-list { padding: 0 16px; }
.plan-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--bg);
}
.plan-item:last-child { border-bottom: none; }
.plan-date { font-size: 11px; color: var(--text3); width: 72px; flex-shrink: 0; }
.plan-name { font-size: 12px; color: var(--text); flex: 1; }
.plan-overdue { color: var(--red) !important; font-weight: 500; }

/* ── User link ──────────────────────────────────────────────── */
.user-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--blue);
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid #BBDEFB; background: var(--blue-lt);
  text-decoration: none; transition: background .15s;
}
.user-link:hover { background: #BBDEFB; }

/* ── Settings ───────────────────────────────────────────────── */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--bg);
}
.settings-row:last-child { border-bottom: none; }
.settings-key { font-size: 12px; color: var(--text); font-weight: 500; }
.settings-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.settings-val { font-size: 12px; color: var(--text3); }

/* Toggle */
.toggle {
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--border); position: relative;
  cursor: pointer; transition: background .2s; flex-shrink: 0;
  border: none;
}
.toggle.on { background: var(--text); }
.toggle::after {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: left .2s;
}
.toggle.on::after { left: 19px; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 480px; max-width: calc(100vw - 32px);
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(8px); transition: transform .15s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 15px; font-weight: 500; color: var(--text); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 18px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--text); }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.form-row select.form-input { appearance: none; cursor: pointer; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  padding: 40px 20px; text-align: center;
  color: var(--text3); font-size: 12px;
}
.empty-state i { font-size: 36px; display: block; margin-bottom: 10px; opacity: .4; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 16px; font-size: 12px; font-weight: 500;
  color: var(--text3); cursor: pointer; border: none;
  background: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-family: inherit; transition: all .15s;
}
.tab:hover { color: var(--text2); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* ── HR ─────────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Section heading ────────────────────────────────────────── */
.section-h { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 12px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 95; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { padding: 16px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .lager-split { grid-template-columns: 1fr; }
  .lager-half + .lager-half { border-left: none; border-top: 1px solid var(--border); }
  .page-header { flex-direction: column; gap: 12px; }
}
@media (max-width: 600px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .acct-name { display: none; }
}

/* ── Onboarding Nav Lock ───────────────────────────────────── */
.nav-item--locked {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; color: var(--text3);
  font-size: 13px; cursor: not-allowed;
  user-select: none; opacity: .55;
}
.nav-item--locked:hover { background: transparent; }
