/* ============================================================
   X-Stack — System X I.T. MSP Platform
   Liquid Glass Redesign — drop-in replacement for styles.css
   Same selectors & variables as v1; no HTML/JS changes needed.
   Themes: dark (default) → arctic → ember → ocean
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --sidebar-w: 232px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 54px;
  --frame-gap: 14px;

  /* Glass tokens */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  --glass-blur: blur(24px) saturate(1.4);
  /* Opaque-ish glass for overlays (dropdowns, modals, pickers) */
  --glass-solid: rgba(21, 25, 40, 0.88);
  --glass-solid-border: rgba(255, 255, 255, 0.14);

  --sidebar-bg: var(--glass-bg);

  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);

  --text-primary: #f0f2f8;
  --text-secondary: rgba(235, 238, 248, 0.65);
  --text-muted: rgba(235, 238, 248, 0.45);
  --text-inverse: #0a0c14;

  --accent: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.18);
  --accent-hover: #4f46e5;

  --green: #4ade80;
  --green-bg: rgba(34, 197, 94, 0.14);
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --red: #f87171;
  --red-bg: rgba(239, 68, 68, 0.14);
  --blue: #60a5fa;
  --blue-bg: rgba(59, 130, 246, 0.15);

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.08);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.09);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.10);

  --transition: 0.15s ease;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 900px 600px at 8% -12%, rgba(99, 102, 241, 0.30), transparent 62%),
    radial-gradient(ellipse 800px 560px at 98% 10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(ellipse 1000px 640px at 45% 115%, rgba(34, 197, 94, 0.16), transparent 60%),
    #0a0c14;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
select { color-scheme: dark; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

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

/* ── Sidebar — floating glass panel ─────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), var(--glass-inset);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--frame-gap);
  left: var(--frame-gap);
  bottom: var(--frame-gap);
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
}

.sx-logo-svg { width: 44px; height: 44px; flex-shrink: 0; }
.sx-logo-img { height: 52px; width: auto; object-fit: contain; }
.brand-logo { display: none; }

.brand-text { display: flex; flex-direction: column; overflow: hidden; }

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Client switcher — inner glass chip */
.client-switcher {
  margin: 12px 12px 0;
  background: var(--glass-bg);
  border-radius: 12px;
  padding: 9px 11px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset);
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-switcher:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-strong);
}

.client-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.client-switcher-info { flex: 1; min-width: 0; overflow: hidden; }

.client-switcher-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.client-switcher-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-switcher-chevron { color: var(--text-muted); flex-shrink: 0; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-section { margin-bottom: 18px; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.nav-item:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

/* Active = raised glass pill */
.nav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.07));
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 10px rgba(0,0,0,0.30);
}

.nav-item.active::before { content: none; }

.nav-item-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-item-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 12px 14px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.powered-by { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }

.powered-by-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.powered-by-text {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Main content area ───────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: calc(var(--sidebar-w) + var(--frame-gap) * 2);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 var(--frame-gap);
  transition: margin-left var(--transition);
}

/* ── Topbar — floating glass bar ─────────────────────────── */
.topbar {
  height: var(--topbar-h);
  margin-top: var(--frame-gap);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30), var(--glass-inset);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  gap: 16px;
  position: sticky;
  top: var(--frame-gap);
  z-index: 50;
  flex-shrink: 0;
}

.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar-breadcrumb .crumb-root { color: var(--text-muted); }
.topbar-breadcrumb .crumb-sep  { color: var(--text-muted); opacity: 0.5; }
.topbar-breadcrumb .crumb-current { color: var(--text-primary); font-weight: 600; }

.topbar-centre { display: flex; align-items: center; justify-content: center; }

.topbar-wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  background: linear-gradient(90deg, #4ade80, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.topbar-sx-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sx-topbar-logo { width: 32px; height: 32px; flex-shrink: 0; }

.topbar-sx-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  opacity: 0.75;
}

