/*
  Wedding Video Portal - StoryBoard Design System
  Fonts: Inter (UI) + JetBrains Mono (numbers/dates) + Source Serif 4 (editorial)
  Accent: orange #E47118. Light = default-applied (body.theme-light), Dark = :root.
*/

/* ================================================================
   StoryBoard Design System — tokens extracted from
   design-upgrade/hifi/Hi-fi Design.html (accent: orange #E47118)
   Architecture preserved: :root = DARK default, .theme-light = LIGHT.
   Raw ramps + scales are theme-independent; semantic tokens differ
   per theme; legacy names (--primary, --surface-*, --text-*) are kept
   as aliases so existing CSS/templates keep working unchanged.
   ================================================================ */
:root {
  /* --- Raw color ramps (theme-independent) --- */
  --orange-50:  #FFF5EC; --orange-100: #FFE5CD; --orange-200: #FBC79A;
  --orange-300: #F4A463; --orange-400: #ED863A; --orange-500: #E47118;
  --orange-600: #C45D0E; --orange-700: #9C480A; --orange-800: #6F3208;

  --gray-0:   #FFFFFF; --gray-25:  #FAFAFA; --gray-50:  #F5F5F4;
  --gray-100: #EFEEEC; --gray-200: #E5E4E1; --gray-300: #D4D2CE;
  --gray-400: #A6A4A0; --gray-500: #797772; --gray-600: #57554F;
  --gray-700: #3D3B36; --gray-800: #26241F; --gray-900: #18171A; --gray-950: #0E0D10;

  --green-50: #E7F5EC; --green-100: #C8E8D2; --green-500: #1A8A4A; --green-600: #156E3B; --green-700: #0E5C2F;
  --red-50:   #FCEAE7; --red-100:   #F7C8C0; --red-500:   #C92F1F; --red-600:   #A52415;
  --amber-50: #FFF6E0; --amber-100: #FFE7A8; --amber-500: #C58F12; --amber-600: #A0750B;

  --avatar-amber: #D69810; --avatar-blue: #2A6AD0; --avatar-magenta: #C03A8E;
  --avatar-orange: #F08A2B; --avatar-pink: #D8478F; --avatar-purple: #8259C9; --avatar-teal: #0FA98E;

  /* --- Brand --- */
  --brand:       var(--orange-500);
  --brand-hover: var(--orange-600);
  --fg-on-brand: #FFFFFF;

  /* --- Typography families --- */
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;

  /* --- Type scale --- */
  --fs-xxs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 32px; --fs-4xl: 40px; --fs-5xl: 56px;
  --lh-tight: 1.15; --lh-snug: 1.3; --lh-body: 1.5;
  --tracking-tight: -0.01em; --tracking-eyebrow: 0.06em;

  /* --- Spacing (px scale) --- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --section-gap: 24px; --card-pad: 22px; --row-pad-y: 12px;

  /* --- Radius --- */
  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --radius-xl: 14px; --radius-2xl: 20px; --radius-pill: 9999px;

  /* --- Motion --- */
  --dur-fast: 120ms; --dur-base: 180ms; --dur-slow: 260ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);

  /* ================= DARK theme (app default) ================= */
  --bg-page:    #0E0D10;
  --bg-surface: #141317;
  --bg-subtle:  #1A191E;
  --bg-muted:   #211F25;
  --fg-default: #E5E2DD;
  --fg-strong:  #F4F2EF;
  --fg-muted:   #9C9893;
  --fg-subtle:  #6B6862;
  --border-soft:    rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.16);
  --brand-soft: rgba(228, 113, 24, 0.10);
  --brand-tint: rgba(228, 113, 24, 0.06);

  --status-paid-bg:    rgba(30, 138, 73, 0.15);  --status-paid-fg:    #5DD18A;          --status-paid-dot:    #2BB36A;
  --status-editing-bg: rgba(230, 154, 26, 0.14); --status-editing-fg: #F0B658;          --status-editing-dot: #E69A1A;
  --status-pending-bg: rgba(255, 255, 255, 0.06);--status-pending-fg: var(--fg-muted);  --status-pending-dot: var(--gray-400);
  --status-danger-bg:  rgba(201, 47, 31, 0.16);  --status-danger-fg:  #F58A7E;          --status-danger-dot:  var(--red-500);
  --status-info-bg:    rgba(42, 106, 208, 0.18); --status-info-fg:    #7FB3F0;          --status-info-dot:    #4A8AE0;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.50);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.60);
  --shadow-focus: 0 0 0 3px rgba(228, 113, 24, 0.25);

  /* ================= Legacy aliases (keep existing CSS working) ================= */
  --bg-900: var(--bg-page);
  --bg-850: var(--bg-subtle);
  --bg-800: var(--bg-surface);
  --surface-800: var(--bg-surface);
  --surface-700: var(--bg-subtle);
  --surface-600: var(--bg-muted);

  --text-100: var(--fg-default);
  --text-200: var(--fg-default);
  --text-300: var(--fg-muted);
  --text-500: var(--fg-subtle);
  --text-muted: var(--fg-muted);
  --text-primary: var(--fg-strong);
  --text-secondary: var(--fg-muted);
  --text-color: var(--fg-default);
  --border-color: var(--border-default);
  --field-bg: var(--bg-muted);

  --primary: var(--brand);
  --primary-700: var(--orange-700);
  --primary-600: var(--orange-600);
  --primary-500: var(--orange-500);
  --primary-400: var(--orange-400);
  --primary-300: var(--orange-300);
  --accent: var(--orange-400);
  --accent-dark: var(--orange-600);
  --success: var(--green-500);
  --success-color: var(--green-500);
  --warning: var(--amber-500);
  --danger: var(--red-500);
  --info: var(--avatar-blue);
  --brand-gold-subtle: var(--brand-soft);

  --font-heading: var(--font-sans);
  --font-body: var(--font-sans);

  --radius: var(--radius-lg);
  --radius-full: var(--radius-pill);

  --transition-fast: var(--dur-fast) var(--ease-out);
  --transition-normal: var(--dur-base) var(--ease-out);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;

  --bs-body-color: var(--fg-default);
  --bs-heading-color: var(--fg-strong);
  --bs-secondary-color: var(--fg-muted);
  --bs-border-color: var(--border-default);

  --field-view-bg: rgba(255, 255, 255, 0.04);
  --field-view-border: var(--border-soft);
  --field-edit-bg: var(--brand-soft);
  --field-edit-border: rgba(228, 113, 24, 0.35);
}

html, body {
  color-scheme: light dark;
}

body {
  background: var(--bg-page);
  color: var(--fg-default);
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
  background: rgba(26, 29, 32, 0.85) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(228, 113, 24, 0.15);
  position: relative;
  z-index: 1030;
}
.navbar-brand {
  font-weight: 700;
  color: var(--text-100) !important;
  transition: opacity 0.2s ease;
}
.navbar-brand:hover {
  opacity: 0.85;
}
.navbar-brand img {
  transition: transform 0.2s ease;
}
.navbar-brand:hover img {
  transform: scale(1.1);
}
.navbar-brand .brand-text strong {
  color: var(--text-100);
}
.navbar-brand .brand-text small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-500) !important;
}
.nav-link {
  color: var(--text-300) !important;
}
.nav-link:hover { color: var(--accent) !important; }

/* Footer */
.footer {
  background: rgba(26, 29, 32, 0.85);
  border-top: 1px solid rgba(228, 113, 24, 0.15);
  backdrop-filter: blur(10px);
}
.footer-link {
  color: var(--primary) !important;
  font-weight: 600;
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: var(--accent) !important;
}

