/* Luton Labs SaaS — Application Styles */

:root {
  --navy:       #0a1428;
  --blue:       #1e5eff;
  --blue-dark:  #0d3bc4;
  --cyan:       #06b6d4;
  --sidebar-w:  260px;
  --topbar-h:   64px;
  --white:      #ffffff;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --green:      #16a34a;
  --amber:      #d97706;
  --red:        #dc2626;
  --radius:     8px;
  --shadow:     0 1px 6px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--navy);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ──────────────────────────────────── */
body.login-page {
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo { display: flex; justify-content: center; margin-bottom: 1.75rem; }
.login-logo img { height: 138px; width: auto; }

.login-heading { text-align: center; margin-bottom: 1.75rem; }
.login-heading h1 { font-size: 1.35rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; }

.tenant-badge {
  display: inline-block;
  background: #dceafe;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.87rem; font-weight: 500; color: #374151; margin-bottom: 0.35rem; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--navy);
  background: var(--gray-50);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(30,94,255,0.12);
}
input::placeholder { color: var(--gray-400); }

.field-error { font-size: 0.82rem; color: var(--red); margin-top: 0.3rem; }
.field-help  { font-size: 0.82rem; color: var(--gray-500); margin-top: 0.3rem; }

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--blue-dark); }

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.87rem;
  color: var(--gray-500);
  text-decoration: none;
}
.forgot-link:hover { color: var(--blue); }

.login-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}
.login-footer img { height: 24px; opacity: 0.6; }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 20;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo img { height: 138px; width: auto; display: block; }
.sidebar-org {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-item.active { border-left: 3px solid var(--blue); padding-left: calc(1.25rem - 3px); }
.nav-item--soon { cursor: default; opacity: 0.45; }
.nav-item--soon:hover { background: none; color: rgba(255,255,255,0.62); }

.nav-section-label {
  padding: 1rem 1.25rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.badge-soon {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { display: block; font-size: 0.87rem; font-weight: 600; color: rgba(255,255,255,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.4); }

.sidebar-logout {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar-logout:hover { color: var(--white); }
.sidebar-logout svg { width: 18px; height: 18px; display: block; }

/* ── Main Area ───────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; gap: 0.75rem; align-items: center; }

.content { flex: 1; padding: 2rem; }

/* Off-canvas mobile drawer components -- inert on desktop by default,
   activated inside the 768px media query below. Matches the pattern
   already shipped across the other 9 Luton Labs properties (see
   Mobile_Apps_Development.md Part 4). */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-close { display: none; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-xs { padding: 0.25rem 0.65rem; font-size: 0.78rem; }
.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-danger:hover { background: #fecaca; }
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--gray-200); }
.btn-outline:hover { border-color: var(--navy); }

/* ── Panels / Cards ──────────────────────────────── */
.panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel--narrow { max-width: 560px; padding: 2rem; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}
.panel-title { font-size: 0.97rem; font-weight: 700; }
.panel-link { font-size: 0.85rem; color: var(--blue); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }

/* ── Stat Cards ──────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card--soon { opacity: 0.55; }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon--blue  { background: #dceafe; } .stat-icon--blue svg  { stroke: var(--blue); }
.stat-icon--amber { background: #fef3c7; } .stat-icon--amber svg { stroke: var(--amber); }
.stat-icon--green { background: #dcfce7; } .stat-icon--green svg { stroke: var(--green); }
.stat-icon--gray  { background: var(--gray-100); } .stat-icon--gray svg { stroke: var(--gray-400); }

.stat-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 500; margin-bottom: 0.2rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-value--soon { font-size: 0.85rem; font-weight: 500; color: var(--gray-400); }

/* ── Tables ──────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left;
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--navy);
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.actions-cell { display: flex; gap: 0.75rem; align-items: center; }
.action-link { font-size: 0.82rem; font-weight: 600; color: var(--blue); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.action-link:hover { text-decoration: underline; }
.action-link--danger { color: var(--red); }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--success, .badge--active   { background: #dcfce7; color: #15803d; }
.badge--failure, .badge--locked   { background: #fef2f2; color: var(--red); }
.badge--denied,  .badge--disabled { background: #fef3c7; color: #92400e; }

/* ── Form Actions ────────────────────────────────── */
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.panel--narrow .form-group { margin-bottom: 1.1rem; }

/* ── Welcome Banner (Member) ─────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy), #0d2461);
  color: var(--white);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.75rem;
}
.welcome-banner h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.3rem; }
.welcome-banner p { color: rgba(255,255,255,0.7); font-size: 0.95rem; }

.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.module-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
}
.module-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.module-card p  { font-size: 0.85rem; color: var(--gray-500); }
.module-card--soon { opacity: 0.55; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.alert--success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert--error   { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.alert--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Utilities ───────────────────────────────────── */
.mt-6 { margin-top: 1.5rem; }
.text-sm   { font-size: 0.82rem; }
.text-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stat-grid, .modules-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 0.9rem; height: 56px; padding: 0 1.1rem;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    position: sticky; top: 0; z-index: 120;
  }
  .mobile-topbar-toggle, .mobile-topbar-back { background: none; border: none; cursor: pointer; padding: 0.3rem; color: var(--navy); display: flex; align-items: center; }
  .mobile-topbar-toggle svg, .mobile-topbar-back svg { width: 22px; height: 22px; }
  .mobile-topbar-title { font-size: 1rem; font-weight: 800; color: var(--navy); }

  .sidebar {
    width: 260px; max-width: 82vw;
    transform: translateX(-100%); transition: transform 0.25s ease; z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-logo { position: relative; }
  .sidebar-close {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.7); padding: 0.2rem;
    position: absolute; top: 0; right: 1.1rem;
  }
  .sidebar-close svg { width: 18px; height: 18px; }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(10,20,40,0.5); z-index: 250;
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.active { opacity: 1; pointer-events: auto; }

  .main-area { margin-left: 0; }
  .content { padding: 1.25rem; }
  .topbar { padding: 0 1.25rem; }
  .stat-grid, .stat-grid--3, .modules-grid { grid-template-columns: 1fr; }

  /* Wide data tables scroll within their own panel instead of blowing
     out page width and forcing the whole page to scroll. */
  .panel { overflow-x: auto; }
  .data-table { min-width: 520px; }
}

/* ── Document Module ─────────────────────────────── */

/* 3-column stat grid variant */
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .stat-grid--3 { grid-template-columns: repeat(2, 1fr); } }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
}
.filter-input {
  flex: 1;
  min-width: 180px;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--navy);
  background: var(--gray-50);
  outline: none;
}
.filter-input:focus { border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 3px rgba(30,94,255,0.12); }
.filter-select {
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--navy);
  background: var(--gray-50);
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--blue); background: var(--white); }

