/* CoreMDM Enterprise Console — enterprise.css
   White/light-grey surfaces · dark navy nav · blue accents */

/* ── Custom Properties ───────────────────────────────────────── */
:root {
  --nav-bg:          #142e40;
  --nav-text:        #c0d0db;
  --nav-text-hover:  #e2e8f0;
  --nav-active-text: #ffffff;
  --nav-active-bg:   #204c53;
  --nav-active-bar:  #6dd4ba;
  --nav-width:       224px;

  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e2e8f0;
  --border-mid:  #cbd5e1;

  --text:    #0f172a;
  --text-2:  #475569;
  --text-3:  #586b7e;

  --blue:        #2563eb;
  --blue-light:  #eff6ff;
  --blue-hover:  #1d4ed8;

  --green:   #16a34a;  --green-bg:   #f0fdf4;
  --amber:   #d97706;  --amber-bg:   #fffbeb;
  --red:     #dc2626;  --red-bg:     #fef2f2;
  --purple:  #7c3aed;  --purple-bg:  #f5f3ff;
  --teal:    #0891b2;  --teal-bg:    #ecfeff;
  --indigo:  #4f46e5;  --indigo-bg:  #eef2ff;
  --slate:   #475569;  --slate-bg:   #f8fafc;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
  --t:         140ms ease;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body.ent {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Auth Screen ─────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 82% 25%, #d5eee6, transparent 55%), #f4f8f9;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-bg { display: none; }
.auth-card {
  background: #fff;
  border: 1px solid #c9dada;
  border-radius: 16px;
  padding: 40px 44px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 18px 46px -24px #23545166;
}
.auth-card .btn-primary { background: #006b62; color: white; }
.auth-card .btn-primary:hover { background: #00574f; }
.auth-card :focus-visible { outline: 3px solid #0879b7; outline-offset: 3px; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-logo { width: 34px; height: auto; }
.auth-brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.4px; color: var(--text); }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; color: var(--text); }
.auth-subtitle { font-size: 13.5px; color: var(--text-2); margin-bottom: 24px; line-height: 1.5; }
.auth-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220,38,38,.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.auth-footer { margin-top: 16px; text-align: center; }
.auth-legal {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: var(--text-3);
}
.auth-legal a { color: var(--text-3); text-decoration: none; }
.auth-legal a:hover { color: var(--text-2); text-decoration: underline; }

/* ── App Layout ──────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--nav-width);
  background: var(--nav-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-logo { width: 26px; height: auto; }
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--nav-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--nav-text-hover); }
.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-left-color: var(--nav-active-bar);
  padding-left: 10px;
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 18px;
  line-height: 16px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.user-pill {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(59,130,246,.35);
  color: #93c5fd;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-email {
  font-size: 12px;
  color: var(--nav-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-signout {
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  color: var(--nav-text);
  font-size: 12.5px; font-weight: 500;
  transition: background var(--t), color var(--t);
  text-align: left;
}
.sidebar-signout:hover { background: rgba(255,255,255,.12); color: var(--nav-text-hover); }

/* ── Main Wrapper ────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.main-content {
  flex: 1;
  padding: 28px 32px 48px;
  max-width: 1200px;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.4px;
  margin-bottom: 2px;
}
.page-sub { font-size: 13.5px; color: var(--text-2); }
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--t), opacity var(--t);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary {
  background: var(--blue); color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }

.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }

.btn-danger {
  background: var(--red); color: #fff;
  border: 1px solid transparent;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-full { width: 100%; justify-content: center; padding: 10px 14px; font-size: 14.5px; }

.btn-icon {
  position: relative;
  padding: 7px 9px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}
.btn-icon:hover { background: var(--surface-2); }

.link-btn {
  background: none; border: none;
  color: var(--blue); font-size: 13.5px;
  cursor: pointer; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ── Form Elements ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-row   { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input::placeholder { color: var(--text-3); }

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  position: relative;
  overflow: hidden;
  outline: none;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--blue));
}
.stat-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
  border-color: var(--blue);
}

.stat-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 34px; font-weight: 700;
  letter-spacing: -1px; line-height: 1.1;
  color: var(--text);
}
.stat-sub {
  font-size: 12px; color: var(--text-3);
  margin-top: 5px;
}

.stat-card.stat-blue   { --stat-color: var(--blue);   }
.stat-card.stat-green  { --stat-color: var(--green);  }
.stat-card.stat-slate  { --stat-color: var(--slate);  }
.stat-card.stat-amber  { --stat-color: var(--amber);  }
.stat-card.stat-red    { --stat-color: var(--red);    }
.stat-card.stat-purple { --stat-color: var(--purple); }
.stat-card.stat-teal   { --stat-color: var(--teal);   }
.stat-card.stat-indigo { --stat-color: var(--indigo); }

/* loading shimmer */
.stat-card.loading .stat-value {
  display: inline-block;
  width: 60px; height: 34px;
  background: var(--border);
  border-radius: 4px; color: transparent;
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ── Notification badge on btn-icon ──────────────────────────── */
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── Tables ──────────────────────────────────────────────────── */
.ent-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ent-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ent-table thead { background: var(--surface-2); }
.ent-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ent-table th.sortable { cursor: pointer; user-select: none; }
.ent-table th.sortable:hover { color: var(--text-2); }
.ent-table td {
  padding: 11px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ent-table tr:last-child td { border-bottom: none; }
.ent-table tr:hover td { background: var(--surface-2); }
.ent-table tr.row-selected td { background: var(--blue-light); }
.ent-table td.text-muted { color: var(--text-3); }

/* ── Status pills ────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-online   { color: var(--green);  background: var(--green-bg); }
.status-offline  { color: var(--slate);  background: var(--slate-bg); }
.status-asleep   { color: var(--teal);   background: var(--teal-bg); }
.status-updating { color: var(--blue);   background: var(--blue-light); }
.status-error    { color: var(--red);    background: var(--red-bg); }
.status-warning  { color: var(--amber);  background: var(--amber-bg); }
.status-pending  { color: var(--purple); background: var(--purple-bg); }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius);
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Modal / Dialog ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
}
.modal-overlay[hidden] { display: none; }

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  max-height: 85vh;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  color: var(--text-2); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.modal-close:hover { background: var(--surface-2); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-body > p { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ── Panel list (customize modal) ────────────────────────────── */
.panel-list { display: flex; flex-direction: column; gap: 4px; }
.panel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: grab;
  transition: background var(--t), box-shadow var(--t);
  user-select: none;
}
.panel-item:active { cursor: grabbing; }
.panel-item:hover { background: var(--surface-2); }
.panel-item.dragging { opacity: .5; box-shadow: var(--shadow-lg); cursor: grabbing; }
.panel-item.drag-over { background: var(--blue-light); border-color: var(--blue); }
.panel-drag-handle { color: var(--text-3); font-size: 16px; cursor: grab; flex-shrink: 0; }
.panel-item-label { flex: 1; font-size: 13.5px; display: flex; align-items: center; gap: 8px; cursor: default; }
.panel-item input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--blue); flex-shrink: 0; cursor: pointer;
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text); color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-lg);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn .2s ease;
  max-width: 320px;
}
.toast.ok  { background: #166534; }
.toast.bad { background: #991b1b; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Section Heading ─────────────────────────────────────────── */
.section-heading {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3);
  padding: 6px 12px 4px;
  margin-top: 10px;
}

/* ── Utilities ───────────────────────────────────────────────── */
[hidden] { display: none !important; }
.text-muted     { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.font-mono      { font-family: var(--mono); }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-6  { margin-top: 24px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
}
.empty-state strong {
  display: block;
  font-size: 15px; color: var(--text-2);
  margin-bottom: 6px;
}

/* ── Page Toolbar (search + filter tabs) ─────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 240px;
}
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-icon svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  display: block;
}
.search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 13.5px; color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.search-input::placeholder { color: var(--text-3); }

.filter-tabs { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.filter-tab {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--t); cursor: pointer;
  white-space: nowrap;
}
.filter-tab:hover { background: var(--surface-2); color: var(--text); }
.filter-tab.active {
  background: var(--blue-light); color: var(--blue);
  border-color: rgba(37,99,235,.2);
}

/* ── Sort indicators ─────────────────────────────────────────── */
.ent-table th.sort-asc::after  { content: ' ↑'; font-size: 10px; }
.ent-table th.sort-desc::after { content: ' ↓'; font-size: 10px; }

/* ── Device table specific ───────────────────────────────────── */
.device-name  { font-size: 13.5px; font-weight: 500; }
.device-model { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.device-row { cursor: pointer; }
.device-row.selected td { background: var(--blue-light) !important; }
.row-check { accent-color: var(--blue); cursor: pointer; }

/* ── Row action buttons ──────────────────────────────────────── */
.row-actions-cell {
  white-space: nowrap;
}
.row-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-mid);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
  min-height: 32px;
}
.row-action-btn:hover {
  background: var(--blue-light);
  border-color: rgba(37,99,235,.3);
  color: var(--blue);
}
.row-action-btn.pending {
  background: var(--amber-bg);
  border-color: rgba(217,119,6,.3);
  color: var(--amber);
}
.row-action-btn + .row-action-btn {
  margin-left: 5px;
}
.row-action-open {
  background: var(--blue-light);
  border-color: rgba(37,99,235,.2);
  color: var(--blue);
}
.row-action-open:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.table-empty {
  padding: 48px 24px; text-align: center;
  color: var(--text-3); font-size: 14px;
}
.table-empty strong {
  display: block; color: var(--text-2);
  font-size: 15px; margin-bottom: 6px;
}

/* ── Detail Panel ────────────────────────────────────────────── */
.detail-backdrop {
  position: fixed; inset: 0;
  z-index: 149;
  background: rgba(0,0,0,.08);
}
.detail-backdrop[hidden] { display: none; }

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
  z-index: 150;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.detail-panel:not([hidden]) { animation: slideInRight .2s ease; }
@keyframes slideInRight {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-name { font-size: 16px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 5px; }
.detail-status-line { display: flex; align-items: center; gap: 8px; }
.detail-close {
  width: 28px; height: 28px;
  border-radius: var(--radius); color: var(--text-2);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background var(--t); flex-shrink: 0;
}
.detail-close:hover { background: var(--surface-2); }
.detail-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.detail-section { margin-bottom: 20px; }
.detail-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-3); margin-bottom: 10px;
}
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-info-label {
  font-size: 11px; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px;
}
.detail-info-value { font-size: 13.5px; color: var(--text); word-break: break-all; }