/* Layout */
.main-container {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Cards */
.card {
  background: var(--surface-800);
  border: 1px solid rgba(228, 113, 24, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.card-header {
  background: transparent;
  color: var(--fg-strong);
  font-weight: 600;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem 1.25rem;
}

/* Buttons */
.btn-primary {
  /* Override Bootstrap's button CSS vars so hover/active/focus stay brand
     (otherwise Bootstrap's default blue --bs-btn-hover-bg shows on hover). */
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-color: var(--fg-on-brand);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-hover-color: var(--fg-on-brand);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-active-color: var(--fg-on-brand);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-disabled-color: var(--fg-on-brand);
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  color: var(--fg-on-brand);
}
.btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active {
  background: var(--brand-hover);
  box-shadow: 0 8px 24px rgba(228, 113, 24, 0.4);
}
/* Soft-filled brand button (was a transparent / cyan outline) */
.btn-outline-primary {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(228, 113, 24, 0.35);
}
.btn-outline-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--fg-on-brand);
}
.btn-danger { background: var(--danger); border: none; }
.btn-warning { background: var(--primary); border: none; color: var(--fg-on-brand); }
/* Neutral filled buttons (StoryBoard Hi-fi) — surface fill + border, like .btn-outline-light.
   No transparent/ghost look. (.btn-group .btn-outline-secondary keeps its own tab styling.) */
.btn-light, .btn-secondary, .btn-outline-secondary, .btn-outline-light {
  background: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
}
.btn-light:hover, .btn-secondary:hover, .btn-outline-secondary:hover, .btn-outline-light:hover {
  background: var(--bg-subtle);
  color: var(--fg-strong);
  border-color: var(--border-strong);
}

/* Tabs - Make unselected tabs MUCH more visible */
/* Tabs — StoryBoard underline style (replaces legacy orange pills).
   Only video_examples + manage_video_examples use .nav-tabs. */
.nav-tabs {
  border-bottom: 1px solid var(--border-default) !important;
  margin-bottom: 1rem;
  gap: var(--sp-1);
}

.nav-tabs .nav-link {
  color: var(--fg-muted) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: var(--sp-3) !important;
  font-weight: 500 !important;
  font-size: var(--fs-sm);
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.nav-tabs .nav-link:hover {
  color: var(--fg-strong) !important;
  background: transparent !important;
  border-bottom-color: var(--border-strong) !important;
}

.nav-tabs .nav-link.active {
  color: var(--fg-strong) !important;
  background: transparent !important;
  border-bottom: 2px solid var(--brand) !important;
  font-weight: 600 !important;
}

.nav-tabs .nav-link i {
  opacity: 0.9;
}

.nav-tabs .nav-link.active i {
  opacity: 1;
}

/* Button Group Tabs (Project Workflow) - Make unselected tabs visible */
.btn-group .btn-outline-secondary {
  color: var(--text-500) !important;
  background-color: rgba(228, 113, 24, 0.08) !important;
  border-color: rgba(228, 113, 24, 0.25) !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-group .btn-outline-secondary:hover:not(:disabled) {
  color: var(--text-100) !important;
  background-color: rgba(228, 113, 24, 0.15) !important;
  border-color: rgba(228, 113, 24, 0.4) !important;
}

/* Active tab - ultra-specific selectors to override Bootstrap */
.btn-group[role="group"] button.btn.btn-outline-secondary.btn-sm.active,
.btn-group button[type="button"].btn-outline-secondary.active,
div.btn-group button.btn.btn-outline-secondary.active,
.btn-group .btn-outline-secondary.active,
.btn-group .btn.btn-outline-secondary.active,
.btn-group button.btn-outline-secondary.active,
button.btn.btn-outline-secondary.btn-sm.active,
.btn-group[role="group"] .btn-outline-secondary.active,
.btn-outline-secondary.active {
  color: var(--fg-on-brand) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* Ensure active state overrides focus, hover, and active pseudo-classes */
.btn-group .btn-outline-secondary.active:hover,
.btn-group .btn-outline-secondary.active:focus,
.btn-group .btn-outline-secondary.active:active,
button.btn-outline-secondary.active:hover,
button.btn-outline-secondary.active:focus {
  color: var(--fg-on-brand) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: none !important;
}

.btn-group .btn-outline-secondary:disabled {
  color: rgba(154, 168, 168, 0.4) !important;
  background-color: rgba(228, 113, 24, 0.03) !important;
  border-color: rgba(228, 113, 24, 0.1) !important;
  opacity: 0.5;
}

/* Radio Button Groups (Currency Selector) - Checked State */
.btn-check:checked + .btn-outline-secondary,
.btn-check:checked + .btn.btn-outline-secondary {
  color: var(--fg-on-brand) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600 !important;
}

.btn-check:checked + .btn-outline-secondary:hover,
.btn-check:checked + .btn-outline-secondary:focus,
.btn-check:checked + .btn.btn-outline-secondary:hover,
.btn-check:checked + .btn.btn-outline-secondary:focus {
  color: var(--fg-on-brand) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Forms */
.form-control, .form-select, .form-control:disabled, .form-select:disabled {
  background-color: var(--surface-600);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-100);
  border-radius: var(--radius-md);
}
.form-control::placeholder { 
  color: var(--text-500); 
  opacity: 0.5;
}
.form-select::placeholder {
  color: var(--text-500);
  opacity: 0.5;
}
textarea.form-control::placeholder {
  color: var(--text-500);
  opacity: 0.5;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(228, 113, 24, 0.5);
  box-shadow: var(--shadow-focus);
  background-color: var(--surface-700);
  color: var(--text-100);
}

/* File input (Choose file) - dark theme alignment */
input[type="file"].form-control, input[type="file"] {
  background-color: var(--surface-600);
  color: var(--text-100);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}
/* Button part of file input (modern browsers) */
input[type="file"]::file-selector-button {
  background: var(--surface-700);
  color: var(--text-100);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  margin-right: 0.75rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: var(--surface-600);
}

/* Select dropdown options in dark mode */
select.form-control option {
  background-color: var(--surface-600);
  color: var(--text-100);
}
select.form-control optgroup {
  background-color: var(--surface-700);
  color: var(--text-100);
}

/* View mode fields (read-only look) */
.form-control-plaintext {
  display: block;
  width: 100%;
  color: var(--text-100);
  background: var(--field-view-bg);
  border: 1px solid var(--field-view-border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0;
  min-height: 42px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Edit mode highlight */
.editable-section.editing {
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
}
.editable-section.editing .edit-mode .form-control,
.editable-section.editing .edit-mode .form-select,
.editable-section .edit-mode .form-control:focus,
.editable-section .edit-mode .form-select:focus {
  background-color: var(--field-edit-bg);
  border-color: var(--field-edit-border);
  box-shadow: 0 0 0 0.15rem rgba(228, 113, 24, 0.12);
}

/* Tables */
.table {
  color: var(--text-100);
  background: var(--surface-800);
}
.table thead { background: rgba(228, 113, 24, 0.08); }
.table tr { border-color: rgba(228, 113, 24, 0.12); }

/* Badges / Status */
.badge { border-radius: 999px; font-weight: 600; }

/* Status pills — StoryBoard "balloon" style: soft bg + colored dot */
.status-badge,
.status-proposed, .status-accepted, .status-contractsigned,
.status-pendingedit, .status-editing, .status-completed, .status-declined {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.status-badge::before,
.status-proposed::before, .status-accepted::before, .status-contractsigned::before,
.status-pendingedit::before, .status-editing::before, .status-completed::before, .status-declined::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, currentColor);
  flex-shrink: 0;
}
.status-proposed       { background: var(--status-pending-bg); color: var(--status-pending-fg); --dot: var(--status-pending-dot); }
.status-accepted       { background: var(--status-info-bg);    color: var(--status-info-fg);    --dot: var(--status-info-dot); }
.status-contractsigned { background: var(--status-info-bg);    color: var(--status-info-fg);    --dot: var(--status-info-dot); }
.status-pendingedit    { background: var(--status-editing-bg); color: var(--status-editing-fg); --dot: var(--status-editing-dot); }
.status-editing        { background: var(--status-editing-bg); color: var(--status-editing-fg); --dot: var(--status-editing-dot); }
.status-completed      { background: var(--status-paid-bg);    color: var(--status-paid-fg);    --dot: var(--status-paid-dot); }
.status-declined       { background: var(--status-danger-bg);  color: var(--status-danger-fg);  --dot: var(--status-danger-dot); font-weight: 600; }

/* Alerts — aliniate la paleta tonala StoryBoard (--status-*, adaptive pe ambele teme, ca .sb-note) */
.alert { border: 1px solid var(--border-soft); }
.alert-info { background: var(--status-info-bg); color: var(--status-info-fg); }
.alert-success { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.alert-warning { background: var(--status-editing-bg); color: var(--status-editing-fg); }
.alert-danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }

/* <code> inside alerts: brighter on dark for IBAN / payment refs readability */
.alert-info code,
.alert-success code,
.alert-warning code,
.alert-danger code {
  color: var(--accent);
  background: rgba(228, 113, 24, 0.10);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Toast Notifications - Floating at top of viewport */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  max-width: 420px;
  width: calc(100% - 40px);
}

.toast-notification {
  background: var(--surface-800);
  border: 1px solid rgba(228, 113, 24, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease-out;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.toast-notification.toast-success {
  border-left: 4px solid var(--success);
  background: var(--surface-800);
}

.toast-notification.toast-error {
  border-left: 4px solid var(--danger);
  background: var(--surface-800);
}

.toast-notification.toast-warning {
  border-left: 4px solid var(--primary);
  background: var(--surface-800);
}

.toast-notification.toast-info {
  border-left: 4px solid #9aa8a8;
  background: var(--surface-800);
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning .toast-icon {
  color: var(--primary);
}

.toast-info .toast-icon {
  color: #9aa8a8;
}

.toast-content {
  flex: 1;
  color: var(--text-100);
  font-size: 0.95rem;
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-300);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  margin: -4px -4px -4px 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-100);
}

.toast-close:active {
  transform: scale(0.9);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-notification.toast-hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* Light theme toast overrides */
.theme-light .toast-notification {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.theme-light .toast-notification.toast-success {
  background: #ffffff;
}

.theme-light .toast-notification.toast-error {
  background: #ffffff;
}

.theme-light .toast-notification.toast-warning {
  background: #ffffff;
}

.theme-light .toast-notification.toast-info {
  background: #ffffff;
}

.theme-light .toast-close {
  color: var(--text-500);
}

.theme-light .toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-100);
}

/* Mobile responsive toast */
@media (max-width: 767px) {
  .toast-container {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: none;
    width: auto;
  }
  
  .toast-notification {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }
  
  .toast-icon {
    font-size: 1.25rem;
  }
  
  .toast-content {
    font-size: 0.85rem;
  }
}

/* Lists */
.list-group-item {
  background: var(--surface-800);
  color: var(--text-100);
  border-color: rgba(228, 113, 24, 0.12);
}
.list-group-item-action:hover {
  background: rgba(228, 113, 24, 0.08);
}

/* Project cards */
.project-card {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

/* Upcoming event backgrounds */
.bg-upcoming-urgent {
  background: rgba(196, 106, 106, 0.12) !important;
  border-left: 4px solid var(--danger) !important;
}

.bg-upcoming-warning {
  background: rgba(228, 113, 24, 0.12) !important;
  border-left: 4px solid var(--warning) !important;
}

.bg-upcoming-soon {
  background: rgba(91, 156, 214, 0.12) !important;
  border-left: 4px solid #5b9cd6 !important;
}

/* Weekday tag (dashboard "Event Date") — ziua săptămânii prescurtată (3 litere),
   rotită 90° antiorar și lipită în stânga datei. Sâmbăta (ziua „normală" de nuntă)
   rămâne discretă; orice altă zi primește un chip portocaliu ca să sară în ochi.
   Vezi Project.get_event_weekday(). */
.ev-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wd-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  flex: none;
  user-select: none;
}
.wd-tag i {
  transform: rotate(-90deg);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.5px;
  font-style: normal;
  white-space: nowrap;
  color: var(--fg-subtle);
}
.wd-tag--off {
  width: 18px;
}
.wd-tag--off i {
  background: var(--warning);
  color: #fff;
  padding: 3px 5px;
  border-radius: 5px;
  font-weight: 700;
}
.theme-light .wd-tag--off i {
  background: #bab7ad; /* gri deschis (~50% din intensitatea antracitului) */
  color: #45443e;      /* text închis — albul nu mai e lizibil pe nuanța deschisă */
}

/* Month alternating stripe (dashboard) — subtle bg so consecutive months stand
   apart. Needs !important to beat ".project-table tbody tr { background:transparent
   !important }", but keeps selector specificity (0,2,1) below tr:hover (0,2,2) so
   row hover still wins. Color comes from a theme var so both themes use the same
   selector (no extra specificity that would override hover in light theme). */
:root { --month-stripe-bg: rgba(255, 255, 255, 0.05); }
.theme-light { --month-stripe-bg: rgba(0, 0, 0, 0.04); }
tr.project-row.month-stripe-alt {
  background-color: var(--month-stripe-bg) !important;
}

/* Urgency badges */
.badge-urgency {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Payment status badge animations */
.pulse-badge {
  animation: pulse-payment 2s ease-in-out infinite;
}

@keyframes pulse-payment {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Project type badges - Subtle, elegant colors */
.badge-type-nunta {
  background: rgba(219, 112, 147, 0.2);
  color: #f5b8c8;
  border: 1px solid rgba(219, 112, 147, 0.3);
  font-weight: 600;
}

.badge-type-botez {
  background: rgba(135, 206, 235, 0.2);
  color: #a8d8ea;
  border: 1px solid rgba(135, 206, 235, 0.3);
  font-weight: 600;
}

.badge-type-altele {
  background: rgba(186, 148, 214, 0.2);
  color: #c9b3d6;
  border: 1px solid rgba(186, 148, 214, 0.3);
  font-weight: 600;
}

/* ============================================================
   Dropdowns — StoryBoard (adaptiv prin tokeni: aceeasi regula in
   ambele teme; FARA override-uri .theme-light)
   ============================================================ */
.dropdown-menu {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: none !important;
  padding: 6px !important;
  min-width: 12rem;
  font-size: var(--fs-sm);
  color: var(--fg-default);
  z-index: 1040 !important;
}
.dropdown-item {
  color: var(--fg-default) !important;
  background-color: transparent !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 0.7rem !important;
  font-size: var(--fs-sm);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.dropdown-item i,
.dropdown-item .bi { color: var(--fg-muted); }
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--brand-tint) !important;
  color: var(--fg-strong) !important;
}
.dropdown-item:hover i,
.dropdown-item:focus i { color: var(--brand); }
.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--brand) !important;
  color: var(--fg-on-brand) !important;
}
.dropdown-item.active i,
.dropdown-item:active i { color: var(--fg-on-brand); }
.dropdown-item.disabled,
.dropdown-item:disabled { color: var(--fg-subtle) !important; background-color: transparent !important; }
.dropdown-header {
  color: var(--fg-muted) !important;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  padding: 0.5rem 0.7rem 0.3rem;
}
.dropdown-divider {
  border-top: 1px solid var(--border-soft) !important;
  margin: 6px 4px;
  opacity: 1;
}

/* Language Switcher Dropdown — aliniat la tokeni (adaptiv) */
.language-dropdown {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  min-width: 160px !important;
  padding: 6px !important;
  backdrop-filter: none !important;
}

.language-dropdown li {
  background-color: transparent !important;
}

.language-dropdown .dropdown-item,
.language-dropdown button.dropdown-item {
  color: var(--fg-default) !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 0.7rem !important;
  font-size: var(--fs-sm) !important;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out) !important;
  cursor: pointer !important;
  width: 100% !important;
  text-align: left !important;
  display: block !important;
}

.language-dropdown .dropdown-item:hover,
.language-dropdown button.dropdown-item:hover {
  background-color: var(--brand-tint) !important;
  color: var(--fg-strong) !important;
}

.language-dropdown .dropdown-item.active,
.language-dropdown button.dropdown-item.active {
  background-color: var(--brand) !important;
  color: var(--fg-on-brand) !important;
  font-weight: 600 !important;
}

/* Modals - Dark Theme (Default) */
.modal-content {
  background-color: var(--surface-800) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text-100) !important;
}
.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(228, 113, 24, 0.1) !important;
}
.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background-color: transparent !important;
}
.modal-title {
  color: var(--text-100) !important;
}
.modal-body {
  color: var(--text-100) !important;
  background-color: var(--surface-800) !important;
}

/* Close button (alerts, modals) on dark */
.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.7;
}
.btn-close:hover { opacity: 1; }

/* Links (exclude .btn so button-links keep their own color) */
a:not(.btn) { color: var(--brand); }
a:not(.btn):hover { color: var(--brand-hover); }

/* Field History Modal */
.history-value-box {
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.9rem;
}
.history-value-old {
  background-color: rgba(108, 117, 125, 0.35) !important;
  color: var(--text-100) !important;
}
.history-value-new {
  background-color: rgba(25, 135, 84, 0.2) !important;
  color: var(--text-100) !important;
}

/* Critical Production Section */
#critical-production-section {
  border-left: 3px solid var(--danger);
  padding-left: 0.75rem;
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
#critical-production-section.editing {
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
#critical-production-section h6 {
  color: var(--danger) !important;
}

/* Due Date Color Classes */
/* Dark theme - approaching dates (2-4 weeks) */
.text-warning-light {
  color: #7c8bff !important; /* blue-purple for dates approaching */
}

