/* Premium ERP Design System - Hollend Legacy Vault */

/* HOLLEND BRAND TEAL
 * ------------------
 * The same tokens hollend.com and the Installer Hub carry, so the mark, the
 * public site and both applications agree on what Hollend teal is.
 *
 * The brand teal has TWO weights and they are not interchangeable. #4EA8BF
 * measures 2.74:1 on white -- it fails AA for text and fails even the 3:1 that
 * SC 1.4.11 asks of a non-text boundary -- so on a light ground it may only be
 * a filled surface with dark text on it. On a DARK ground it is the opposite:
 * 7.00:1 on --bg-primary here. This application is dark, so it uses the brand
 * teal directly, and --color-teal-ink exists for the light panels and for any
 * markup that is ever lifted onto a white background.
 *
 * Worth recording: --accent-primary (#6366F1) measures 4.29:1 on --bg-primary
 * and 3.87:1 on --bg-secondary, so indigo TEXT on those grounds is already
 * below AA. The teal below clears it on all three. The indigo is left in place
 * rather than swapped wholesale here -- that is a visual change across every
 * screen and wants a designer's eye, not a find-and-replace -- but new brand
 * surfaces use the teal.
 */
:root {
  --color-teal: #4ea8bf;        /* brand teal: fills, and text on dark grounds */
  --color-teal-ink: #2f7386;    /* teal TEXT on light: 5.36:1 white, 4.60:1 wash */
  --color-teal-hover: #3d8fa4;  /* hover fill / UI boundary, >=3:1 on light */
  --color-on-teal: #1a2328;     /* what goes ON a teal fill: 5.84:1 */
}

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131a2e;
  --bg-tertiary: #1e294b;
  /* The Hollend brand teal. 7.00:1 on --bg-primary, 6.32:1 on --bg-secondary,
     5.21:1 on --bg-tertiary -- AAA on the first and AA on the rest. It replaces
     indigo #6366F1, which measured 4.29 / 3.87 / 3.19:1 and was below AA as
     text on all three.

     The hover is LIGHTER, not darker, which is the opposite of the indigo it
     replaces. --accent-primary is a fill as well as a text colour, and the text
     on that fill is dark (see --color-on-teal): darkening on hover would push
     that text down to 4.31:1, while brightening takes it to 6.74:1. */
  --accent-primary: #4ea8bf;
  --accent-primary-hover: #5fb4c9;
  --accent-secondary: #0ea5e9; /* Sky Blue */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glass-bg: rgba(19, 26, 46, 0.8);
  --glass-blur: blur(16px);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility Styles - Light Mode */
body.theme-light {
  /* THE ACCENT IS A DIFFERENT TEAL IN THIS THEME, AND HAS TO BE.
     --accent-primary is inherited unless overridden, and #4EA8BF measures
     2.61 / 2.74 / 2.50:1 against these three backgrounds -- it fails AA as text
     and fails the 3:1 a boundary needs. It is a dark-ground colour.

     #127285 is the same brand hue carried down to where it reads on white:
     5.32:1 on --bg-primary, 5.57:1 on --bg-secondary, 5.08:1 on --bg-tertiary.

     --color-on-teal flips with it. The dark theme puts charcoal on a light teal
     fill; here the fill is dark, so white goes on it at 5.57:1. Overriding the
     token means .btn-primary and .nav-btn.active follow automatically rather
     than needing a light-theme rule each.

     The hover darkens here, where the dark theme's brightens -- in both cases
     away from the text sitting on the fill, not toward it. */
  --accent-primary: #127285;
  --accent-primary-hover: #0f6675;
  --color-on-teal: #ffffff;

  --bg-primary: #f8fafc; /* Slate 50 */
  --bg-secondary: #ffffff; /* White */
  --bg-tertiary: #f1f5f9; /* Slate 100 */
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --border-color: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
}

/* Accessibility Styles - Font Scaling */
body.font-size-large,
body.font-size-large button,
body.font-size-large input,
body.font-size-large select,
body.font-size-large textarea,
body.font-size-large table,
body.font-size-large td,
body.font-size-large th,
body.font-size-large .logo-text h1,
body.font-size-large .logo-text span,
body.font-size-large .nav-btn {
  font-size: 17px !important;
}
body.font-size-large h1 { font-size: 26px !important; }
body.font-size-large h2 { font-size: 22px !important; }
body.font-size-large h3 { font-size: 19px !important; }