/* ── Command buttons (detail panel) ──────────────────────────── */
.cmd-grid-ent { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cmd-btn-ent {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500;
  text-align: left;
  border: 1px solid var(--border-mid);
  background: var(--surface-2); color: var(--text);
  transition: background var(--t), border-color var(--t), color var(--t);
  cursor: pointer; white-space: nowrap;
}
.cmd-btn-ent:hover:not(:disabled) { background: var(--blue-light); border-color: rgba(37,99,235,.3); color: var(--blue); }
.cmd-btn-ent:disabled { opacity: .5; cursor: default; }
.cmd-btn-ent.pending { background: var(--amber-bg); border-color: rgba(217,119,6,.3); color: var(--amber); }
.cmd-btn-ent.danger  { border-color: rgba(220,38,38,.25); color: var(--red); }
.cmd-btn-ent.danger:hover:not(:disabled) { background: var(--red-bg); border-color: rgba(220,38,38,.35); }

.msg-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.msg-form input, .msg-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text);
  background: var(--surface);
  outline: none; resize: vertical;
  transition: border-color var(--t);
}
.msg-form input:focus, .msg-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Chat page full-height overrides ─────────────────────────── */
body.ent.chat-page { overflow: hidden; }
body.ent.chat-page #app { height: 100vh; overflow: hidden; }
body.ent.chat-page .main-wrap { overflow: hidden; height: 100%; }