/* Past Event Date Color - Gold-greyish tone */
.text-past-event {
  color: #b8a67d !important; /* gold-greyish for past events */
}

/* Dark theme - far due dates (>1 month) - more specific selector */
.card-body .text-muted,
.project-card .text-muted {
  color: #9aa8a8 !important; /* keep original muted color */
}

/* Dark theme - far due dates specifically in due date context */
p .text-muted {
  color: #696969 !important;
}

/* Light theme - approaching dates (2-4 weeks) */
.theme-light .text-warning-light {
  color: #5a6fd8 !important; /* darker blue for light theme */
}

/* Light theme - far dates (>1 month) */
.theme-light p .text-muted {
  color: #8a8a8a !important; /* medium gray for light theme */
}

/* Fine-tuning */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--fg-strong); }
/* Ensure small headers inside cards/lists are bright */
.card h6, .editable-section h6, .list-group-item h6 { color: var(--text-100) !important; }
/* Emphasize section headings and delimit sections */
.editable-section + .editable-section {
  border-top: 1px solid var(--bs-border-color);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}
.editable-section h6 {
  position: relative;
  font-weight: 700;
  padding-bottom: 0.35rem;
}
.editable-section h6::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 84px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  opacity: 0.9;
}
.editable-section.editing h6::after {
  height: 3px;
  width: 112px;
  box-shadow: 0 0 12px rgba(228, 113, 24, 0.5);
}
small, .text-muted { color: var(--text-300) !important; }
.text-secondary { color: var(--text-300) !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.7) !important; }
.form-label { color: var(--text-300); }
.form-control-plaintext { color: var(--text-100); }

/* Generic borders */
.border { border-color: rgba(255, 255, 255, 0.1) !important; }

/* Progress bars - use gold color */
.progress-bar.bg-info,
.progress-bar {
  background-color: var(--primary) !important;
}

/* Checkboxes - use gold color */
.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.form-check-input:focus {
  border-color: rgba(228, 113, 24, 0.5) !important;
  box-shadow: 0 0 0 0.25rem rgba(228, 113, 24, 0.25) !important;
}

/* Scrollbar (WebKit) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-850); }
*::-webkit-scrollbar-thumb { background: var(--surface-600); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Light Theme Variables & Overrides */
.theme-light {
  /* ================= LIGHT theme (body.theme-light) =================
     Override only the semantic layer; legacy aliases (--surface-*,
     --text-*, --primary, ...) reference these and cascade automatically. */
  --bg-page:    var(--gray-25);
  --bg-surface: var(--gray-0);
  --bg-subtle:  var(--gray-50);
  --bg-muted:   var(--gray-100);
  --fg-default: var(--gray-800);
  --fg-strong:  var(--gray-900);
  --fg-muted:   var(--gray-500);
  --fg-subtle:  var(--gray-400);
  --border-soft:    var(--gray-100);
  --border-default: var(--gray-200);
  --border-strong:  var(--gray-300);
  --brand-soft: var(--orange-50);
  --brand-tint: rgba(228, 113, 24, 0.06);

  --status-paid-bg:    var(--green-50); --status-paid-fg:    var(--green-700); --status-paid-dot:    #2BB36A;
  --status-editing-bg: var(--amber-50); --status-editing-fg: var(--amber-600); --status-editing-dot: #E69A1A;
  --status-pending-bg: var(--gray-50);  --status-pending-fg: var(--gray-600);  --status-pending-dot: var(--gray-400);
  --status-danger-bg:  var(--red-50);   --status-danger-fg:  var(--red-600);   --status-danger-dot:  var(--red-500);
  --status-info-bg:    rgba(42, 106, 208, 0.10); --status-info-fg: #2A6AD0; --status-info-dot: #2A6AD0;

  --shadow-xs: 0 1px 2px rgba(24, 23, 26, 0.04);
  --shadow-sm: 0 1px 3px rgba(24, 23, 26, 0.06), 0 1px 2px rgba(24, 23, 26, 0.04);
  --shadow-md: 0 4px 12px rgba(24, 23, 26, 0.06), 0 2px 4px rgba(24, 23, 26, 0.04);
  --shadow-lg: 0 12px 32px rgba(24, 23, 26, 0.08), 0 4px 8px rgba(24, 23, 26, 0.04);
  --shadow-focus: 0 0 0 3px rgba(228, 113, 24, 0.25);

  --field-view-bg: rgba(0, 0, 0, 0.04);
  --field-view-border: var(--border-default);
  --field-edit-bg: var(--brand-soft);
  --field-edit-border: rgba(228, 113, 24, 0.30);

  /* Re-declare theme-varying aliases here too: a custom property that
     references another via var() freezes at the value of its declaring
     scope (:root = dark), so it must be redeclared in .theme-light to pick
     up the light semantic values. */
  --bg-900: var(--bg-page);
  --bg-850: var(--bg-subtle);
  --bg-800: var(--bg-surface);
  --surface-800: var(--bg-surface);
  --surface-700: var(--bg-subtle);
  --surface-600: var(--bg-muted);
  --text-100: var(--fg-default);
  --text-200: var(--fg-default);
  --text-300: var(--fg-muted);
  --text-500: var(--fg-subtle);
  --text-muted: var(--fg-muted);
  --text-primary: var(--fg-strong);
  --text-secondary: var(--fg-muted);
  --text-color: var(--fg-default);
  --border-color: var(--border-default);
  --field-bg: var(--bg-muted);
  --brand-gold-subtle: var(--brand-soft);
  --bs-body-color: var(--fg-default);
  --bs-heading-color: var(--fg-strong);
  --bs-secondary-color: var(--fg-muted);
  --bs-border-color: var(--border-default);
}

body.theme-light {
  background: var(--bg-page);
  color: var(--fg-default);
}

.theme-light .navbar { background: rgba(255, 255, 255, 0.85) !important; border-bottom: 1px solid rgba(228, 113, 24, 0.25); }
.theme-light .nav-link { color: var(--text-300) !important; }
.theme-light .nav-link:hover { color: #000 !important; }
.theme-light .card {
  background-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid rgba(228, 113, 24, 0.2) !important;
}

.theme-light .card.project-card,
.theme-light div.card.project-card {
  background-color: #ffffff !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.theme-light .card .card-body,
.theme-light .card-body {
  background-color: transparent !important;
}
.theme-light .list-group-item { border-color: rgba(0,0,0,0.06); }
/* Dropdown-urile sunt adaptive in regula de baza (.dropdown-menu/.dropdown-item/
   .language-dropdown folosesc tokeni) — fara override-uri .theme-light. */
.theme-light .btn-close { filter: none; opacity: 0.6; }
.theme-light .btn-close:hover { opacity: 1; }
/* .theme-light .alert-* eliminate: regula de baza .alert-* foloseste deja tokeni --status-* adaptivi */
.theme-light .alert-info code,
.theme-light .alert-success code,
.theme-light .alert-warning code,
.theme-light .alert-danger code {
  color: var(--brand);
  background: transparent;
  padding: 0;
  font-weight: normal;
}
.theme-light .table tr { border-color: rgba(0,0,0,0.06); }
.theme-light .list-group-item-action:hover { background: rgba(0,0,0,0.04); }
.theme-light a:not(.btn) { color: var(--brand); }
.theme-light a:not(.btn):hover { color: var(--brand-hover); }
.theme-light .text-white-50 { color: rgba(0, 0, 0, 0.45) !important; }
.theme-light .text-white { color: var(--text-100) !important; }

/* Light theme button tweaks: make outline-primary (Edit buttons) a bit darker */
.theme-light .btn-outline-primary {
  color: var(--brand);
  border-color: rgba(228, 113, 24, 0.35);
  background: var(--brand-soft);
}
.theme-light .btn-outline-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--fg-on-brand);
}

/* Light theme - Tab buttons (btn-outline-secondary) - More specific selectors */
body.theme-light .btn-group .btn-outline-secondary:not(.active),
.theme-light .btn-group button.btn-outline-secondary:not(.active),
.theme-light div.btn-group .btn-outline-secondary:not(.active) {
  color: #2a2d31 !important;
  background-color: rgba(228, 113, 24, 0.12) !important;
  border-color: rgba(228, 113, 24, 0.4) !important;
  font-weight: 500 !important;
}

body.theme-light .btn-group .btn-outline-secondary:not(.active):hover:not(:disabled),
.theme-light .btn-group button.btn-outline-secondary:not(.active):hover:not(:disabled),
.theme-light div.btn-group .btn-outline-secondary:not(.active):hover:not(:disabled) {
  color: var(--fg-default) !important;
  background-color: rgba(228, 113, 24, 0.12) !important;
  border-color: rgba(228, 113, 24, 0.45) !important;
}

body.theme-light .btn-group .btn-outline-secondary.active,
.theme-light .btn-group button.btn-outline-secondary.active,
.theme-light div.btn-group .btn-outline-secondary.active {
  color: var(--fg-on-brand) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600 !important;
}

/* Light theme - Project type badges with better contrast */
.theme-light .badge-type-nunta {
  background: rgba(219, 39, 119, 0.12);
  color: #be185d;
  border: 1px solid rgba(219, 39, 119, 0.4);
  font-weight: 700;
}

.theme-light .badge-type-botez {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
  border: 1px solid rgba(14, 116, 144, 0.4);
  font-weight: 700;
}

.theme-light .badge-type-altele {
  background: rgba(126, 34, 206, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(126, 34, 206, 0.4);
  font-weight: 700;
}

/* Light theme - Urgency badges with better visibility */
.theme-light .badge-urgency.bg-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c;
}

.theme-light .badge-urgency.bg-warning {
  background: #f59e0b !important;
  color: #ffffff !important;
  border: 1px solid #d97706;
}

.theme-light .badge-urgency.bg-info {
  background: #0891b2 !important;
  color: #ffffff !important;
  border: 1px solid #0e7490;
}

/* Light theme - Upcoming event backgrounds */
.theme-light .bg-upcoming-urgent {
  background: rgba(220, 38, 38, 0.08) !important;
  border-left: 4px solid #dc2626 !important;
}

.theme-light .bg-upcoming-warning {
  background: rgba(245, 158, 11, 0.08) !important;
  border-left: 4px solid #f59e0b !important;
}

.theme-light .bg-upcoming-soon {
  background: rgba(8, 145, 178, 0.08) !important;
  border-left: 4px solid #0891b2 !important;
}

/* Light theme - Text colors for better readability */
.theme-light .text-muted {
  color: #64748b !important;
}

.theme-light .card-title {
  color: #0f172a !important;
  font-weight: 600;
}

.theme-light .text-white {
  color: #0f172a !important;
}

/* Light theme - Status badges */
.theme-light .badge.bg-secondary {
  background-color: #64748b !important;
  color: #ffffff !important;
}

.theme-light .badge.bg-success {
  background-color: #16a34a !important;
  color: #ffffff !important;
}

.theme-light .badge.bg-danger {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}

.theme-light .badge.bg-warning {
  background-color: #f59e0b !important;
  color: #ffffff !important;
}

.theme-light .badge.bg-info {
  background-color: #0891b2 !important;
  color: #ffffff !important;
}

/* Light theme modal overrides */
.theme-light .modal-content {
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: var(--text-100) !important;
}
.theme-light .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  background: rgba(228, 113, 24, 0.08) !important;
}
.theme-light .modal-body {
  background-color: #ffffff !important;
  color: var(--text-100) !important;
}
.theme-light .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  background-color: transparent !important;
}
.theme-light .history-value-old {
  background-color: rgba(108, 117, 125, 0.2) !important;
  color: var(--text-100) !important;
}
.theme-light .history-value-new {
  background-color: rgba(25, 135, 84, 0.12) !important;
  color: var(--text-100) !important;
}

/* Light theme critical production section */
.theme-light #critical-production-section {
  background: rgba(239, 68, 68, 0.08);
}
.theme-light #critical-production-section.editing {
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Light theme dashboard overrides */
.theme-light #projectSearch {
  background-color: var(--bg-surface) !important;
  border-color: var(--border-default) !important;
  color: var(--fg-default) !important;
}

.theme-light #projectSearch::placeholder {
  color: rgba(36, 39, 43, 0.5) !important;
}

.theme-light .card-title.text-white {
  color: var(--text-100) !important;
}

.theme-light .text-white {
  color: var(--text-100) !important;
}

/* Light theme - project card specific styling removed - using uniform card background */

/* Status pill colors are token-based (--status-*) and adapt to light/dark
   automatically — no per-theme overrides needed. */

/* Light theme - neutral surface buttons (New Project / Archived) */
.theme-light .btn-light {
  color: var(--fg-default) !important;
  background-color: var(--bg-surface) !important;
  border-color: var(--border-default) !important;
}

