/* Account workspaces share the existing dashboard shell. */
.workspace-switch-field { padding: 12px 16px; }
.workspace-switch-field label { display: block; margin-bottom: 6px; }
.workspace-switch-field select { width: 100%; }
.account-workspace > .card, .account-workspace > .toolbar { margin-bottom: 20px; }
.account-workspace td .btn-secondary { margin: 3px; }
.account-details { display: grid; gap: 16px; }
.account-details dt { font-weight: 600; }
.account-details dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.account-stat { font-size: 2rem; font-weight: 700; }
.account-document-frame { width: 100%; height: 55vh; border: 1px solid #ddd; background: white; }
/* ==========================================================================
   Kennen Admin — enterprise console design system
   Dark, restrained, structured. One shared system for every admin module.
   ========================================================================== */

:root {
  /* ESG visual system — globally accessible, enterprise-grade palette.
     Environmental (green), Social (blue), Governance (navy).
     Base tokens; the admin console applies the dark ESG theme below
     so the ESG gradient background is active on every route and module.
     All three ESG pillars are available as surface / status tokens. */

  /* ESG core tokens — exact admin palette */
  --environmental: #0F6B4F;
  --environmental-dark: #0A573F;
  --environmental-light: #e8f5ef;
  --social: #155E75;
  --social-dark: #0F4A5C;
  --social-light: #e8f3f8;
  --governance: #0B1F3A;
  --governance-slate: #334155;
  --governance-light: #eef2f7;

  /* Surfaces — light enterprise canvas. Page background is a soft
     off-white so elevated white panels (cards, tables, modals) read as
     distinct surfaces without needing heavy borders or shadows. */
  --bg: #f8faf9;
  --bg-2: #ffffff;
  --bg-elevated: #eef0f3;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --panel-3: #eef0f3;
  --border: #d7e0e5;
  --border-strong: #b9c5cc;

  /* Text — dark governance on light surfaces */
  --text: #172033;
  --text-2: #475569;
  --muted: #64748b;
  --muted-2: #94a3b8;

  /* Brand accent — environmental green. --primary is for fills (buttons,
     active nav, badges, focus rings). --primary-text is a deeper, text-safe
     shade for links/icons rendered directly on light surfaces. */
  --primary: var(--environmental);
  --primary-hover: var(--environmental-dark);
  --primary-active: #073d2e;
  --primary-text: var(--environmental-dark);
  --on-primary: #f1f5f4;
  --primary-soft: rgba(22, 122, 90, 0.12);
  --primary-border: rgba(22, 122, 90, 0.38);

  /* Semantic states — chosen to remain >= 4.5:1 on white. */
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.10);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.14);
  --info: #0369a1;
  --info-soft: rgba(3, 105, 161, 0.10);

  /* ESG state tints for table rows, tags and workflow badges */
  --environmental-soft: #e8f5ef;
  --social-soft: #e8f3f8;
  --governance-soft: #eef2f7;

  /* Shape & motion */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 140ms ease;
  --shadow-pop: 0 16px 40px -16px rgba(7, 26, 23, 0.16);

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --content-max: 1160px;

  /* Render native UI with both light and dark variants supported. */
  color-scheme: light;
}

/* ==========================================================================
   ESG admin theme — default dark console background
   This is the only theme for the admin portal, so the ESG background is
   shown on every route and module regardless of the OS color-scheme.
   ========================================================================== */
:root {
  /* Surfaces */
  --bg: #071C26;
  --bg-2: #082B25;
  --bg-elevated: #102F3A;
  --panel: #102F3A;
  --panel-2: #0B1F3A;
  --panel-3: #082B25;
  --border: #285363;
  --border-strong: #3A6A7A;

  /* Text */
  --text: #F1F5F4;
  --text-2: #CBD5D1;
  --muted: #94A3A8;
  --muted-2: #6B7F7D;

  /* Accent — sustainable green */
  --primary: #0F6B4F;
  --primary-hover: #128A66;
  --primary-active: #0A573F;
  --primary-text: #6EE7B7;
  --on-primary: #FFFFFF;
  --primary-soft: rgba(15, 107, 79, 0.18);
  --primary-border: rgba(15, 107, 79, 0.50);

  /* Semantic tints */
  --success: #4ADE9A;
  --success-soft: rgba(74, 222, 154, 0.14);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --info: #56B4D8;
  --info-soft: rgba(86, 180, 216, 0.12);

  /* ESG shared viewport background — reusable global token, no per-page styles */
  --admin-bg:
    radial-gradient(circle at 15% 15%, rgba(15, 107, 79, 0.20), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(21, 94, 117, 0.18), transparent 34%),
    linear-gradient(135deg, #071C26 0%, #0B1F3A 55%, #082B25 100%);

  color-scheme: dark;
}

html, body { background-color: var(--bg); color: var(--text); }
.login, .admin { background: var(--admin-bg); }
.topbar { background: rgba(11, 31, 58, 0.94); }
.brand, .sidebar, .login-box, .topbar { border-color: var(--border); }
.sidebar { background: var(--governance); }
.brand-mark, .login-brand .brand-mark { background: var(--primary); color: var(--on-primary); }
.card, .report-card, .filters, .panel, .modal, .modal-content, .data-table td, .data-table th { background: var(--panel); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary-soft); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3, h4 { line-height: 1.25; }
.muted { color: var(--muted); }
code { background: var(--panel-3); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.85em; }

/* --------------------------------------------------------------------------
   Focus — keyboard navigation
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); }
.btn-secondary { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.35); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.18); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, .btn-ghost:disabled {
  opacity: 0.45; cursor: not-allowed; transform: none;
}
.btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled), .btn-danger:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-link {
  background: transparent; border: none; padding: 0; margin: 0;
  color: var(--primary); text-decoration: underline; cursor: pointer;
  font: inherit; font-size: 0.85rem;
}
.btn-link:hover { color: var(--primary-hover); text-decoration: none; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.2;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-icon:hover { background: var(--panel-3); color: var(--text); border-color: var(--border-strong); }
.btn-icon.btn-danger:hover { background: var(--danger-soft); }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; background: var(--admin-bg); }
.login-box { width: 400px; max-width: 100%; padding: 2.25rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.login-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.login-box h1 { margin: 0; font-size: 1.4rem; }
.login-box p { color: var(--muted); margin: 0.25rem 0 1.5rem; }
.login-box label { display: block; margin: 0.9rem 0 0.35rem; font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.login-box input { width: 100%; padding: 0.65rem 0.8rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem; }
.login-box input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.login-box button[type="submit"] { width: 100%; margin-top: 1.5rem; padding: 0.75rem; border: none; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: background var(--transition); }
.login-box button[type="submit"]:hover { background: var(--primary-hover); }

/* --------------------------------------------------------------------------
   App shell — sidebar + topbar + content
   -------------------------------------------------------------------------- */
.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--governance);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.brand h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.01em; }

nav { flex: 1; min-height: 0; padding: 0.75rem 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; overflow-y: auto; }
.nav-group { margin-top: 1rem; }
.nav-group:first-child { margin-top: 0.25rem; }
.nav-group-label { display: block; padding: 0 0.75rem 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted-2); }
nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition);
}
nav a .nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; }
nav a:hover { background: rgba(21, 94, 117, 0.16); color: var(--text); }
nav a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
nav a.active .nav-icon { opacity: 1; }