.chat-top-bar {
  padding: 18px 28px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.chat-top-bar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.chat-top-bar .page-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.tab-bar {
  display: flex; gap: 0;
  margin-bottom: -1px;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-count {
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Chat two-column layout ──────────────────────────────────── */
.chat-layout-body {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
}

/* ── Conversation list (left) ────────────────────────────────── */
.conv-panel {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.conv-search-bar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.conv-search-bar .search-input { font-size: 13px; padding: 6px 10px 6px 30px; }
.conv-list { flex: 1; overflow-y: auto; }

.conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  position: relative;
}
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--blue-light); }
.conv-item.unread .conv-name { font-weight: 600; }

.conv-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
}
.conv-dot.online  { background: var(--green); }
.conv-dot.asleep  { background: var(--teal); }
.conv-dot.offline { background: var(--border-mid); }

.conv-info { flex: 1; min-width: 0; }
.conv-name {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-preview {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
}

.conv-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-3); font-size: 13.5px;
}

/* ── Chat panel (right) ──────────────────────────────────────── */
.chat-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.chat-no-selection {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-3); text-align: center; gap: 8px;
  padding: 32px;
}
.chat-no-selection strong { font-size: 15px; color: var(--text-2); display: block; }
.chat-no-selection p { font-size: 13.5px; max-width: 260px; }