body.font-size-xlarge,
body.font-size-xlarge button,
body.font-size-xlarge input,
body.font-size-xlarge select,
body.font-size-xlarge textarea,
body.font-size-xlarge table,
body.font-size-xlarge td,
body.font-size-xlarge th,
body.font-size-xlarge .logo-text h1,
body.font-size-xlarge .logo-text span,
body.font-size-xlarge .nav-btn {
  font-size: 19px !important;
}
body.font-size-xlarge h1 { font-size: 30px !important; }
body.font-size-xlarge h2 { font-size: 26px !important; }
body.font-size-xlarge h3 { font-size: 22px !important; }

/* Accessibility Styles - Typography Legibility */
body.font-accessible,
body.font-accessible * {
  font-family: 'Comic Sans MS', 'Arial', sans-serif !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* App Layout */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-icon {
  font-size: 32px;
  color: var(--accent-primary);
  background: rgba(78, 168, 191, 0.15);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(78, 168, 191, 0.3);
}

.logo-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.logo-text span {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-secondary);
  letter-spacing: 1px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  width: 100%;
  position: relative;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  /* Same reasoning as .btn-primary: --text-primary is #f8fafc and measured
     4.27:1 on the old indigo fill. Dark on teal is 5.84:1. */
  color: var(--color-on-teal);
  background: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(78, 168, 191, 0.4);
}

.nav-btn .material-symbols-outlined {
  font-size: 20px;
}

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
}

.badge-warning {
  background: var(--warning);
  color: var(--bg-primary);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.status-indicator {
  font-size: 10px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}

/* Main Content Area */
.main-content {
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  width: 320px;
  transition: var(--transition-fast);
}

.header-search:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(78, 168, 191, 0.2);
  width: 380px;
}

.header-search input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  width: 100%;
}

.header-search input::placeholder {
  color: var(--text-secondary);
}

