/* ─────────────────────────────────────────────────────────────
   SBC Client Hub — Design System
   Strategic Business Concepts, LLC branding (matches sbcllc.us)
   Primary: Navy #0F2C54 | Accent: Azure #5FA8E8
   Fonts: Inter (UI/body) + IBM Plex Serif (page headings)
   ───────────────────────────────────────────────────────────── */

:root {
  /* ---- Brand tokens (same values as sbcllc.us) ---- */
  --navy-950:        #06152B;
  --navy-900:        #0A1F3D;
  --navy-800:        #0F2C54;
  --navy-700:        #173D70;
  --steel-600:       #2F6FB0;
  --azure-400:       #5FA8E8;
  --azure-200:       #B9D8F3;
  --ice-50:          #F3F7FC;
  --ice-100:         #E4EDF8;
  --slate-600:       #4F5D73;
  --charcoal:        #1E2733;
  --font-display:    'IBM Plex Serif', Georgia, 'Times New Roman', serif;

  /* ---- App tokens ---- */
  --sidebar-w:       224px;
  --sidebar-bg:      var(--navy-900);
  --sidebar-border:  rgba(255,255,255,0.10);
  --sidebar-text:    #ffffff;
  --sidebar-text-hover: var(--azure-200);
  --sidebar-hover:   rgba(95,168,232,0.12);
  --sidebar-active:  rgba(95,168,232,0.22);
  --primary:         var(--navy-800);
  --primary-hover:   var(--navy-700);
  --primary-rgb:     15,44,84;
  --accent:          var(--azure-400);
  --link:            var(--steel-600);
  --success:         #16a34a;
  --warning:         #d97706;
  --danger:          #dc2626;
  --surface:         #ffffff;
  --surface-tint:    var(--ice-50);
  --bg:              var(--ice-50);
  --border:          #dbe4f0;
  --border-light:    var(--ice-100);
  --text:            var(--charcoal);
  --text-2:          var(--slate-600);
  --text-3:          #8a97ab;
  --radius:          8px;
  --radius-sm:       6px;
  --shadow-xs:       0 1px 2px rgba(10,31,61,0.06);
  --shadow-sm:       0 1px 3px rgba(10,31,61,0.08), 0 1px 2px rgba(10,31,61,0.04);
  --shadow-md:       0 4px 10px -1px rgba(10,31,61,0.10), 0 2px 4px -2px rgba(10,31,61,0.05);

  /* ---- Bootstrap mapping, so bg-primary, text-primary, links, focus rings,
          *-subtle badges and alerts all pick up the brand ---- */
  --bs-primary:                var(--navy-800);
  --bs-primary-rgb:            15,44,84;
  --bs-primary-text-emphasis:  var(--navy-900);
  --bs-primary-bg-subtle:      var(--ice-100);
  --bs-primary-border-subtle:  var(--azure-200);
  --bs-info:                   var(--steel-600);
  --bs-info-rgb:               47,111,176;
  --bs-info-text-emphasis:     var(--navy-800);
  --bs-info-bg-subtle:         #E6F1FC;
  --bs-info-border-subtle:     var(--azure-200);
  --bs-body-color:             var(--charcoal);
  --bs-body-color-rgb:         30,39,51;
  --bs-secondary-color:        var(--slate-600);
  --bs-link-color:             var(--steel-600);
  --bs-link-color-rgb:         47,111,176;
  --bs-link-hover-color:       var(--navy-800);
  --bs-link-hover-color-rgb:   15,44,84;
  --bs-focus-ring-color:       rgba(47,111,176,0.30);
  --bs-border-color:           #dbe4f0;
}