.sidebar-footer { padding: 0.9rem 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.7rem; }
.sidebar-footer .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who strong { display: block; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who small { color: var(--muted); font-size: 0.72rem; }
#logout { padding: 0.35rem 0.6rem; }

/* Main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0 1.75rem;
  background: rgba(11, 31, 58, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
#nav-toggle { display: none; }
.topbar .page-heading { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; }
#page-subtitle { margin: 0; font-size: 0.8rem; color: var(--muted); }
.topbar .topbar-link { color: var(--muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.topbar .topbar-link:hover { color: var(--primary); }

.content { flex: 1; padding: 1.5rem 1.75rem 3rem; overflow-x: hidden; }

.page { max-width: var(--content-max); animation: page-in 160ms ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Global error banner now lives in the topbar region */
.global-error {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.85rem; line-height: 1.45;
  max-width: 46%;
}
.global-error:not(.has-error) { display: none; }
.error-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--danger); color: #fff; font-weight: bold; font-size: 0.75rem; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dashboard-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.dashboard-toolbar h2 { margin: 0 0 0.25rem; font-size: 1.3rem; font-weight: 700; }
.dashboard-toolbar .muted { color: var(--muted); font-size: 0.85rem; }
.dashboard-toolbar > div:last-child { display: flex; align-items: center; gap: 0.6rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); }
/* Dashboard KPI cards get a brand-orange accent bar to anchor the metric visually. */
.cards .card { border-top: 3px solid var(--primary); }
.card h3 { margin: 0; font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.card p { color: var(--muted); margin: 0.2rem 0 0; font-size: 0.82rem; font-weight: 500; }

.dashboard-reports { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.report-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.report-card--wide { grid-column: 1 / -1; }
.report-card h3 { margin: 0; padding: 0.8rem 1.1rem; background: var(--panel-2); font-size: 0.88rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 0.6rem 1.1rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.report-table th { color: var(--muted); font-weight: 500; }
.report-table td { text-align: right; font-weight: 600; }
.report-table tr:last-child th, .report-table tr:last-child td { border-bottom: 0; }
.report-table-scroll { overflow-x: auto; }
.report-table--orders { min-width: 720px; }
.report-table--orders small { display: block; color: var(--muted); font-weight: 400; margin-top: 0.15rem; }
.report-table--orders td { text-align: left; font-weight: 400; }

.analytics-card { margin-top: 1rem; }
.analytics-card > h3 { padding: 0.8rem 1.1rem; }
.analytics-kpis { display: flex; gap: 1.25rem; flex-wrap: wrap; padding: 1rem 1.1rem 0.75rem; }
.analytics-kpis div { min-width: 120px; display: flex; flex-direction: column; gap: 0.15rem; }
.analytics-kpis strong { font-size: 1.5rem; font-weight: 700; color: var(--primary-text); }
.analytics-kpis span { color: var(--muted); font-size: 0.78rem; }
.analytics-card .report-card { margin: 0 1.1rem 1.1rem; }
.analytics-card > div > .report-card { margin: 0.5rem 1.1rem; }

/* --------------------------------------------------------------------------
   Filters / toolbars
   -------------------------------------------------------------------------- */
.filters {
  display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
.filters input, .filters select { min-width: 200px; }
.filters button { flex-shrink: 0; }
.inline-filter { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.85rem; }
.inline-filter select { min-width: 180px; }

/* --------------------------------------------------------------------------
   Form controls (global inside the console)
   One shared design for every text-like field — bare <input> (no type
   attribute), typed inputs, selects and textareas all inherit this block.
   .form-control / .form-input / .input are accepted aliases so existing
   markup using those classes stays identical.
   -------------------------------------------------------------------------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
textarea, select,
.form-control, .form-input, .input {
  padding: 0.55rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.45;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
/* Keep file inputs' native control consistent with the design system. */
input[type="file"] {
  padding: 0.45rem 0.6rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.8rem;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
input[type="file"]::file-selector-button:hover { background: var(--panel-3); }

/* Hover — subtle border lift on all editable fields. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(:disabled):not([readonly]):hover,
textarea:not(:disabled):not([readonly]):hover, select:not(:disabled):hover,
input[type="file"]:not(:disabled):hover,
.form-control:not(:disabled):not([readonly]):hover { border-color: var(--border-strong); }

/* Focus — brand accent border + soft ring. */
input:focus, textarea:focus, select:focus, .form-control:focus, .form-input:focus, .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* Active (being clicked) — keep the accent ring without the stronger focus style. */
input:not([type="checkbox"]):not([type="radio"]):active:not(:disabled), select:active:not(:disabled) {
  border-color: var(--primary-border);
}

/* Placeholder: present but visibly lighter than entered text. */
input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }

/* Disabled / read-only */
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }
input[readonly]:not(:disabled), textarea[readonly]:not(:disabled) {
  background: var(--panel);
  color: var(--muted);
  cursor: default;
}

/* Selects keep their native arrow (rendered dark via color-scheme) and pointer. */
select { cursor: pointer; padding-right: 2rem; }
select option, select optgroup { background: var(--panel); color: var(--text); }
select[multiple] option:checked { background: var(--primary) linear-gradient(0deg, var(--primary), var(--primary)); color: #fff; font-weight: 600; }

/* Native pickers/indicators stay visible against the dark field. */
input::-webkit-calendar-picker-indicator { opacity: 0.75; cursor: pointer; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { opacity: 1; }

/* Textareas: taller, vertically resizable only. */
textarea { min-height: 88px; resize: vertical; }

/* Checkboxes / radios use the accent colour everywhere. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); cursor: pointer; }

/* Browser autofill must not repaint fields white. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* Validation states — error pairs with .is-invalid applied by submitModal/submitSection. */
.is-invalid { border-color: var(--danger) !important; background: rgba(220, 38, 38, 0.06) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.is-valid { border-color: var(--success) !important; }
.is-valid:focus { box-shadow: 0 0 0 3px var(--success-soft) !important; }

/* Structured field: label → hint → input → error */
.field { margin-bottom: 0.9rem; }
.field > label, .field-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.3rem; }
.field > input, .field > select, .field > textarea { width: 100%; }
.field-hint { color: var(--muted); font-size: 0.75rem; margin: 0.25rem 0 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem 1rem; }
.field-grid .field { margin-bottom: 0; }

/* A label that wraps its control directly (implicit label association,
   used where a stable id isn't available/needed, e.g. repeated rows or
   read-only detail fields) still lays out as label-above-field. Selector is
   scoped per-container too so it always outranks .modal/.content-section/
   .call-form > label (equal specificity, defined later in this file). */
.modal label.field-label-wrap, .content-section label.field-label-wrap,
.call-form label.field-label-wrap, .field label.field-label-wrap,
label.field-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 0.6rem 0;
}
label.field-label-wrap > input, label.field-label-wrap > select, label.field-label-wrap > textarea { width: 100%; }

/* --------------------------------------------------------------------------
   Data tables
   -------------------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: var(--panel-2); font-weight: 700; white-space: nowrap;
}
.data-table td { font-size: 0.88rem; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tr:hover td { background: var(--panel-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td .btn-secondary, .data-table td .btn-icon { margin-right: 0.3rem; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; background: var(--panel-3); border: 1px solid var(--border-strong); }
.badge.New { color: var(--primary-text); background: var(--primary-soft); border-color: var(--primary-border); }
.badge.Featured { color: var(--warning); background: var(--warning-soft); border-color: rgba(180,83,9,0.3); }
.badge.Contacted { color: var(--warning); background: var(--warning-soft); border-color: rgba(180,83,9,0.3); }
.badge.Qualified { color: var(--success); background: var(--success-soft); border-color: rgba(21,128,61,0.3); }
.badge.Won, .badge.Paid, .badge.Published { color: var(--success); background: var(--success-soft); border-color: rgba(21,128,61,0.3); }
.badge.Lost, .badge.Failed { color: var(--danger); background: var(--danger-soft); border-color: rgba(220,38,38,0.3); }
.badge.Spam, .badge.Draft, .badge.Created { color: var(--muted); }
.badge.Pending { color: var(--warning); background: var(--warning-soft); border-color: rgba(180,83,9,0.3); }

/* Pagination */
.pagination { display: flex; gap: 0.4rem; margin-top: 1rem; align-items: center; flex-wrap: wrap; }
.pagination button { padding: 0.4rem 0.75rem; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.82rem; }
.pagination button:hover:not(:disabled) { background: var(--panel-3); border-color: var(--border-strong); }
/* renderPagination() marks the current page with `disabled` — style that as
   the active page (brand orange) rather than a greyed-out control. */
.pagination button:disabled {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
  font-weight: 700; opacity: 1; cursor: default;
}
.pagination .page-info { color: var(--muted); font-size: 0.82rem; margin: 0 0.5rem; }

/* --------------------------------------------------------------------------
   Content sections / configuration cards
   -------------------------------------------------------------------------- */
.content-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}
.content-section > h3 {
  margin: 0 0 1rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.95rem; font-weight: 700;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.content-section > h3 small { color: var(--muted); font-weight: 500; }
.content-section .items { list-style: none; padding: 0; margin: 0.5rem 0; color: var(--text); font-size: 0.9rem; }
.content-section .items li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.content-section .items li:last-child { border-bottom: 0; }
.content-section .items li small { color: var(--muted); }
.content-section .content-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
.content-actions { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.content-heading { margin: 1.75rem 0 0.75rem; font-size: 1.15rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }

/* Forms inside configuration cards: stacked label → control */
.content-section > label, .call-form > label, .modal > label {
  display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin: 0.85rem 0 0.3rem;
}
.content-section > label:first-of-type { margin-top: 0; }
.content-section > input, .content-section > select, .content-section > textarea { width: 100%; max-width: 520px; display: block; }
.content-section > textarea { max-width: 100%; }

/* Checkbox rows become selectable pills */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; margin-top: 0.4rem; }
.modal label:has(input[type="checkbox"]),
.content-section label:has(input[type="checkbox"]),
.call-form label:has(input[type="checkbox"]) {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  margin: 0.4rem 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.check-grid label:has(input[type="checkbox"]) { margin: 0; }
label:has(input[type="checkbox"]):hover { border-color: var(--border-strong); background: var(--panel-2); }
label:has(input[type="checkbox"]):has(input:checked) { border-color: var(--primary-border); background: var(--primary-soft); color: var(--text); }
.modal input[type="checkbox"], .content-section input[type="checkbox"], .call-form input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
}

/* Sub-groups inside a config card (e.g. cybersecurity) */
.config-subgroup { margin-top: 1.15rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.config-subgroup > h4 { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.config-subgroup:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

/* Actions row inside cards/forms */
.content-section .actions, .call-form .actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); align-items: center; }
.content-section .actions .btn-danger, .call-form .actions .btn-danger { margin-left: auto; }

/* --------------------------------------------------------------------------
   Pricing Config workspace
   -------------------------------------------------------------------------- */
.pc-context {
  display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; margin-bottom: 1rem;
}
.pc-context .pc-context-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); }
.pc-context select { min-width: 280px; font-weight: 600; }
.pc-context .badge { margin-left: auto; }

.pc-tabs { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.1rem; }
.pc-tab-group { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.pc-group-label {
  min-width: 128px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-2); padding-top: 0.45rem;
}
.pc-tab { padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.82rem; }
.pc-tab.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Resources table — wide, horizontally scrollable with inline-editable cells */
.pc-table-scroll { overflow-x: auto; }
.pc-table-scroll .data-table { min-width: 1400px; }
.pc-cell-input {
  width: 4.6rem; padding: 0.28rem 0.4rem; font-size: 0.85rem;
  background: var(--bg-elevated, var(--panel)); border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px); color: inherit;
}
.pc-cell-input.pc-cell-cost { width: 7rem; }
.pc-cell-input:focus { border-color: var(--primary); outline: none; }

/* Industry vertical badge + assignment card */
.pc-vertical-badge { background: var(--primary-soft, rgba(122, 31, 61, 0.12)); color: var(--primary); border: 1px solid var(--primary-border, var(--primary)); }
.pc-vertical-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin: 0.75rem 0; background: var(--bg-elevated, var(--panel));
  max-width: 640px;
}