.topbar-platform-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.topbar-platform-badge.m365   { background: var(--blue-bg); color: var(--blue); border-color: rgba(59,130,246,0.3); }
.topbar-platform-badge.google { background: var(--red-bg);  color: var(--red);  border-color: rgba(239,68,68,0.3); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.topbar-user:hover { background: var(--glass-bg-hover); border-color: var(--glass-border); }

.topbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.topbar-role-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.topbar-role-badge[data-role="msp_admin"]   { background: rgba(99,102,241,0.20); color: #a5b4fc; }
.topbar-role-badge[data-role="msp_analyst"] { background: rgba(129,140,248,0.18); color: #c7d2fe; }
.topbar-role-badge[data-role="client_admin"]{ background: rgba(34,197,94,0.18); color: #86efac; }
.topbar-role-badge[data-role="client_read"] { background: rgba(251,146,60,0.18); color: #fdba74; }
.topbar-role-badge[data-role="demo"]        { background: rgba(192,132,252,0.18); color: #d8b4fe; }

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.topbar-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* ── User dropdown menu ──────────────────────────────────── */
.user-menu-wrapper { position: relative; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--glass-solid);
  border: 1px solid var(--glass-solid-border);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  min-width: 210px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.user-dropdown.open { display: block; }

.user-dropdown-header { padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
.user-dropdown-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.user-dropdown-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.user-dropdown-item:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.10); }

.user-dropdown-divider { height: 1px; background: var(--glass-border); margin: 4px 0; }

/* ── Page content ────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 22px 10px 24px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ── Cards — glass panels ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ── Software-stack chart cards — expand-on-hover reveal ─── */
/* The donut + its centre figures are always visible. The legend/stats
   on the right stay hidden until the card is expanded, then flow in. */
.chart-card.expanded { box-shadow: var(--shadow); z-index: 1; }

.chart-legend {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.chart-card.expanded .chart-legend {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Each row fades + rises into place; per-row transition-delay (set inline)
   staggers them for a smooth flowing reveal rather than a hard pop. */
.chart-legend-row {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.chart-card.expanded .chart-legend-row {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .chart-legend, .chart-legend-row { transition-duration: 0.001s; transform: none; }
}

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.stat-card-link { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, background 0.15s; }

.stat-card-link:hover {
  border-color: rgba(165, 180, 252, 0.45);
  background: var(--glass-bg-hover);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(165,180,252,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.stat-card-link:active { transform: translateY(0); }

.card.stat-card-link { transform: none; }

.card.stat-card-link:hover {
  transform: none;
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(165,180,252,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}

.stat-arrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.stat-card-link:hover .stat-arrow { opacity: 1; transform: translateX(2px); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(180deg, #6d70f3, #5457ea);
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.40), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #7a7df5, #6366f1);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border-color: var(--glass-border);
  box-shadow: var(--glass-inset);
}
.btn-secondary:hover { background: var(--glass-bg-hover); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--glass-bg-hover); color: var(--text-primary); }

.btn-danger {
  background: linear-gradient(180deg, #f0524a, #dc3d35);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-danger:hover { background: linear-gradient(180deg, #f3655e, #e8483f); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm svg { width: 12px; height: 12px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger-ghost { color: var(--text-muted); }
.btn-danger-ghost:hover { background: rgba(239, 68, 68, 0.12); color: var(--red); }

/* ── Badges / Tags ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-green { background: var(--green-bg); color: var(--green); border-color: rgba(34,197,94,0.30); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border-color: rgba(245,158,11,0.30); }
.badge-red   { background: var(--red-bg);   color: var(--red);   border-color: rgba(239,68,68,0.30); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue);  border-color: rgba(59,130,246,0.30); }
.badge-grey  { background: var(--surface-3); color: var(--text-secondary); border-color: var(--glass-border); }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--glass-bg-hover); }

tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--red); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.20);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
}

/* ── Native <select> option popups ────────────────────────────
   The browser draws the <option> list itself and ignores our
   translucent theme variables (and, on some Windows/Chrome builds,
   `color-scheme`), so the list can render as unreadable grey. Give
   options SOLID, theme-correct colours so every theme is legible. */
select option,
.form-select option {
  background-color: #151a29;   /* solid dark — default / dark theme */
  color: #f0f2f8;
}
body[data-theme="ember"] select option,
body[data-theme="ember"] .form-select option {
  background-color: #1c140c;   /* warm dark */
  color: #f5ead8;
}
body[data-theme="ocean"] select option,
body[data-theme="ocean"] .form-select option {
  background-color: #08151e;   /* teal dark */
  color: #e2f6f8;
}
body[data-theme="arctic"] select option,
body[data-theme="arctic"] .form-select option {
  background-color: #ffffff;   /* light theme */
  color: #1e2846;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.20), inset 0 1px 3px rgba(0,0,0,0.2);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 14, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--glass-solid);
  border: 1px solid var(--glass-solid-border);
  border-radius: 18px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 1240px; }

.modal-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover { background: var(--glass-bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Client selector dropdown ────────────────────────────── */
.client-picker-overlay { position: fixed; inset: 0; z-index: 200; display: none; }
.client-picker-overlay.open { display: block; }

.client-picker {
  position: fixed;
  left: 22px;
  top: 118px;
  width: 240px;
  background: var(--glass-solid);
  border: 1px solid var(--glass-solid-border);
  border-radius: 16px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  overflow: hidden;
}

.client-picker-header {
  padding: 10px 12px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}

.client-picker-search { padding: 8px 12px; border-bottom: 1px solid var(--glass-border); }

.client-picker-search input {
  width: 100%;
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.client-picker-search input::placeholder { color: var(--text-muted); }
.client-picker-search input:focus { border-color: var(--accent); }

.client-picker-list { max-height: 280px; overflow-y: auto; padding: 6px; }

.client-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--transition);
}

.client-picker-item:hover  { background: var(--glass-bg-hover); }
.client-picker-item.active { background: var(--accent-light); }

.client-picker-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-picker-item-platform { font-size: 10px; color: var(--text-muted); }

.client-picker-footer { padding: 6px; border-top: 1px solid var(--glass-border); }

.client-picker-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 9px;
  cursor: pointer;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition);
}

.client-picker-add:hover { background: var(--accent-light); }

.msp-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.msp-mode-btn:hover { background: var(--glass-bg-hover); color: var(--text-primary); }

/* ── App icon / vendor logo ──────────────────────────────── */
.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-secondary);
  box-shadow: var(--glass-inset);
}

.app-icon.microsoft { background: var(--blue-bg); }
.app-icon.adobe     { background: var(--red-bg);  }
.app-icon.google    { background: var(--red-bg);  }
.app-icon.slack     { background: var(--surface-3); border: 1px solid var(--glass-border); }
.app-icon.generic   { background: var(--surface-3); }

/* ── Licence bar ─────────────────────────────────────────── */
.licence-bar-wrap { display: flex; align-items: center; gap: 8px; }

.licence-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.licence-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.40);
  transition: width 0.3s ease;
}

.licence-bar-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.licence-bar-fill.danger  { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.licence-bar-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Status dots ─────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active   { background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.status-dot.warning  { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.status-dot.danger   { background: var(--red);   box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.status-dot.inactive { background: var(--border-strong); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: none;
  margin-bottom: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  box-shadow: var(--glass-inset);
}

.tab-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: none;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  margin-bottom: 0;
}

.tab-btn:hover { color: var(--text-primary); background: var(--glass-bg-hover); }

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: transparent;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 8px rgba(0,0,0,0.25);
}

/* ── Client card (grid) ──────────────────────────────────── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.client-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--client-colour, var(--accent));
  opacity: 0.9;
}

.client-card:hover {
  border-color: rgba(165, 180, 252, 0.45);
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.client-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.client-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 8px rgba(0,0,0,0.25);
}

.client-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.client-card-domain { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.client-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.client-stat {
  text-align: center;
  padding: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  box-shadow: var(--glass-inset);
}

.client-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}

.client-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.client-card-footer { display: flex; align-items: center; justify-content: space-between; }

/* ── Org chart ───────────────────────────────────────────── */
.org-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.org-dept-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}

.org-dept-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }

.org-dept-count {
  font-size: 24px;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: -0.5px;
}

.org-dept-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ── Alert banner ────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-inset);
}

.alert-banner.warning { background: var(--amber-bg); border: 1px solid rgba(245, 158, 11, 0.35); color: var(--amber); }
.alert-banner.danger  { background: var(--red-bg);   border: 1px solid rgba(239, 68, 68, 0.35);  color: var(--red); }
.alert-banner.info    { background: var(--blue-bg);  border: 1px solid rgba(59, 130, 246, 0.35); color: var(--blue); }

/* ── Audit log ───────────────────────────────────────────── */
.audit-entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
}

.audit-entry:last-child { border-bottom: none; }

.audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.55);
  margin-top: 5px;
  flex-shrink: 0;
}

.audit-action { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.audit-detail { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.audit-meta   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--glass-solid);
  border: 1px solid var(--glass-solid-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: #f0f2f8;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastIn 0.2s ease;
  max-width: 320px;
}

.toast.success { background: rgba(6, 118, 71, 0.85);  border-color: rgba(74, 222, 128, 0.35); }
.toast.error   { background: rgba(190, 40, 40, 0.85); border-color: rgba(248, 113, 113, 0.35); }
.toast.warning { background: rgba(181, 71, 8, 0.85);  border-color: rgba(251, 191, 36, 0.35); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  width: 200px;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* ── Colour picker swatch ────────────────────────────────── */
.colour-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.colour-swatch {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform var(--transition), border-color var(--transition);
}

.colour-swatch:hover { transform: scale(1.1); }
.colour-swatch.selected { border-color: var(--text-primary); }

/* ── Platform icons ──────────────────────────────────────── */
.platform-icon { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }

/* ── Sync status ─────────────────────────────────────────── */
.sync-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }

.sync-dot { width: 6px; height: 6px; border-radius: 50%; }
.sync-dot.live   { background: var(--green); box-shadow: 0 0 6px rgba(74, 222, 128, 0.6); }
.sync-dot.manual { background: var(--border-strong); }

/* ── Cost display ────────────────────────────────────────── */
.cost-display { font-variant-numeric: tabular-nums; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utility classes ─────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--glass-border); margin: 16px 0; }

/* ══════════════════════════════════════════════════════════
   THEME SYSTEM — 4 colour schemes
   Toggle cycles: dark → arctic → ember → ocean → dark
   dark   = Liquid Glass (indigo/violet/green glow)
   arctic = Liquid Glass Light (frosted white)
   ember  = Liquid Glass (amber glow)
   ocean  = Liquid Glass (teal glow)
   ══════════════════════════════════════════════════════════ */

/* ── Theme toggle button (all themes) ───────────────────── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ── Theme swatch picker (Settings → Platform Theme) ─────── */
.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-swatch { cursor: pointer; width: 88px; }
.theme-swatch-frame { display: flex; height: 54px; border-radius: 7px; overflow: hidden; border: 2px solid var(--border); transition: border-color 0.15s; }
.theme-swatch:hover .theme-swatch-frame { border-color: var(--border-strong); }
.theme-swatch-label { font-size: 11px; font-weight: 600; margin-top: 5px; text-align: center; color: var(--text-secondary); }
.theme-swatch-active .theme-swatch-frame { border-color: var(--accent); }
.theme-swatch-active .theme-swatch-label { color: var(--accent); }

/* ── ARCTIC — Liquid Glass Light ─────────────────────────── */
body[data-theme="arctic"] {
  background:
    radial-gradient(ellipse 900px 600px at 8% -12%, rgba(99, 102, 241, 0.22), transparent 62%),
    radial-gradient(ellipse 800px 560px at 98% 10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(ellipse 1000px 640px at 45% 115%, rgba(34, 197, 94, 0.16), transparent 60%),
    #e3e7f0;
  background-attachment: fixed;
  color: #1c2333;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --glass-blur: blur(24px) saturate(1.3);
  --glass-solid: rgba(255, 255, 255, 0.90);
  --glass-solid-border: rgba(255, 255, 255, 0.95);

  --sidebar-bg: var(--glass-bg);

  --surface: rgba(255, 255, 255, 0.60);
  --surface-2: rgba(255, 255, 255, 0.45);
  --surface-3: rgba(255, 255, 255, 0.70);
  --border: rgba(30, 40, 70, 0.12);
  --border-strong: rgba(30, 40, 70, 0.22);

  --text-primary: #1c2333;
  --text-secondary: rgba(30, 40, 70, 0.68);
  --text-muted: rgba(30, 40, 70, 0.48);
  --text-inverse: #ffffff;

  --accent: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.14);
  --accent-hover: #4f46e5;

  --green: #16a34a;
  --green-bg: rgba(34, 197, 94, 0.12);
  --amber: #d97706;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --red: #dc2626;
  --red-bg: rgba(239, 68, 68, 0.10);
  --blue: #2563eb;
  --blue-bg: rgba(59, 130, 246, 0.12);

  --shadow-sm: 0 4px 16px rgba(40, 50, 90, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  --shadow: 0 8px 24px rgba(40, 50, 90, 0.12), inset 0 1px 0 rgba(255,255,255,0.9);
  --shadow-lg: 0 16px 48px rgba(40, 50, 90, 0.18), inset 0 1px 0 rgba(255,255,255,0.95);
}

body[data-theme="arctic"] .sidebar,
body[data-theme="arctic"] .topbar {
  box-shadow: 0 8px 28px rgba(40, 50, 90, 0.12), var(--glass-inset);
}

/* Sidebar text — the shell hardcodes white; flip to ink (incl. inline styles) */
body[data-theme="arctic"] .sidebar-brand span { color: rgba(30, 40, 70, 0.55) !important; }
body[data-theme="arctic"] .sidebar-footer > div:last-child { color: rgba(30, 40, 70, 0.38) !important; }

body[data-theme="arctic"] .nav-item { color: var(--text-secondary); }
body[data-theme="arctic"] .nav-item:hover { background: rgba(255, 255, 255, 0.70); color: var(--text-primary); }
body[data-theme="arctic"] .nav-item.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(40, 50, 90, 0.14), inset 0 1px 0 #ffffff;
}
body[data-theme="arctic"] .nav-item.active .nav-item-icon { color: var(--accent); }

body[data-theme="arctic"] .nav-badge { box-shadow: none; background: #ef4444; }
body[data-theme="arctic"] .powered-by-dot { box-shadow: none; }

body[data-theme="arctic"] .topbar-wordmark {
  background: linear-gradient(90deg, #16a34a, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-theme="arctic"] .topbar-role-badge[data-role="msp_admin"]    { background: rgba(99,102,241,0.13); color: #4f46e5; }
body[data-theme="arctic"] .topbar-role-badge[data-role="msp_analyst"]  { background: rgba(67,56,202,0.10); color: #4338ca; }
body[data-theme="arctic"] .topbar-role-badge[data-role="client_admin"] { background: rgba(21,128,61,0.10); color: #15803d; }
body[data-theme="arctic"] .topbar-role-badge[data-role="client_read"]  { background: rgba(194,65,12,0.10); color: #c2410c; }
body[data-theme="arctic"] .topbar-role-badge[data-role="demo"]         { background: rgba(126,34,206,0.10); color: #7e22ce; }

body[data-theme="arctic"] .topbar-sx-label { color: var(--text-primary); }

body[data-theme="arctic"] thead th { background: rgba(255, 255, 255, 0.40); }
body[data-theme="arctic"] tbody tr { border-bottom-color: rgba(30, 40, 70, 0.08); }
body[data-theme="arctic"] tbody tr:hover { background: rgba(255, 255, 255, 0.55); }

body[data-theme="arctic"] .form-input,
body[data-theme="arctic"] .form-select,
body[data-theme="arctic"] .form-textarea,
body[data-theme="arctic"] select {
  color-scheme: light;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 3px rgba(40, 50, 90, 0.06);
}

body[data-theme="arctic"] .client-picker-search input { background: rgba(255, 255, 255, 0.75); }

body[data-theme="arctic"] .badge-green { border-color: rgba(34,197,94,0.25); }
body[data-theme="arctic"] .badge-amber { border-color: rgba(245,158,11,0.25); }
body[data-theme="arctic"] .badge-red   { border-color: rgba(239,68,68,0.25); }
body[data-theme="arctic"] .badge-blue  { border-color: rgba(59,130,246,0.25); }

body[data-theme="arctic"] .alert-banner.warning { border-color: rgba(217, 119, 6, 0.30); color: #92400e; }
body[data-theme="arctic"] .alert-banner.danger  { border-color: rgba(220, 38, 38, 0.30); color: #991b1b; }
body[data-theme="arctic"] .alert-banner.info    { border-color: rgba(37, 99, 235, 0.30); color: #1e40af; }

body[data-theme="arctic"] .status-dot.active,
body[data-theme="arctic"] .status-dot.warning,
body[data-theme="arctic"] .status-dot.danger,
body[data-theme="arctic"] .sync-dot.live,
body[data-theme="arctic"] .audit-dot,
body[data-theme="arctic"] .licence-bar-fill { box-shadow: none; }

body[data-theme="arctic"] .licence-bar { background: rgba(30, 40, 70, 0.10); box-shadow: none; }

body[data-theme="arctic"] .topbar-platform-badge.m365   { background: rgba(37,99,235,0.10); color: #1d4ed8; border-color: rgba(37,99,235,0.22); }
body[data-theme="arctic"] .topbar-platform-badge.google { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.20); }

body[data-theme="arctic"] .toast { color: #ffffff; }

body[data-theme="arctic"] ::-webkit-scrollbar-thumb { background: rgba(30, 40, 70, 0.25); }

body[data-theme="arctic"] .modal-overlay { background: rgba(30, 40, 70, 0.25); }

/* ── EMBER — Liquid Glass, amber glow ────────────────────── */
body[data-theme="ember"] {
  background:
    radial-gradient(ellipse 900px 600px at 8% -12%, rgba(245, 158, 11, 0.24), transparent 62%),
    radial-gradient(ellipse 800px 560px at 98% 10%, rgba(239, 68, 68, 0.16), transparent 60%),
    radial-gradient(ellipse 1000px 640px at 45% 115%, rgba(217, 119, 6, 0.14), transparent 60%),
    #120d08;
  background-attachment: fixed;

  --accent: #f59e0b;
  --accent-light: rgba(245, 158, 11, 0.16);
  --accent-hover: #d97706;

  --text-primary: #f5ead8;
  --text-secondary: rgba(240, 228, 204, 0.65);
  --text-muted: rgba(240, 228, 204, 0.45);
}

body[data-theme="ember"] .topbar-wordmark {
  background: linear-gradient(90deg, #fbbf24, #fb923c, #f87171);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-theme="ember"] .btn-primary {
  background: linear-gradient(180deg, #f6a623, #e08c06);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.40), inset 0 1px 0 rgba(255,255,255,0.25);
}
body[data-theme="ember"] .btn-primary:hover {
  background: linear-gradient(180deg, #f8b13d, #f59e0b);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}

body[data-theme="ember"] .audit-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.55); }
body[data-theme="ember"] .topbar-avatar { background: linear-gradient(135deg, #f59e0b, #ef4444); }
body[data-theme="ember"] .org-dept-count { color: #fcd34d; }
body[data-theme="ember"] .client-picker-add { color: #fcd34d; }

body[data-theme="ember"] .topbar-role-badge[data-role="msp_admin"]    { background: rgba(245,158,11,0.18); color: #fcd34d; }
body[data-theme="ember"] .topbar-role-badge[data-role="msp_analyst"]  { background: rgba(251,191,36,0.14); color: #fde68a; }
body[data-theme="ember"] .topbar-role-badge[data-role="client_admin"] { background: rgba(163,230,53,0.14); color: #bef264; }
body[data-theme="ember"] .topbar-role-badge[data-role="client_read"]  { background: rgba(251,146,60,0.16); color: #fdba74; }
body[data-theme="ember"] .topbar-role-badge[data-role="demo"]         { background: rgba(252,211,77,0.14); color: #fde68a; }

body[data-theme="ember"] .form-input:focus,
body[data-theme="ember"] .form-select:focus,
body[data-theme="ember"] .form-textarea:focus { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.20), inset 0 1px 3px rgba(0,0,0,0.2); }
body[data-theme="ember"] .search-bar:focus-within { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }

/* ── OCEAN — Liquid Glass, teal glow ─────────────────────── */
body[data-theme="ocean"] {
  background:
    radial-gradient(ellipse 900px 600px at 8% -12%, rgba(20, 184, 166, 0.24), transparent 62%),
    radial-gradient(ellipse 800px 560px at 98% 10%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(ellipse 1000px 640px at 45% 115%, rgba(99, 102, 241, 0.16), transparent 60%),
    #06121a;
  background-attachment: fixed;

  --accent: #14b8a6;
  --accent-light: rgba(20, 184, 166, 0.16);
  --accent-hover: #0d9488;

  --text-primary: #e2f6f8;
  --text-secondary: rgba(214, 240, 244, 0.65);
  --text-muted: rgba(214, 240, 244, 0.45);
}

body[data-theme="ocean"] .topbar-wordmark {
  background: linear-gradient(90deg, #2dd4bf, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-theme="ocean"] .btn-primary {
  background: linear-gradient(180deg, #1cc8b5, #0fa896);
  box-shadow: 0 2px 12px rgba(20, 184, 166, 0.40), inset 0 1px 0 rgba(255,255,255,0.25);
}
body[data-theme="ocean"] .btn-primary:hover {
  background: linear-gradient(180deg, #2fd8c5, #14b8a6);
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}

body[data-theme="ocean"] .audit-dot { background: #14b8a6; box-shadow: 0 0 8px rgba(20, 184, 166, 0.55); }
body[data-theme="ocean"] .topbar-avatar { background: linear-gradient(135deg, #14b8a6, #38bdf8); }
body[data-theme="ocean"] .org-dept-count { color: #5eead4; }
body[data-theme="ocean"] .client-picker-add { color: #5eead4; }

body[data-theme="ocean"] .topbar-role-badge[data-role="msp_admin"]    { background: rgba(20,184,166,0.18); color: #5eead4; }
body[data-theme="ocean"] .topbar-role-badge[data-role="msp_analyst"]  { background: rgba(56,189,248,0.16); color: #7dd3fc; }
body[data-theme="ocean"] .topbar-role-badge[data-role="client_admin"] { background: rgba(74,222,128,0.14); color: #86efac; }
body[data-theme="ocean"] .topbar-role-badge[data-role="client_read"]  { background: rgba(251,146,60,0.16); color: #fdba74; }
body[data-theme="ocean"] .topbar-role-badge[data-role="demo"]         { background: rgba(192,132,252,0.16); color: #d8b4fe; }

body[data-theme="ocean"] .form-input:focus,
body[data-theme="ocean"] .form-select:focus,
body[data-theme="ocean"] .form-textarea:focus { box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.20), inset 0 1px 3px rgba(0,0,0,0.2); }
body[data-theme="ocean"] .search-bar:focus-within { box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-collapsed-w); }
  .brand-text, .nav-item span, .client-switcher-info,
  .client-switcher-chevron, .sidebar-footer .powered-by-text,
  .nav-section-label { display: none; }
  .main-content { margin-left: calc(var(--sidebar-collapsed-w) + var(--frame-gap) * 2); }
  .client-switcher { justify-content: center; padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .client-picker { left: calc(var(--sidebar-collapsed-w) + var(--frame-gap) * 2); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px 4px; }
  .topbar { padding: 0 14px; grid-template-columns: 1fr auto; }
  .topbar-centre { display: none; }
  .topbar-sx-label { display: none; }
}

/* Reduce heavy blur on devices that struggle */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-blur: none; }
}

/* ── Client portal — Liquid Glass shell (matches the MSP app) ─── */
.portal-shell {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), var(--glass-inset);
  border-radius: 18px;
  overflow: hidden;
}
.portal-sidebar {
  background: var(--glass-bg);
  border-right: 1px solid var(--glass-border);
}
.portal-nav-item { transition: background 0.12s, color 0.12s, box-shadow 0.12s; }
.portal-nav-item.pnav-active {
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.07)) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 10px rgba(0,0,0,0.30);
}
.portal-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}
.portal-login-card {
  background: var(--glass-solid);
  border: 1px solid var(--glass-solid-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), var(--glass-inset);
  border-radius: 20px;
}
/* Portal topbar — X-Stack-branded glass bar (mirrors the MSP topbar) */
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 58px;
  flex-shrink: 0;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Light (arctic) theme — the active nav pill hardcodes white text, which is
   invisible on the light sidebar. Flip it to an accent-tinted pill + ink text. */
body[data-theme="arctic"] .portal-nav-item.pnav-active {
  background: rgba(99, 102, 241, 0.14) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 10px rgba(40, 50, 90, 0.12);
}
body[data-theme="arctic"] .portal-nav-item.pnav-active svg { color: var(--accent) !important; }

/* ── Change-request flow: category picker + detail/history ─────────── */
.stat-card-link.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 28px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.cr-cat-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cr-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}
.cr-cat svg { width: 16px; height: 16px; flex-shrink: 0; }
.cr-cat:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--glass-bg-hover); }
.cr-cat.is-active {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.cr-detail-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.cr-detail-top .mono { font-size: 12px; color: var(--text-muted); margin-right: 4px; }

.cr-detail-value { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

.cr-detail-fields {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
}
.cr-detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--glass-border);
}
.cr-detail-row:last-child { border-bottom: none; }
.cr-detail-row span:first-child { color: var(--text-secondary); font-size: 12px; }
.cr-detail-row span:last-child { color: var(--text-primary); }

.cr-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.cr-detail-meta > div { font-size: 13px; color: var(--text-primary); }
.cr-detail-meta .form-label { margin-bottom: 4px; }

.cr-history { display: flex; flex-direction: column; gap: 6px; }
.cr-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 12px;
  background: rgba(0,0,0,0.12);
}
.cr-history-by { color: var(--text-secondary); }
.cr-history-note { color: var(--text-muted); flex: 1; }
.cr-history-at { color: var(--text-muted); white-space: nowrap; }

/* Changes-needed negotiation thread */
.cr-thread { display: flex; flex-direction: column; gap: 6px; }
.cr-thread-msg {
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 12px;
  background: rgba(0,0,0,0.12);
}
.cr-thread-msg.is-internal { border-style: dashed; }
.cr-thread-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-thread-head .cr-history-at { margin-left: auto; }
.cr-thread-text { margin-top: 4px; white-space: pre-wrap; color: var(--text-secondary); }
.cr-thread-compose { margin-top: 8px; }
.cr-thread-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.cr-thread-actions .form-select { width: auto; }

@media (max-width: 640px) {
  .cr-detail-row { grid-template-columns: 1fr; gap: 2px; }
  .cr-detail-meta { grid-template-columns: 1fr; }
}

/* ── Cost & Margin module (Project Management Tools) ───────────── */
.cm-num { text-align: right; font-family: var(--font-mono); min-width: 72px; }
.cm-total td { border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.cm-margin-chk {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.cm-margin-chk input { accent-color: var(--accent); cursor: pointer; }
.cm-override-row { display: flex; align-items: center; gap: 8px; }
.cm-override-row .cm-margin-chk { flex-shrink: 0; }
.cm-override-row .form-input { flex: 1; min-width: 0; }
.cm-override-row .form-input:disabled { opacity: 0.5; }
.cm-line-drag {
  display: inline-flex; align-items: center; vertical-align: middle;
  color: var(--text-muted); cursor: grab; margin-right: 6px;
  opacity: 0.55; transition: opacity var(--transition);
}
.cm-line-drag:hover { opacity: 1; color: var(--text-secondary); }
.cm-line-row.dragging { opacity: 0.4; }
.cm-line-row.drag-over td { background: rgba(99, 102, 241, 0.12); }
.cm-audit { display: flex; flex-direction: column; }
.cm-audit-row {
  display: grid; grid-template-columns: 160px 1fr 140px 150px;
  gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--glass-border);
  align-items: center;
}
.cm-audit-row:last-child { border-bottom: none; }
.cm-audit-key { font-weight: 600; color: var(--text-primary); }
@media (max-width: 640px) {
  .cm-audit-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Transition Tracker (folded-in Shard Capital tool) ─────────────────── */
.tt-progress { background: var(--surface-3); border-radius: 8px; height: 10px; overflow: hidden; margin-top: 6px; }
.tt-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #22c55e); border-radius: 8px; transition: width 0.35s ease; }
.tt-progress-label { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; margin-top: 8px; }

.controls-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.controls-bar .form-input, .controls-bar .form-select { min-width: 0; }

.tt-chip { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.tt-chip-cyber { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.tt-chip-ms { background: var(--blue-bg); color: #60a5fa; }
.tt-chip-misc { background: var(--green-bg); color: #4ade80; }
.tt-chip-yearly { background: rgba(244, 114, 182, 0.16); color: #f472b6; }
.tt-chip-contracted { background: rgba(251, 146, 60, 0.16); color: #fb923c; }

.tt-section-row td { background: var(--surface-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 8px 14px; border-bottom: 1px solid var(--glass-border); }

.tt-select { min-width: 96px; padding: 4px 8px; font-size: 12px; }
.tt-renewal { max-width: 118px; padding: 4px 8px; font-size: 12px; }
.tt-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.tt-decision.tt-renew { background: var(--green-bg); color: var(--green); }
.tt-decision.tt-terminate { background: var(--red-bg); color: var(--red); }

.tt-status.tt-st-notstarted { background: var(--surface-3); color: var(--text-muted); }
.tt-status.tt-st-inprogress { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.tt-status.tt-st-notified { background: var(--blue-bg); color: #60a5fa; }
.tt-status.tt-st-creds { background: rgba(192, 132, 252, 0.16); color: #c084fc; }
.tt-status.tt-st-complete { background: var(--green-bg); color: #4ade80; }

.tt-note-dot { display: inline-block; width: 7px; height: 7px; background: #fbbf24; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.tt-service-name { font-weight: 700; color: var(--accent); margin-bottom: 16px; font-size: 14px; background: var(--glass-bg-hover); padding: 8px 12px; border-radius: 8px; }
.tt-check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.tt-check-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.tt-mini-wrap { background: var(--surface-3); border-radius: 4px; height: 6px; overflow: hidden; width: 140px; display: inline-block; vertical-align: middle; }
.tt-mini { height: 100%; background: linear-gradient(90deg, #6366f1, #22c55e); border-radius: 4px; }

.tt-renewal-list { display: flex; flex-direction: column; gap: 8px; }
.tt-renewal-item { background: var(--surface-2); border-radius: 8px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border-left: 3px solid var(--border-strong); }
.tt-renewal-item strong { font-size: 12px; }
.tt-renewal-item.tt-soon { border-left-color: var(--red); }
.tt-renewal-item.tt-soon strong { color: var(--red); }
.tt-renewal-item.tt-medium { border-left-color: var(--amber); }
.tt-renewal-item.tt-medium strong { color: var(--amber); }
.tt-renewal-item.tt-ok { border-left-color: var(--green); }
.tt-renewal-item.tt-ok strong { color: var(--green); }

/* ── Transition Tracker — Reports charts ─────────────────────────────── */
.tt-reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.tt-reports-divider { margin: 20px 0 4px; padding: 14px 0 0; border-top: 1px solid var(--glass-border); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.report-card { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 18px 20px; }
.report-card h3 { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }
.tt-chart-wrap { position: relative; height: 240px; }
.tt-cat-table { width: 100%; border-collapse: collapse; }
.tt-cat-table th { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.tt-cat-table td { padding: 8px; font-size: 13px; border-bottom: 1px solid var(--glass-border); }
.tt-cat-table tr:last-child td { border-bottom: none; }
@media (max-width: 900px) {
  .tt-reports-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   Project Delivery — plan/assign, Gantt, workload, reports
   ═══════════════════════════════════════════════════════════════════ */

/* Roll-up progress bar */
.pd-progress { position: relative; background: var(--surface-3); border-radius: 8px; height: 12px; min-width: 80px; }
.pd-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #22c55e); border-radius: 8px; transition: width 0.35s ease; }
.pd-progress-label { position: absolute; right: 7px; top: 0; font-size: 10px; color: var(--text-muted); line-height: 12px; }

.pd-chip { display: inline-flex; align-items: center; color: var(--accent); vertical-align: middle; margin-left: 5px; }

.pd-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pd-legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: var(--text-secondary); }
.pd-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.pd-legend-milestone { display: inline-block; width: 11px; height: 11px; background: #6366f1; border-radius: 3px; transform: rotate(45deg); }

/* Task / resource editor checkboxes */
.pd-check-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pd-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.pd-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* Reports */
.pd-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pd-stat-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); padding: 7px 0; }
.pd-stat-row strong { margin-left: auto; color: var(--text-primary); font-size: 15px; }
.pd-stat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pd-chart-wrap { position: relative; height: 220px; }

/* Client portal */
.pd-client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pd-client-card { transition: transform var(--transition), box-shadow var(--transition); }
.pd-client-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pd-client-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 6px; }
.pd-client-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }

/* ── Gantt ─────────────────────────────────────────────────────────── */
.gantt-scroll { overflow-x: auto; }
.gantt-inner { position: relative; }
.gantt-row { display: flex; align-items: stretch; height: 36px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.gantt-row-head { height: 44px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,0.02); }
.gantt-body-wrap { position: relative; }

.gantt-label {
  position: sticky; left: 0; z-index: 3; width: 230px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #0e111c; border-right: 1px solid var(--glass-border);
  font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden;
}
.gantt-label-head { height: 44px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.gantt-name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }

.gantt-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-shrink: 0; }
.gantt-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.gantt-act:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.gantt-act.gantt-del:hover { background: rgba(239,68,68,0.18); color: #f87171; }
.gantt-act:disabled { opacity: 0.22; cursor: not-allowed; }
.gantt-act:disabled:hover { background: transparent; color: var(--text-muted); }

.gantt-head-track { position: relative; flex: 1; flex-shrink: 0; }
.gantt-months { display: flex; height: 20px; border-bottom: 1px solid var(--glass-border); }
.gantt-month { flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 6px 0; border-right: 1px solid var(--glass-border); overflow: hidden; white-space: nowrap; }
.gantt-days { display: flex; height: 24px; }
.gantt-day { flex-shrink: 0; font-size: 10px; color: var(--text-muted); text-align: center; line-height: 24px; border-right: 1px solid rgba(255,255,255,0.05); }
.gantt-day.is-weekend { background: rgba(255,255,255,0.03); }
.gantt-day.is-today { color: var(--accent); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }

.gantt-track { position: relative; flex: 1; flex-shrink: 0; }

.gantt-bar {
  position: absolute; top: 6px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; overflow: hidden; cursor: grab; z-index: 1;
  border: 1px solid rgba(255,255,255,0.12); box-sizing: border-box;
  touch-action: none;
}
.gantt-bar:active { cursor: grabbing; }
.gantt-bar-open { background: rgba(255,255,255,0.10); }
.gantt-bar-progress { background: linear-gradient(180deg, #6d70f3, #5457ea); }
.gantt-bar-complete { background: linear-gradient(180deg, #34d399, #22c55e); }
.gantt-bar-blocked { background: linear-gradient(180deg, #f87171, #ef4444); }
.gantt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.28); }
.gantt-bar-label { position: relative; z-index: 2; font-size: 11px; font-weight: 600; color: #fff; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.gantt-bar-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; }

.gantt-milestone { position: absolute; top: 11px; width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); z-index: 2; cursor: pointer; border: 1px solid rgba(255,255,255,0.4); touch-action: none; }
.gantt-milestone-open { background: #6366f1; }
.gantt-milestone-done { background: #22c55e; }

.gantt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gantt-dot-open { background: rgba(255,255,255,0.20); }
.gantt-dot-progress { background: #6366f1; }
.gantt-dot-complete { background: #22c55e; }
.gantt-dot-blocked { background: #ef4444; }

.gantt-links { position: absolute; left: 230px; top: 0; pointer-events: none; z-index: 0; }
.gantt-link { fill: none; stroke: rgba(148, 163, 255, 0.45); stroke-width: 1.5; }
.gantt-link-dot { fill: #94a3ff; }

.gantt-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 13px; }

@media (max-width: 900px) {
  .pd-report-grid { grid-template-columns: 1fr; }
}

/* ── Customer portal — Home (#/home) ─────────────────────────
   Ported from xops-enduser-mockup.html + xops-carousel.html.
   Classes are ch- prefixed so they never collide with the ops views. */
.ch-home { font-size: 14px; }
.ch-home .mono { font-family: var(--font-mono); }
.ch-hello h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-primary); }
.ch-hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.ch-hello p { color: var(--text-muted); margin-top: 4px; font-size: 13px; }

/* Greeting widget: live clock, date + quote of the day */
.ch-clock {
  flex-shrink: 0; max-width: 340px; padding: 10px 14px; border-radius: 12px; text-align: right;
  border: 1px solid var(--glass-border); background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow-sm);
}
.ch-clock-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; }
.ch-time { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-primary); }
.ch-date { font-size: 12.5px; color: var(--text-secondary); }
.ch-quote { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.ch-quote-q { font-style: italic; }
.ch-quote-a { white-space: nowrap; }

/* Quick actions */
.ch-quick { display: grid; grid-template-columns: repeat(var(--qa-cols, 3), 1fr); gap: 14px; margin: 22px 0; }
.ch-qa {
  border-radius: 14px; padding: 18px 18px 16px; cursor: pointer; border: 1px solid var(--glass-border);
  background: var(--surface); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm); transition: transform var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.ch-qa:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.ch-qa.primary {
  background: linear-gradient(135deg, rgba(99,102,241,0.28), rgba(99,102,241,0.10));
  border-color: rgba(99,102,241,0.45);
}
.ch-qi { font-size: 22px; margin-bottom: 12px; }
/* "Change request" tile: 2×2 collage of the change-type icons, in the emoji's footprint */
.ch-qi-grid { display: grid; grid-template-columns: repeat(2, 13px); gap: 3px; width: max-content; color: var(--text-primary); }
.ch-qi-grid span { display: flex; }
.ch-qi-grid svg { width: 13px; height: 13px; }
.ch-qa h3 { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.ch-qa p { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.ch-arrow { position: absolute; right: 14px; top: 14px; color: var(--text-muted); font-size: 14px; }

/* Buttons (mockup .btn — kept separate from the ops .btn) */
.ch-btn {
  font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text-primary);
  transition: background var(--transition);
}
.ch-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ch-btn.primary:hover { background: var(--accent-hover); }
.ch-btn.small { font-size: 11px; padding: 5px 10px; flex-shrink: 0; }
.ch-btn.ch-btn-lg { font-size: 12.5px; padding: 9px 15px; }

/* X-One promo carousel */
.ch-promo {
  margin: 0 0 22px; border-radius: 14px; border: 1px solid rgba(99,102,241,0.38);
  background: linear-gradient(120deg, rgba(99,102,241,0.20), rgba(139,92,246,0.09) 55%, rgba(255,255,255,0.03));
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.ch-slide { display: none; }
.ch-slide.active {
  display: flex; align-items: center; gap: 24px; padding: 26px 30px 44px; min-height: 210px;
  animation: ch-fade 0.35s ease;
}
@keyframes ch-fade { from { opacity: 0; } to { opacity: 1; } }
.ch-slide-left { flex: 1; min-width: 0; }
.ch-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.6px; color: #a5b4fc; margin-bottom: 8px; }
.ch-slide-left h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-primary); }
.ch-slide-left p { font-size: 13px; color: var(--text-secondary); margin: 9px 0 16px; line-height: 1.6; max-width: 500px; }
.ch-slide-right { flex-shrink: 0; width: 380px; }
.ch-mini-app {
  border-radius: 11px; border: 1px solid rgba(255,255,255,0.12); background: #0b0e16; padding: 16px 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.4); color: #e7eaf0;
}
.ch-ma-head { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; margin-bottom: 12px; }
.ch-mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ch-mini-stats { display: flex; gap: 9px; margin-bottom: 12px; }
.ch-mini-stat { flex: 1; background: rgba(255,255,255,0.07); border-radius: 8px; padding: 8px 10px; }
.ch-mini-stat .v { font-size: 16px; font-weight: 800; }
.ch-mini-stat .k { font-size: 9px; color: #838a96; margin-top: 1px; }
.ch-mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.ch-mini-bars i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #818cf8, #4f46e5); }
/* Mini-app checklist (X-Ops self-service slide) */
.ch-steps { display: flex; flex-direction: column; gap: 7px; }
.ch-step {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px; padding: 7px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.ch-tick { width: 16px; text-align: center; font-size: 13px; }
.ch-step.done { color: #b3bac6; } .ch-step.done .ch-tick { color: var(--green); }
.ch-step.now { border-color: rgba(99,102,241,0.4); } .ch-step.now .ch-tick { color: var(--accent); }
.ch-step.next { color: #838a96; } .ch-step.next .ch-tick { color: #838a96; }
.ch-obar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.07); margin: 13px 2px 6px; overflow: hidden; }
.ch-obar i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 4px; }
.ch-ocap { font-size: 10.5px; color: #838a96; text-align: center; }
/* X-Track report rows */
.ch-rows { display: flex; flex-direction: column; gap: 9px; }
.ch-row { font-size: 11.5px; }
.ch-rl { display: flex; justify-content: space-between; margin-bottom: 4px; }
.ch-pct { font-weight: 700; color: #b3bac6; }
.ch-track { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ch-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #34d399, #22c55e); }
/* Dots sit centred under the mini-app; arrows top-right */
.ch-dots { position: absolute; bottom: 16px; right: 30px; width: 380px; display: flex; gap: 6px; justify-content: center; }
.ch-dots span {
  width: 7px; height: 7px; border-radius: 50%; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-strong); transition: width var(--transition);
}
.ch-dots span.on { background: var(--accent); border-color: var(--accent); width: 19px; border-radius: 4px; }
.ch-arrows { position: absolute; right: 14px; top: 13px; display: flex; gap: 6px; }
.ch-arr {
  width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; user-select: none;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-secondary); font-size: 14px;
}
.ch-arr:hover { color: var(--text-primary); border-color: var(--accent); }

/* Cards grid */
.ch-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.ch-card { padding: 18px; border-radius: 14px; scroll-margin-top: 90px; }
.ch-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ch-card-head h2 { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; color: var(--text-primary); }
.ch-link { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 600; }
.ch-link:hover { color: #a5b4fc; }
.ch-count { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; }

/* Request rows */
.ch-req { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--glass-border); }
.ch-req:last-child { border-bottom: none; }
.ch-rid { font-size: 11px; color: var(--text-muted); width: 68px; flex-shrink: 0; }
.ch-rt { flex: 1; min-width: 0; }
.ch-rt .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-rt .meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ch-chip { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ch-chip.green { color: #0a2a16; background: rgba(74,222,128,0.85); }
.ch-chip.amber { color: #241a02; background: rgba(251,191,36,0.85); }
.ch-chip.blue  { color: #0b1c33; background: rgba(96,165,250,0.8); }
.ch-chip.grey  { color: #d1d5db; background: rgba(255,255,255,0.12); }

/* Self-service */
.ch-ss { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-ss-item {
  display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--glass-border); cursor: pointer; transition: border-color var(--transition);
}
.ch-ss-item:hover { border-color: var(--border-strong); }
.ch-ss-item .e { font-size: 18px; }
.ch-ss-item .l { font-size: 12.5px; font-weight: 600; }
.ch-ss-item .s { font-size: 10.5px; color: var(--text-muted); }

/* Self-service guides (modal) */
.gd-intro { font-size: 13px; color: var(--text-secondary); margin: 0 0 14px; line-height: 1.5; }
.gd-tabs { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 14px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--glass-border); }
.gd-tab { font: inherit; font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.gd-tab.on { background: var(--accent); color: #fff; }
.gd-steps { margin: 0 0 14px; padding-left: 22px; font-size: 13px; line-height: 1.55; color: var(--text-primary); }
.gd-steps li { margin-bottom: 8px; }
.gd-tip { font-size: 12px; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--glass-border); color: var(--text-secondary); }

/* Approvals + announcements */
.ch-stack { display: flex; flex-direction: column; gap: 14px; }
.ch-grid.ch-one { grid-template-columns: 1fr; }
.ch-appr, .ch-ann {
  display: flex; gap: 11px; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--glass-border); background: var(--surface);
}
.ch-appr { align-items: center; }
.ch-appr + .ch-appr, .ch-ann + .ch-ann { margin-top: 10px; }
.ch-a-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.ch-appr .ch-a-ic { background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3); }
.ch-ann .ch-a-ic { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); }

/* Announcements page (views/announcements.js) */
.an-empty { text-align: center; padding: 48px 24px; }
.an-empty .an-art { display: flex; justify-content: center; margin-bottom: 18px; }
.an-empty h2 { font-size: 18px; margin: 0 0 8px; }
.an-empty p { color: var(--text-secondary, rgba(255,255,255,0.6)); max-width: 420px; margin: 0 auto 18px; line-height: 1.5; }
.ch-a-t { flex: 1; min-width: 0; }
.ch-a-t .t { font-size: 12.5px; font-weight: 600; }
.ch-appr .ch-a-t .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-a-t .m { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

/* Client-portal shell bits (topbar search + bell, sidebar client tag) */
.topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: 10px; padding: 7px 13px; color: var(--text-muted);
}
.topbar-search input { background: none; border: none; outline: none; color: var(--text-primary); font-size: 13px; flex: 1; min-width: 0; }
.topbar-bell { position: relative; display: flex; align-items: center; color: var(--text-secondary); cursor: pointer; padding: 4px; }
.topbar-bell::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 7px var(--red);
}
.topbar-user-sub { font-size: 11px; color: var(--text-muted); }
.client-tag {
  margin: 8px auto 0; width: fit-content; font-size: 10px; color: var(--text-muted);
  background: var(--surface-3); border: 1px solid var(--glass-border); border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.nav-badge-accent { background: var(--accent); box-shadow: 0 0 10px rgba(99,102,241,0.45); }

@media (max-width: 1200px) {
  .ch-slide-right, .ch-dots { width: 320px; }
}
@media (max-width: 1000px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-slide-right { display: none; }
  .ch-dots { left: 0; right: 0; width: auto; }
}
@media (max-width: 700px) {
  .ch-quick, .ch-ss { grid-template-columns: 1fr; }
  .ch-hello { flex-direction: column; }
  .ch-clock { max-width: none; width: 100%; text-align: left; }
  .ch-clock-row { justify-content: flex-start; }
}

/* ── Guided request catalogue ("Change request") ──────────────────── */
.rc-intro { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 16px; border-radius: 14px; cursor: pointer; font: inherit;
  color: var(--text-primary); background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.rc-card:hover, .rc-card:focus-visible {
  transform: translateY(-2px); outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255,255,255,0.10);
}
.rc-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 10px; color: var(--accent);
  background: rgba(99, 102, 241, 0.14); border: 1px solid rgba(99, 102, 241, 0.30);
}
.rc-name { font-size: 14px; font-weight: 600; margin-top: 4px; }
.rc-sub { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.rc-soon { font-size: 10px; margin-left: 4px; vertical-align: middle; }
.rc-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rc-choice { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 2px; }
.rc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.rc-repeat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.rc-repeat-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
.rc-repeat-row .form-group { margin-bottom: 0; }
.rc-repeat-remove { font-size: 16px; line-height: 1; }

/* ── Runbooks (Exchange / SharePoint / Azure / Scripting) ──────────── */
.rb-steps { display: flex; flex-direction: column; gap: 6px; }
.rb-step {
  display: grid; grid-template-columns: 28px 1fr 150px; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--glass-border); border-radius: 10px;
  background: rgba(0,0,0,0.12);
}
.rb-step-num {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--surface-3);
}
.rb-step-in_progress .rb-step-num { color: #fbbf24; background: rgba(245, 158, 11, 0.16); }
.rb-step-done .rb-step-num { color: #4ade80; background: var(--green-bg); }
.rb-step-done .rb-step-text { color: var(--text-secondary); text-decoration: line-through; }
.rb-step-text { font-size: 13px; color: var(--text-primary); line-height: 1.45; }
.rb-step-status { padding: 6px 8px; font-size: 12px; }
.rb-step-main { min-width: 0; }
.rb-cmd { position: relative; margin-top: 8px; border: 1px solid var(--glass-border); border-radius: 8px; background: rgba(0,0,0,0.22); }
.rb-cmd pre {
  margin: 0; padding: 8px 64px 8px 10px; overflow-x: auto; white-space: pre;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--text-primary);
}
.rb-cmd-copy { position: absolute; top: 4px; right: 4px; padding: 3px 8px; font-size: 11px; }
.rb-edit-row { grid-template-columns: 2fr 1fr auto; }
.rb-edit-cmd { grid-column: 1 / 3; }
.rb-edit-cmd textarea { font-family: var(--font-mono); font-size: 12px; min-height: 0; }
@media (max-width: 640px) {
  .rb-step { grid-template-columns: 28px 1fr; }
  .rb-step-status { grid-column: 2; }
}

/* ── Disk space (X-Disk) ───────────────────────────────────────────── */
.dk-free-text { font-size: 12px; color: var(--text-secondary); }
.dk-free-text strong { color: var(--text-primary); }
.dk-meter { background: var(--surface-3); border-radius: 6px; height: 6px; overflow: hidden; margin-top: 4px; }
.dk-meter span { display: block; height: 100%; border-radius: 6px; background: var(--green); }
.dk-mid .dk-meter span { background: var(--amber); }
.dk-low .dk-meter span { background: var(--red); }
.dk-low .dk-free-text strong { color: var(--red); }
.dk-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-warn { color: var(--red); }
.dk-path { word-break: break-all; font-size: 12px; }
.dk-tree { display: flex; flex-direction: column; gap: 2px; }
.dk-node > summary, .dk-leaf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 160px) 72px; gap: 12px; align-items: center; padding: 4px 6px; border-radius: 6px; }
.dk-node > summary { cursor: pointer; list-style: none; }
.dk-node > summary::-webkit-details-marker { display: none; }
.dk-node > summary .dk-name::before { content: '▸'; display: inline-block; width: 14px; color: var(--text-muted); transition: transform var(--transition); }
.dk-node[open] > summary .dk-name::before { transform: rotate(90deg); }
.dk-leaf .dk-name { padding-left: 14px; }
.dk-node > summary:hover, .dk-leaf:hover { background: var(--surface-3); }
.dk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-own .dk-name { color: var(--text-muted); font-style: italic; }
.dk-bar { background: var(--surface-3); border-radius: 4px; height: 8px; overflow: hidden; }
.dk-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dk-size { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.dk-kids { margin-left: 18px; border-left: 1px solid var(--border); padding-left: 6px; }
.dk-profile > summary { padding: 8px 6px; }
.dk-tier2 { display: flex; flex-direction: column; gap: 10px; }
.dk-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.dk-check input { margin-top: 3px; }
.dk-stale { margin-left: 28px; display: flex; flex-direction: column; gap: 6px; }
.dk-stale-row { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dk-force { font-size: 12px; color: var(--text-secondary); display: inline-flex; gap: 4px; align-items: center; }
.dk-approval { padding: 12px 0; border-bottom: 1px solid var(--border); }
.dk-approval:last-child { border-bottom: 0; }
.dk-actions { display: flex; gap: 8px; margin-top: 8px; }
.dk-steps { margin: 12px 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) {
  .dk-node > summary, .dk-leaf { grid-template-columns: minmax(0, 1fr) 64px; }
  .dk-bar { display: none; }
}

/* ── Secure key handover ───────────────────────────────────────────── */
.ho-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.ho-box .form-textarea { width: 100%; font-family: var(--font-mono); }
.ho-box #ho-secret-out { width: 100%; }
.ho-secret pre { white-space: pre-wrap; word-break: break-all; }
.dk-state { margin-bottom: 16px; }
.cr-todo { color: var(--amber); font-weight: 600; }

/* Office plan (floorplan.js): furniture stencils over the plan drawing */
.fp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.fp-zoom { display: inline-flex; gap: 4px; margin-left: auto; }
.fp-viewport { height: 60vh; border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 10px; overflow: hidden; background: #fff; }
.fp-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.fp-svg:active { cursor: grabbing; }
.fp-item { cursor: pointer; }
.fp-hit { fill: transparent; }
.fp-top { fill: #f8fafc; stroke: #475569; stroke-width: 1.2; }
.fp-line { fill: #cbd5e1; stroke: #64748b; stroke-width: 0.8; }
.fp-chair { fill: #94a3b8; stroke: #334155; stroke-width: 1; }
.fp-chair-back { fill: #475569; stroke: #1e293b; stroke-width: 1; }
.fp-wall { fill: #475569; stroke: #1e293b; stroke-width: 1; }
.fp-plant-pot { fill: #d6b98c; stroke: #8a6a3a; stroke-width: 1; }
.fp-plant { fill: #4ade80; stroke: #15803d; stroke-width: 0.8; }
.fp-seat.free .fp-top { fill: #dcfce7; stroke: #16a34a; }
.fp-seat.taken .fp-top { fill: #e0e7ff; stroke: #4f46e5; }
.fp-seat.from .fp-top { fill: #fde68a; stroke: #d97706; stroke-width: 2; }
.fp-seat.to .fp-top { fill: #bae6fd; stroke: #0284c7; stroke-width: 2; }
.fp-label { fill: #0f172a; font-family: Inter, system-ui, sans-serif; font-weight: 700; text-anchor: middle; pointer-events: none; }
.fp-who { fill: #334155; font-family: Inter, system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.fp-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.fp-key.from { background: #f59e0b; } .fp-key.to { background: #0ea5e9; }
.modal-full { max-width: 98vw; width: 98vw; max-height: 97vh; }
.modal-full .modal-body { max-height: calc(100vh - 190px); }
.fpe-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.fpe-snap { display: inline-flex; align-items: center; gap: 4px; }
.fpe-main { display: grid; grid-template-columns: 176px 1fr 270px; gap: 12px; height: calc(100vh - 310px); min-height: 380px; }
.fpe-canvas { border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 10px; overflow: hidden; background: #fff; }
.fpe-palette { overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; padding-right: 4px; }
.fpe-stencil { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 8px;
  background: rgba(255,255,255,0.92); cursor: grab; font-size: 11px; color: #334155; user-select: none; touch-action: none; }
.fpe-stencil:hover { border-color: var(--accent); }
.fpe-stencil svg { width: 62px; height: 40px; }
.fpe-ghost { position: fixed; z-index: 10000; pointer-events: none; transform: translate(-50%, -50%); opacity: 0.85; width: 96px; }
.fpe-props { overflow-y: auto; }
.fpe-h3 { font-weight: 700; margin-bottom: 8px; }
.fpe-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fpe-seats { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; margin-bottom: 6px; }
.fpe-seat-row { display: grid; grid-template-columns: 60px 1fr; gap: 4px; padding: 6px; border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 8px; }
.fpe-seat-row input[data-k="email"] { grid-column: 1 / -1; }
.fpe-seat-row.active { border-color: #ef4444; }
.fpe-seat-row .form-input { padding: 6px 8px; font-size: 12px; }
.fp-tseat.bookable.free .fp-chair { fill: #86efac; stroke: #16a34a; }
.fp-tseat.bookable.taken .fp-chair { fill: #a5b4fc; stroke: #4f46e5; }
.fp-tseat.from .fp-chair { fill: #fbbf24; stroke: #d97706; }
.fp-tseat.to .fp-chair { fill: #38bdf8; stroke: #0284c7; }
.fp-tseat.active .fp-chair { stroke: #ef4444; stroke-width: 2.5; }
.fp-tseat.bookable { cursor: pointer; }
.fpe-keys { margin-top: 14px; font-size: 12px; line-height: 1.7; color: var(--text-secondary); }
.fpe-outline { fill: none; stroke: #ef4444; stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.fpe-h { fill: #fff; stroke: #ef4444; stroke-width: 1.5; }
.fpe-h-n, .fpe-h-s { cursor: ns-resize; } .fpe-h-e, .fpe-h-w { cursor: ew-resize; }
.fpe-h-nw, .fpe-h-se { cursor: nwse-resize; } .fpe-h-ne, .fpe-h-sw { cursor: nesw-resize; }
.fpe-rot { cursor: grab; fill: #ef4444; }
.fpe-frame { fill: rgba(239,68,68,0.08); stroke: #ef4444; stroke-width: 2; stroke-dasharray: 6 4; }
.selected .fp-top { stroke: #ef4444; }
@media (max-width: 900px) { .fpe-main { grid-template-columns: 1fr; height: auto; } .fpe-canvas { height: 60vh; } .fpe-palette { flex-direction: row; overflow-x: auto; } }
.dm-row { position: relative; padding: 10px 36px 10px 10px; border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 10px; margin-bottom: 8px; }
.dm-row.active { border-color: var(--accent); }
.dm-row .rc-repeat-remove { position: absolute; top: 8px; right: 6px; }
.dm-desks { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