/* ── Base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── App Shell ────────────────────────────────────────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  transition: transform 0.22s ease;
}

.sidebar-brand {
  padding: 1.25rem 0.875rem 1.125rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-logo-link:hover { opacity: 0.88; }

.sidebar-logo-img {
  width: 100%;
  max-width: 196px;
  height: auto;
  display: block;
  image-rendering: optimizequality;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-hover);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-link-icon {
  width: 16px;
  text-align: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-link.active .sidebar-link-icon { opacity: 1; }

.sidebar-link-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--warning);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar-logout:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-hover);
}

.sidebar-user {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-timer {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.18);
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-timer:hover { background: rgba(220, 38, 38, 0.28); color: var(--sidebar-text); }
.sidebar-timer-text { flex: 1; }
.sidebar-timer .timer-clock { font-variant-numeric: tabular-nums; }
.sidebar-timer .timer-dot { color: #f87171; font-size: 0.5rem; }

.timer-dot { animation: timer-pulse 1.4s ease-in-out infinite; }
@keyframes timer-pulse { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .timer-dot { animation: none; }
}

/* ── Sidebar mobile overlay & toggle ──────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* ── Mobile top bar (logo left, hamburger right) ─────────── */

.mobile-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 1rem;
  z-index: 1002;
}

.mobile-topbar-logo {
  height: 30px;
  width: auto;
}

.sidebar-toggle {
  background: transparent;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ── Page Body ────────────────────────────────────────────── */

.page-body {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.page-content {
  padding: 2rem 2.5rem;
}

/* ── Page Header ──────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0;
}

/* ── Cards ────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-xs) !important;
}

.card-header {
  background: var(--surface-tint) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.875rem 1.25rem !important;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 1.25rem; }

/* ── Tables ───────────────────────────────────────────────── */

.table {
  font-size: 0.8125rem;
  color: var(--text);
  margin: 0;
  --bs-table-hover-bg: #f8fafc;
}

.table > thead > tr > th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border) !important;
  padding: 0.625rem 1rem;
  white-space: nowrap;
  background: var(--surface-tint);
}

.table > tbody > tr > td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  border-top: none;
}

.table > tbody > tr:last-child > td { border-bottom: none; }

/* Clickable rows (see app.js) - hover highlight even on tables without .table-hover */
.table > tbody > tr[data-href] { cursor: pointer; }
.table > tbody > tr[data-href]:hover > * { --bs-table-bg-state: var(--bs-table-hover-bg); }

/* ── Stat Cards ───────────────────────────────────────────── */

.stat-card {
  border-left: 3px solid transparent;
  transition: box-shadow 0.15s;
}

.stat-card:hover { box-shadow: var(--shadow-md) !important; }

.stat-card.stat-primary { border-color: var(--primary); }
.stat-card.stat-success { border-color: var(--success); }
.stat-card.stat-warning { border-color: var(--warning); }
.stat-card.stat-danger  { border-color: var(--danger); }

.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 600;
  margin-top: 0.375rem;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  line-height: 1.4;
}

.btn-primary {
  --bs-btn-bg:                  var(--primary);
  --bs-btn-border-color:        var(--primary);
  --bs-btn-hover-bg:            var(--primary-hover);
  --bs-btn-hover-border-color:  var(--primary-hover);
  --bs-btn-active-bg:           var(--primary-hover);
  --bs-btn-active-border-color: var(--primary-hover);
  --bs-btn-disabled-bg:         var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb:    var(--primary-rgb);
  box-shadow: none !important;
}

.btn-outline-primary {
  --bs-btn-color:              var(--primary);
  --bs-btn-border-color:       var(--primary);
  --bs-btn-hover-bg:           var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg:          var(--primary);
  --bs-btn-active-border-color:var(--primary);
  --bs-btn-focus-shadow-rgb:   var(--primary-rgb);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
}

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-2);
}

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

/* ── Nav pills & tabs ─────────────────────────────────────── */

.nav-pills {
  --bs-nav-pills-link-active-bg:    var(--primary);
  --bs-nav-pills-link-active-color: #fff;
}

.nav-pills .nav-link { color: var(--primary); }
.nav-pills .nav-link:hover { color: var(--primary-hover); background: rgba(var(--primary-rgb),0.07); }

.nav-tabs {
  --bs-nav-tabs-link-active-color:        var(--primary);
  --bs-nav-tabs-link-active-border-color: var(--primary) var(--primary) #fff;
}

.nav-tabs .nav-link { color: var(--text-2); }
.nav-tabs .nav-link:hover { color: var(--primary); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--primary); }

/* ── Forms ────────────────────────────────────────────────── */

.form-control, .form-select {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--azure-400);
  box-shadow: 0 0 0 3px rgba(47,111,176,0.18);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.3rem;
}