/* Preview & publish summary */
.pc-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.pc-summary-item { display: flex; align-items: center; gap: 0.55rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 0.85rem; }
.pc-summary-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.pc-summary-item.ok .dot { background: var(--success); }
.pc-summary-item.ok { border-color: rgba(21,128,61,0.3); }

/* Advanced settings disclosure on the pricing config page */
.pc-advanced { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.pc-advanced > .pc-advanced-summary {
  cursor: pointer; list-style: none; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2);
  padding: 0.25rem 0 0.6rem;
}
.pc-advanced > .pc-advanced-summary::before { content: '▸ '; }
.pc-advanced[open] > .pc-advanced-summary::before { content: '▾ '; }

/* Milestone template item rows inside the modal */
.mt-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; margin-bottom: 0.6rem; }
.mt-item .mt-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.mt-item label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.mt-item label.field-label-wrap { font-size: 0.75rem; color: var(--muted); margin: 0; }
.mt-item input { width: 100%; }
.mt-item .field { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Account settings
   -------------------------------------------------------------------------- */
.account-settings-card { max-width: 560px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.6rem; }
.account-settings-card h2 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.settings-form { margin-top: 1.1rem; }
.settings-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin: 0.9rem 0 0.3rem; }
.password-field { display: flex; gap: 0.5rem; }
.password-field input { flex: 1; }
.password-field .btn-secondary { min-width: 64px; }
.password-hint { color: var(--muted); font-size: 0.78rem; margin: 0.6rem 0; }
.settings-form .success { color: var(--success); margin: 0.75rem 0; font-size: 0.85rem; }
.settings-form .btn-primary { margin-top: 1.1rem; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 8, 7, 0.7);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 60; overflow: auto; padding: 3vh 1rem;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 660px;
  max-height: 90vh; overflow: auto;
  padding: 1.5rem 1.6rem 3rem;
  box-shadow: var(--shadow-pop);
  animation: modal-in 160ms ease;
  scroll-padding-bottom: 4rem;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.modal .proposal-block { border-top: 1px solid var(--border-strong); margin-top: 1rem; padding-top: 0.4rem; }
.modal .proposal-block .muted { font-size: 0.8rem; margin: 0.2rem 0 0.6rem; word-break: break-all; }
.modal > p.muted { margin-top: 0; }
.modal input, .modal textarea, .modal select { width: 100%; }
.modal .actions {
  display: flex; gap: 0.6rem; margin-top: 1.4rem; justify-content: flex-end;
  position: sticky; bottom: -1.6rem; background: var(--panel);
  padding: 1rem 0 0.2rem; border-top: 1px solid var(--border);
}
.modal .actions button { min-width: 84px; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; justify-content: flex-end; }

.modal-error-bar { display: none; background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem; margin-bottom: 1rem; color: var(--danger); font-size: 0.85rem; }
.modal-error-bar.has-error { display: block; }
.modal-error-bar ul { margin: 0; padding-left: 1.2rem; }
.modal-error-bar li { margin: 0.2rem 0; }

.field-error-inline { color: var(--danger); font-size: 0.75rem; margin: 0.3rem 0 0.4rem; }
.form-grid > .field-error-inline { grid-column: 1 / -1; }
.error { color: var(--danger); margin-top: 0.75rem; font-size: 0.85rem; }
.success { color: var(--success); font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   Confirm dialog
   -------------------------------------------------------------------------- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 8, 7, 0.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.confirm-box {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  max-width: 420px; width: 100%; padding: 1.4rem 1.5rem; box-shadow: var(--shadow-pop);
  animation: modal-in 160ms ease;
}
.confirm-box h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.confirm-box p { margin: 0 0 1.25rem; color: var(--text-2); font-size: 0.9rem; }
.confirm-box .confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
#toast-root { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: 0.6rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--panel-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 0.7rem 1rem;
  font-size: 0.86rem; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-pop); pointer-events: auto;
  animation: toast-in 220ms ease;
  max-width: 380px;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.toast-success { border-color: rgba(21,128,61,0.4); }