.chat-active-wrap {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.chat-active-header {
  padding: 13px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
}
.chat-active-name { font-size: 15px; font-weight: 600; }

/* Container where mountChat() renders */
#chat-thread {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ── Chat bubbles (from mountChat output) ────────────────────── */
.chat {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.chat-log {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.chat-msg { display: flex; flex-direction: column; margin-bottom: 8px; }
.chat-mine  { align-items: flex-end; }
.chat-theirs { align-items: flex-start; }
.chat-bubble {
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.45;
  max-width: 76%;
  white-space: pre-wrap; word-break: break-word;
}
.chat-mine .chat-bubble {
  background: var(--blue); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-theirs .chat-bubble {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-meta {
  font-size: 11px; color: var(--text-3);
  margin-top: 4px; padding: 0 2px;
}
.chat-tag { color: var(--blue); font-weight: 500; }
.chat-empty {
  text-align: center; padding: 32px 24px;
  color: var(--text-3); font-size: 13.5px;
}
.chat-send {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--surface);
}
.chat-send textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  font-size: 14px; color: var(--text);
  background: var(--surface-2);
  resize: none; outline: none;
  font-family: var(--font);
  transition: border-color var(--t), background var(--t);
  line-height: 1.45;
}
.chat-send textarea:focus {
  border-color: var(--blue); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.chat-send-row {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 8px; align-items: center;
}
/* Compatibility alias: chat.js uses .btn-pri */
.btn-pri {
  background: var(--blue); color: #fff;
  padding: 7px 18px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none;
  font-family: var(--font);
  transition: background var(--t);
}
.btn-pri:hover { background: var(--blue-hover); }
.chat-audience {
  font-family: var(--font);
  font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--surface);
  outline: none;
  cursor: pointer;
}

/* ── Notifications placeholder ───────────────────────────────── */
.notif-placeholder {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-3); text-align: center; gap: 8px;
  padding: 32px;
}
.notif-placeholder strong { font-size: 15px; color: var(--text-2); display: block; }
.notif-placeholder p { font-size: 13.5px; max-width: 320px; }

/* ── Content cards ───────────────────────────────────────────── */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.content-card-title {
  font-size: 14px; font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

/* ── Info / note card ────────────────────────────────────────── */
.info-card {
  background: var(--blue-light);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  font-size: 13.5px; color: var(--text-2);
  margin-bottom: 20px; line-height: 1.6;
}
.info-card strong { color: var(--blue); }

/* ── Numbered step list ──────────────────────────────────────── */
.step-list { counter-reset: step; padding: 0; list-style: none; }
.step-list li {
  counter-increment: step;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.6; color: var(--text-2);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(step);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.step-list b { color: var(--text); }
.step-list code {
  font-family: var(--mono); font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 4px; color: var(--text);
}

/* ── Command blocks ───────────────────────────────────────────── */
.cmd-block {
  display: flex; align-items: center; gap: 8px;
  background: #1e293b; color: #cbd5e1;
  padding: 9px 14px; border-radius: var(--radius);
  margin: 6px 0;
  overflow-x: auto;
}
.cmd-block code {
  flex: 1; font-family: var(--mono); font-size: 12.5px;
  color: #e2e8f0; background: none; border: none; padding: 0; white-space: nowrap;
}
.cmd-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,.1); color: #94a3b8;
  border: none; border-radius: 4px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t), color var(--t);
  font-family: var(--font);
}
.cmd-copy:hover { background: rgba(255,255,255,.2); color: #fff; }
.cmd-copy.copied { color: #4ade80 !important; }
.cmd-note {
  font-size: 12px; color: var(--text-3);
  margin: -2px 0 10px; padding: 0 2px; line-height: 1.5;
}

/* ── QR display ──────────────────────────────────────────────── */
.qr-display {
  text-align: center; padding: 16px 0;
}
.qr-display svg { max-width: 200px; border-radius: var(--radius); }
.qr-display p { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }

/* ── Token reveal box ────────────────────────────────────────── */
.token-reveal {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-top: 12px;
}
.token-reveal-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3); margin-bottom: 6px;
}
.token-value {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--text); letter-spacing: 1px; word-break: break-all;
}
.token-expiry { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── Status badge variants ───────────────────────────────────── */
.badge-PENDING  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(217,119,6,.25); }
.badge-ENROLLED { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(22,163,74,.25);  }
.badge-BLOCKED  { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(220,38,38,.25);  }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle-switch {
  position: relative; display: inline-block;
  width: 36px; height: 20px; flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--border); cursor: pointer;
  transition: background var(--t);
}
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-switch input:disabled + .toggle-track { opacity: .5; cursor: default; }
.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--blue); outline-offset: 2px;
}