.input-group-text {
  font-size: 0.875rem;
  background: var(--surface-tint);
  border-color: var(--border);
  color: var(--text-2);
}

/* ── Badges ───────────────────────────────────────────────── */

.badge {
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 0.2em 0.55em;
  letter-spacing: 0.02em;
}

/* ── Alerts ───────────────────────────────────────────────── */

.alert {
  border-radius: var(--radius);
  font-size: 0.875rem;
}

/* ── Invoice line items ───────────────────────────────────── */

#lineItemsTable td {
  vertical-align: middle;
  padding: 0.3rem 0.4rem;
}

#lineItemsTable input,
#lineItemsTable select {
  font-size: 0.8125rem;
  padding: 0.3rem 0.5rem;
}

/* ── Product combobox dropdown ────────────────────────────── */

.product-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.product-dropdown-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.3;
}

.product-dropdown-item:last-child { border-bottom: none; }

.product-dropdown-item:hover { background: var(--ice-100); }

.product-dropdown-item strong {
  color: var(--primary);
  flex-shrink: 0;
  min-width: 52px;
  font-size: 0.75rem;
  font-family: monospace;
}

.product-dropdown-desc {
  color: var(--text-2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-dropdown-price {
  color: var(--text-3);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Padding to clear the icon button on combobox inputs */
.item-product-text,
.customer-combobox-text {
  padding-right: 1.75rem;
}

.combobox-btn {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.combobox-btn .combobox-plus {
  color: var(--primary);
  text-decoration: none;
}

.combobox-btn .combobox-plus:hover { opacity: 0.75; }

/* ── Invoice combobox dropdown ────────────────────────────── */

.invoice-dropdown {
  min-width: 560px;
}

.invoice-dropdown-item {
  display: grid;
  grid-template-columns: 3.2rem 5.4rem 1fr 5.6rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

.invoice-dropdown-item:last-child { border-bottom: none; }
.invoice-dropdown-item:hover { background: var(--ice-100); }

.inv-num      { font-family: monospace; color: var(--primary); font-weight: 600; }
.inv-date     { color: var(--text-3); font-size: 0.75rem; }
.inv-customer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-balance  {
  text-align: right;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.inv-total { font-size: 0.7rem; color: var(--text-3); text-decoration: line-through; }
.inv-due   { font-weight: 600; }

/* Allow text editing in form-select-styled inputs */
.invoice-combobox-text { cursor: text; }

/* ── Automatch badge (reconcile page) ────────────────────────────────── */
.automatch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  font-size: 0.75rem;
  cursor: help;
  flex-shrink: 0;
}

.line-total-col {
  min-width: 90px;
  text-align: right;
  font-weight: 500;
}

/* ── Invoice view ─────────────────────────────────────────── */

.invoice-view-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.invoice-number {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.025em;
}

/* ── Totals block ─────────────────────────────────────────── */

.totals-block {
  max-width: 320px;
  margin-left: auto;
}

.totals-block td { padding: 0.3rem 0.5rem; }

.totals-block .grand-total td {
  font-size: 1.05rem;
  font-weight: 700;
  border-top: 2px solid var(--border);
  padding-top: 0.5rem;
}

/* ── Unreconciled payment rows ────────────────────────────── */

tr.unreconciled > td { background: #fffbeb; }
tr.unreconciled:hover > td { background: #fef3c7 !important; }
tr.unreconciled > td:first-child { border-left: 3px solid var(--warning); }

/* ── Inactive customer rows ───────────────────────────────── */

tr.inactive-row > td { opacity: 0.55; }
tr.inactive-row:hover > td { opacity: 1; }

/* ── Login page ───────────────────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
  image-rendering: optimizequality;
}

/* ── Responsive ───────────────────────────────────────────── */

/* ── Agreements ───────────────────────────────────────────── */

.agreement-editor {
  min-height: 420px;
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
}

.ql-toolbar.ql-snow { border-color: var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ql-container.ql-snow { border-color: var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

.agreement-content {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}

.agreement-content h2 { font-size: 1.125rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
.agreement-content h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.agreement-content h4 { font-size: 0.9375rem; font-weight: 600; margin: 0.875rem 0 0.375rem; }
.agreement-content > :first-child { margin-top: 0; }
.agreement-content .ql-indent-1 { padding-left: 2em; }
.agreement-content .ql-indent-2 { padding-left: 4em; }
.agreement-content .ql-indent-3 { padding-left: 6em; }

/* ── Plans & Tickets ──────────────────────────────────────── */

.plan-badge { color: #fff; font-weight: 600; letter-spacing: 0.02em; }

.timer-display {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.timer-display .timer-dot { font-size: 0.625rem; vertical-align: middle; }

.line-work-by { font-size: 0.75rem; color: var(--text-2); margin-top: 0.125rem; }
.line-work-by a { color: var(--text-2); }

.ticket-type-option {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  height: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.ticket-type-option:hover { border-color: var(--text-3); }
.ticket-type-title { font-weight: 700; font-size: 0.9375rem; color: var(--text); }
.ticket-type-summary { font-size: 0.8125rem; color: var(--text); }
.ticket-type-examples { font-size: 0.75rem; color: var(--text-2); margin: 0; padding-left: 1.1rem; }
.ticket-type-billing { font-size: 0.75rem; font-weight: 600; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 0.375rem; margin-top: auto; }

.btn-check:checked + .ticket-type-change   { border-color: var(--primary); background: var(--ice-100); }
.btn-check:checked + .ticket-type-incident { border-color: var(--danger);  background: #fef2f2; }
.btn-check:focus-visible + .ticket-type-option { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  /* Hide sidebar's own brand logo — topbar logo replaces it */
  .sidebar-brand { display: none; }

  /* Push sidebar nav below the mobile topbar */
  .sidebar-nav { padding-top: calc(56px + 0.5rem); }

  .page-body { margin-left: 0; }

  .page-content {
    padding: 1.25rem;
    padding-top: calc(56px + 1.25rem);
  }

  .stat-card .stat-value { font-size: 1.5rem; }
}

/* ── Mobile (≤575px) ──────────────────────────────────────── */

@media (max-width: 575px) {
  .page-content { padding: 0.75rem; padding-top: calc(56px + 0.75rem); }

  /* Stat cards: 2-per-row, no decorative icon, compact text */
  .stat-card .card-body { padding: 0.625rem 0.75rem; gap: 0.375rem; }
  .stat-card .card-body > i { display: none; }
  .stat-card .stat-value { font-size: 1.05rem; letter-spacing: -0.02em; }
  .stat-card .stat-label { font-size: 0.6rem; margin-top: 0.1rem; }

  /* Tighter table cells */
  .table > thead > tr > th { padding: 0.4rem 0.5rem; font-size: 0.625rem; }
  .table > tbody > tr > td { padding: 0.5rem 0.5rem; font-size: 0.8rem; }

  /* Shrink page title and header action buttons */
  .page-header h1 { font-size: 1.1rem; }
  .page-header .btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; }

  /* ── Column hiding via named table classes ──────────────── */
  /* Invoice + dashboard lists
     Cols: 1=# 2=Customer 3=Issued 4=Due 5=Total 6=Balance 7=Status 8=Action
     Keep: #, Customer, Balance, Status  |  Hide: Issued, Due, Total, Action */
  .tbl-invoices th:nth-child(3), .tbl-invoices td:nth-child(3),
  .tbl-invoices th:nth-child(4), .tbl-invoices td:nth-child(4),
  .tbl-invoices th:nth-child(5), .tbl-invoices td:nth-child(5),
  .tbl-invoices th:nth-child(8), .tbl-invoices td:nth-child(8) { display: none; }

  /* Customer list
     Cols: 1=Company 2=Contact 3=Email 4=Phone 5=Balance 6=Action
     Keep: Company, Balance, Action  |  Hide: Contact, Email, Phone */
  .tbl-customers th:nth-child(2), .tbl-customers td:nth-child(2),
  .tbl-customers th:nth-child(3), .tbl-customers td:nth-child(3),
  .tbl-customers th:nth-child(4), .tbl-customers td:nth-child(4) { display: none; }

  /* Customer detail — invoice sub-table
     Cols: 1=# 2=Issued 3=Due 4=Total 5=Balance 6=Status 7=Action
     Keep: #, Balance, Status, Action  |  Hide: Issued, Due, Total */
  .tbl-cust-invoices th:nth-child(2), .tbl-cust-invoices td:nth-child(2),
  .tbl-cust-invoices th:nth-child(3), .tbl-cust-invoices td:nth-child(3),
  .tbl-cust-invoices th:nth-child(4), .tbl-cust-invoices td:nth-child(4) { display: none; }

  /* Ticket list
     Cols: 1=# 2=Opened 3=Customer 4=Type 5=Subject 6=Status 7=Billing 8=Mods/Hrs 9=Action
     Keep: Customer, Subject, Status, Action  |  Hide: #, Opened, Type, Billing, Mods/Hrs */
  .tbl-tickets th:nth-child(1), .tbl-tickets td:nth-child(1),
  .tbl-tickets th:nth-child(2), .tbl-tickets td:nth-child(2),
  .tbl-tickets th:nth-child(4), .tbl-tickets td:nth-child(4),
  .tbl-tickets th:nth-child(7), .tbl-tickets td:nth-child(7),
  .tbl-tickets th:nth-child(8), .tbl-tickets td:nth-child(8) { display: none; }

  /* Customer detail — ticket sub-table
     Cols: 1=# 2=Opened 3=Type 4=Subject 5=Status 6=Billing
     Keep: Subject, Status, Billing  |  Hide: #, Opened, Type */
  .tbl-cust-tickets th:nth-child(1), .tbl-cust-tickets td:nth-child(1),
  .tbl-cust-tickets th:nth-child(2), .tbl-cust-tickets td:nth-child(2),
  .tbl-cust-tickets th:nth-child(3), .tbl-cust-tickets td:nth-child(3) { display: none; }

  /* Ticket time entries
     Cols: 1=Date 2=Who 3=Time 4=Description 5=Billing 6=Action
     Keep: Who, Time, Billing, Action  |  Hide: Date, Description */
  .tbl-ticket-time th:nth-child(1), .tbl-ticket-time td:nth-child(1),
  .tbl-ticket-time th:nth-child(4), .tbl-ticket-time td:nth-child(4) { display: none; }

  /* Work log time entries
     Cols: 1=Date 2=Person 3=Customer 4=Ticket 5=Description 6=Time 7=Billing
     Keep: Date, Person, Customer, Time  |  Hide: Ticket, Description, Billing */
  .tbl-work-time th:nth-child(4), .tbl-work-time td:nth-child(4),
  .tbl-work-time th:nth-child(5), .tbl-work-time td:nth-child(5),
  .tbl-work-time th:nth-child(7), .tbl-work-time td:nth-child(7) { display: none; }

  /* Work log invoice lines
     Cols: 1=Issued 2=Invoice 3=Customer 4=Description 5=Worked By 6=Amount 7=Status
     Keep: Customer, Worked By, Amount  |  Hide: Issued, Invoice, Description, Status */
  .tbl-work-lines th:nth-child(1), .tbl-work-lines td:nth-child(1),
  .tbl-work-lines th:nth-child(2), .tbl-work-lines td:nth-child(2),
  .tbl-work-lines th:nth-child(4), .tbl-work-lines td:nth-child(4),
  .tbl-work-lines th:nth-child(7), .tbl-work-lines td:nth-child(7) { display: none; }

  /* Payment list
     Cols: 1=Date 2=Invoice 3=Customer 4=Method 5=Ref# 6=Amount 7=Action
     Keep: Date, Customer, Amount, Action  |  Hide: Invoice#, Method, Ref# */
  .tbl-payments th:nth-child(2), .tbl-payments td:nth-child(2),
  .tbl-payments th:nth-child(4), .tbl-payments td:nth-child(4),
  .tbl-payments th:nth-child(5), .tbl-payments td:nth-child(5) { display: none; }

  /* Invoice view — line items table
     Cols: 1=Description 2=Qty 3=Unit Price 4=Discount 5=Total
     Keep: Description, Qty, Total  |  Hide: Unit Price, Discount */
  .tbl-items th:nth-child(3), .tbl-items td:nth-child(3),
  .tbl-items th:nth-child(4), .tbl-items td:nth-child(4) { display: none; }

  /* Totals block: full width on mobile */
  .totals-block { max-width: 100%; }
}