.header-search .material-symbols-outlined {
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  /* Charcoal on teal, 5.84:1. NOT white: white on this teal is 2.74:1, and
     white on the indigo this replaced was 4.47:1 -- already under AA. */
  color: var(--color-on-teal);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 14px rgba(78, 168, 191, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

/* Tabs Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* Dashboard Hero */
.dashboard-hero {
  margin-bottom: 32px;
}

.dashboard-hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dashboard-hero p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* KPI Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(78, 168, 191, 0.2);
}

.metric-card.urgent {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-icon {
  color: var(--accent-primary);
  font-size: 24px;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.metric-footer {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Panels */
.panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 32px;
}

.panel-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.panel-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.filters-header {
  flex-wrap: wrap;
  gap: 16px;
}

.filter-controls {
  display: flex;
  gap: 12px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.table th {
  padding: 16px 24px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-sm th, .table-sm td {
  padding: 10px 14px;
  font-size: 12px;
}

/* Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.won, .status-badge.yes, .status-badge.paid {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.status-badge.lost, .status-badge.no, .status-badge.cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.status-badge.outstanding, .status-badge.pending, .status-badge.not.invoiced {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.status-badge.quickbooks.ready {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-secondary);
}

/* OECM Reports Section */
.oecm-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--border-color);
}

.panel-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.panel-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.row-group {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.row-group > div {
  flex: 1;
}

.split-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.result-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.audit-summary-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.audit-summary-indicator.alert {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.audit-summary-indicator .status-icon {
  font-size: 32px;
}

.report-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

.report-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 16px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.report-tab-btn:hover {
  color: var(--text-primary);
}

.report-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.inner-header {
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
}

/* Forms */
.form-container {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.col-span-2 {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(78, 168, 191, 0.2);
}

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

.input-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

/* File Upload Zone */
.file-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.01);
}

.file-dropzone:hover {
  border-color: var(--accent-primary);
  background: rgba(78, 168, 191, 0.02);
}

.file-dropzone .material-symbols-outlined {
  font-size: 40px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.file-dropzone p {
  font-size: 13px;
  color: var(--text-secondary);
}

.file-name-display {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-secondary);
  font-weight: 600;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-large {
  max-width: 900px;
}

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

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

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

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

.modal-content form {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-grow: 1;
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
}

/* Wizard steps */
.wizard-steps {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
}

.step {
  flex: 1;
  text-align: center;
  padding: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}

.step.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.wizard-pane {
  display: none;
}

.wizard-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Quote Builder specific layout */
.quote-builder-controls {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-start;
}

.quote-totals {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  font-size: 15px;
}

.quote-totals strong {
  font-size: 18px;
  color: var(--accent-secondary);
}

/* Grid layout for settings */
.setting-form {
  max-width: 600px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Login Page Overlay Styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.4s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header img {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.login-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
  animation: shake 0.3s ease-in-out;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

/* User profile section in sidebar footer */
.user-profile-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.user-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-secondary) !important;
}

/* Shake Animation for login error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Social SSO Buttons */
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.btn-google {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}
.btn-google:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-microsoft {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}
.btn-microsoft:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.sso-icon {
  flex-shrink: 0;
  display: inline-block;
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .sidebar {
    height: auto !important;
    position: static !important;
    padding: 16px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
  }
  
  .sidebar-header {
    margin-bottom: 16px !important;
  }
  
  .sidebar-menu {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  .nav-btn {
    width: auto !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
  
  .sidebar-footer {
    margin-top: 16px !important;
    padding-top: 16px !important;
    border-top: 1px solid var(--border-color) !important;
  }
  
  .main-content {
    padding: 16px !important;
  }
  
  .dashboard-hero {
    padding: 20px 16px !important;
  }
  
  .dashboard-hero h2 {
    font-size: 20px !important;
  }
  
  .dashboard-grid,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .card {
    padding: 16px !important;
  }
  
  .table-container {
    overflow-x: auto !important;
  }
  
  .modal-container {
    width: 95% !important;
    padding: 20px !important;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 16px !important;
  }
  .nav-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  h1 { font-size: 20px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }
  
  .login-card {
    padding: 24px 16px !important;
    margin: 12px !important;
  }
  
  .login-header h2 {
    font-size: 20px !important;
  }
}

/* Quote Builder inside the project modal.
   Pricing is fetched from the server, so these columns are displays, not
   inputs - a value the browser cannot change cannot drift from the quote. */
.qb-controls {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px;
  padding:14px; margin-bottom:14px;
  background:var(--bg-secondary,rgba(255,255,255,.03));
  border:1px solid var(--border-color); border-radius:8px;
}
.qb-controls label { font-size:11px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.04em; }
.qb-controls .form-input { margin-top:5px; padding:7px 9px; font-size:14px; }
.qb-controls .qb-check { display:flex; align-items:center; gap:8px; text-transform:none; letter-spacing:0; font-size:13px; align-self:end; padding-bottom:8px; }
.qb-controls .qb-check input { width:16px; height:16px; }

.qb-status { font-size:12px; color:var(--text-secondary); margin-left:12px; }
.qb-gp { font-size:13px; color:var(--text-secondary); margin-left:16px; }

/* A breached line is tinted AND labelled. Colour alone is invisible to anyone
   who cannot distinguish it, and this is the number that decides whether the
   quote is contractually compliant. */
#quote-builder-tbody tr.qb-breach { background:rgba(239,68,68,.10); }
#quote-builder-tbody tr.qb-breach .row-unit { color:var(--danger); font-weight:700; }
.qb-tag { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.05em;
          text-transform:uppercase; padding:2px 6px; border-radius:4px; white-space:nowrap; }
.qb-tag.ok   { background:rgba(34,197,94,.15); color:#22c55e; }
.qb-tag.bad  { background:rgba(239,68,68,.15); color:var(--danger); }
.qb-tag.warn { background:rgba(251,188,5,.15); color:#eab308; }
.qb-tag.none { background:rgba(255,255,255,.06); color:var(--text-secondary); }

#qb-alerts .qb-alert { padding:10px 13px; border-radius:7px; margin-top:12px; font-size:13px; border-left:3px solid; }
#qb-alerts .qb-alert.bad  { background:rgba(239,68,68,.08); border-color:var(--danger); }
#qb-alerts .qb-alert.warn { background:rgba(251,188,5,.08); border-color:#eab308; }
#qb-alerts .qb-alert.info { background:rgba(255,255,255,.04); border-color:var(--border-color); }
#qb-alerts .qb-alert strong { display:block; margin-bottom:2px; }

/* Lifecycle status badges. Each stage gets its own colour so a tracker can be
   scanned rather than read, and a breached project carries a marker of its own
   because "Client Approved" says nothing about whether it should have been. */
.lifecycle { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.05em;
             text-transform:uppercase; padding:3px 8px; border-radius:4px; white-space:nowrap; }
.lifecycle.draft            { background:rgba(255,255,255,.07); color:var(--text-secondary); }
.lifecycle.quote-sent       { background:rgba(59,130,246,.15); color:#60a5fa; }
.lifecycle.client-approved  { background:rgba(168,85,247,.15); color:#c084fc; }
.lifecycle.order-placed     { background:rgba(251,188,5,.15); color:#eab308; }
.lifecycle.installed        { background:rgba(34,197,94,.15); color:#22c55e; }
.lifecycle.cancelled        { background:rgba(239,68,68,.12); color:var(--danger); }
.breach-marker { display:inline-block; margin-left:6px; font-size:10px; font-weight:700;
                 color:var(--danger); cursor:help; }

/* Amber row for a thin margin on a non-contract line. Red stays reserved for a
   contract breach, so the two never look alike in the same table. */
#quote-builder-tbody tr.qb-thin { background:rgba(251,188,5,.08); }
#quote-builder-tbody tr.qb-thin td { border-bottom-color:rgba(251,188,5,.22); }

/* QuickBooks preview pane. The payload is shown as raw JSON on purpose: this is
   a developer-and-bookkeeper tool for checking what would be sent, and a
   prettified summary would hide the field that turns out to be wrong. */
.qbo-status { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.05em;
              text-transform:uppercase; padding:4px 10px; border-radius:4px;
              background:rgba(255,255,255,.06); color:var(--text-secondary); }
.qbo-status.dry  { background:rgba(251,188,5,.15); color:#eab308; }
.qbo-status.live { background:rgba(34,197,94,.15); color:#22c55e; }
.qbo-note { font-size:13px; color:var(--text-secondary); margin:8px 0;
            padding:10px 12px; background:rgba(255,255,255,.03);
            border-left:3px solid var(--border-color); border-radius:0 6px 6px 0; }
.qbo-note.warn { border-left-color:#eab308; }
.qbo-json { max-height:46vh; overflow:auto; margin:0; padding:14px;
            background:#0f0e15; border:1px solid var(--border-color); border-radius:8px;
            font-family:ui-monospace,"SF Mono",Menlo,monospace; font-size:12px; line-height:1.55;
            color:#d6d3e0; white-space:pre; }

/* --- orders mailbox ingestion (settings) ---------------------------------
   Read-only panel. Colour carries meaning here rather than decoration: the
   expiry banner and the status pills are the two things an operator scans for,
   so semantic tones are kept distinct from the indigo accent used elsewhere. */
.gmail-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 8px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.5;
  border: 1px solid var(--border-color); background: var(--bg-secondary);
}
.gmail-banner .material-symbols-outlined { font-size: 20px; flex: none; margin-top: 1px; }
.gmail-banner.ok      { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.gmail-banner.ok      .material-symbols-outlined { color: var(--success); }
.gmail-banner.warn    { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.gmail-banner.warn    .material-symbols-outlined { color: var(--warning); }
.gmail-banner.danger  { border-color: color-mix(in srgb, var(--danger) 55%, transparent);
                        background: color-mix(in srgb, var(--danger) 8%, var(--bg-secondary)); }
.gmail-banner.danger  .material-symbols-outlined { color: var(--danger); }
.gmail-banner.neutral .material-symbols-outlined { color: var(--text-secondary); }

.gmail-config {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 20px; margin-bottom: 14px;
}
.gmail-config > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.gmail-config .k {
  flex: none; width: 130px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-secondary);
}
.gmail-config .v {
  font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow-wrap: anywhere; min-width: 0;
}
.gmail-config .v.missing { color: var(--danger); }
.gmail-config .cfg-warn { grid-column: 1 / -1; color: var(--danger); font-size: 12px; }

.gmail-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.gmail-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border-color); color: var(--text-secondary);
}
.gmail-chip b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.gmail-chip.unmatched   { border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
.gmail-chip.failed,
.gmail-chip.drive_failed{ border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.gmail-chip.filed       { border-color: color-mix(in srgb, var(--success) 45%, transparent); }

.gmail-list { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; }
.gmail-msg {
  border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 14px;
  background: var(--bg-secondary);
}
.gmail-msg header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gmail-msg .subj { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.gmail-msg .meta,
.gmail-msg .facts { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
.gmail-msg .facts { font-variant-numeric: tabular-nums; }
.gmail-msg .hint  { margin: 6px 0 0; font-size: 12px; color: var(--warning); }
.gmail-msg .detail {
  margin: 6px 0 0; font-size: 12px; color: var(--text-secondary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere;
}

.gmail-status {
  flex: none; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid var(--border-color); color: var(--text-secondary);
}
.gmail-status.filed        { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.gmail-status.unmatched    { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
.gmail-status.partial      { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
.gmail-status.failed,
.gmail-status.drive_failed { color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

/* Used by the ingestion panel's secondary text and empty states. */
.muted-small { font-size: 12px; color: var(--text-secondary); }

/* Triage proposals on an unmatched ingested message. */
.gmail-triage { margin-top: 8px; }
.triage-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--border-color); flex-wrap: wrap;
}
.triage-option .btn { flex: none; min-height: 34px; padding: 0 12px; font-size: 13px; }
.triage-why { font-size: 13px; min-width: 0; }
.triage-conf {
  margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--border-color); color: var(--text-secondary);
}
.triage-conf.high   { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.triage-conf.medium { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.triage-error { display: block; width: 100%; margin-top: 4px; font-size: 12px; color: var(--danger); }

/* ---------------------------------------------------------------------------
   Idle blur
   ---------------------------------------------------------------------------
   Sensitive regions are obscured after a period without interaction, so a
   signed-in terminal on a shop floor does not show a customer's financials to
   whoever walks past.

   This is a PRESENTATION measure and not a security boundary. The data is
   already in the DOM and anyone with a console can read it; the boundary is the
   step-up gate on the server. Treating the blur as protection it cannot provide
   is the mistake this comment exists to prevent.
   --------------------------------------------------------------------------- */

[data-sensitive] {
  /* Only the transition is declared here, so an element that is never blurred
     carries no filter and no compositing cost. */
  transition: filter 240ms ease;
}

[data-sensitive].is-idle-blurred {
  filter: blur(10px);
  /* Selection would let someone copy text they cannot read. */
  user-select: none;
  pointer-events: none;
}

/* The overlay is a sibling of the blurred regions, never a descendant: nested
   inside one it would be blurred along with it, and its own button would be
   unreadable and unclickable. */
#idle-shield {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#idle-shield.is-visible {
  display: flex;
}

#idle-shield .idle-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

#idle-shield .idle-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  margin: 12px 0 8px;
  color: var(--text-primary);
}

#idle-shield .idle-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

#idle-shield .idle-icon {
  font-size: 40px;
  color: var(--accent-primary);
}

/* The blur is the function, not decoration, so it stays. Only the animation
   into it is suppressed -- a filter transition is exactly the kind of motion
   this preference is about. */
@media (prefers-reduced-motion: reduce) {
  [data-sensitive] {
    transition: none;
  }
  #idle-shield {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Queued for QBO. The badge tones are a fixed set of tokens: the class used to be
   the status lower-cased, so "QuickBooks Ready" produced two class names and
   matched neither. */
.status-badge.ready {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
}

/* A bill whose subtotal and tax were never recorded says so, rather than showing a
   figure derived from an assumed rate. */
.breakdown-missing {
  color: var(--text-secondary);
  font-style: italic;
}

.install-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.install-filters .active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ---- Hollend brand surfaces ----------------------------------------------
   The two elements added with the role-scoped login work. Both use the brand
   teal on this application's dark ground, where it measures 7.00:1. */

/* The sidebar emblem is a link home. It needs a visible focus ring of its own:
   wrapping an <img> in an <a> makes it keyboard-reachable, and a link nobody
   can see the focus on is worse than one nobody can tab to. */
.sidebar-home {
  display: inline-flex;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
}
.sidebar-home:hover { opacity: 0.85; }
.sidebar-home:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 3px;
}

/* The installer sandbox toggle. Teal marks it as the one control in the top
   bar that leaves this application. */
#btn-installer-sandbox {
  border: 1px solid var(--color-teal);
  color: var(--color-teal);
}
#btn-installer-sandbox:hover {
  background: var(--color-teal);
  color: var(--color-on-teal);
  border-color: var(--color-teal);
}
#btn-installer-sandbox:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
}
/* [hidden] must win over the .btn display rule, or the toggle shows for
   everyone the moment a stylesheet sets display on it. */
#btn-installer-sandbox[hidden] { display: none !important; }
