/* ============================================================
   SkyByte Tenant Portal — Design System
   ============================================================ */

:root {
  /* Surface */
  --bg-base:        #f4f4f7;
  --bg-surface:     #ffffff;
  --bg-elevated:    #ebebf0;
  --bg-hover:       #e4e4ec;
  --bg-active:      #d8d8e4;

  /* Borders */
  --border-subtle:  rgba(0,0,0,0.08);
  --border-default: rgba(0,0,0,0.14);

  /* Text */
  --text-primary:   #1a1a1e;
  --text-secondary: #52525e;
  --text-tertiary:  #8888a0;
  --text-link:      #2563eb;

  /* Accent */
  --accent:         #2563eb;
  --accent-hover:   #1d4ed8;
  --accent-text:    #fff;

  /* Status — Green */
  --green-solid:    #059669;
  --green-bg:       rgba(5,150,105,0.10);
  --green-text:     #065f46;

  /* Status — Amber */
  --amber-solid:    #d97706;
  --amber-bg:       rgba(217,119,6,0.10);
  --amber-text:     #78350f;

  /* Status — Red */
  --red-solid:      #dc2626;
  --red-bg:         rgba(220,38,38,0.09);
  --red-text:       #7f1d1d;

  /* Status — Blue */
  --blue-solid:     #1d4ed8;
  --blue-bg:        rgba(29,78,216,0.09);
  --blue-text:      #1e3a8a;

  /* Layout */
  --sidebar-width:  200px;
  --sidebar-rail:    56px;
  --header-height:   44px;
  --content-max:    960px;

  /* Misc */
  --radius-sm:   4px;
  --radius:      6px;
  --radius-pill: 999px;
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.16);
  --transition:  0.14s ease;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

#app { display: flex; flex-direction: column; height: 100vh; }

/* Client-view banner above header */
#client-view-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 36px;
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-solid);
  font-size: 13px;
  color: var(--amber-text);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
}
#client-view-banner.visible { display: flex; }
#client-view-banner span { flex: 1; }
#client-view-banner a { color: var(--amber-text); font-weight: 500; }

/* Maintenance banner */
#maintenance-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 32px;
  background: var(--blue-bg);
  border-bottom: 1px solid var(--blue-solid);
  font-size: 12px;
  color: var(--blue-text);
  flex-shrink: 0;
}
#maintenance-banner.visible { display: flex; }

/* Header */
#header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
#header-toggle {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
}
#header-toggle:hover { background: var(--bg-hover); }

#wordmark {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em; white-space: nowrap;
}
#header-context {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 13px;
}
#header-context .slash { color: var(--text-tertiary); }
#header-context .ctx-name { color: var(--text-primary); }

.role-pill {
  padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-pill.operator { background: var(--amber-bg); color: var(--amber-text); }
.role-pill.platform { background: var(--blue-bg); color: var(--blue-text); }

#header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

#help-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
}
#help-btn:hover { background: var(--bg-hover); }

#avatar {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 600; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; user-select: none; flex-shrink: 0;
  position: relative;
}

#avatar-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  min-width: 160px; z-index: 200; overflow: hidden;
}
#avatar-menu.open { display: block; }
#avatar-menu-header {
  padding: 10px 14px 8px; border-bottom: 1px solid var(--border-subtle);
  font-size: 11px; color: var(--text-secondary); white-space: nowrap;
}
.avatar-menu-item {
  display: block; width: 100%; padding: 9px 14px; background: none;
  border: none; text-align: left; cursor: pointer; font-size: 13px;
  color: var(--text-primary); white-space: nowrap;
}
.avatar-menu-item:hover { background: var(--bg-hover); }

/* Body below header */
#body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: width var(--transition);
  display: flex; flex-direction: column;
}
#sidebar.collapsed { width: var(--sidebar-rail); }

.sidebar-section-label {
  padding: 14px 14px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden;
}
#sidebar.collapsed .sidebar-section-label { opacity: 0; }

.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; border-radius: var(--radius);
  margin: 1px 6px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px;
  white-space: nowrap; overflow: hidden;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { background: var(--bg-active); color: var(--text-primary); }