/* Document status badges */
.badge--doc-draft    { background: #f1f5f9; color: var(--gray-600); }
.badge--doc-active   { background: #dcfce7; color: #15803d; }
.badge--doc-archived { background: #fef3c7; color: #92400e; }

/* Checkout badges in table */
.checkout-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.checkout-indicator--out  { color: var(--amber); }
.checkout-indicator--free { color: var(--green); font-weight: 500; }
.checkout-indicator--overdue { color: var(--red); }

/* Checkout status badges (checkout history) */
.badge--checkout-active   { background: #fef3c7; color: var(--amber); }
.badge--checkout-returned { background: #dcfce7; color: #15803d; }
.badge--checkout-expired  { background: #fef2f2; color: var(--red); }

/* Document detail layout */
.doc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .doc-meta-grid { grid-template-columns: 1fr; } }

.doc-meta-body { padding: 1rem 1.5rem; }
.doc-meta-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
  align-items: start;
}
.doc-meta-row:last-child { border-bottom: none; }
.doc-meta-row--full { grid-template-columns: 1fr; }
.doc-meta-label { font-size: 0.78rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }

/* Checkout status panel */
.checkout-status {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 0;
  font-size: 0.88rem;
}
.checkout-status strong { display: block; font-size: 0.93rem; margin-bottom: 0.2rem; }
.checkout-status p { color: var(--gray-600); margin: 0; }
.checkout-status--out  svg { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.checkout-status--free svg { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.checkout-status--overdue svg { color: var(--red); flex-shrink: 0; margin-top: 2px; }
.checkout-status--overdue strong { color: var(--red); }
.text-danger { color: var(--red); font-weight: 600; }

/* Version badge */
.version-badge {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.version-badge--current {
  background: #dceafe;
  color: var(--blue);
}

/* File upload area */
.file-drop-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--gray-50);
}
.file-drop-area:hover, .file-drop-area.drag-over {
  border-color: var(--blue);
  background: #f0f5ff;
}
.file-drop-label { font-size: 0.9rem; color: var(--gray-600); margin-bottom: 0.3rem; }
.file-drop-link { color: var(--blue); cursor: pointer; text-decoration: underline; }
.file-drop-hint { font-size: 0.78rem; color: var(--gray-400); }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-selected-name { margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--navy); }

/* Tags */
.tag-chip {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  margin: 0.1rem;
}

/* Required field star */
.required-star { color: var(--red); }

/* mb-4 utility */
.mb-4 { margin-bottom: 1rem; }

/* Module card link variant */
.module-card--link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.module-card--link:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-1px); }
.module-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.module-card-icon--blue { background: #dceafe; color: var(--blue); }
.module-card-icon--gray { background: var(--gray-100); color: var(--gray-400); }
.module-card--link h3 { margin-bottom: 0.2rem; }
.module-card--link p  { font-size: 0.83rem; color: var(--gray-500); }

/* ── Meeting status badges ───────────────────────── */
.badge--meeting-scheduled { background: #dbeafe; color: #1e40af; }
.badge--meeting-completed  { background: #dcfce7; color: #15803d; }
.badge--meeting-cancelled  { background: var(--gray-100); color: var(--gray-500); }

/* ── Task status badges ──────────────────────────── */
.badge--task-open        { background: #dbeafe; color: #1e40af; }
.badge--task-in_progress { background: #fef3c7; color: #92400e; }
.badge--task-blocked     { background: #fee2e2; color: #991b1b; }
.badge--task-completed   { background: #dcfce7; color: #15803d; }
.badge--task-cancelled   { background: var(--gray-100); color: var(--gray-500); }

/* ── Priority badges ─────────────────────────────── */
.badge--priority-low    { background: var(--gray-100); color: var(--gray-500); }
.badge--priority-medium { background: #dbeafe; color: #1e40af; }
.badge--priority-high   { background: #fef3c7; color: #92400e; }
.badge--priority-urgent { background: #fee2e2; color: #991b1b; }

/* ── Note type badges ────────────────────────────── */
.badge--note-agenda     { background: #e0e7ff; color: #3730a3; }
.badge--note-discussion { background: var(--gray-100); color: var(--gray-500); }
.badge--note-decision   { background: #dcfce7; color: #15803d; }
.badge--note-risk       { background: #fee2e2; color: #991b1b; }
.badge--note-action     { background: #fef3c7; color: #92400e; }

/* ── Overdue badge ───────────────────────────────── */
.badge--overdue { background: #fee2e2; color: #991b1b; }
.text-red { color: var(--red) !important; }

/* ── Stat icon red ───────────────────────────────── */
.stat-icon--red { background: #fee2e2; }
.stat-icon--red svg { stroke: var(--red); }

/* ── Meeting notes ───────────────────────────────── */
.notes-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.note-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem 1rem;
}
.note-item--action { border-left: 3px solid var(--amber); }
.note-item--decision { border-left: 3px solid var(--green); }
.note-item--risk { border-left: 3px solid var(--red); }
.note-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
}
.note-meta { font-size: .78rem; color: var(--gray-500); margin-left: auto; }
.note-body { font-size: .9rem; color: var(--gray-600); white-space: pre-line; }

/* ── Add note form ───────────────────────────────── */
.add-note-form {
  border-top: 1px solid var(--gray-200);
  padding-top: 1.25rem;
  margin-top: .5rem;
}

/* ── Attendee list ───────────────────────────────── */
.attendee-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.attendee-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: .9rem;
}
.attendee-name { font-weight: 500; }

/* ── Comments ────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.comment-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem 1rem;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
  font-size: .82rem;
}
.comment-meta strong { color: var(--navy); }
.comment-body { font-size: .9rem; color: var(--gray-600); white-space: pre-line; }

/* ── Checkbox grid (attendees) ───────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .4rem .75rem;
  padding: .75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
}
.checkbox-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  cursor: pointer;
  padding: .2rem 0;
}
.checkbox-option input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }

/* ── Filter checkbox ─────────────────────────────── */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
}
.filter-checkbox input { cursor: pointer; }

/* ── Accounting sub-nav ──────────────────────────── */
.acct-subnav {
  display: flex;
  align-items: center;
  gap: .25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.acct-subnav::-webkit-scrollbar { display: none; }
.acct-tab {
  display: inline-block;
  padding: .55rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.acct-tab:hover    { color: var(--navy); }
.acct-tab--active  { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ── Invoice / Bill status badges ────────────────── */
.badge--inv-draft          { background: var(--gray-100); color: var(--gray-500); }
.badge--inv-sent           { background: #dbeafe; color: #1e40af; }
.badge--inv-partially_paid { background: #fef3c7; color: #92400e; }
.badge--inv-paid           { background: #dcfce7; color: #15803d; }
.badge--inv-void           { background: var(--gray-100); color: var(--gray-400); text-decoration: line-through; }

.badge--bill-draft          { background: var(--gray-100); color: var(--gray-500); }
.badge--bill-received       { background: #dbeafe; color: #1e40af; }
.badge--bill-partially_paid { background: #fef3c7; color: #92400e; }
.badge--bill-paid           { background: #dcfce7; color: #15803d; }
.badge--bill-void           { background: var(--gray-100); color: var(--gray-400); }

.badge--refund-pending  { background: #fef3c7; color: #92400e; }
.badge--refund-approved { background: #dbeafe; color: #1e40af; }
.badge--refund-issued   { background: #dcfce7; color: #15803d; }
.badge--refund-denied   { background: var(--gray-100); color: var(--gray-400); text-decoration: line-through; }

/* ── AIEnhanceBug status/type badges ─────────────── */
.badge--aeb-new          { background: #dbeafe; color: #1e40af; }
.badge--aeb-analyzing    { background: #ede9fe; color: #5b21b6; }
.badge--aeb-analyzed     { background: #e0e7ff; color: #3730a3; }
.badge--aeb-approved     { background: #fef3c7; color: #92400e; }
.badge--aeb-in_progress  { background: #fef3c7; color: #92400e; }
.badge--aeb-fixed        { background: #dcfce7; color: #15803d; }
.badge--aeb-completed    { background: #dcfce7; color: #15803d; }
.badge--aeb-rejected     { background: var(--gray-100); color: var(--gray-400); text-decoration: line-through; }
.badge--aeb-roadmap      { background: #f1f5f9; color: var(--gray-600); }
.badge--aeb-needs_info   { background: #fee2e2; color: #991b1b; }
.badge--aeb-type-bug         { background: #fee2e2; color: #991b1b; }
.badge--aeb-type-enhancement { background: #dbeafe; color: #1e40af; }
.badge--aeb-type-other       { background: var(--gray-100); color: var(--gray-600); }
.aeb-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.aeb-score--high { color: #15803d; }
.aeb-score--mid  { color: #92400e; }
.aeb-score--low  { color: #991b1b; }
.aeb-analysis-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .aeb-analysis-cols { grid-template-columns: 1fr; } }
.aeb-analysis-col { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 1rem; }
.aeb-analysis-col pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.85rem; margin: 0; }
.aeb-prose { font-size: 0.85rem; line-height: 1.65; color: var(--navy); word-break: break-word; }
.aeb-prose p { margin: 0 0 0.75rem 0; }
.aeb-prose p:last-child { margin-bottom: 0; }
.aeb-prose-list { font-size: 0.85rem; line-height: 1.65; color: var(--navy); margin: 0; padding-left: 1.2rem; }
.aeb-prose-list li { margin-bottom: 0.4rem; }
.aeb-analysis-section { margin-top: 0.85rem; }
.aeb-analysis-section:first-of-type { margin-top: 0.6rem; }
.aeb-analysis-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); margin-bottom: 0.25rem; }
.aeb-corr-item { padding: 0.85rem 1rem; border-bottom: 1px solid var(--gray-100); }
.aeb-corr-item:last-child { border-bottom: none; }
.aeb-corr-meta { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 0.25rem; }

/* ── Expense status badges ───────────────────────── */
.badge--exp-draft     { background: var(--gray-100); color: var(--gray-500); }
.badge--exp-submitted { background: #dbeafe; color: #1e40af; }
.badge--exp-approved  { background: #dcfce7; color: #15803d; }
.badge--exp-rejected  { background: #fee2e2; color: #991b1b; }
.badge--exp-paid      { background: #d1fae5; color: #065f46; }

/* ── Account type badges ─────────────────────────── */
.badge--acct-asset     { background: #dbeafe; color: #1e40af; }
.badge--acct-liability { background: #fce7f3; color: #9d174d; }
.badge--acct-equity    { background: #ede9fe; color: #5b21b6; }
.badge--acct-revenue   { background: #dcfce7; color: #15803d; }
.badge--acct-expense   { background: #fee2e2; color: #991b1b; }
.badge--acct-cogs      { background: #fef3c7; color: #92400e; }

.badge--active { background: #dcfce7; color: #15803d; }

/* ── Line items table ────────────────────────────── */
.line-items-table td { vertical-align: middle; padding: .5rem .75rem; }
.line-items-table input.line-qty   { width: 70px;  text-align: right; }
.line-items-table input.line-price { width: 100px; text-align: right; }
.line-items-table .line-amount { font-weight: 600; text-align: right; white-space: nowrap; }

/* ── Invoice totals ──────────────────────────────── */
.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  margin-bottom: 1.5rem;
}
.totals-row {
  display: flex;
  gap: 2rem;
  font-size: .9rem;
  color: var(--gray-600);
  min-width: 260px;
  justify-content: space-between;
}
.totals-row--total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  border-top: 1px solid var(--gray-200);
  padding-top: .35rem;
}

/* ── Reports ─────────────────────────────────────── */
.report-wrapper { max-width: 900px; }
.report-header { margin-bottom: 1.5rem; }
.report-header h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin: 0 0 .25rem; }
.report-header p  { font-size: .875rem; color: var(--gray-500); margin: 0; }
.report-section { margin-bottom: 1.5rem; }
.report-section-header {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  padding: .5rem 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: .5rem;
}
.report-table { width: 100%; border-collapse: collapse; }
.report-table td { padding: .45rem .5rem; font-size: .9rem; }
.report-table td.amount { text-align: right; font-variant-numeric: tabular-nums; }
.report-subtotal td { font-weight: 600; border-top: 1px solid var(--gray-200); }
.report-gross td { font-size: 1rem; }
.report-total td {
  font-size: 1.05rem;
  font-weight: 700;
  border-top: 2px solid var(--navy);
  color: var(--navy);
}
.report-bucket-header {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-700);
  margin: 1.5rem 0 .5rem;
}
.report-total-row {
  text-align: right;
  padding: 1rem 0;
  font-size: 1rem;
  border-top: 2px solid var(--navy);
  margin-top: 1rem;
}
.filter-date { padding: .4rem .6rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .875rem; }
.filter-label { font-size: .85rem; color: var(--gray-600); white-space: nowrap; }

/* ── Confirm modal ───────────────────────────────── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.confirm-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
.confirm-msg {
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
}

/* ── Detail / form layout helpers ────────────────── */
.detail-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.two-col-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-page      { max-width: 760px; }
.form-grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.5rem; }
.form-check-row { display: flex; align-items: center; gap: .6rem; }
.form-hint      { font-size: .8rem; color: var(--gray-500); margin: .35rem 0 0; }
.empty-panel    { padding: 2rem; text-align: center; color: var(--gray-500); }
.text-mono      { font-family: monospace; font-size: .875rem; }

/* ── Stat icon colour variants ───────────────────── */
.stat-icon--amber { background: #fef3c7; }
.stat-icon--amber svg { stroke: var(--amber); }
.stat-icon--green { background: #dcfce7; }
.stat-icon--green svg { stroke: var(--green); }

/* ── Accounting nav cards ─────────────────────────── */
.acct-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.acct-nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1.25rem .75rem 1rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 500;
  transition: box-shadow .15s, border-color .15s, transform .1s;
  cursor: pointer;
}
.acct-nav-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(30,94,255,.12);
  transform: translateY(-2px);
  color: var(--blue);
}
.acct-nav-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.acct-nav-card:hover .acct-nav-icon {
  background: #eff4ff;
}
.acct-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--navy);
  transition: stroke .15s;
}
.acct-nav-card:hover .acct-nav-icon svg {
  stroke: var(--blue);
}
.acct-nav-label {
  text-align: center;
  line-height: 1.3;
}
.acct-nav-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.acct-nav-badge--amber {
  background: var(--amber);
  color: var(--navy);
}

@media (max-width: 768px) {
  .detail-grid, .two-col-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .acct-subnav { gap: 0; }
  .acct-tab { padding: .5rem .65rem; font-size: .8rem; }
  .acct-nav-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Platform Administration ────────────────────────────────────────────── */

/* Sub-nav (horizontal strip below topbar) */
.pa-layout { display: flex; flex-direction: column; gap: 0; min-height: calc(100vh - var(--topbar-h)); }
.pa-subnav {
  display: flex; gap: 0; background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem;
  overflow-x: auto;
}
.pa-subnav-item {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem; font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.pa-subnav-item svg { width: 15px; height: 15px; }
.pa-subnav-item:hover { color: var(--navy); }
.pa-subnav-item.active { color: var(--blue); border-bottom-color: var(--blue); }

.pa-content { padding: 2rem 1.75rem; flex: 1; }

.pa-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.pa-page-title { font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.pa-page-subtitle { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }
.pa-section-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray-500);
  margin-bottom: 0.75rem;
}
.pa-section-label.mt-6 { margin-top: 2rem; }
.pa-form-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.pa-form-main { max-width: 760px; }

/* Panel body padding */
.panel-body { padding: 1.25rem 1.5rem; }

/* ── Provider Cards ── */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.provider-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.provider-card--active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,94,255,0.08), var(--shadow);
}
.provider-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem;
}
.provider-name { font-size: 1.05rem; font-weight: 700; color: var(--navy); display: block; }
.provider-type-badge {
  display: inline-block; margin-top: 0.2rem;
  background: var(--gray-100); color: var(--gray-600);
  font-size: 0.75rem; font-weight: 600;
  padding: 0.15rem 0.6rem; border-radius: 20px;
}
.provider-mode {
  font-size: 0.82rem; color: var(--gray-500); margin-bottom: 1rem;
}

/* Provider info card — the "Best For / Monthly Fee / Processing Cost" panel */
.provider-info-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border: 1px solid #c7d9fd;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.provider-info-card--form {
  background: linear-gradient(135deg, #f0f4ff 0%, #edf5ff 100%);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.provider-info-card-title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  margin-bottom: 0.75rem;
}
.provider-info-row {
  display: flex; gap: 0.5rem;
  font-size: 0.84rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(30,94,255,0.1);
}
.provider-info-row:last-child { border-bottom: none; }
.provider-info-label {
  font-weight: 600; color: var(--gray-600);
  min-width: 160px; flex-shrink: 0;
}
.provider-info-value { color: var(--navy); }
.highlight-fee {
  color: #0d3bc4; font-weight: 700;
}
.highlight-rate {
  color: #16a34a; font-weight: 700;
}

.provider-card-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ── Credential field groups ── */
.cred-group {
  padding: 0.75rem 0;
  border-top: 1px solid var(--gray-100);
  margin-top: 0.25rem;
}

/* ── Search bar ── */
.search-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; }
.search-select { width: auto; min-width: 140px; }

/* ── Subscriber detail ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; font-size: 0.9rem; }
.detail-list dt { font-weight: 600; color: var(--gray-500); white-space: nowrap; }
.detail-list dd { color: var(--navy); margin: 0; }
.action-list { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-amber { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.btn-amber:hover { background: #fde68a; }
.btn-green { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.btn-green:hover { background: #bbf7d0; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-500); font-size: 0.95rem;
}
.empty-state .btn { margin-top: 1rem; }

/* ── Form helpers ── */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-error { color: var(--red); font-size: 0.83rem; margin-top: 0.25rem; }
.form-help-inline { color: var(--gray-400); font-size: 0.8rem; font-weight: 400; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.text-muted { color: var(--gray-400); }

/* ── Badge variants ── */
.badge { display:inline-block; font-size:0.74rem; font-weight:600; padding:0.18rem 0.55rem; border-radius:20px; }
.badge--green  { background:#dcfce7; color:#166534; }
.badge--blue   { background:#dbeafe; color:#1d4ed8; }
.badge--amber  { background:#fef3c7; color:#92400e; }
.badge--red    { background:#fee2e2; color:#991b1b; }
.badge--gray   { background:#f1f5f9; color:#475569; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .providers-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .pa-content { padding: 1.25rem 1rem; }
  .provider-info-label { min-width: 120px; }
}