/* ── Setting rows ────────────────────────────────────────────── */
.setting-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row-info { flex: 1; min-width: 0; }
.setting-row-label { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.setting-row-sub   { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 2px; }
.setting-row-warn  { font-size: 12px; color: var(--amber); line-height: 1.5; margin-top: 4px; }

/* Section enabled badge */
.section-badge {
  font-size: 11px; font-weight: 600;
  background: var(--blue-light); color: var(--blue);
  padding: 2px 8px; border-radius: 999px;
  margin-left: auto;
}
.section-badge.none { background: var(--surface-2); color: var(--text-3); }

/* ── Bulk action bar ─────────────────────────────────────────── */
.bulk-bar {
  position: sticky; top: 12px; z-index: 100;
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-lg);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  transform: translateY(-6px); opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.bulk-bar.visible { transform: translateY(0); opacity: 1; pointer-events: all; }
.bulk-bar-count {
  font-size: 13.5px; font-weight: 700; white-space: nowrap; margin-right: 4px;
}
.bulk-sep { width: 1px; height: 18px; background: rgba(255,255,255,.2); flex-shrink: 0; }
.bulk-btn {
  background: rgba(255,255,255,.1); color: #fff;
  border: none; border-radius: 6px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t);
  font-family: var(--font);
}
.bulk-btn:hover { background: rgba(255,255,255,.2); }
.bulk-btn:disabled { opacity: .45; cursor: default; }
.bulk-btn.danger { background: rgba(220,38,38,.35); }
.bulk-btn.danger:hover { background: rgba(220,38,38,.55); }
.bulk-clear {
  margin-left: auto; color: rgba(255,255,255,.55);
  font-size: 12px; cursor: pointer; background: none; border: none;
  font-family: var(--font); padding: 4px 8px; border-radius: 4px;
  transition: color var(--t);
}
.bulk-clear:hover { color: #fff; }

/* Result badges in bulk table */
.result-ok  { font-size: 11.5px; font-weight: 600; color: var(--green); }
.result-err { font-size: 11.5px; font-weight: 600; color: var(--red);   }
.result-sent{ font-size: 11.5px; font-weight: 500; color: var(--text-3);}

/* ── Mobile top bar (injected by renderNav) ─────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--nav-bg);
  position: sticky; top: 0; z-index: 110;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.mobile-topbar-brand { display: flex; align-items: center; gap: 8px; }
.mobile-topbar-brand img  { width: 22px; height: auto; }
.mobile-topbar-brand-name { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.mobile-menu-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--nav-text);
  background: none; border: none; cursor: pointer;
  transition: background var(--t);
}
.mobile-menu-btn:hover { background: rgba(255,255,255,.1); }
.mobile-menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

/* ── Notifications tab ───────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 8px; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
}
.notif-item:hover, .notif-item:focus-visible {
  border-color: var(--border-mid); box-shadow: var(--shadow); outline: none;
}
.notif-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.type-message .notif-icon { background: var(--blue-light); color: var(--blue); }
.type-offline  .notif-icon { background: var(--slate-bg);  color: var(--slate); }
.type-inactive .notif-icon { background: var(--amber-bg);  color: var(--amber); }

.notif-info { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.notif-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.notif-all-clear {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 56px 32px; text-align: center; color: var(--text-3);
}
.notif-all-clear strong { font-size: 15px; color: var(--text-2); display: block; }
.notif-all-clear p { font-size: 13.5px; max-width: 280px; }

/* ── Policy groups (device detail panel) ─────────────────────── */
.pol-group { border-bottom: 1px solid var(--border); }
.pol-group:last-of-type { border-bottom: none; }
.pol-group > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 0;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3);
  user-select: none;
}
.pol-group > summary::-webkit-details-marker { display: none; }
.pol-group > summary::after {
  content: '›'; font-size: 14px; font-weight: 400; color: var(--text-3);
  display: inline-block; transition: transform var(--t); flex-shrink: 0;
}
.pol-group[open] > summary::after { transform: rotate(90deg); }
.pol-group > summary .section-badge { margin-left: auto; font-size: 10px; }
.pol-group-body { padding-bottom: 6px; }