.sidebar-item svg { flex-shrink: 0; opacity: 0.75; }
.sidebar-item.active svg { opacity: 1; }
.sidebar-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .badge {
  min-width: 18px; height: 18px; border-radius: var(--radius-pill);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 10px; font-weight: 600; display: flex;
  align-items: center; justify-content: center; padding: 0 5px;
  flex-shrink: 0;
}
#sidebar.collapsed .label,
#sidebar.collapsed .badge { display: none; }
#sidebar.collapsed .sidebar-item { justify-content: center; padding: 7px; }

/* Main */
#main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  background: var(--bg-base);
}
#page { max-width: var(--content-max); padding: 22px 24px; margin: 0 auto; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.page-title  { font-size: 22px; font-weight: 500; line-height: 1.25; }
.section-heading { font-size: 16px; font-weight: 500; }
.row-title   { font-size: 14px; font-weight: 500; }
.body-text   { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.meta-text   { font-size: 11px; font-weight: 400; color: var(--text-tertiary); }

/* ============================================================
   STATUS PILLS & DOTS
   ============================================================ */

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
}
.status-pill.active   { background: var(--green-bg); color: var(--green-text); }
.status-pill.suspended { background: var(--amber-bg); color: var(--amber-text); }
.status-pill.failed   { background: var(--red-bg);   color: var(--red-text); }
.status-pill.pending  { background: var(--blue-bg);  color: var(--blue-text); }
.status-pill.subscribed { background: var(--green-bg); color: var(--green-text); }
.status-pill.coming-soon { background: var(--bg-elevated); color: var(--text-tertiary); }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.green  { background: var(--green-solid); }
.status-dot.amber  { background: var(--amber-solid); }
.status-dot.red    { background: var(--red-solid); }
.status-dot.blue   { background: var(--blue-solid); }
.status-dot.gray   { background: var(--text-tertiary); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-text { background: none; color: var(--text-link); padding: 0; font-size: 13px; }
.btn-text:hover { text-decoration: underline; }

.btn .spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   CARDS / PANELS
   ============================================================ */

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.panel-pad { padding: 14px 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ============================================================
   BLOCK LIBRARY
   ============================================================ */

/* -- Header block -- */
.block-header { margin-bottom: 24px; }
.block-header-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.block-header-title .service-icon { opacity: 0.85; flex-shrink: 0; }
.block-header-title h1 { font-size: 20px; font-weight: 500; }
.block-header-meta { margin-top: 5px; color: var(--text-secondary); font-size: 13px; }
.block-header-meta .dot { margin: 0 5px; color: var(--text-tertiary); }

/* -- Metrics row -- */
.block-metrics { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.metric-tile {
  flex: 1; min-width: 140px; padding: 14px 16px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.metric-tile .metric-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.metric-tile .metric-value { font-size: 24px; font-weight: 500; line-height: 1.1; }
.metric-tile .metric-context { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* -- List block -- */
.block-list { margin-bottom: 24px; }
.block-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.list-items { display: flex; flex-direction: column; gap: 0; }
.list-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.list-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.list-row:only-child  { border-radius: var(--radius); border-bottom: none; }
.list-row-lead { flex-shrink: 0; margin-top: 2px; }
.list-row-body { flex: 1; overflow: hidden; }
.list-row-primary { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-secondary { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-trail { color: var(--text-tertiary); font-size: 11px; flex-shrink: 0; white-space: nowrap; }

.avatar-circle {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 10px; font-weight: 600; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}

/* -- Settings block -- */
.block-settings { margin-bottom: 24px; }
.settings-rows { display: flex; flex-direction: column; }
.settings-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.settings-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.settings-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.settings-row:only-child  { border-radius: var(--radius); border-bottom: none; }
.settings-row-body { flex: 1; }
.settings-row-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.settings-row-value { font-size: 13px; color: var(--text-primary); word-break: break-word; }
.settings-row-action { flex-shrink: 0; }
.managed-label { font-size: 11px; color: var(--text-tertiary); }

/* -- Embed block -- */
.block-embed { margin-bottom: 24px; }
.embed-frame {
  width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border-subtle);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-surface);
  position: relative;
}
.embed-label { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.embed-frame iframe, .embed-frame img { width: 100%; height: 100%; object-fit: cover; border: none; }
.embed-frame .live-badge {
  position: absolute; bottom: 8px; right: 10px;
  background: var(--green-bg); color: var(--green-text);
  padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600;
}

/* -- Info / empty block -- */
.block-info {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 28px 24px; gap: 8px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); margin-bottom: 24px;
}
.block-info .info-icon { color: var(--text-tertiary); margin-bottom: 4px; }
.block-info .info-headline { font-size: 14px; font-weight: 500; }
.block-info .info-body { font-size: 13px; color: var(--text-secondary); max-width: 340px; }

/* -- Toggle switch -- */
.toggle {
  position: relative; width: 36px; height: 20px; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated); border-radius: var(--radius-pill);
  transition: background var(--transition);
}
.toggle input:checked ~ .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; transition: transform var(--transition);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* ============================================================
   OPERATOR HOME
   ============================================================ */

.attention-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.attention-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.attention-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.attention-row:only-child  { border-radius: var(--radius); border-bottom: none; }
.attention-row-body { flex: 1; }
.attention-row-name { font-size: 13px; font-weight: 500; }
.attention-row-desc { font-size: 12px; color: var(--text-secondary); }

.add-strip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
  margin-top: 14px; gap: 20px;
}
.add-strip-copy { }
.add-strip-copy .row-title { margin-bottom: 3px; }

/* ============================================================
   CLIENT LIST TABLE
   ============================================================ */

.client-table { width: 100%; border-collapse: collapse; }
.client-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-tertiary); padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.client-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); }
.client-table tr:last-child td { border-bottom: none; }
.client-table tbody tr { cursor: pointer; transition: background var(--transition); }
.client-table tbody tr:hover td { background: var(--bg-hover); }
.client-table td:last-child { text-align: right; }