.toast.toast-success::before { background: var(--success); }
.toast.toast-error { border-color: rgba(220,38,38,0.4); color: var(--danger); }
.toast.toast-error::before { background: var(--danger); }
.toast.toast-out { opacity: 0; transform: translateY(6px); transition: opacity 200ms ease, transform 200ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Call history / misc
   -------------------------------------------------------------------------- */
.call-history { display: grid; gap: 0.5rem; max-height: 240px; overflow: auto; }
.call-entry { padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.call-entry strong, .call-entry small { display: block; }
.call-entry small { color: var(--muted); margin-top: 0.2rem; }
.call-entry p { margin: 0.35rem 0 0; font-size: 0.85rem; }
.call-entry .follow-up { color: var(--warning); }
.call-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1rem; }
.call-form h3 { margin-top: 0; font-size: 0.95rem; }
.call-form .error { margin-top: 0.5rem; }

/* Empty / loading states */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state strong { display: block; color: var(--text-2); font-size: 0.95rem; margin-bottom: 0.25rem; }
.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--radius-sm); min-height: 1em; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(15,23,42,0.06), transparent); animation: skeleton-shimmer 1.4s infinite; }
@keyframes skeleton-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -3px; margin-right: 0.45rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Reduced motion — respect user preference and keep the console lightweight
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   CKEditor 5 dark-theme overrides
   -------------------------------------------------------------------------- */
.ck-editor-target { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); min-height: 260px; }
.ck-editor { min-height: 260px; }
.ck.ck-editor__main > .ck-editor__editable { background: var(--bg-2) !important; color: var(--text) !important; min-height: 240px; border: none !important; }
.ck.ck-editor__main > .ck-editor__editable.ck-focused { box-shadow: none !important; }
.ck-editor-target + .field-error-inline { margin-top: 0.4rem; }
.ck.ck-toolbar { background: var(--panel-2) !important; border-color: var(--border) !important; }
.ck.ck-toolbar .ck.ck-button { color: var(--text) !important; }
.ck.ck-toolbar .ck.ck-button.ck-on, .ck.ck-toolbar .ck.ck-button:hover { background: var(--primary) !important; color: var(--on-primary) !important; }
.ck.ck-dropdown__panel { background: var(--panel) !important; border-color: var(--border) !important; }
.ck.ck-list__item { color: var(--text) !important; }
.ck.ck-list__item .ck-button:hover { background: var(--primary) !important; color: var(--on-primary) !important; }
.ck.ck-input-text { background: var(--bg-2) !important; color: var(--text) !important; border-color: var(--border) !important; }
.ck-editor-fallback { width: 100%; min-height: 260px; padding: 0.6rem 0.75rem; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: 0.9rem; line-height: 1.5; resize: vertical; }
.ck-editor-fallback-note { display: block; margin: 0.25rem 0 0.4rem; color: var(--danger-text, var(--muted)); }

/* Make rich-text content look like the live site while editing, so pasted or
   typed content previews against the theme instead of CKEditor defaults. */
.ck.ck-editor__main > .ck-editor__editable { font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif; line-height: 1.7; }
.ck.ck-editor__main > .ck-editor__editable h1,
.ck.ck-editor__main > .ck-editor__editable h2,
.ck.ck-editor__main > .ck-editor__editable h3,
.ck.ck-editor__main > .ck-editor__editable h4 { color: var(--text); margin: 1.25em 0 0.4em; line-height: 1.25; font-weight: 600; }
.ck.ck-editor__main > .ck-editor__editable p { margin-bottom: 0.9em; }
.ck.ck-editor__main > .ck-editor__editable a { color: var(--primary-text, var(--primary)); }
.ck.ck-editor__main > .ck-editor__editable blockquote { border-left: 3px solid var(--primary); margin: 1em 0; padding: 0.25em 0 0.25em 1em; color: var(--muted); font-style: normal; }
.ck.ck-editor__main > .ck-editor__editable table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.ck.ck-editor__main > .ck-editor__editable td,
.ck.ck-editor__main > .ck-editor__editable th { border: 1px solid var(--border); padding: 0.5em 0.75em; }
.ck.ck-editor__main > .ck-editor__editable img { max-width: 100%; border-radius: 0.75rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  :root { --content-max: 100%; }
  .content { padding: 1.25rem 1.25rem 3rem; }
}

@media (max-width: 880px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow-pop);
  }
  .admin.nav-open .sidebar { transform: none; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgba(4, 8, 7, 0.6);
    opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  }
  .admin.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  #nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); cursor: pointer; font-size: 1.1rem;
  }
  .topbar { padding: 0 1rem; gap: 0.75rem; }
  .global-error { max-width: 100%; order: 3; flex-basis: 100%; }
  .topbar { flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .content { padding: 1rem 1rem 3rem; }
  .data-table { display: block; overflow-x: auto; }
  .modal { padding: 1.25rem 1.15rem; max-height: 94vh; }
  .pc-group-label { min-width: 100%; }
  #toast-root { left: 1rem; right: 1rem; }
  .toast { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   Maroon ESG enterprise admin theme
   -------------------------------------------------------------------------- */
:root {
  /* Maroon ESG design tokens — exact from spec */
  --primary-maroon: #7A1F3D;
  --primary-maroon-dark: #54142A;
  --primary-maroon-light: #F3E7EB;

  --environment-green: #2F6B4F;
  --environment-green-dark: #1F4D38;
  --environment-green-light: #E6F1EB;

  --governance-gold: #C49A3A;
  --governance-gold-dark: #947127;
  --governance-gold-light: #F7EED8;

  --social-terracotta: #A8563F;
  --social-terracotta-light: #F7EAE6;

  --page-background: #F7F3ED;
  --surface-primary: #FFFFFF;
  --surface-secondary: #FBF8F4;
  --border-default: #D8CEC5;

  --text-primary: #241F20;
  --text-secondary: #625A5D;
  --text-on-dark: #FFFFFF;

  --success: #287A50;
  --success-background: #E5F4EB;
  --warning: #9A6700;
  --warning-background: #FFF4D6;
  --error: #B42318;
  --error-background: #FEECEB;
  --info: #285E8E;
  --info-background: #E8F1F8;

  /* Admin semantic mapping */
  --admin-bg: var(--page-background);
  --admin-surface: var(--surface-primary);
  --admin-surface-cream: var(--surface-secondary);
  --admin-surface-dark: var(--primary-maroon-dark);
  --admin-sidebar: var(--primary-maroon-dark);
  --admin-primary: var(--primary-maroon);
  --admin-primary-hover: var(--primary-maroon-dark);
  --admin-primary-active: var(--primary-maroon-dark);
  --admin-text: var(--text-primary);
  --admin-text-light: var(--text-on-dark);
  --admin-muted: var(--text-secondary);
  --admin-border: var(--border-default);
  --admin-focus: var(--governance-gold);

  --bg: var(--page-background);
  --bg-2: var(--surface-primary);
  --bg-elevated: var(--surface-secondary);
  --panel: var(--surface-primary);
  --panel-2: var(--surface-secondary);
  --panel-3: #F2EEEA;
  --border: var(--border-default);
  --border-strong: #C7BEB5;

  --text: var(--text-primary);
  --text-2: var(--text-secondary);
  --muted: var(--text-secondary);
  --muted-2: #9D9496;

  --primary: var(--primary-maroon);
  --primary-hover: var(--primary-maroon-dark);
  --primary-active: var(--primary-maroon-dark);
  --primary-text: var(--primary-maroon);
  --on-primary: var(--text-on-dark);
  --primary-soft: rgba(122, 31, 61, 0.10);
  --primary-border: rgba(122, 31, 61, 0.40);

  /* Semantic states */
  --success-soft: var(--success-background);
  --danger: var(--error);
  --danger-soft: var(--error-background);
  --warning-soft: var(--warning-background);
  --info-soft: var(--info-background);

  /* Legacy ESG tokens mapped to maroon palette */
  --environmental: var(--environment-green);
  --environmental-dark: var(--environment-green-dark);
  --environmental-light: var(--environment-green-light);
  --social: var(--social-terracotta);
  --social-dark: #8A4230;
  --social-light: var(--social-terracotta-light);
  --governance: var(--primary-maroon);
  --governance-slate: var(--primary-maroon-dark);
  --governance-light: var(--primary-maroon-light);

  --shadow-pop: 0 16px 40px -16px rgba(36, 31, 32, 0.12);

  color-scheme: light;
}

html, body { background-color: var(--admin-bg); color: var(--admin-text); }
.login, .admin { background: var(--admin-bg); }

/* Shell */
.topbar {
  background: rgba(122, 31, 61, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: var(--text-on-dark);
  --text: var(--text-on-dark);
  --text-2: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.70);
  --muted-2: rgba(255, 255, 255, 0.62);
  --panel-2: rgba(255, 255, 255, 0.10);
  --panel-3: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.24);
}
.topbar .topbar-link:hover { color: var(--governance-gold); }

.sidebar {
  background: var(--primary-maroon-dark);
  border-right-color: rgba(255, 255, 255, 0.10);
  color: var(--text-on-dark);
  --text: var(--text-on-dark);
  --text-2: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.70);
  --muted-2: rgba(255, 255, 255, 0.62);
  --panel-2: rgba(255, 255, 255, 0.08);
  --panel-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
}
nav a:hover { background: rgba(196, 154, 58, 0.14); color: var(--text-on-dark); }
nav a.active { background: var(--governance-gold); color: var(--primary-maroon-dark); border-color: var(--governance-gold); }
nav a.active .nav-icon { color: var(--primary-maroon-dark); }
.brand-mark { background: var(--governance-gold); color: var(--primary-maroon-dark); }