.theme-light .btn-light:hover {
  background-color: var(--bg-subtle) !important;
  border-color: var(--border-strong) !important;
  color: var(--fg-strong) !important;
}

.theme-light .btn-outline-light {
  color: var(--fg-default) !important;
  border-color: var(--border-default) !important;
  background-color: var(--bg-surface) !important;
}

.theme-light .btn-outline-light:hover {
  background-color: var(--bg-subtle) !important;
  border-color: var(--border-strong) !important;
  color: var(--fg-strong) !important;
}

/* ========================================
   STORYBOARD EVENT PORTAL - CUSTOM THEME
   ======================================== */

/* Tablet and smaller (iPad and below) */
@media (max-width: 991px) {
  /* Reduce main container padding */
  .main-container {
    padding: 1.5rem 0;
  }
  
  /* Smaller headings */
  h2 {
    font-size: 1.5rem;
  }
  
  h5 {
    font-size: 1.1rem;
  }
  
  /* Compact cards */
  .card-header {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* Mobile phones (portrait and landscape) */
@media (max-width: 767px) {
  /* Typography adjustments */
  body {
    font-size: 0.9rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h5, h6 {
    font-size: 1rem;
  }
  
  /* Compact layout */
  .main-container {
    padding: 1rem 0;
  }
  
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Navbar optimizations */
  .navbar-brand {
    font-size: 1rem;
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* Button optimizations - better touch targets */
  .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
  
  .btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }
  
  .btn-lg {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }
  
  /* Compact cards */
  .card {
    margin-bottom: 0.75rem;
    border-radius: 12px;
  }
  
  .card-header {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  
  .card-body {
    padding: 0.85rem;
  }
  
  /* Form controls - better touch targets */
  .form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.65rem;
    min-height: 42px; /* Minimum touch target */
  }
  
  textarea.form-control {
    min-height: 80px;
  }
  
  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }
  
  /* Project cards on dashboard */
  .project-card {
    margin-bottom: 0.75rem;
  }
  
  .project-card .card-body {
    padding: 0.85rem;
  }
  
  .project-card .card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  /* Badges and status */
  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Tables - make scrollable */
  .table-responsive {
    font-size: 0.85rem;
  }
  
  .table {
    font-size: 0.85rem;
  }
  
  .table th, .table td {
    padding: 0.5rem;
  }
  
  /* Alerts */
  .alert {
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
  }
  
  /* Modals */
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-body {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }
  
  .modal-footer {
    padding: 0.65rem 1rem;
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
  
  /* Dropdown menus */
  .dropdown-menu {
    font-size: 0.85rem;
    min-width: 180px;
  }
  
  .dropdown-item {
    padding: 0.5rem 0.85rem;
  }
  
  /* Mobile: Make dropdowns full width on small screens */
  .dropdown-menu-end {
    right: 0;
    left: auto;
  }
  
  /* List groups */
  .list-group-item {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  
  /* Input groups (search bars) */
  .input-group {
    width: 100% !important;
    max-width: 100%;
  }
  
  .input-group .form-control {
    font-size: 0.85rem;
  }
  
  /* Dashboard header controls - mobile optimization */
  .card-header .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* Search bar full width on mobile */
  .card-header .input-group {
    width: 100% !important;
    flex-basis: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Checkbox - make text smaller but visible */
  .form-check-label {
    font-size: 0.75rem !important;
  }
  
  /* Dashboard checkbox - full width on mobile */
  .dashboard-checkbox {
    flex-basis: 100% !important;
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  /* Dashboard filters (Year + Sort) - side by side on same row */
  .dashboard-filters {
    flex-basis: 100% !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
  }
  
  /* Year and Sort dropdowns - equal width, side by side */
  .dashboard-filters .dropdown {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .dashboard-filters .dropdown.flex-fill {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .dashboard-filters .dropdown .btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
  }
  
  /* Editable sections */
  .editable-section {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .editable-section h6 {
    font-size: 0.95rem;
  }
  
  /* Tab buttons - make them wrap and smaller */
  .nav-tabs .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* Progress bars */
  .progress {
    height: 1.25rem;
    font-size: 0.75rem;
  }
  
  /* Progress bar color - use gold instead of info/cyan */
  .progress-bar.bg-info,
  .progress-bar {
    background-color: var(--primary) !important;
  }
  
  /* Icon sizes */
  .bi {
    font-size: 1rem;
  }
  
  h2 .bi {
    font-size: 1.2rem;
  }
}

/* Extra small phones (portrait) */
@media (max-width: 575px) {
  /* Even more compact */
  body {
    font-size: 0.85rem;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Stack buttons vertically */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-bottom: 0.25rem;
  }
  
  /* Full width buttons in action areas */
  .col-auto .btn {
    width: 100%;
    margin-bottom: 0.35rem;
  }
  
  /* Project detail header - stack everything */
  .row.mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .row.mb-4 .col-auto {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  /* Dashboard filters - full width and stacked */
  .card-header .d-flex.gap-2 {
    flex-direction: column;
    width: 100%;
  }
  
  .card-header .dropdown,
  .card-header .form-check {
    width: 100%;
  }
  
  .card-header .dropdown .btn {
    width: 100%;
  }
  
  /* Make project cards full width on very small screens */
  .col-md-6.col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Compact navbar */
  .navbar {
    padding: 0.5rem 0.75rem;
  }
  
  .navbar-brand {
    font-size: 0.95rem;
  }
  
  /* Smaller modals */
  .modal-dialog {
    margin: 0.5rem;
  }
  
  /* Form groups - reduce spacing */
  .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  /* Compact alerts */
  .alert {
    font-size: 0.8rem;
    padding: 0.5rem 0.65rem;
  }
  
  /* Smaller badges */
  .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Landscape phone optimization */
@media (max-width: 767px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape */
  .main-container {
    padding: 0.75rem 0;
  }
  
  .card {
    margin-bottom: 0.5rem;
  }
  
  .card-body {
    padding: 0.65rem;
  }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn, .nav-link, .dropdown-item, .list-group-item-action {
    min-height: 44px; /* Apple's recommended minimum */
    display: flex;
    align-items: center;
  }
  
  /* Better tap feedback */
  .btn:active, .nav-link:active, .dropdown-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* Remove hover effects on touch devices */
  .project-card:hover {
    transform: none;
  }
  
  .project-card:active {
    transform: scale(0.98);
  }
}

/* Print optimizations */
@media print {
  .navbar, .btn, .alert, .modal {
    display: none;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* ========================================
   TABLE VIEW STYLES
   ======================================== */

/* Project table */
.project-table {
  margin-bottom: 0;
  background: transparent !important;
}

.project-table thead th {
  background: transparent !important;
  color: var(--fg-muted) !important;
  font-weight: 600;
  border-bottom: 1px solid var(--border-default);
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.project-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background-color var(--dur-fast) var(--ease-out);
  background: transparent !important;
}

.project-table tbody tr:hover {
  background: var(--bg-subtle) !important;
}

.project-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--fg-default);
  background: transparent !important;
}

/* Don't override text color classes - let them work naturally */
.project-table tbody td i {
  margin-right: 0.25rem;
}

/* Override Bootstrap table defaults for dark theme */
.table {
  --bs-table-bg: transparent !important;
  --bs-table-striped-bg: transparent !important;
  --bs-table-hover-bg: rgba(228, 113, 24, 0.08) !important;
  color: var(--text-300) !important;
}

/* Progress bar in table */
.project-table .progress {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.project-table .progress-bar {
  transition: width 0.3s ease;
}

/* View toggle buttons */
.btn-group .btn.active {
  background: rgba(228, 113, 24, 0.25);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-group .btn:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.btn-group .btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* Inactive Period Rows */
.inactive-period-row {
  transition: background-color 0.3s ease;
}

.inactive-period-row:hover {
  background-color: rgba(255, 193, 7, 0.35) !important;
}

.inactive-period-row td {
  font-weight: 500;
}

/* Inactive Period Cards */
.card.inactive-period-card {
  transition: box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
  will-change: box-shadow;
  overflow: hidden;
}

.card.inactive-period-card:hover {
  box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
  background: rgba(255, 193, 7, 0.25) !important;
}

/* Responsive table adjustments */
@media (max-width: 991px) {
  .project-table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .project-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 767px) {
  .project-table {
    font-size: 0.85rem;
  }
  
  .project-table thead th {
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
  }
  
  .project-table tbody td {
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
  }
  
  .project-table tbody td .fw-bold {
    font-size: 0.9rem;
  }
  
  /* Hide less important columns on mobile */
  .project-table th:nth-child(7),
  .project-table td:nth-child(7) {
    display: none;
  }
}

/* Light theme: project-table colors are token-based in the rules above and
   adapt automatically — no orange-tinted overrides needed. */

.theme-light .btn-group .btn.active {
  background: rgba(228, 113, 24, 0.35);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.theme-light .btn-group .btn:not(.active) {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.6);
}

.theme-light .btn-group .btn:not(.active):hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.3);
  color: black;
}

/* Year Separators */
.year-separator-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.year-separator-table {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.year-separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
}

.year-separator-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 0.5rem;
  text-shadow: 0 0 10px rgba(228, 113, 24, 0.3);
}

.year-separator-row {
  background: transparent !important;
}

.year-separator-row:hover {
  background: transparent !important;
  cursor: default !important;
}

.year-separator-cell {
  padding: 0 !important;
  border: none !important;
}

/* Light theme year separators */
.theme-light .year-separator-text {
  color: var(--accent-dark);
  text-shadow: 0 0 20px rgba(168, 143, 74, 0.2);
}

.theme-light .year-separator-line {
  background: linear-gradient(90deg, transparent, var(--accent-dark), transparent);
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .year-separator-text {
    font-size: 0.7rem;
    padding: 0 0.4rem;
  }
  
  .year-separator-card,
  .year-separator-table {
    gap: 0.4rem;
    padding: 0.4rem 0;
  }
}

/* Video container styling - ensure black background for videos */
.video-container {
  background-color: #000 !important;
}

.video-container .ratio {
  background-color: #000 !important;
}

.video-container iframe,
.video-container video {
  background-color: #000 !important;
}

/* Ensure video cards have dark background */
.card.bg-dark .video-container {
  background-color: #000 !important;
}

/* Today Marker - Separates past events from future events */
.today-marker,
.today-marker-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0;
}

.today-marker-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4ade80, #22c55e, #4ade80, transparent);
  opacity: 0.7;
}

.today-marker-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.today-marker-content i {
  color: #4ade80;
  font-size: 0.7rem;
}

.today-marker-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4ade80;
  text-transform: none;
  letter-spacing: 0.01em;
}

.today-marker-separator {
  color: rgba(74, 222, 128, 0.5);
  font-size: 0.6rem;
}

.today-marker-countdown {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.today-marker-countdown i {
  color: rgba(74, 222, 128, 0.7);
  margin-right: 0.15rem;
  font-size: 0.6rem;
}

.today-marker-row {
  background: transparent !important;
}

.today-marker-row:hover {
  background: transparent !important;
  cursor: default !important;
}

.today-marker-cell {
  padding: 0.25rem 0.5rem !important;
  border: none !important;
}

/* Light theme today marker */
.theme-light .today-marker-date {
  color: #16a34a;
}

.theme-light .today-marker-content {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.4);
}

.theme-light .today-marker-line {
  background: linear-gradient(90deg, transparent, #16a34a, #22c55e, #16a34a, transparent);
}

.theme-light .today-marker-countdown {
  color: rgba(0, 0, 0, 0.7);
}

.theme-light .today-marker-content i {
  color: #16a34a;
}

/* Mobile adjustments for today marker */
@media (max-width: 767px) {
  .today-marker-content {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0.5rem;
    text-align: center;
  }
  
  .today-marker-date {
    font-size: 0.6rem;
  }
  
  .today-marker-separator {
    display: none;
  }
  
  .today-marker-countdown {
    font-size: 0.55rem;
  }
  
  .today-marker,
  .today-marker-card {
    gap: 0.3rem;
    padding: 0.3rem 0;
  }
}

/* ========================================
   MEMORIA Logo & Info Button Styles
   ======================================== */

/* Memoria logo images - theme switching */
.memoria-logo {
  height: 11px;
  width: auto;
  vertical-align: baseline;
  position: relative;
  top: 1px;
}

/* Dark theme (default) - show white logo */
.memoria-logo-light {
  display: none;
}
.memoria-logo-dark {
  display: inline-block;
}

/* Light theme - show dark logo */
.theme-light .memoria-logo-dark {
  display: none;
}
.theme-light .memoria-logo-light {
  display: inline-block;
}

/* Memoria logo text styling (fallback) */
.memoria-logo-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: var(--text-100);
}

.theme-light .memoria-logo-text {
  color: #2B2A29;
}

/* Memoria source container */
.memoria-source {
  color: var(--text-muted);
  font-size: 0.8rem;
  align-items: baseline !important;
}

.theme-light .memoria-source {
  color: #6c757d;
}

/* Memoria info button */
.memoria-info-btn {
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  text-decoration: none;
}

.memoria-info-btn i {
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.memoria-info-btn:hover i {
  color: var(--primary) !important;
  opacity: 1;
}

.theme-light .memoria-info-btn i {
  color: #6c757d;
}

.theme-light .memoria-info-btn:hover i {
  color: #4338ca !important;
}

/* Popover styling for Memoria info */
.memoria-popover {
  max-width: 300px;
  --bs-popover-bg: var(--bg-surface);
  --bs-popover-body-color: var(--fg-default);
  --bs-popover-border-color: var(--border-default);
}

.memoria-popover .popover-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.memoria-popover .popover-body strong {
  color: var(--fg-strong);
}

.memoria-popover .popover-arrow::after {
  border-top-color: var(--bg-surface);
}

.memoria-popover .memoria-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.memoria-popover .memoria-link:hover {
  color: #e8d68f;
  text-decoration: underline;
}

/* Light theme popover */
.theme-light .memoria-popover {
  --bs-popover-bg: #ffffff;
  --bs-popover-body-color: #333333;
  --bs-popover-border-color: rgba(0, 0, 0, 0.15);
}

.theme-light .memoria-popover .popover-body {
  color: #555555;
}

.theme-light .memoria-popover .popover-body strong {
  color: #2B2A29;
}

.theme-light .memoria-popover .popover-arrow::after {
  border-top-color: #ffffff;
}

.theme-light .memoria-popover .memoria-link {
  color: #4338ca;
}

.theme-light .memoria-popover .memoria-link:hover {
  color: #3730a3;
}

/* ==============================================
   CLIENT ACCESS INDICATORS (Admin View)
   Visual indicators showing what clients can/cannot see
   ============================================== */

/* Base badge for access indicators */
.access-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  padding: 0;
  margin-left: 4px;
  transition: opacity 0.2s ease;
  line-height: 1;
  vertical-align: middle;
}

/* Access granted - client CAN see this */
.access-indicator.access-granted {
  color: #7ba87b;
}

/* Access denied - client CANNOT see this */
.access-indicator.access-denied {
  color: #c46a6a;
}

/* Icon inside the badge */
.access-indicator i {
  font-size: 0.65rem;
}

/* Tab button modifications when access is denied */
.tab-access-denied {
  position: relative;
  opacity: 0.7;
}

.tab-access-denied::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(196, 106, 106, 0.1) 4px,
    rgba(196, 106, 106, 0.1) 8px
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Light theme adjustments */
.theme-light .access-indicator.access-granted {
  color: #28a745;
}

.theme-light .access-indicator.access-denied {
  color: #dc3545;
}

/* ==============================================
   THEME-BASED VISIBILITY
   Show/hide elements based on light/dark theme
   ============================================== */

/* Dark theme (default): show dark-only, hide light-only */
.theme-light-only {
  display: none !important;
}

.theme-dark-only {
  display: inline-block;
}

/* Light theme: show light-only, hide dark-only */
.theme-light .theme-light-only {
  display: inline-block !important;
}

.theme-light .theme-dark-only {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Summary Tab Enhancements ===== */

/* "NOU" badge for changed sections */
.badge-nou {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: var(--radius-sm, 4px);
  background-color: var(--brand);
  color: var(--fg-on-brand);
  margin-left: 6px;
  vertical-align: middle;
  animation: badge-nou-pulse 2s ease-in-out 3;
}

@keyframes badge-nou-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Card / section updated since the client's last visit (carries a NOU badge) */
.sb-card.sb-updated { box-shadow: var(--shadow-sm), inset 3px 0 0 var(--brand); }
.sb-updated:not(.sb-card) { box-shadow: inset 3px 0 0 var(--brand); padding-left: 8px; border-radius: var(--radius-sm, 4px); }

/* Reduced Motion Safety */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================
   Dashboard stat cards (StoryBoard)
   ================================================================ */
.stat-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.stat-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card .stat-icon {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1rem;
}
.stat-card .stat-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg-muted);
  font-weight: 600;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: 600;
  color: var(--fg-strong);
  line-height: var(--lh-tight);
  margin-top: var(--sp-2);
}
.stat-card .stat-value .stat-unit {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  color: var(--fg-muted);
  font-weight: 500;
}
.stat-card .stat-sub {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin-top: var(--sp-1);
}
@media (max-width: 575px) {
  .stat-card { padding: var(--sp-4); }
  .stat-card .stat-value { font-size: var(--fs-2xl); }
  .stat-card .stat-icon { display: none; }
}

/* ================================================================
   Dashboard hero card (next event) + workflow stepper (StoryBoard)
   ================================================================ */
.hero-card {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  color: var(--fg-default);
  background: var(--bg-surface);
}
/* Top section: subtle diagonal film-strip stripes (exact Hi-fi values) */
.hero-top {
  position: relative;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--gray-900) 0%, #2a1812 100%);
}
.hero-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg,
    rgba(228, 113, 24, 0.08) 0px,
    rgba(228, 113, 24, 0.08) 8px,
    transparent 8px,
    transparent 22px);
  pointer-events: none;
}
.hero-top > * { position: relative; z-index: 1; }
.hero-badge-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(228, 113, 24, 0.18);
  color: #FFD7B4;
  border: none;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.hero-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.hero-rel { color: #FFD7B4; font-size: 12px; font-family: var(--font-mono); }
.hero-card .hero-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}
.hero-card .hero-meta { color: rgba(255, 255, 255, 0.7); font-size: 14px; margin-top: 6px; }
.hero-card .hero-meta .mono { font-family: var(--font-mono); }
.hero-card .hero-open-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  font-weight: 600;
  white-space: nowrap;
}
.hero-card .hero-open-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.30);
}
.hero-card .hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.hero-card .hero-stat { min-width: 140px; }
.hero-card .hero-stat .k {
  font-size: var(--fs-xxs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgba(255, 255, 255, 0.5);
}
.hero-card .hero-stat .v {
  font-size: 13px;
  color: #ffffff;
  font-weight: 500;
  margin-top: 4px;
}
.hero-card .hero-stat .v.mono { font-family: var(--font-mono); }
/* Bottom section: workflow stepper */
.hero-workflow {
  padding: 18px 24px;
  background: transparent;
  border-top: 1px solid var(--border-soft);
}
.hero-wf-label {
  font-size: var(--fs-xxs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
.hero-stepper { display: flex; align-items: flex-start; }
.hero-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.hero-step .bar {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-default);
  z-index: 0;
}
.hero-step:last-child .bar { display: none; }
.hero-step .circle {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  color: var(--fg-muted);
}
.hero-step.done .bar { background: var(--brand); }
.hero-step.done .circle { background: var(--brand); border-color: var(--brand); color: #fff; }
.hero-step.current .circle {
  background: var(--bg-surface);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.hero-step .lbl {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  margin-top: var(--sp-2);
  white-space: nowrap;
}
.hero-step.current .lbl { color: var(--fg-strong); font-weight: 600; }
.hero-step.done .lbl { color: var(--fg-default); }
@media (max-width: 575px) {
  .hero-step .lbl { font-size: 9px; }
  .hero-step .circle { width: 28px; height: 28px; font-size: var(--fs-xs); }
  .hero-card .hero-stats { gap: var(--sp-4); }
  .hero-card .hero-title { font-size: var(--fs-2xl); }
}

/* Recent activity feed */
.activity-card .activity-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.activity-item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.activity-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  /* Fallback neutru (acțiuni de sistem, fără user) */
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .5px;
}
/* Paletă avatar per utilizator — DARK (default :root): fundal translucid + text deschis */
.activity-avatar.av-0 { background: rgba(228, 113, 24, 0.20); color: #FAC775; } /* amber  */
.activity-avatar.av-1 { background: rgba(29, 158, 117, 0.20); color: #5DCAA5; } /* teal   */
.activity-avatar.av-2 { background: rgba(127, 119, 221, 0.22); color: #AFA9EC; } /* purple */
.activity-avatar.av-3 { background: rgba(55, 138, 221, 0.20); color: #85B7EB; } /* blue   */
.activity-avatar.av-4 { background: rgba(212, 83, 126, 0.20); color: #ED93B1; } /* pink   */
.activity-avatar.av-5 { background: rgba(216, 90, 48, 0.20); color: #F0997B; } /* coral  */
/* Paletă avatar — LIGHT: fundal pal (stop 50) + text închis (stop 800) */
.theme-light .activity-avatar.av-0 { background: #FAEEDA; color: #633806; }
.theme-light .activity-avatar.av-1 { background: #E1F5EE; color: #085041; }
.theme-light .activity-avatar.av-2 { background: #EEEDFE; color: #3C3489; }
.theme-light .activity-avatar.av-3 { background: #E6F1FB; color: #0C447C; }
.theme-light .activity-avatar.av-4 { background: #FBEAF0; color: #72243E; }
.theme-light .activity-avatar.av-5 { background: #FAECE7; color: #712B13; }
.activity-body { min-width: 0; }
.activity-text {
  font-size: var(--fs-sm);
  color: var(--fg-default);
  line-height: var(--lh-snug);
}
.activity-time { font-size: var(--fs-xs); color: var(--fg-muted); margin-top: 2px; }

/* ================================================================
   Dashboard greeting header (StoryBoard)
   ================================================================ */
.dash-breadcrumb {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.dash-breadcrumb .bi-chevron-right { font-size: 0.7em; opacity: 0.6; }
.dash-breadcrumb span { color: var(--fg-default); font-weight: 500; }
.dash-greeting {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.dash-subtitle {
  font-size: var(--fs-md);
  color: var(--fg-muted);
  margin-top: var(--sp-1);
  margin-bottom: 0;
}
@media (max-width: 575px) {
  .dash-greeting { font-size: var(--fs-2xl); }
}

/* ================================================================
   Dashboard table filter tabs (StoryBoard)
   ================================================================ */
.table-tabs {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--sp-4);
}
.table-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: var(--sp-3) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.table-tab:hover { color: var(--fg-default); }
.table-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.table-tab .tt-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--bg-muted);
  color: var(--fg-muted);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  line-height: 1.5;
}
.table-tab.active .tt-count { background: var(--brand-soft); color: var(--brand); }

/* ================================================================
   Top navigation — StoryBoard top-nav
   ================================================================ */
.navbar .main-nav { gap: 2px; }
.navbar .main-nav .nav-link {
  padding: 6px 12px !important;
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  font-weight: 500;
  white-space: nowrap;
  color: var(--fg-muted) !important;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.navbar .main-nav .nav-link:hover { color: var(--fg-default) !important; background: var(--bg-muted); }
.navbar .main-nav .nav-link.active {
  color: var(--brand) !important;
  background: var(--brand-soft);
  font-weight: 600;
}
.navbar .main-nav .nav-link.disabled {
  color: var(--fg-subtle) !important;
  pointer-events: none;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-soon {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-muted);
  color: var(--fg-subtle);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  font-weight: 600;
}
/* Subtle icon theme-toggle button */
.btn-theme-toggle {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--fg-muted);
  border-radius: var(--radius-md);
  width: 34px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-theme-toggle:hover { background: var(--bg-muted); color: var(--fg-default); border-color: var(--border-strong); }
.btn-theme-toggle:focus { box-shadow: var(--shadow-focus); outline: none; }

/* ================================================================
   Payment pills (dashboard table) — same balloon style as status
   ================================================================ */
.pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.pay-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, currentColor);
  flex-shrink: 0;
}
.pay-paid    { background: var(--status-paid-bg);    color: var(--status-paid-fg);    --dot: var(--status-paid-dot); }
.pay-partial { background: var(--status-editing-bg); color: var(--status-editing-fg); --dot: var(--status-editing-dot); }
.pay-unpaid  { background: var(--status-pending-bg); color: var(--status-pending-fg); --dot: var(--status-pending-dot); }
.pay-overdue { background: var(--status-danger-bg);  color: var(--status-danger-fg);  --dot: var(--status-danger-dot); }

.project-price,
.dashboard-money {
  color: var(--fg-default);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.project-price { font-weight: 600; }
.project-price--paid { color: var(--status-paid-fg); }
.project-price--unpaid { color: var(--status-danger-fg); }
.project-price--partial { color: var(--fg-default); }

/* ================================================================
   Utilities + neutral control buttons (StoryBoard)
   ================================================================ */
.mono { font-family: var(--font-mono); }

/* Neutral "chip" buttons used for dashboard controls/filters (Hi-fi style) */
.btn-outline-light {
  background-color: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-weight: 500;
}
.btn-outline-light:hover {
  background-color: var(--bg-subtle);
  color: var(--fg-strong);
  border-color: var(--border-strong);
}

/* Hidden-columns indicator in table header — subtle, not loud yellow */
#column-warning-badge {
  background: var(--bg-muted) !important;
  color: var(--fg-muted) !important;
  border: 1px solid var(--border-default);
  font-weight: 500 !important;
  text-transform: none;
  letter-spacing: 0;
}

/* ================================================================
   Dashboard header action buttons — exact Hi-fi sizing
   ================================================================ */
.dash-actions .btn {
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  line-height: 1;
}
.dash-actions .btn i { font-size: 14px; }

/* ================================================================
   Project detail page — header, tabs & Summary (StoryBoard / Hi-fi)
   ================================================================ */

/* --- Page header (breadcrumb · pills · title · subtitle · actions) --- */
.proj-head { margin-bottom: var(--sp-5); }
.proj-crumbs {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--fg-muted); margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}
.proj-crumbs a { color: var(--fg-muted); text-decoration: none; }
.proj-crumbs a:hover { color: var(--fg-default); }
.proj-crumbs .sep { opacity: 0.45; }
.proj-crumbs .current { color: var(--fg-strong); font-weight: 500; }
.proj-meta {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap; margin-bottom: var(--sp-2);
}
.proj-meta .meta-bit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--fg-muted);
}
.proj-meta .meta-bit.mono { font-family: var(--font-mono); }
.proj-title {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--fg-strong);
  margin: 0;
}
.proj-sub {
  font-size: var(--fs-md); color: var(--fg-muted);
  margin: var(--sp-2) 0 0; line-height: var(--lh-snug);
}
.proj-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.proj-actions .btn { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; border-radius: var(--radius-md); white-space: nowrap; }
.proj-actions .dropdown-toggle::after { margin-left: 4px; }

/* --- Project tab bar (underline tabs, like the dashboard filter tabs) --- */
.proj-tabs {
  display: flex; gap: var(--sp-1); flex-wrap: wrap;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--sp-5);
}
.proj-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: var(--sp-3) 14px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--fg-muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.proj-tab i { font-size: 14px; opacity: 0.85; }
.proj-tab:hover { color: var(--fg-default); }
/* Active = dark text + orange underline only (Hi-fi: subtle, not a filled chip) */
.proj-tab.active { color: var(--fg-strong); border-bottom-color: var(--brand); font-weight: 600; }
.proj-tab.active i { opacity: 1; color: var(--brand); }
.proj-tab:disabled, .proj-tab.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.proj-tab .tab-count {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  background: var(--bg-muted); color: var(--fg-muted);
  border-radius: var(--radius-pill); padding: 1px 7px; line-height: 1.5;
}
.proj-tab.active .tab-count { background: var(--brand-soft); color: var(--brand); }
/* Memoria "M" hint chip keeps its cyan (set inline); other counts stay neutral/subtle */
.proj-tab .tab-count.mem { background: var(--status-info-bg); color: var(--info); }
/* access indicator (admin eye) inside a tab */
.proj-tab .access-indicator { font-size: 11px; opacity: 0.65; margin-left: 2px; }
.proj-tab .access-indicator.access-denied { color: var(--status-danger-fg); }
.proj-tab .access-indicator.access-granted { color: var(--status-paid-fg); }

/* --- Summary grid (main + side) --- */
.sb-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); align-items: start; }
@media (min-width: 992px) { .sb-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.sb-col { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }

/* --- Summary card (light, soft, Hi-fi spec) --- */
.sb-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
}
.sb-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.sb-card-title {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-md); font-weight: 600; color: var(--fg-strong);
}
.sb-card-title i { color: var(--fg-muted); font-size: 15px; }
.sb-card-link {
  font-size: var(--fs-sm); color: var(--fg-muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.sb-card-link:hover { color: var(--brand); }

/* eyebrow label */
.sb-eyebrow {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted);
}

/* --- Workflow stepper --- */
.sb-wf { display: flex; align-items: flex-start; }
.sb-wf-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.sb-wf-step .bar {
  position: absolute; top: 13px; left: 50%; width: 100%; height: 2px;
  background: var(--border-default); z-index: 0;
}
.sb-wf-step:last-child .bar { display: none; }
.sb-wf-step .dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--fg-muted);
}
.sb-wf-step.done .bar { background: var(--brand); }
.sb-wf-step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.sb-wf-step.current .dot { background: var(--bg-surface); border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.sb-wf-step .lbl { font-size: var(--fs-xs); color: var(--fg-muted); margin-top: var(--sp-2); white-space: nowrap; }
.sb-wf-step.current .lbl { color: var(--fg-strong); font-weight: 600; }
.sb-wf-step.done .lbl { color: var(--fg-default); }
.sb-wf-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; margin-top: 22px; padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
}
.sb-wf-foot .stage-val { font-size: var(--fs-md); font-weight: 600; color: var(--fg-strong); margin-top: 2px; }
.sb-wf-prog { display: flex; align-items: center; gap: var(--sp-3); }
.sb-wf-prog .muted { font-size: var(--fs-sm); color: var(--fg-muted); }
.sb-bar { display: inline-block; width: 140px; height: 6px; border-radius: var(--radius-pill); background: var(--bg-muted); overflow: hidden; vertical-align: middle; }
.sb-bar > i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--brand); }
@media (max-width: 575px) {
  .sb-wf-step .dot { width: 24px; height: 24px; font-size: 10px; }
  .sb-wf-step .bar { top: 11px; }
  .sb-wf-step .lbl { font-size: 9px; }
  .sb-wf-foot { margin-top: var(--sp-4); }
}

/* --- Key dates grid --- */
.sb-keydates { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 575px) { .sb-keydates { grid-template-columns: repeat(2, 1fr); } }
.sb-kd { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.sb-kd .val { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; line-height: 1.2; color: var(--fg-strong); }
.sb-kd .val.sans { font-family: var(--font-heading); }
.sb-kd.is-event { background: var(--brand-tint); border-radius: var(--radius-md); padding: var(--sp-3); margin: calc(var(--sp-1) * -1); }
.sb-kd.is-event .val { color: var(--brand); }

/* --- Generic key/value list (used for status, package, payments) --- */
.sb-kv { display: flex; flex-direction: column; gap: var(--sp-3); }
.sb-kv-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.sb-kv-row .k { font-size: var(--fs-sm); color: var(--fg-muted); }
.sb-kv-row .v { font-size: var(--fs-sm); color: var(--fg-default); font-weight: 500; text-align: right; }

/* --- Client card --- */
.sb-client-top { display: flex; align-items: center; gap: var(--sp-3); }
.sb-client-avatar {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--fs-md); color: #fff; background: var(--avatar-pink);
}
.sb-client-name { font-size: 15px; font-weight: 600; color: var(--fg-strong); }
.sb-client-sub { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-muted); margin-top: 1px; }
.sb-client-rows {
  display: flex; flex-direction: column; gap: var(--sp-2);
  margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border-soft);
}
.sb-client-rows .row-bit { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--fg-default); }
.sb-client-rows .row-bit i { color: var(--fg-muted); font-size: 14px; width: 16px; text-align: center; }
.sb-client-rows .row-bit .mono { font-family: var(--font-mono); }
.sb-client-rows a.row-bit { text-decoration: none; }
.sb-client-rows a.row-bit:hover { color: var(--brand); }
.sb-client-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.sb-client-actions .btn { flex: 1; min-width: 0; height: 34px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* --- Quick actions list --- */
.qa-list { display: flex; flex-direction: column; }
.qa-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: 10px 0; font-size: var(--fs-sm); color: var(--fg-default);
  background: none; border: none; border-top: 1px solid var(--border-soft);
  text-align: left; width: 100%; cursor: pointer; text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.qa-item:first-child { border-top: none; }
.qa-item:hover { color: var(--brand); }
.qa-item:hover .qa-arrow { transform: translateX(2px); color: var(--brand); }
.qa-item .qa-label { display: inline-flex; align-items: center; gap: 10px; }
.qa-item .qa-label i { color: var(--fg-muted); font-size: 15px; width: 16px; text-align: center; }
.qa-item:hover .qa-label i { color: var(--brand); }
.qa-item .qa-arrow { color: var(--fg-subtle); font-size: 13px; transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }

/* --- Notices list --- */
.sb-notices { display: flex; flex-direction: column; gap: var(--sp-2); }
.sb-notice {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--fg-default);
}
.sb-notice i { font-size: 14px; width: 16px; text-align: center; }
.sb-notice.ok i { color: var(--status-paid-fg); }
.sb-notice.info i { color: var(--info); }
.sb-notice.warn i { color: var(--status-danger-fg); }
.sb-empty { font-size: var(--fs-sm); color: var(--fg-muted); }