.client-name  { font-size: 13px; font-weight: 500; }
.client-email { font-size: 11px; color: var(--text-tertiary); }
.service-icon-row { display: flex; gap: 4px; align-items: center; }
.service-icon-sm  { width: 16px; height: 16px; color: var(--text-tertiary); }

.table-controls {
  display: flex; gap: 10px; margin-bottom: 14px; align-items: center;
}
.search-input {
  flex: 1; padding: 7px 12px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-tertiary); }

.filter-select {
  padding: 7px 10px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }

.pagination-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; color: var(--text-tertiary); font-size: 12px;
}
.pagination-btns { display: flex; gap: 8px; }

/* ============================================================
   CATALOG
   ============================================================ */

.catalog-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-tertiary);
  margin: 20px 0 10px;
}
.catalog-card {
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); position: relative;
}
.catalog-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.catalog-card-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.catalog-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.catalog-card-action { margin-top: auto; }

/* ============================================================
   SLIDE-OVER
   ============================================================ */

#slideover-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.35);
}
#slideover-overlay.open { display: block; }

#slideover {
  position: fixed; top: 0; right: -100%; bottom: 0;
  width: min(56vw, 520px); background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg); z-index: 301;
  display: flex; flex-direction: column;
  transition: right 0.2s ease;
}
#slideover.open { right: 0; }

#slideover-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 2px;
  position: relative;
}
#slideover-service-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
#slideover-title { font-size: 17px; font-weight: 500; }
#slideover-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
}
#slideover-close:hover { background: var(--bg-hover); }