/* Dashboard KPI cards */
.cards .card {
  background: var(--primary-maroon-dark);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 3px solid var(--governance-gold);
  --text: var(--text-on-dark);
  --text-2: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.70);
  --panel-2: rgba(255, 255, 255, 0.08);
  --panel-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
}
.cards .card:hover { border: 1px solid var(--governance-gold); border-top: 3px solid var(--governance-gold); }
.cards .card h3 { color: var(--governance-gold); }
.cards .card p { color: rgba(255, 255, 255, 0.78); }

/* Tables and report headers */
.data-table th {
  background: var(--primary-maroon-dark);
  color: var(--text-on-dark);
  border-color: rgba(255, 255, 255, 0.10);
}
.data-table td { background: var(--admin-surface); color: var(--text-primary); }
.data-table tr:hover td { background: var(--surface-secondary); }
.report-table thead th {
  background: var(--primary-maroon-dark);
  color: var(--text-on-dark);
  border-color: rgba(255, 255, 255, 0.10);
}
.report-card h3 {
  background: var(--primary-maroon-dark);
  color: var(--text-on-dark);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

/* Modals */
.modal { background: var(--admin-surface); color: var(--admin-text); }
.modal > h2:first-of-type {
  background: var(--primary-maroon-dark);
  color: var(--text-on-dark);
  padding: 0.8rem 1rem;
  margin: 0 -0.5rem 1rem;
  border-radius: var(--radius-sm);
}
.modal .actions { background: var(--admin-surface); border-top-color: var(--admin-border); }

/* Overlays and backdrops */
.modal-overlay { background: rgba(36, 31, 32, 0.55); }
.confirm-overlay { background: rgba(36, 31, 32, 0.55); }
.sidebar-backdrop { background: rgba(36, 31, 32, 0.55); }

/* Accent details and focus */
.analytics-kpis strong { color: var(--governance-gold); }
.skeleton::after { background: linear-gradient(90deg, transparent, rgba(122, 31, 61, 0.06), transparent); animation: skeleton-shimmer 1.4s infinite; }
:focus-visible { outline-color: var(--governance-gold); }

/* Buttons */
.btn-primary { background: var(--primary-maroon); color: var(--text-on-dark); border-color: var(--primary-maroon); }
.btn-primary:hover { background: var(--primary-maroon-dark); border-color: var(--primary-maroon-dark); }
.btn-primary:disabled { background: #A89A9E; border-color: #A89A9E; color: var(--text-on-dark); opacity: 0.7; }
.btn-secondary { background: var(--surface-primary); color: var(--primary-maroon); border-color: var(--primary-maroon); }
.btn-secondary:hover { background: var(--primary-maroon-light); color: var(--primary-maroon-dark); border-color: var(--primary-maroon-dark); }
.btn-danger { background: var(--error-background); color: var(--error); border-color: rgba(180, 35, 24, 0.35); }
.btn-danger:hover { background: rgba(180, 35, 24, 0.12); color: var(--error); border-color: rgba(180, 35, 24, 0.45); }
.btn-success { background: var(--environment-green); color: var(--text-on-dark); border-color: var(--environment-green); }
.btn-success:hover { background: var(--environment-green-dark); border-color: var(--environment-green-dark); }
.btn-warning { background: var(--governance-gold); color: var(--text-primary); border-color: var(--governance-gold); }
.btn-warning:hover { background: var(--governance-gold-dark); border-color: var(--governance-gold-dark); color: var(--text-on-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-default); }
.btn-ghost:hover { background: var(--surface-secondary); color: var(--primary-maroon); border-color: var(--primary-maroon); }
.btn-icon { background: transparent; border-color: var(--border-default); color: var(--text-secondary); }
.btn-icon:hover { background: var(--surface-secondary); border-color: var(--border-strong); color: var(--primary-maroon); }

/* Form controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
textarea, select,
.form-control, .form-input, .input {
  background: var(--surface-primary);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* ---------------------------------------------------------------------------
   Accordion navigation
   -------------------------------------------------------------------------- */
nav { overflow-y: auto; }
.nav-group { margin-top: 0.25rem; }
.nav-section-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-section-trigger:hover,
.nav-section-trigger[aria-expanded="true"] {
  background: rgba(21, 94, 117, 0.16);
  color: var(--text);
}
.nav-section-trigger .nav-section-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-section-trigger .nav-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 200ms ease;
  opacity: 0.7;
  pointer-events: none;
  transform: rotate(-90deg);
}
.nav-section-trigger[aria-expanded="true"] .nav-chevron { transform: rotate(0deg); }
.nav-section-trigger .nav-icon,
nav a .nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; }
.nav-section-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 200ms ease;
  overflow: hidden;
}
.nav-section-panel.is-open { grid-template-rows: 1fr; }
.nav-section-panel > div { min-height: 0; }
.nav-section-panel a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-section-panel a:hover { background: rgba(21, 94, 117, 0.16); color: var(--text); }
.nav-section-panel a.active,
nav a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.nav-section-panel a.active .nav-icon,
nav a.active .nav-icon { opacity: 1; color: var(--on-primary); }
.nav-group-active .nav-section-trigger { color: var(--governance-gold); }

/* Compact mode */
.sidebar.compact { width: 64px; }
.sidebar.compact .brand { justify-content: center; padding: 1rem 0.5rem; }
.sidebar.compact .brand-wordmark,
.sidebar.compact .nav-section-label,
.sidebar.compact .nav-chevron,
.sidebar.compact .sidebar-footer .who,
.sidebar.compact .sidebar-footer #logout { display: none; }
.sidebar.compact .nav-section-trigger { justify-content: center; padding: 0.6rem; }
.sidebar.compact nav a { justify-content: center; padding-left: 0.6rem; }
.sidebar.compact nav a span { display: none; }
.sidebar.compact .nav-section-trigger,
.sidebar.compact nav a { position: relative; }
.sidebar.compact .nav-section-trigger[title]:hover::after,
.sidebar.compact nav a[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
}

/* Focus visible */
.nav-section-trigger:focus-visible,
.nav-section-panel a:focus-visible {
  outline: 2px solid var(--governance-gold);
  outline-offset: -2px;
}