.detail-pol-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-pol-row:last-child { border-bottom: none; }
.detail-pol-label { font-size: 12.5px; color: var(--text); line-height: 1.3; flex: 1; min-width: 0; }

/* ── Quick Actions ───────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-action-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  cursor: pointer;
}
.quick-action-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
  transform: translateY(-1px);
  color: var(--blue);
}
.qa-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--blue-light); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.qa-icon svg {
  width: 16px; height: 16px; fill: none; stroke: var(--blue);
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.qa-label { flex: 1; }
.qa-arrow { color: var(--text-3); font-size: 18px; line-height: 1; }

/* ── Section row (heading + action link) ─────────────────────── */
.section-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-heading-lg {
  font-size: 15px; font-weight: 700; letter-spacing: -.2px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 20px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px)  {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 28px 24px 24px; }
  .main-content { padding: 16px; }
}
@media (max-width: 540px)  {
  .sidebar { transform: translateX(-224px); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
  .sidebar-overlay.visible { display: block; }
  .mobile-topbar { display: flex; }
}

/* Shared page rhythm across the signed-in workspaces. */
.page-header {
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  letter-spacing: -.035em;
}
.content-card,
.ent-table-wrap {
  border-radius: 12px;
}
.sidebar-nav :is(a, button):focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: -3px;
}
.security-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.security-page .sidebar-signout,
.security-page .mobile-menu-btn {
  background: transparent;
  color: var(--nav-text-hover);
  border: 0;
}
.security-page dialog {
  margin: auto;
}

body.organizations-page.management-signed-in > :is(.bg, .nav),
.organizations-page.management-signed-in .console-main > .foot,
.organizations-page.management-signed-in [data-signout],
.organizations-page:not(.management-signed-in) .mobile-topbar,
.security-page #security-shell:not(.main-wrap) .mobile-topbar {
  display: none;
}
body.organizations-page.management-signed-in {
  background: var(--bg);
}
.organizations-page.management-signed-in .console-main {
  width: auto;
  max-width: none;
  padding: 0 clamp(16px, 3vw, 40px) 32px;
}