.critical-summary-notice {
  width: 100%;
  padding: var(--sp-3);
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-fg);
  border-radius: var(--radius-md);
  color: var(--fg-default);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.critical-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.critical-summary-copy small { color: var(--fg-muted); }
.critical-summary-arrow { margin-left: auto; }
.critical-summary-notice:hover,
.critical-summary-notice:focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--status-danger-bg);
}

/* --- Progress gallery thumb (summary) --- */
.sb-gallery { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; }
.sb-gallery img { width: 84px; height: 60px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border-default); flex-shrink: 0; }
.sb-gallery .g-title { font-size: var(--fs-sm); color: var(--fg-strong); font-weight: 500; }
.sb-gallery .g-sub { font-size: var(--fs-xs); color: var(--fg-muted); margin-top: 2px; }
.sb-gallery:hover .g-title { color: var(--brand); }

/* NOU badge sits next to a card title */
.sb-card-title .badge-nou { margin-left: 6px; }

/* ================================================================
   Project detail — form tabs Hi-fi reskin (CSS-first, scoped)
   Restyles the EXISTING Bootstrap form markup into the StoryBoard
   card / eyebrow / input-box look WITHOUT touching editing logic
   (.editable-section / .view-mode / .edit-mode / [data-field] /
   [data-section] are preserved verbatim).
   ================================================================ */