@media (max-width: 880px) {
  .nav-section-trigger { padding: 0.7rem 1rem; }
  .nav-section-panel a { padding-left: 2.75rem; }
  .sidebar.compact { width: var(--sidebar-w); }
  .sidebar.compact .brand { justify-content: flex-start; padding: 1.25rem 1.25rem 1rem; }
  .sidebar.compact .nav-section-label,
  .sidebar.compact .nav-chevron,
  .sidebar.compact .sidebar-footer .who,
  .sidebar.compact .sidebar-footer #logout { display: initial; }
  .sidebar.compact .brand-wordmark { display: flex; }
  .sidebar.compact .nav-section-trigger { justify-content: flex-start; padding: 0.7rem 1rem; }
  .sidebar.compact nav a { justify-content: flex-start; padding-left: 2.75rem; }
  .sidebar.compact nav a span { display: inline; }
}
input:focus, textarea:focus, select:focus, .form-control:focus, .form-input:focus, .input:focus {
  border-color: var(--governance-gold);
  box-shadow: 0 0 0 3px rgba(196, 154, 58, 0.15);
  outline: none;
}
input[type="file"] { background: var(--surface-primary); color: var(--text-secondary); border-color: var(--border-default); }
input[type="file"]::file-selector-button {
  background: var(--surface-secondary);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
input[type="file"]::file-selector-button:hover { background: var(--surface-primary); border-color: var(--governance-gold); color: var(--primary-maroon); }

/* Badges and status */
.badge { background: var(--surface-secondary); border-color: var(--border-default); color: var(--text-secondary); }
.badge.New { color: var(--primary-maroon); background: var(--primary-maroon-light); border-color: rgba(122, 31, 61, 0.30); }
.badge.Featured { color: var(--warning); background: var(--warning-background); border-color: rgba(154, 103, 0, 0.30); }
.badge.Contacted { color: var(--warning); background: var(--warning-background); border-color: rgba(154, 103, 0, 0.30); }
.badge.Qualified { color: var(--success); background: var(--success-background); border-color: rgba(40, 122, 80, 0.30); }
.badge.Won, .badge.Paid, .badge.Published, .badge.approved, .badge.completed, .badge.active { color: var(--success); background: var(--success-background); border-color: rgba(40, 122, 80, 0.30); }
.badge.Lost, .badge.Failed, .badge.rejected, .badge.critical { color: var(--error); background: var(--error-background); border-color: rgba(180, 35, 24, 0.30); }
.badge.Spam, .badge.Draft, .badge.Created, .badge.pending, .badge.under-review { color: var(--warning); background: var(--warning-background); border-color: rgba(154, 103, 0, 0.30); }
.badge.Pending { color: var(--governance-gold); background: var(--governance-gold-light); border-color: rgba(196, 154, 58, 0.30); }
.badge.archived, .badge.disabled, .badge.inactive { color: var(--text-secondary); background: #EFEBEA; border-color: var(--border-default); }
.badge.info, .badge.processing { color: var(--info); background: var(--info-background); border-color: rgba(40, 94, 142, 0.30); }

/* Toast */
.toast { border-color: var(--border-default); background: var(--surface-primary); color: var(--text-primary); }
.toast.toast-success { border-color: rgba(40, 122, 80, 0.4); }
.toast.toast-error { border-color: rgba(180, 35, 24, 0.4); color: var(--error); }
.toast.toast-warning { border-color: rgba(154, 103, 0, 0.4); color: var(--warning); }
.toast.toast-info { border-color: rgba(40, 94, 142, 0.4); color: var(--info); }

/* Pagination */
.pagination button { background: var(--surface-primary); border-color: var(--border-default); color: var(--text-primary); }
.pagination button:hover:not(:disabled) { background: var(--surface-secondary); border-color: var(--border-strong); color: var(--primary-maroon); }
.pagination button.active { background: var(--primary-maroon); color: var(--text-on-dark); border-color: var(--primary-maroon); }
.pagination button:disabled { background: var(--surface-secondary); color: var(--text-secondary); cursor: not-allowed; }

/* Rich text editor */
.ck-editor-target { background: var(--surface-primary); border-color: var(--border-default); }
.ck.ck-editor__main > .ck-editor__editable { background: var(--surface-primary) !important; color: var(--text-primary) !important; }

/* Empty / loading states */
.empty { color: var(--text-secondary); background: var(--surface-secondary); border: 1px dashed var(--border-default); }
.skeleton { background: linear-gradient(90deg, var(--surface-secondary) 25%, var(--page-background) 50%, var(--surface-secondary) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; }

/* Feature edit checkbox row */
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.field-row label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }

/* Plan content section manager */
.section-list { max-height: 60vh; overflow-y: auto; padding-right: 0.5rem; }
.section-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem; border: 1px solid var(--border-default); border-radius: 0.5rem; margin-bottom: 0.5rem; background: var(--surface-secondary); }
.section-card__meta { flex: 1; min-width: 0; }
.section-card__meta strong { color: var(--text-primary); }
.section-card__lang { display: inline-block; margin: 0 0.35rem; padding: 0.1rem 0.4rem; border-radius: 0.25rem; background: var(--page-background); font-size: 0.75rem; text-transform: uppercase; }
.section-card__actions { display: flex; gap: 0.35rem; }
.section-card__actions button { min-width: 2rem; }

/* Full-screen rich text editor */
.ck-editor--fullscreen { position: fixed; inset: 0; z-index: 2000; background: var(--page-background); display: flex; flex-direction: column; padding: 1rem; }
.ck-editor--fullscreen .ck.ck-editor { display: flex; flex-direction: column; height: 100%; }
.ck-editor--fullscreen .ck.ck-editor__main { flex: 1; overflow: auto; }
.ck-editor--fullscreen .ck-editor__editable { min-height: 60vh; }

.feature-image-preview img { max-width: 160px; border-radius: 0.25rem; }

/* Section preview and version history */
.section-preview-body { max-width: 100%; overflow-x: auto; }
.section-preview-body img,
.section-preview-body iframe,
.section-preview-body video { max-width: 100%; height: auto; border-radius: 0.25rem; }
.section-preview-body table { width: 100%; border-collapse: collapse; }
.section-preview-body th,
.section-preview-body td { border: 1px solid var(--border); padding: 0.5rem; }
.version-list { display: flex; flex-direction: column; gap: 0.5rem; }

#page-business-growth .pc-context { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#page-business-growth .pc-context h2 { margin: 0.15rem 0 0; }
#page-business-growth .pc-context label { margin-left: auto; }
#page-business-growth .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
#page-business-growth .field { min-width: 0; }
#page-business-growth .field label { display: block; margin-bottom: 0.35rem; color: var(--text-2); font-weight: 600; }
#page-business-growth .field input:not([type="checkbox"]), #page-business-growth .field select, #page-business-growth .field textarea { width: 100%; }
#page-business-growth .bg-field-wide { grid-column: 1 / -1; }
#page-business-growth .bg-check { display: flex; align-items: center; }
#page-business-growth .bg-check label { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
#page-business-growth .bg-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(130px, 1fr)) auto auto auto; gap: 0.6rem; align-items: center; }
#page-business-growth .bg-filters > * { min-width: 0; width: 100%; }
.bg-bulk-toolbar, .bg-list-footer, .bg-preview-controls, .bg-drag-cell { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bg-bulk-toolbar { margin: 0.8rem 0; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.bg-bulk-toolbar[hidden], [data-bg-panel][hidden], .bg-preview-frame[hidden] { display: none; }
.bg-bulk-toolbar strong { margin-right: auto; }
.bg-list-footer { justify-content: space-between; }
.bg-order-help { margin: 0.75rem 0; }
.bg-drag-cell { min-width: 155px; }
.bg-drag-handle { cursor: grab; border: 0; background: transparent; color: var(--text); font-size: 1.2rem; }
tr[draggable="true"].bg-row-selected td { background: var(--primary-soft); }
tr[draggable="true"]:active { opacity: 0.75; }
.bg-contrast-fail { color: var(--danger); font-weight: 700; }
.bg-preview-frame { width: min(100%, 1120px); margin: 1rem auto; padding: 1.5rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--preview-bg, #102f3a); color: var(--preview-text, #fff); transition: width var(--transition); }
.bg-preview-frame.is-tablet { width: min(100%, 760px); }
.bg-preview-frame.is-mobile { width: min(100%, 390px); }
.bg-preview-badge { color: var(--preview-accent, #6ee7b7); font-weight: 700; }
.bg-preview-grid { display: grid; grid-template-columns: repeat(var(--preview-cols, 3), minmax(0, 1fr)); gap: 1px; margin-top: 1rem; background: transparent; }
.is-tablet .bg-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-mobile .bg-preview-grid { grid-template-columns: 1fr; }
.bg-preview-card { min-height: 220px; display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid currentColor; background: color-mix(in srgb, var(--preview-bg, #102f3a) 90%, white); }
.bg-preview-card img { width: 48px; height: 48px; object-fit: contain; }
.bg-preview-card p { flex: 1; }
.bg-preview-card button { align-self: flex-start; padding: 0.5rem 0.8rem; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: var(--radius-sm); }
@media (max-width: 1050px) { #page-business-growth .bg-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { #page-business-growth .form-grid, #page-business-growth .bg-filters { grid-template-columns: 1fr; } #page-business-growth .bg-field-wide { grid-column: auto; } #page-business-growth .pc-context label { margin-left: 0; } .bg-preview-grid { grid-template-columns: 1fr; } }

/* Product Promotion Flow: ordered partnership pipeline */
.flow-pipeline { display: flex; align-items: stretch; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.flow-stage { min-width: 190px; flex: 1 0 190px; display: flex; flex-direction: column; margin: 0; }
.flow-stage-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.flow-stage-head h4 { margin: 0; font-size: 0.95rem; }
.flow-step { flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primary); color: var(--on-primary, #fff); font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; }
.flow-stage p { flex: 1; font-size: 0.85rem; margin: 0 0 0.8rem; }
.flow-stage-foot { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.flow-stage-foot button { margin-left: auto; padding: 0.3rem 0.7rem; }
.flow-arrow { align-self: center; color: var(--muted, #888); font-size: 1.1rem; flex: 0 0 auto; }
@media (max-width: 700px) {
  .flow-pipeline { flex-direction: column; overflow: visible; }
  .flow-stage { min-width: 0; }
  .flow-arrow { transform: rotate(90deg); padding: 0.15rem 0; }
}

/* Platform Journey: unified enterprise platform diagram */
.pj-layout { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(220px, 260px); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.pj-main { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.pj-rail { display: flex; flex-direction: column; gap: 0.9rem; position: sticky; top: 1rem; }
.pj-rail-title { margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pj-row { display: grid; gap: 0.9rem; }
.pj-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pj-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-center { grid-template-columns: minmax(0, 360px); justify-content: center; }
.pj-track, .pj-lifecycle { display: flex; flex-direction: column; }
.pj-lifecycle { max-width: 460px; width: 100%; align-self: center; }
.pj-arrow { text-align: center; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0.35rem 0; }
.pj-node { background: var(--governance); color: #e2ecf7; border: 2px solid transparent; border-radius: 10px; padding: 0.8rem 0.9rem; box-shadow: 0 2px 6px rgba(11, 31, 58, 0.18); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.pj-node-dark { background: #050d18; border-style: dashed; border-color: #3b4f6b; }
.pj-node-db { border-radius: 50% / 14px; padding-top: 1.2rem; }
.pj-node.is-source { border-color: #7dd3fc; }
.pj-node.is-linked { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35); transform: translateY(-1px); }
.pj-node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.pj-node-head h4 { margin: 0; font-size: 0.9rem; line-height: 1.3; color: #fff; }
.pj-count { flex: 0 0 auto; min-width: 2rem; text-align: center; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 700; font-size: 0.85rem; }
.pj-summary { margin: 0.35rem 0 0; font-size: 0.78rem; color: #b6c6da; }
.pj-pending { display: inline-block; margin-top: 0.45rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(245, 158, 11, 0.22); color: #fcd34d; font-size: 0.75rem; font-weight: 600; }
.pj-links { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.pj-link { padding: 0.2rem 0.55rem; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; background: transparent; color: #e2ecf7; font-size: 0.75rem; cursor: pointer; }
.pj-link:hover, .pj-link:focus-visible { background: rgba(255, 255, 255, 0.14); border-color: #fff; outline: none; }
.pj-connects { margin: 0.5rem 0 0; font-size: 0.72rem; color: #8fa6c2; font-style: italic; }
@media (max-width: 1200px) {
  .pj-layout { grid-template-columns: minmax(0, 1fr); }
  .pj-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .pj-rail > .pj-node { flex: 1 1 220px; }
  .pj-rail-title { flex-basis: 100%; }
  .pj-rail-right { order: 3; }
}
@media (max-width: 700px) { .pj-row-3, .pj-row-2 { grid-template-columns: minmax(0, 1fr); } }

/* Shared marketing footer, visible on both login and workspace screens. */
.admin-footer {
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 0.75rem;
  background: var(--primary-maroon-dark);
  border-top: 1px solid var(--border-default);
  color: var(--text-on-dark);
}
.admin-footer-inner { width: 100%; max-width: 1440px; margin-inline: auto; }
.admin-footer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-bottom: 0.75rem; }
.admin-footer-bar > span { font-weight: 600; }
.admin-footer .admin-footer-links {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  min-height: 44px;
  padding: 0;
  overflow: visible;
}
.admin-footer .admin-footer-links a,
.admin-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.admin-footer .admin-footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 0.82rem; }
.admin-footer a:hover { color: var(--governance-gold); text-decoration: underline; }
.admin-footer-directory { border-block: 1px solid rgba(255, 255, 255, 0.16); }
.admin-footer-directory > summary { min-height: 44px; padding-block: 0.65rem; cursor: pointer; font-weight: 500; }
.admin-footer-directory > summary:focus-visible { outline-color: var(--governance-gold); }
.admin-footer-directory-content { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; padding-block: 1rem; }
.admin-footer-section { min-width: 0; }
.admin-footer-section h2 { margin: 0 0 0.65rem; font-size: 0.9rem; color: var(--governance-gold); }
.admin-footer-section h3 { margin: 1rem 0 0.35rem; font-size: 0.82rem; }
.admin-footer-section p { margin: 0; color: rgba(255, 255, 255, 0.72); font-size: 0.78rem; line-height: 1.6; }
.admin-footer-section ul { display: grid; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.admin-footer-section li { line-height: 1.4; }
.admin-footer-section a { display: inline-block; padding-block: 0.1rem; font-size: 0.78rem; line-height: 1.45; }
.admin-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding-top: 0.75rem; color: rgba(255, 255, 255, 0.72); font-size: 0.78rem; }
.admin-footer-bottom p { margin: 0; }
@media (max-width: 900px) {
  .admin-footer-directory-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (max-width: 560px) {
  .admin-footer { padding-inline: 1rem; }
  .admin-footer-directory-content { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .admin-footer .admin-footer-links { gap: 0 0.75rem; }
}


/* Partner Pipeline: lowercased status badges */
.badge.approved, .badge.active, .badge.signed, .badge.won, .badge.settled { color: var(--success); background: var(--success-soft, var(--success-background)); border-color: rgba(21,128,61,0.3); }
.badge.lost, .badge.rejected, .badge.terminated, .badge.cancelled, .badge.expired { color: var(--danger, var(--error)); background: var(--danger-soft, var(--error-background)); border-color: rgba(220,38,38,0.3); }
.badge.submitted, .badge.underreview, .badge.pendingsignature, .badge.accrued, .badge.disputed, .badge.pending { color: var(--warning); background: var(--warning-soft, var(--warning-background)); border-color: rgba(180,83,9,0.3); }
.badge.draft { color: var(--muted); }

/* --- Site Pages (CMS) --- */
#page-landing-pages .section-toolbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
#page-landing-pages .section-toolbar h2 { margin: 0; margin-right: auto; font-size: 1.05rem; }
#page-landing-pages .filters { margin-bottom: 1rem; }
#page-landing-pages .filters input { min-width: 220px; }
.modal .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.modal .form-grid .field { min-width: 0; }
.modal .bg-check { display: flex; align-items: center; }
.modal .bg-check label { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 500; color: var(--text-2); }
.cms-media-preview { min-height: 3.5rem; display: flex; align-items: center; padding: 0.4rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-2); }
.cms-media-panel { margin-top: 0.5rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); max-height: 300px; overflow: auto; }
.cms-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.6rem; }
.cms-media-cell { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; font-size: 0.72rem; color: var(--text-2); word-break: break-all; text-align: center; }
button.cms-media-cell:hover { border-color: var(--primary); }
.cms-media-cell img { width: 100%; height: 64px; object-fit: cover; border-radius: 0.25rem; }
.cms-related-picker { max-height: 140px; overflow: auto; padding: 0.4rem 0.2rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 700px) { .modal .form-grid { grid-template-columns: 1fr; } }

/* --- Kennen CMS document editor --- */
.cms-editor-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cms-editor-topbar-left { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cms-editor-topbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cms-editor-heading { margin: 0 0 0 0.5rem; font-size: 1.2rem; display: inline-block; vertical-align: middle; }
.cms-tabs { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.cms-tab { padding: 0.45rem 1.1rem; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.cms-tab:hover { color: var(--text); }
.cms-tab.is-active { background: var(--primary); color: #fff; }
.cms-doc-fields { margin-bottom: 1rem; }
.cms-doc-fields .field > label { font-weight: 600; }
#cms-doc-title { font-size: 1.15rem; font-weight: 600; }
.cms-doc-section { margin-bottom: 1rem; }
.cms-doc-section-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.cms-sec-index { font-size: 0.8rem; }
.cms-sec-tools { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.cms-sec-toggle { display: flex; align-items: center; gap: 0.45rem; margin: 0.4rem 0 0.75rem; font-size: 0.85rem; color: var(--text-2); cursor: pointer; }
.cms-sec-toggle input[type="checkbox"] { margin: 0; }
.cms-sec-heading { width: 100%; font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.cms-sec-sub { width: 100%; margin-bottom: 0.75rem; }
.cms-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.cms-sec-layout { max-width: 220px; }
.cms-sec-note { margin: 0.25rem 0 0; }
.cms-doc-section.is-hidden-section { border-style: dashed; opacity: 0.8; }
.cms-item-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; margin-bottom: 0.6rem; background: var(--bg-2); }
.cms-item-card.is-hidden-section { border-style: dashed; opacity: 0.75; }
.cms-item-grid { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.cms-item-foot { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.cms-item-foot .cms-sec-tools { margin-left: auto; }
.cms-media-picker--compact { display: inline-flex; align-items: center; gap: 0.4rem; }
.cms-media-thumb { display: inline-flex; align-items: center; min-width: 48px; min-height: 32px; }
.cms-media-thumb img { max-width: 48px !important; max-height: 32px !important; }
.cms-media-picker--compact .cms-media-panel { position: absolute; z-index: 30; width: min(520px, 90vw); }
.cms-media-picker--compact { position: relative; }
.ck-lazy { min-height: 90px; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: text; overflow: hidden; }
.ck-lazy:hover { border-color: var(--primary); }
.ck-lazy:focus-within { border-color: var(--primary); }
.cms-add-section { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.cms-editor-footer { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 0; margin-top: 0.5rem; border-top: 1px solid var(--border); background: var(--bg-2); z-index: 5; }
#cms-save-status[data-tone="error"] { color: var(--danger, #dc2626); }
#cms-save-status[data-tone="warn"] { color: var(--warning, #b45309); }
.cms-preview-host { border: 1px solid var(--border); border-radius: 0.5rem; min-height: 300px; max-height: 72vh; overflow: auto; }
@media (max-width: 700px) {
  .cms-two-col, .cms-item-grid { grid-template-columns: 1fr; }
}

/* --- Sales pipeline board --- */
.sp-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.sp-column { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 160px; display: flex; flex-direction: column; }
.sp-column-head { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; }
.sp-cards { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; }
.sp-card { text-align: left; background: var(--bg-1, #fff); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.15rem; font: inherit; }
.sp-card:hover { border-color: var(--primary); }
.sp-card strong { font-size: 0.9rem; }
.sp-card .muted { font-size: 0.78rem; }
.sp-activity { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.sp-activity li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }

/* --- Checkout funnel metrics --- */
.cf-metrics { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cf-motion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.cf-metric { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; display: flex; flex-direction: column; min-width: 110px; cursor: pointer; }
.cf-metric:hover { border-color: var(--primary); }
.cf-metric-value { font-size: 1.3rem; font-weight: 700; }
@media (max-width: 700px) {
  .sp-board { grid-auto-flow: row; grid-auto-columns: unset; }
}

/* --- Sidebar search --- */
.nav-search { padding: 0.5rem 0.75rem; }
.nav-search input {
  width: 100%; padding: 0.45rem 0.7rem; font-size: 0.85rem;
  background: var(--panel-2, var(--bg-2)); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.nav-search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* --- Tables --- */
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Report bars (executive reports / analytics) --- */
.report-bar-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.35rem 0; }
.report-bar-label { flex: 0 0 9rem; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { flex: 1; height: 0.5rem; background: var(--bg-2, rgba(0,0,0,.06)); border-radius: 999px; overflow: hidden; }
.report-bar-fill { height: 100%; background: var(--primary); }
.report-bar-value { flex: 0 0 auto; font-size: 0.8rem; color: var(--muted); }

/* --- Button-styled links in modals/filters --- */
.link-btn { text-decoration: none; display: inline-block; }
a.link { color: var(--primary); cursor: pointer; }

/* --- Business-owner workspace (business-workspace-ops.js) + shared detail/badge rows --- */
.toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar select { min-width: 12rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.stat-card { padding: 0.9rem 1rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.attention-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.attention-list li { margin: 0.3rem 0; }
.details-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5rem 1.2rem; }
.detail-row label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.15rem; }
.detail-row p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.data-table td.actions { white-space: nowrap; }

/* Field grids followed or preceded by single fields keep the same vertical rhythm. */
.field-grid + .field, .field + .field-grid, .field-grid + .field-grid { margin-top: 0.9rem; }
.field-grid .field-span-all { grid-column: 1 / -1; }
.field-grid .field-span-wide { grid-column: span 2; }
.lead-qualification .field-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.lead-qualification .field label { display: block; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-qualification .field input, .lead-qualification .field select, .lead-qualification .field textarea { box-sizing: border-box; min-height: 2.4rem; }
.lead-qualification .field textarea { resize: vertical; }
.lead-qualification .lead-activity-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 0.9rem 1rem; align-items: start; }
@media (max-width: 640px) { .field-grid .field-span-wide { grid-column: 1 / -1; } .lead-qualification .lead-activity-row { grid-template-columns: 1fr; } }

/* Match the company wordmark across the login view and admin sidebar. */
.brand-wordmark { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.brand-wordmark h1,
.brand-wordmark h2 { margin: 0; color: var(--text-on-dark); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand-wordmark > span { margin-top: 0.15rem; color: rgba(255, 255, 255, 0.78); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.16em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.login-brand .brand-wordmark h1 { color: var(--text-primary); font-size: 1rem; }
.login-brand .brand-wordmark > span { color: var(--text-secondary); }
.brand .brand-mark,
.login-brand .brand-mark { display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, #4ade9a 0%, #2fbc7d 100%); color: #04231a; }