#slideover-body {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
#slideover-intro { font-size: 13px; color: var(--text-secondary); }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); }
.form-input {
  padding: 8px 12px; background: var(--bg-elevated);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-tertiary); }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-list-item {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.form-list-item .form-input { flex: 1; }
.form-list-del {
  background: none; border: none; color: var(--text-tertiary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
}
.form-list-del:hover { color: var(--red-text); }
.btn-add-another { background: none; border: none; color: var(--text-link); font-size: 13px; cursor: pointer; padding: 0; }
.btn-add-another:hover { text-decoration: underline; }

.help-note {
  display: flex; gap: 8px; padding: 10px 12px;
  background: var(--amber-bg); border-radius: var(--radius);
  border: 1px solid rgba(239,159,39,0.25); font-size: 12px; color: var(--amber-text);
}

#slideover-footer {
  padding: 14px 20px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

@media (max-width: 640px) {
  #slideover { width: 100%; }
}

/* ============================================================
   TOAST
   ============================================================ */

#toast-container {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-width: 400px; width: max-content;
  pointer-events: all; animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-msg { font-size: 13px; font-weight: 500; }
.toast-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-dismiss { background: none; border: none; color: var(--text-tertiary); cursor: pointer; flex-shrink: 0; padding: 1px; }

/* ============================================================
   ONBOARDING CHECKLIST
   ============================================================ */

.onboarding-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.onboarding-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.onboarding-item:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.onboarding-item:only-child  { border-radius: var(--radius); border-bottom: none; }

.onboarding-indicator {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--border-default); display: flex; align-items: center; justify-content: center;
}
.onboarding-indicator.done { background: var(--green-solid); border-color: var(--green-solid); }
.onboarding-item-body { flex: 1; }
.onboarding-item-label { font-size: 13px; font-weight: 500; }
.onboarding-item.done .onboarding-item-label { text-decoration: line-through; color: var(--text-tertiary); }
.onboarding-item-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   HOME PAGE SHARED
   ============================================================ */

.home-greeting { margin-bottom: 22px; }
.home-greeting .page-title { margin-bottom: 4px; }
.home-subhead { color: var(--text-secondary); font-size: 14px; }
.home-subhead .attention-count { color: var(--amber-text); font-weight: 500; }

.section-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-row .section-heading { }
.section-row-meta { font-size: 12px; color: var(--text-tertiary); }

.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }

.subscriptions-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface); cursor: pointer;
  transition: background var(--transition);
  text-decoration: none; color: inherit;
}
.subscriptions-list-row:hover { background: var(--bg-hover); }
.subscriptions-list-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.subscriptions-list-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.subscriptions-list-row:only-child  { border-radius: var(--radius); border-bottom: none; }

.expand-strip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
  gap: 16px; margin-top: 14px;
}

/* ============================================================
   MAINTENANCE PAGE
   ============================================================ */

.maintenance-page {
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--bg-base);
}
.maintenance-header {
  padding: 0 20px; height: 44px; display: flex; align-items: center;
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);
}
.maintenance-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 24px; text-align: center; gap: 10px;
}
.maintenance-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--amber-bg); display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; color: var(--amber-solid);
}
.maintenance-title { font-size: 24px; font-weight: 500; }
.maintenance-desc { font-size: 14px; color: var(--text-secondary); max-width: 440px; line-height: 1.6; }
.maintenance-time-box {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius); padding: 16px 24px; text-align: left;
  margin: 12px 0; min-width: 280px;
}
.maintenance-time-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.maintenance-time-value { font-size: 22px; font-weight: 500; margin: 4px 0 2px; }
.maintenance-time-rel { font-size: 12px; color: var(--text-secondary); }
.maintenance-divider { width: 100%; max-width: 400px; height: 1px; background: var(--border-subtle); margin: 8px 0; }
.maintenance-contact { font-size: 14px; color: var(--text-secondary); }
.maintenance-footer {
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-tertiary);
  background: var(--bg-surface);
}
.maintenance-footer .checking { display: flex; align-items: center; gap: 5px; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.profile-hero {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 28px; padding: 20px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-text);
  font-size: 22px; font-weight: 600; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; user-select: none;
}
.profile-hero-text { display: flex; flex-direction: column; gap: 3px; }
.profile-name  { font-size: 20px; font-weight: 500; line-height: 1.2; }
.profile-email { font-size: 13px; color: var(--text-secondary); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.profile-section-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ============================================================
   UTILITIES
   ============================================================ */

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-22 { margin-top: 22px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-22 { margin-bottom: 22px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.hidden { display: none !important; }

/* -- User management -- */
.user-list { display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface); flex-wrap: wrap;
}
.user-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.user-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.user-row:only-child  { border-radius: var(--radius); border-bottom: none; }
.user-row.user-disabled { opacity: 0.6; }
.user-row-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.user-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.avatar-circle.avatar-sm { width: 32px; height: 32px; font-size: 11px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  #sidebar { position: fixed; left: -220px; top: 0; bottom: 0; z-index: 150; transition: left 0.2s ease; }
  #sidebar.mobile-open { left: 0; }
  #body { overflow: visible; }
  #main { overflow-y: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .block-metrics { flex-direction: column; }
}