/* ---- Shared field-level reskin (editable-section tabs) ---- */
:is(#preproduction-content, #package-content) .editable-section h6 {
  font-family: var(--font-heading);
  font-size: var(--fs-md); font-weight: 600; color: var(--fg-strong) !important;
  padding-bottom: 0;
}
:is(#preproduction-content, #package-content) .editable-section h6::after { display: none !important; }

:is(#preproduction-content, #package-content) .form-label {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted) !important;
  margin-bottom: var(--sp-2);
}

/* Read-only SINGLE-value fields -> underline style: a thin baseline keeps the row
   readable without a heavy box (the '>' skips composite blocks like the Clients view) */
:is(#preproduction-content, #package-content) .view-mode > .form-control-plaintext {
  border: none; border-bottom: 1px solid var(--border-default); border-radius: 0;
  padding: 5px 2px; background: transparent; color: var(--fg-strong);
  font-size: var(--fs-md); min-height: 30px; margin: 0;
}
:is(#preproduction-content, #package-content) .view-mode .form-control-plaintext { color: var(--fg-default); }
:is(#preproduction-content, #package-content) .view-mode .row .form-control-plaintext { border: none; padding: 0; min-height: 0; background: transparent; }
:is(#preproduction-content, #package-content) .text-not-specified { color: var(--fg-subtle) !important; }

:is(#preproduction-content, #package-content) .edit-mode .form-control,
:is(#preproduction-content, #package-content) .edit-mode .form-select,
:is(#preproduction-content, #package-content) .edit-mode textarea {
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--fg-strong);
}

:is(#preproduction-content, #package-content) .alert-info {
  background: var(--bg-muted); border: 1px solid var(--border-soft); color: var(--fg-default);
}

:is(#preproduction-content, #package-content) .edit-btn,
:is(#preproduction-content, #package-content) .reorder-btn {
  background: var(--bg-surface); color: var(--fg-muted);
  border: 1px solid var(--border-default); border-radius: var(--radius-md); font-weight: 500;
}
:is(#preproduction-content, #package-content) .edit-btn:hover,
:is(#preproduction-content, #package-content) .reorder-btn:hover {
  background: var(--bg-muted); color: var(--fg-strong); border-color: var(--border-strong);
}

/* ---- Details: single outer wrapper flattened; each editable-section is a card ----
   (!important needed to beat the global `.theme-light .card { ... !important }`) */
#preproduction-content > .card { background: transparent !important; border: none !important; box-shadow: none !important; border-radius: 0; overflow: visible; }
#preproduction-content > .card > .card-header { display: none; }
#preproduction-content > .card > .card-body { padding: 0; }
#preproduction-content .editable-section {
  background: var(--bg-surface) !important; border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm) !important;
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
#preproduction-content .editable-section + .editable-section { border-top: none; padding-top: var(--sp-4); margin-top: 0; }
#preproduction-content .editable-section.editing { border-left: 1px solid var(--brand) !important; padding-left: var(--sp-4); }

/* ---- Package: the main .card IS the card; the inner section stays flat ---- */
#package-content > .card.mb-4 {
  background: var(--bg-surface) !important; border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm) !important;
}
#package-content > .card.mb-4 > .card-header { background: transparent !important; border-bottom: 1px solid var(--border-soft); color: var(--fg-strong); }
#package-content .editable-section { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0; margin-bottom: 0; }
#package-content .editable-section.editing { border-left: 1px solid var(--brand) !important; padding-left: var(--sp-3); }

/* ================================================================
   Project detail — card-based tabs Hi-fi reskin (CSS-first, scoped)
   Production / Download / Documents / Feedback. These use .card
   directly as section cards (Production also has editable-sections).
   Editing/JS hooks (.editable-section, ids, onclick, collapse pairs)
   are NOT touched. !important is required to beat the global
   `.theme-light .card { ... !important }` and hard-coded dark inline
   styles that predate the new design tokens.
   ================================================================ */
:is(#production-content, #download-content, #documents-content, #feedback-content) .card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-sm) !important;
}
/* nested cards (e.g. test-file tiles) sit slightly recessed */
:is(#production-content, #download-content, #documents-content, #feedback-content) .card .card {
  background: var(--bg-subtle) !important; box-shadow: none !important;
}

/* Card headers -> clean Hi-fi header (neutralize colored fills) */
:is(#production-content, #download-content, #documents-content, #feedback-content) .card-header {
  background: transparent !important; color: var(--fg-strong) !important;
  border-bottom: 1px solid var(--border-soft) !important; font-weight: 600;
}

/* Dark-theme leftover text helpers that go invisible on white cards */
:is(#production-content, #download-content, #documents-content, #feedback-content) .text-white { color: var(--fg-strong) !important; }
:is(#production-content, #download-content, #documents-content, #feedback-content) .text-white-50 { color: var(--fg-muted) !important; }
/* hard-coded dark inline backgrounds/borders on collapsible cards */
:is(#production-content, #download-content, #documents-content, #feedback-content) [style*="255, 255, 255, 0.05"],
:is(#production-content, #download-content, #documents-content, #feedback-content) [style*="255,255,255,0.05"] { background-color: var(--bg-subtle) !important; }
:is(#production-content, #download-content, #documents-content, #feedback-content) [style*="255, 255, 255, 0.1"],
:is(#production-content, #download-content, #documents-content, #feedback-content) [style*="255,255,255,0.1"] { border-color: var(--border-default) !important; }

/* Field labels -> eyebrow */
:is(#production-content, #download-content, #documents-content, #feedback-content) .form-label {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted) !important; margin-bottom: var(--sp-2);
}

/* Read-only single-value fields -> underline style (thin baseline, no heavy box) */
:is(#production-content, #download-content, #documents-content, #feedback-content) .view-mode > .form-control-plaintext {
  border: none; border-bottom: 1px solid var(--border-default); border-radius: 0;
  padding: 5px 2px; background: transparent; color: var(--fg-strong);
  font-size: var(--fs-md); min-height: 30px; margin: 0;
}
:is(#production-content, #download-content, #documents-content, #feedback-content) .text-not-specified { color: var(--fg-subtle) !important; }

/* Inputs / selects / textareas -> clean tokens (override inline dark styles) */
:is(#production-content, #download-content, #documents-content, #feedback-content) .form-control,
:is(#production-content, #download-content, #documents-content, #feedback-content) .form-select,
:is(#production-content, #download-content, #documents-content, #feedback-content) textarea {
  background: var(--bg-surface) !important; border: 1px solid var(--border-default) !important;
  color: var(--fg-default) !important; border-radius: var(--radius-md);
}

/* Editable-section titles (Production): drop the gradient, flatten the section */
:is(#production-content, #download-content, #documents-content, #feedback-content) .editable-section { background: transparent !important; border: none !important; box-shadow: none !important; }
:is(#production-content, #download-content, #documents-content, #feedback-content) .editable-section h6 {
  font-family: var(--font-heading); font-size: var(--fs-md); font-weight: 600; color: var(--fg-strong) !important; padding-bottom: 0;
}
:is(#production-content, #download-content, #documents-content, #feedback-content) .editable-section h6::after { display: none !important; }

#production-content #critical-production-section {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-xl);
  padding: var(--sp-4);
  scroll-margin-top: 96px;
}
#production-content #critical-production-section.has-critical-content {
  background: var(--status-danger-bg) !important;
  border-color: var(--status-danger-fg) !important;
  border-left: 4px solid var(--status-danger-fg) !important;
  box-shadow: var(--shadow-sm) !important;
}
#production-content #critical-production-section.has-critical-content .critical-production-title {
  color: var(--status-danger-fg) !important;
}
#production-content #critical-production-section:focus-visible {
  outline: 3px solid var(--status-danger-fg);
  outline-offset: 3px;
}
.critical-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Alerts -> soft note panels */
:is(#production-content, #download-content, #documents-content, #feedback-content) .alert {
  border-radius: var(--radius-md);
}
:is(#production-content, #download-content, #documents-content, #feedback-content) .alert-info {
  background: var(--bg-muted); border: 1px solid var(--border-soft); color: var(--fg-default);
}

/* list-group rows -> clean */
:is(#production-content, #download-content, #documents-content, #feedback-content) .list-group-item {
  background: transparent !important; border-color: var(--border-soft) !important; color: var(--fg-default);
}

/* edit / reorder buttons -> compact neutral chips */
:is(#production-content, #download-content, #documents-content, #feedback-content) .edit-btn,
:is(#production-content, #download-content, #documents-content, #feedback-content) .reorder-btn {
  background: var(--bg-surface); color: var(--fg-muted);
  border: 1px solid var(--border-default); border-radius: var(--radius-md); font-weight: 500;
}

/* ================================================================
   Project detail — element-level Hi-fi reskin (buttons, badges,
   alerts, form-checks, progress, code) scoped to the 6 project tabs.
   These are the Bootstrap-coloured leftovers the structural pass did
   not cover. Semantic hue is kept but rendered as soft StoryBoard
   tokens. JS/markup untouched (save-btn/cancel-btn/form-check etc.
   keep their classes + data attributes).
   ================================================================ */

/* ---- Buttons: consistent sizing; primary=brand, neutral=outline ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn {
  border-radius: var(--radius-md); font-weight: 500;
}
/* primary / confirm / positive -> brand */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-success,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .save-btn {
  background: var(--brand) !important; border: 1px solid var(--brand) !important; color: #fff !important;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-success:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .save-btn:hover { filter: brightness(1.06); }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-success {
  background: transparent !important; border: 1px solid var(--brand) !important; color: var(--brand) !important;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-success:hover { background: var(--brand-soft) !important; }

/* neutral / cancel / secondary / info / warning -> quiet outline chip */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-secondary,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .cancel-btn,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-secondary,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-info,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-info,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-warning,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-warning {
  background: var(--bg-surface) !important; border: 1px solid var(--border-default) !important; color: var(--fg-default) !important;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-secondary:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .cancel-btn:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-secondary:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-info:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-info:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-warning:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-warning:hover {
  background: var(--bg-muted) !important; color: var(--fg-strong) !important; border-color: var(--border-strong) !important;
}
/* checked radio / active toggle inside workflow tabs -> brand fill
   (the quiet-chip rule above flattens .btn-outline-secondary, so the selected
   state must be restored here with equal-or-higher specificity + later order) */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-check:checked + .btn-outline-secondary,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-check:checked + .btn.btn-outline-secondary,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-secondary.active,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-check:checked + .btn-outline-secondary:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-check:checked + .btn.btn-outline-secondary:hover,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-secondary.active:hover {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--fg-on-brand, #fff) !important;
  font-weight: 600 !important;
}

/* destructive stays red, but tonal */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-danger {
  background: var(--danger, #c4534f) !important; border: 1px solid var(--danger, #c4534f) !important; color: #fff !important;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .btn-outline-danger {
  background: transparent !important; border: 1px solid var(--status-danger-fg) !important; color: var(--status-danger-fg) !important;
}

/* ---- Badges -> soft tonal pills (semantic hue, StoryBoard style) ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge {
  border-radius: var(--radius-pill); font-weight: 500; font-size: var(--fs-xs); padding: 3px 9px; letter-spacing: 0;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-success { background: var(--status-paid-bg) !important; color: var(--status-paid-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-danger  { background: var(--status-danger-bg) !important; color: var(--status-danger-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-warning { background: var(--status-editing-bg) !important; color: var(--status-editing-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-info    { background: var(--status-info-bg) !important; color: var(--status-info-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-primary { background: var(--brand-soft) !important; color: var(--brand) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.bg-secondary { background: var(--bg-muted) !important; color: var(--fg-muted) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .badge.text-dark { color: var(--status-editing-fg) !important; }

/* ---- Alerts -> soft tonal note panels ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert { border-radius: var(--radius-md); }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-success { background: var(--status-paid-bg) !important; border: 1px solid transparent !important; color: var(--status-paid-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-warning { background: var(--status-editing-bg) !important; border: 1px solid transparent !important; color: var(--status-editing-fg) !important; }
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-danger  { background: var(--status-danger-bg) !important; border: 1px solid transparent !important; color: var(--status-danger-fg) !important; }
/* keep alert text legible regardless of inner helper classes */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-success *,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-warning *,
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .alert-danger * { color: inherit !important; }

/* ---- Form checks / radios / switches -> brand accent ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .form-check-input {
  accent-color: var(--brand); border-color: var(--border-strong);
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .form-check-input:checked {
  background-color: var(--brand) !important; border-color: var(--brand) !important;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .form-check-input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 0.18rem var(--brand-soft);
}

/* ---- Progress bars -> thin Hi-fi bar ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .progress {
  height: 8px !important; border-radius: var(--radius-pill); background: var(--bg-muted) !important; overflow: hidden;
}
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .progress-bar {
  background: var(--brand) !important; border-radius: var(--radius-pill);
}

/* ---- inline <code> (payment / bank values) ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) code {
  background: var(--bg-muted); color: var(--brand); border-radius: var(--radius-sm, 4px); padding: 2px 7px; font-family: var(--font-mono);
}

/* ---- input-group seams ---- */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .input-group-text {
  background: var(--bg-muted) !important; border: 1px solid var(--border-default) !important; color: var(--fg-muted) !important;
}

/* ---- Social media agreement — compact status view (Hi-fi) ---- */
.sb-consent { display: flex; align-items: center; gap: var(--sp-3); }
.sb-consent-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.sb-consent-icon.ok { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.sb-consent-icon.no { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.sb-consent-icon.neutral { background: var(--bg-muted); color: var(--fg-subtle); }
.sb-consent-label { font-size: 15px; font-weight: 600; color: var(--fg-strong); }
.sb-consent-sub { font-size: var(--fs-sm); color: var(--fg-muted); margin-top: 1px; }
.sb-consent-extra { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); color: var(--fg-default); }
.sb-consent-extra .sb-eyebrow { display: block; margin-bottom: 4px; }

/* Multi-line read-only values (textarea-backed, marked by inline white-space:pre-wrap):
   a thin bottom-underline reads oddly under a tall block -> use a subtle tinted panel
   with a left accent instead. Scoped to the form tabs; higher specificity than the
   single-line underline rule so it wins without !important. */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .view-mode > .form-control-plaintext[style*="pre-wrap"] {
  border: none; border-left: 2px solid var(--border-strong);
  border-radius: var(--radius-md); background: var(--bg-subtle);
  padding: 9px 12px; min-height: 0; color: var(--fg-default);
}

/* Fields whose value is a status pill: no underline (the pill is the visual) */
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .view-mode > .form-control-plaintext:has(> .status-badge),
:is(#preproduction-content, #package-content, #production-content, #download-content, #documents-content, #feedback-content) .view-mode > .form-control-plaintext:has(> .badge) {
  border: none; padding: 4px 0; min-height: 0; background: transparent;
}

/* Package config: each read-only value becomes a subtle tile (Hi-fi stat-box feel) so
   the sparse grid reads as unified groups instead of underlines floating in whitespace. */
#package-content .editable-section .view-mode {
  background: var(--bg-subtle); border: 1px solid var(--border-soft);
  border-radius: var(--radius-md); padding: 9px 12px; min-height: 42px;
}
#package-content .editable-section .view-mode .form-control-plaintext {
  border: none !important; border-left: none !important; background: transparent !important;
  padding: 0 !important; min-height: 0 !important; margin: 0;
}

/* ---- Compact client payment details (invoices) ---- */
.sb-paybox { display: flex; flex-direction: column; }
.sb-pay-amount { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; padding-bottom: var(--sp-3); }
.sb-pay-amount .k { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted); }
.sb-pay-amount .v { font-size: 18px; font-weight: 700; color: var(--brand); font-family: var(--font-mono); }
.sb-pay-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--border-soft); }
.sb-pay-row .k { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted); flex-shrink: 0; }
.sb-pay-v { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; justify-content: flex-end; flex-wrap: wrap; }
.sb-pay-v code { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--fg-strong); background: var(--bg-muted); padding: 2px 7px; border-radius: var(--radius-sm, 4px); word-break: break-all; }
.sb-copy { background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand); border-radius: var(--radius-pill, 999px); padding: 3px 11px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; flex-shrink: 0; font-size: var(--fs-xs, 12px); font-weight: 600; line-height: 1.4; white-space: nowrap; }
.sb-copy:hover { background: var(--brand); color: var(--fg-on-brand, #fff); border-color: var(--brand); }
.sb-copy .sb-copy-label { white-space: nowrap; }

/* ---- Compact inline empty-state (replaces bulky faded-icon blocks) ---- */
.sb-empty-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3) 0; color: var(--fg-muted); font-size: var(--fs-sm); border-top: 1px solid var(--border-soft); }
.sb-empty-row > i { font-size: 1rem; opacity: 0.6; }
.sb-empty-row .btn { margin-left: auto; }

/* Tone down bulky faded empty-state / hero icons inside the project tabs
   (they read as legacy). Inline font-size needs !important; scoped to tab content
   so modal icons are untouched. */
:is(#download-content, #production-content, #documents-content) i.bi[style*="font-size: 3rem"],
:is(#download-content, #production-content, #documents-content) i.bi[style*="font-size: 2.5rem"],
:is(#download-content, #production-content, #documents-content) i.bi[style*="font-size: 2rem"] {
  font-size: 1.5rem !important;
}

/* Package config: flatten the 3 Bootstrap rows into ONE dense responsive grid so
   short fields (format/cameras) become compact tiles and pack tightly. */
#package-content .sb-pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: var(--sp-3); grid-auto-flow: row dense; }
#package-content .sb-pkg-grid .row { display: contents; }
#package-content .sb-pkg-grid [class*="col-"] { width: auto; max-width: none; flex: none; padding: 0; grid-column: span 2; }
#package-content .sb-pkg-grid [class*="col-"] > .mb-3 { margin-bottom: 0 !important; }
/* list fields (Montages / Equipment) get more room; cameras stays narrow (1, 2, 3) */
#package-content .sb-pkg-grid .col-md-6 { grid-column: span 3; }
#package-content .sb-pkg-grid .pkg-cam { grid-column: span 1; }
/* Compact team display: only non-zero roles, stacked tightly */
#package-content .sb-team { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--fg-muted); }
#package-content .sb-team strong { color: var(--fg-strong); font-weight: 600; }
/* the package label gets a tile-top label inside the grid */
#package-content .sb-pkg-grid .form-label { display: block; margin-bottom: var(--sp-2); }
/* Package Type = primary field: brand-tinted accent tile (distinct, same font) */
#package-content .view-mode.pkg-primary { background: var(--brand-tint); border-color: rgba(228, 113, 24, 0.3); }
#package-content .view-mode.pkg-primary .form-control-plaintext { color: var(--brand); font-weight: 600; }

/* ---- Editing progress (Production) — Hi-fi prominent display ---- */
.sb-editprog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.sb-editprog-pct { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--fg-strong); line-height: 1; }
.sb-editprog-stage { font-size: var(--fs-sm); color: var(--fg-muted); margin-top: 5px; }
.sb-editprog-est { font-size: var(--fs-sm); color: var(--fg-muted); font-family: var(--font-mono); white-space: nowrap; }
.sb-bar.sb-bar-wide { display: block; width: 100%; height: 8px; }

/* ================================================================
   Login / authentication page (StoryBoard)
   Standalone auth card built on .sb-card (no Bootstrap .card, so the
   global `.theme-light .card { ...!important }` reskin doesn't apply).
   ================================================================ */
.auth-wrap { display: flex; justify-content: center; padding: var(--sp-8) var(--sp-4); }
.auth-card { width: 100%; max-width: 440px; padding: var(--sp-8); }

.auth-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.auth-logo {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius-lg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-tint);
}
.auth-brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auth-brand-text .sb-eyebrow { line-height: 1; }
.auth-title {
  font-size: var(--fs-2xl); font-weight: 700; color: var(--fg-strong);
  letter-spacing: var(--tracking-tight); line-height: 1.1; margin: 0;
}
.auth-sub { font-size: var(--fs-sm); color: var(--fg-muted); line-height: var(--lh-body); margin: 0 0 var(--sp-5); }

.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field > label { font-size: var(--fs-sm); font-weight: 600; color: var(--fg-default); margin: 0; }
.auth-field .form-control { height: 42px; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.auth-label-row label { margin: 0; }
.auth-forgot { font-size: var(--fs-xs); color: var(--fg-muted); text-decoration: none; white-space: nowrap; }
.auth-forgot:hover { color: var(--brand); }
.auth-submit {
  height: 44px; font-weight: 600; margin-top: var(--sp-1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.auth-dev { margin-top: var(--sp-4); }
.auth-dev-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 38px; border-radius: var(--radius-md);
  background: transparent; border: 1px dashed var(--border-strong); color: var(--fg-muted);
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.auth-dev-btn:hover { color: var(--fg-strong); border-color: var(--fg-muted); }
.auth-dev-note { text-align: center; font-size: var(--fs-xxs); color: var(--fg-subtle); margin: 6px 0 0; }

.auth-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: var(--sp-3);
  font-size: var(--fs-sm); color: var(--fg-muted); text-decoration: none;
}
.auth-back:hover { color: var(--brand); }

/* ================================================================
   Soft tonal note panel (reusable across secondary pages)
   Replaces bulky Bootstrap .alert-* blocks. Variants: ok/warn/info/danger.
   ================================================================ */
.sb-note {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  background: var(--bg-muted); border: 1px solid var(--border-soft);
  color: var(--fg-default); font-size: var(--fs-sm); line-height: var(--lh-body);
}
.sb-note > i { font-size: 16px; margin-top: 1px; flex-shrink: 0; color: var(--fg-muted); }
.sb-note strong { color: var(--fg-strong); }
.sb-note p { margin: 4px 0 0; }
.sb-note a { color: inherit; text-decoration: underline; font-weight: 600; }
.sb-note.ok    { background: var(--status-paid-bg); }    .sb-note.ok > i    { color: var(--status-paid-fg); }
.sb-note.warn  { background: var(--status-editing-bg); } .sb-note.warn > i  { color: var(--status-editing-fg); }
.sb-note.info  { background: var(--status-info-bg); }    .sb-note.info > i  { color: var(--status-info-fg); }
.sb-note.danger{ background: var(--status-danger-bg); }  .sb-note.danger > i{ color: var(--status-danger-fg); }

/* ================================================================
   Tonal status pills (reutilizabil global) — inlocuieste badge-urile
   solide Bootstrap (bg-success/info/warning/danger/secondary). Adaptive.
   ================================================================ */
.sb-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; line-height: 1;
  padding: 0.28rem 0.6rem; border-radius: var(--radius-pill); white-space: nowrap;
}
.sb-pill--paid     { background: var(--status-paid-bg);    color: var(--status-paid-fg); }
.sb-pill--info     { background: var(--status-info-bg);    color: var(--status-info-fg); }
.sb-pill--editing  { background: var(--status-editing-bg); color: var(--status-editing-fg); }
.sb-pill--danger   { background: var(--status-danger-bg);  color: var(--status-danger-fg); }
.sb-pill--neutral  { background: var(--surface-600);       color: var(--text-300); }
/* estimari financiare (paritate cu seria mov din grafic, COLORS.forecastExp) */
.sb-pill--forecast { background: rgba(155, 89, 182, 0.20); color: #C9A0DC; }
.theme-light .sb-pill--forecast { background: #F2E7F7; color: #7D3C98; }

/* ================================================================
   Declined offer page (StoryBoard)
   ================================================================ */
.declined-page { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.declined-head { margin-bottom: var(--sp-1); }
.declined-title { font-size: var(--fs-2xl); font-weight: 700; color: var(--fg-strong); letter-spacing: var(--tracking-tight); line-height: 1.15; margin: var(--sp-3) 0 0; }
.declined-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--fg-muted); }
.declined-meta span { display: inline-flex; align-items: center; gap: 6px; }
.declined-meta i { color: var(--fg-subtle); font-size: 14px; }
.declined-message { font-size: var(--fs-md); line-height: 1.75; color: var(--fg-default); }
.declined-message > :last-child { margin-bottom: 0; }
.declined-message strong { color: var(--fg-strong); }
.declined-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-4); }
.declined-field label { font-size: var(--fs-sm); font-weight: 500; color: var(--fg-default); margin: 0; }
.declined-intro { font-size: var(--fs-sm); color: var(--fg-muted); line-height: var(--lh-body); margin: 0 0 var(--sp-4); }
.declined-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-4); }
.dd-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dd-k { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--fg-muted); }
.dd-v { font-size: var(--fs-sm); color: var(--fg-strong); word-break: break-word; }
.declined-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.declined-back { text-align: center; padding-top: var(--sp-2); }
.declined-fb-text { font-size: var(--fs-md); color: var(--fg-strong); font-weight: 500; margin: 0 0 6px; }
.declined-fb-meta { font-size: var(--fs-xs); color: var(--fg-muted); }
.declined-page .sb-note ul { margin: 8px 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 3px; }
.declined-page .sb-note hr { border: 0; border-top: 1px solid var(--border-soft); margin: var(--sp-3) 0; }
.declined-page .sb-note-meta { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--fg-muted); }
@media (max-width: 575px) { .declined-data { grid-template-columns: 1fr; } }

/* ================================================================
   Video examples gallery (StoryBoard)
   ================================================================ */
.vex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.vex-title { font-size: var(--fs-2xl); font-weight: 700; color: var(--fg-strong); letter-spacing: var(--tracking-tight); line-height: 1.15; margin: var(--sp-2) 0 0; }
.vex-sub { font-size: var(--fs-sm); color: var(--fg-muted); margin: var(--sp-2) 0 0; }
.vex-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; flex-shrink: 0; }

/* Tabs use the global StoryBoard underline .nav-tabs style. */

/* Grid + video cards */
.vex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-4); }
.vex-card { display: flex; flex-direction: column; gap: var(--sp-2); }
.vex-video { background: #000; border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--sp-1); }
.vex-video video, .vex-video iframe { border: 0; border-radius: var(--radius-md); background: #000; width: 100%; height: 100%; }
.vex-card-title { font-size: var(--fs-md); font-weight: 600; color: var(--fg-strong); margin: 0; }
.vex-card-desc { font-size: var(--fs-sm); color: var(--fg-muted); line-height: var(--lh-body); margin: 0; }
.vex-card-meta { font-size: var(--fs-xs); color: var(--fg-subtle); margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.vex-card-meta i { color: var(--fg-muted); }
@media (max-width: 575px) { .vex-grid { grid-template-columns: 1fr; } }

.auth-note {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  background: var(--status-info-bg); color: var(--fg-default);
  font-size: var(--fs-sm); line-height: var(--lh-body);
}
.auth-note i { color: var(--status-info-fg); font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.auth-note strong { color: var(--fg-strong); }

.auth-foot {
  margin-top: var(--sp-5); padding-top: var(--sp-5);
  border-top: 1px solid var(--border-soft); text-align: center;
}
.auth-foot p { font-size: var(--fs-sm); color: var(--fg-muted); line-height: var(--lh-body); margin: 0 0 var(--sp-3); }
.auth-foot p strong { color: var(--fg-default); font-weight: 600; }
.auth-foot-logo { width: 84px; height: auto; opacity: 0.75; }

@media (max-width: 575px) {
  .auth-wrap { padding: var(--sp-4) 0; }
  .auth-card { padding: var(--sp-5); }
}
