:root{
  /* ClientConnect AI Brand Colors */
  --accent-main: #22c55e;     /* Main green accent from logo */
  --accent-hover: #16a34a;    /* Green 600 - buttons, links */
  --accent-dark: #15803d;     /* Green 700 - hover states */
  --accent-darker: #166534;   /* Green 800 - darker green */
  --accent-darkest: #14532d;  /* Green 900 - darkest green */
  
  --green-50: #f0fdf4;        /* Very light backgrounds */
  --green-100: #dcfce7;       /* Light backgrounds */
  --green-200: #bbf7d0;       /* Subtle highlights */
  --green-300: #86efac;       /* Lighter accents */
  --green-400: #4ade80;       /* Medium green */
  
  --navy-dark: #1a1f23;       /* Darkest navy */
  --navy-medium: #212529;     /* Dark navy */
  --navy-light: #343a40;      /* Medium navy */
  
  --gray-50: #f8f9fa;         /* Lightest gray */
  --gray-100: #e9ecef;
  --gray-200: #dee2e6;
  --gray-300: #ced4da;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;        /* Medium gray */
  --gray-600: #495057;        /* Dark gray */
  
  /* Main theme variables */
  --bg: var(--gray-50);
  --card: #fff;
  --text: var(--navy-dark);
  --muted: var(--gray-500);
  --primary: var(--accent-main);
  --danger: #dc3545;
  --border: var(--gray-200);
  --statement-panel-bg: #ffffff;
  --statement-panel-text: #0f172a;
  --statement-panel-muted: var(--gray-600);
  --statement-panel-section-bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --shadow: rgba(15, 23, 42, 0.08);
  --hover-bg: rgba(34, 197, 94, 0.18); /* brand-green hover glow */
  --card-bg: var(--card);
  --border-color: var(--border);
  --text-color: var(--text);
  --text-muted: var(--muted);
  --accent-bg: rgba(34, 197, 94, 0.12);
  --hover-bg: rgba(34, 197, 94, 0.12);
}
html[data-theme="dark"]{ 
  --bg: var(--navy-dark); 
  --card: var(--navy-medium); 
  --text: #ffffff; 
  --muted: var(--gray-100); 
  --primary: var(--accent-main); 
  --danger: #ff6b6b; 
  --border: var(--navy-light); 
  --statement-panel-bg: #ffffff;
  --statement-panel-text: #0f172a;
  --statement-panel-muted: #475569;
  --statement-panel-section-bg: #f1f5f9;
  --bg-secondary: rgba(255,255,255,0.08);
  --shadow: rgba(0,0,0,0.55);
  --card-bg: var(--card);
  --border-color: var(--border);
  --text-color: var(--text);
  --text-muted: var(--muted);
  --accent-bg: rgba(34, 197, 94, 0.22);
  --hover-bg: rgba(34, 197, 94, 0.25);
}
*{ box-sizing: border-box; }
html, body{ height:100%; }
body{ margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; background:var(--bg); color:var(--text); }
.appbar{ display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--card); position:sticky; top:0; z-index:3; }
.brand{ font-weight:700; display:flex; align-items:center; gap:6px; }
.org-name-chip{ padding:4px 8px; border-radius:8px; background:var(--accent-bg); color:var(--accent-main); font-size:12px; font-weight:600; }
.spacer{ flex:1; }
.icon, .btn{ border:1px solid var(--border); background:var(--card); color:var(--text); padding:8px 12px; border-radius:10px; cursor:pointer; }
.btn.primary{ background:var(--primary); color:white; border:none; }
.btn.danger{ background:var(--danger); color:white; border:none; }
.btn.secondary.active{ border-color:var(--primary); color:var(--primary); }
.chip{ padding:6px 10px; border:1px solid var(--border); border-radius:999px; }
.pill-outstanding{ display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:14px; background:linear-gradient(135deg,#fdf5e6 0%,#e9f5ff 100%); color:#0f172a; box-shadow:0 8px 24px rgba(0,0,0,0.05); border:1px solid rgba(15,23,42,0.08); font-weight:600; }
.pill-outstanding::before{ content:'Outstanding'; text-transform:uppercase; font-size:11px; letter-spacing:0.4px; color:#16a34a; background:rgba(22,163,74,0.12); padding:4px 8px; border-radius:999px; }
.link-btn{ border:none; background:none; color:var(--primary); cursor:pointer; padding:0; font-size:inherit; }
.center{ display:grid; place-items:center; padding:40px; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); z-index: 1000; }
.card{ background:var(--card); border:1px solid var(--border); border-radius:14px; padding:24px; width:min(560px, 90vw); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.card.table-full{ width:100%; max-width:100%; }
.card h1{ margin-top:0; }
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }
.card-header h3 { margin: 0; color: var(--text); font-size: 16px; font-weight: 600; }
.card-body p { margin: 0 0 8px 0; }
.btn-group { display: flex; flex-wrap: wrap; }

/* Login Logo Styles */
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(34,197,94,0.25);
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
}

.card input,
.card select,
.card textarea{ width:100%; padding:10px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--text); }
select{
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
}
select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 2px rgba(34,197,94,0.2);
}
select option{
  background:var(--card);
  color:var(--text);
}
html[data-theme="dark"] select option{
  background:var(--navy-medium);
  color:#fff;
}
label{ display:block; margin:10px 0 6px; color:var(--muted); font-size:13px; }
.muted{ color:var(--muted); }
.row{ display:flex; align-items:center; gap:10px; }
.row.end{ justify-content:flex-end; }
.gap{ gap:10px; }
.tabs{ display:flex; gap:8px; padding:12px 16px; border-bottom:1px solid var(--border); }
.tab{ border:none; background:transparent; padding:10px 14px; border-bottom:2px solid transparent; cursor:pointer; color:var(--muted); }
.tab.active{ color:var(--text); border-color:var(--primary); }

/* Tab Dropdown Navigation */
.tab-dropdown { position: relative; display: inline-block; }
.tab-dropdown .dropdown-toggle { 
  border:none; 
  background:transparent; 
  padding:10px 14px; 
  border-bottom:2px solid transparent; 
  cursor:pointer; 
  color:var(--muted); 
  white-space: nowrap;
}
.tab-dropdown.active .dropdown-toggle { color:var(--text); border-color:var(--primary); }
.tab-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 1000;
  min-width: 180px;
  margin-top: 4px;
}
.tab-dropdown-item {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  display: block;
}
.tab-dropdown-item:hover {
  background: var(--hover-bg);
  color: var(--primary);
}
.tab-dropdown-item.active {
  background: rgba(47,111,237,.1);
  color: var(--primary);
  font-weight: 500;
}
.tab-dropdown-item:first-child { border-radius: 8px 8px 0 0; }
.tab-dropdown-item:last-child { border-radius: 0 0 8px 8px; }
.tab-dropdown-item:only-child { border-radius: 8px; }

.toolbar{ display:flex; gap:10px; padding:12px 16px; }
.toolbar input{ padding:10px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--text); }
.tabview{ padding:6px 16px 16px; }
.list{ border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--card); }
.list .row{ padding:12px 14px; border-bottom:1px solid var(--border); }
.list .row:last-child{ border-bottom:none; }
.list .row.header{ font-weight:700; background:rgba(127,127,127,.08); }
.list .row > div{ flex:1; }
.list .row:hover{ background:var(--hover-bg); cursor:pointer; }
.list.scrollable{ overflow-y:auto; max-height:320px; }

html[data-theme="dark"] .list .row.header,
html[data-theme="dark"] .list.table-grid .row.header,
html[data-theme="dark"] #employeesList .row.header {
  background: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .list .row:hover,
html[data-theme="dark"] .list.table-grid .row:not(.header):hover,
html[data-theme="dark"] #employeesList .row:not(.header):hover {
  background: var(--hover-bg);
}
html[data-theme="dark"] .table-card thead th {
  background: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .table-card tbody tr:hover {
  background: var(--hover-bg);
}

.report-panel,
.gl-report-card,
.aging-summary-card,
.gl-report-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.hidden{ display:none !important; }
.drawer{ position:fixed; top:0; right:0; height:100vh; width:min(720px, 95vw); background:var(--bg); border-left:1px solid var(--border); box-shadow:-10px 0 24px rgba(0,0,0,.15); z-index:10; display:flex; flex-direction:column; overflow:hidden; }
.drawer-head{ position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; background:var(--card); border-bottom:1px solid var(--border); padding:12px 16px; z-index:11; }
.drawer-body{ padding:16px; overflow-y:auto; flex:1; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid2 input, .grid2 select, textarea{ width:100%; padding:10px; border-radius:10px; border:1px solid var(--border); background:var(--card); color:var(--text); }
textarea{ width:100%; }
.toasts{ position:fixed; bottom:16px; right:16px; display:flex; flex-direction:column; gap:8px; z-index:300; }
.toast{ background:var(--card); border:1px solid var(--border); padding:10px 12px; border-radius:10px; box-shadow:0 10px 20px rgba(0,0,0,.12); }
.filters{display:flex;gap:1rem;margin:.75rem 0;align-items:center;}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.75rem;}
.row.task{display:grid;grid-template-columns: 160px 1fr 1fr 120px 140px;gap:.5rem;align-items:center;padding:.4rem 0;border-bottom:1px solid var(--border);}
.badge.pending{background:#fff3cd;color:#9c6f00;border:1px solid #ffe6a7;padding:.1rem .35rem;border-radius:8px;}
.badge.filed{background:#d1fae5;color:#065f46;border:1px solid #9ae6b4;padding:.1rem .35rem;border-radius:8px;}

/* Settings modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Must sit above drawers, notifications, and statement preview overlay */
  z-index: 5000;
}
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}
.modal-content {
  position: relative;
  background: var(--card);
  color: var(--text);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
  width: min(720px, 95vw);
  max-height: 85vh;
  overflow: auto;
  z-index: 5001;
}
.modal-content h2 { margin-top: 0; margin-bottom: 0.5rem; }
.modal-content input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary, rgba(255,255,255,0.08));
  color: var(--text);
}

.modal-content textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary, rgba(255,255,255,0.08));
  color: var(--text);
  min-height: 80px;
  resize: vertical;
}

.modal-content input:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary, #22c55e);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.grid2 .wide { grid-column: 1 / -1; }

.modal-content.medium { width: min(560px, 95vw); }
.modal-content.wide { width: min(960px, 95vw); }
.expense-wide {
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  max-height: 90vh;
}
#expenseModal .modal-content {
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  max-height: 90vh;
}
.credit-modal {
  max-height: 90vh;
  overflow-y: auto;
}

/* Item sales table responsiveness */
.item-sales-table {
  width: 100%;
  overflow-x: auto;
}
.item-sales-table table {
  min-width: 900px;
}

/* Hide Item Sales on dashboard */
#itemSalesTab,
.item-sales-section {
  display: none !important;
  visibility: hidden !important;
}

.row.right { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.list.table-grid .row { cursor: default; }
.list.table-grid .row.header { background: rgba(127,127,127,.08); font-weight: 600; }
.table-grid .actions { display:flex; gap:6px; justify-content:flex-end; }
.table-card,
.list.table-grid,
#paymentsListArea,
#creditNotesListContainer,
#expensesTableContainer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  overflow: hidden;
}
.table-card table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.table-card thead th {
  background: rgba(0,0,0,0.04);
  color: var(--text);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table-card td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table-card tbody tr:last-child td { border-bottom: none; }
.table-card tbody tr:hover { background: var(--hover-bg); }
.table-card .badge { border-radius: 999px; font-weight: 600; }

#vatTab .table-card {
  overflow-x: auto;
}
#vatTab .vat-table {
  width: 100%;
  min-width: 760px;
}
#vatTab .vat-table th,
#vatTab .vat-table td {
  white-space: nowrap;
}
#vatTab .vat-table td:nth-child(2) {
  white-space: normal;
}
#vatTab .vat-table .actions-cell {
  display: flex;
  gap: 6px;
}
#vatTab .vat-table .actions-cell .btn {
  min-width: 70px;
}

.quote-row {
  display:grid;
  grid-template-columns: minmax(200px, 2.2fr) minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) 140px;
  gap:8px;
  align-items:center;
}
.invoice-row {
  display:grid;
  grid-template-columns: 36px minmax(200px, 2.2fr) minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 140px;
  gap:8px;
  align-items:center;
}
.payment-row {
  display:grid;
  grid-template-columns: minmax(220px, 2.3fr) 120px 120px minmax(140px, 1fr) minmax(140px, 1fr) 160px;
  gap:8px;
  align-items:center;
}
.credit-row {
  display:grid;
  grid-template-columns: minmax(220px, 2.4fr) minmax(180px, 1.6fr) minmax(120px, 1fr) minmax(140px, 1fr) minmax(120px, .8fr) minmax(220px, 2fr) 140px;
  gap:8px;
  align-items:center;
}
.expense-row {
  display:grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) minmax(220px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(120px, .9fr);
  gap:8px;
  align-items:center;
}
.service-row {
  display:grid;
  grid-template-columns: minmax(200px, 2fr) minmax(140px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 120px;
  gap:8px;
  align-items:center;
}
.service-row .pill {
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(127,127,127,.12);
  font-size:12px;
}

/* Employee table layout */
#employeesList .row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(150px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(100px, 0.8fr) 100px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
#employeesList .row.header {
  background: rgba(127,127,127,.08);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
#employeesList .row:not(.header):hover {
  background: rgba(127,127,127,.05);
}

.item-row {
  display:grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(180px, 2fr) minmax(80px, .8fr) repeat(3, minmax(100px, 1fr)) minmax(80px, .8fr) minmax(100px, 1fr) 70px;
  gap:8px;
  align-items:center;
}
.item-row input,
.item-row select,
.item-row textarea {
  width:100%;
  padding:8px;
  border-radius:8px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
}
.item-row .item-total {
  text-align:right;
  font-weight:600;
}
.item-actions {
  display:flex;
  gap:6px;
  justify-content:flex-end;
}

.totals {
  text-align:right;
  font-weight:600;
  color:var(--text);
}

.statement-row {
  display:grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(100px, 1fr) minmax(100px, .8fr) minmax(100px, .8fr) minmax(120px, 1fr) 100px;
  gap:8px;
  align-items:center;
}
.statement-actions {
  display:flex;
  justify-content:flex-end;
  gap:6px;
}

.aging-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow);
}

.aging-card-label {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--muted);
}

.aging-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.aging-card-value.accent {
  color: var(--primary);
}

.aging-card-value.success {
  color: #059669;
}

/* Downloads Grid Styles */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px;
}

.download-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
  transition: all 0.2s ease;
  cursor: pointer;
}

.download-card:hover {
  border-color: var(--accent-main);
  box-shadow: 0 4px 12px var(--shadow);
  background: var(--hover-bg);
  transform: translateY(-1px);
}

.download-card-header {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.download-card-title {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  font-size: 1rem;
}

.download-card-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.download-card-body {
  padding: 16px;
}

.download-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.download-card-date {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.download-card-size {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.download-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.download-card-actions button {
  padding: 6px 12px;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* Document Viewer Modal */
.document-viewer-modal {
  width: 90vw;
  height: 90vh;
  max-width: none;
  max-height: none;
}

/* Sub-tabs for Downloads */
.sub-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  margin: 0 16px;
  border-radius: 8px 8px 0 0;
}

.sub-tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.sub-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-secondary);
}

.aging-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
}

.aging-table table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.aging-table thead {
  background: var(--bg-secondary);
}

.aging-table th,
.aging-table td {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.aging-table tfoot {
  background: var(--bg-secondary);
  font-weight: 600;
}

.surface-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow);
}

.statement-outstanding {
  margin-top: 1em;
}

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

.statement-outstanding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.statement-outstanding-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.statement-outstanding-card .name {
  font-weight: 600;
  color: var(--text);
}

.statement-outstanding-card .meta {
  font-size: 13px;
  color: var(--muted);
}

.statement-outstanding-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.statement-outstanding-card .amount {
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
}

.statement-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  /* Keep statement preview below other modals (invoice/credit/payment) */
  z-index: 150;
}

.statement-preview-modal.hidden {
  display: none;
}

.statement-preview-panel {
  width: min(960px, 100%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.statement-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.statement-preview-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

#quoteModal, #invoiceModal {
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 60px) !important;
  background: var(--surface) !important;
  z-index: 1000 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

#quoteModal .document-editor, #invoiceModal .document-editor {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  margin: 0;
  padding: 24px;
  border-radius: 0;
  max-width: none;
}

#quoteModal .modal-backdrop, #invoiceModal .modal-backdrop {
  display: none !important;
}

#quoteModal .modal-content, #invoiceModal .modal-content {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#quoteModal .document-editor .list.table-grid, #invoiceModal .document-editor .list.table-grid {
  flex: 1;
  min-height: 0;
  max-height: 45vh;
  overflow-y: auto;
}

.invoice-logo-preview{ max-width:180px; max-height:120px; border:1px solid var(--border); border-radius:8px; margin-top:8px; object-fit:contain; }

/* Settings Dropdown Styles */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 1000;
  min-width: 160px;
}
.dropdown-content:not(.hidden) { display: block; }
.dropdown-item {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.dropdown-item:hover {
  background: rgba(127,127,127,.1);
}
.dropdown-item:first-child { border-radius: 8px 8px 0 0; }
.dropdown-item:last-child { border-radius: 0 0 8px 8px; }
.dropdown-item:only-child { border-radius: 8px; }

/* Locked/Disabled Features */
.locked-feature {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed !important;
}

.locked-feature::before {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  z-index: 10;
  pointer-events: none;
}

.locked-feature-wrapper {
  position: relative;
  display: inline-block;
}

.locked-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  margin-bottom: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.locked-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.locked-feature-wrapper:hover .locked-tooltip {
  opacity: 1;
}

/* Tab/Button specific locked state */
.tab.locked, .btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.tab.locked::after, .btn.locked::after {
  content: '🔒';
  margin-left: 6px;
  font-size: 12px;
}

/* Chart of Accounts Styles */
.account-group {
  margin-bottom: 24px;
}

.account-type-header {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  padding: 8px 16px;
  background: var(--border);
  border-radius: 8px;
  color: var(--text);
}

.account-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-row {
  display: grid;
  grid-template-columns: 100px 1fr 2fr 120px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.account-row:hover {
  background: rgba(127, 127, 127, 0.05);
  border-color: var(--primary);
}

.account-row.inactive {
  opacity: 0.6;
}

.account-code {
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: var(--muted);
}

.account-name {
  font-weight: 500;
  color: var(--text);
}

.account-desc {
  color: var(--muted);
  font-size: 14px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #10b981;
  color: white;
}

.badge.inactive {
  background: var(--muted);
}

.badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.paid {
  background: #16a34a;
}

.status-pill.partial {
  background: #f59e0b;
}

.status-pill.unpaid {
  background: #ef4444;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn.xs {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

/* Utility text colors */
.text-green {
  color: #10b981;
}

.text-blue {
  color: #3b82f6;
}

.text-red {
  color: #ef4444;
}

/* Payment invoice item hover */
.payment-invoice-item:hover {
  background: #f9fafb;
}

.credit-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.credit-action-bar {
  display: flex;
  gap: 8px;
}

.credit-view-section label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.credit-summary-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  margin-bottom: 16px;
}

.credit-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.credit-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.credit-view-value {
  font-weight: 600;
  color: var(--text);
}

.credit-notes-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-secondary);
}

.credit-form-section {
  margin-bottom: 16px;
}

.credit-selected-invoice {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.credit-selected-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.credit-invoice-ref {
  font-weight: 600;
  font-size: 16px;
}

.credit-invoice-amount {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.credit-invoice-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--card);
}

.credit-invoice-results .table-row {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.credit-invoice-results .table-row:last-child {
  border-bottom: none;
}

/* Dashboard Styles */
.dashboard-grid {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: calc(100vh - 120px);
  overflow-y: auto;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.kpi-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.kpi-icon.clients { background: linear-gradient(135deg, var(--accent-main), var(--accent-hover)); }
.kpi-icon.revenue { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-icon.invoices { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-icon.inventory { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.kpi-content {
  flex: 1;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.kpi-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.kpi-change.positive {
  color: var(--accent-main);
  background-color: var(--accent-bg);
}

.kpi-change.negative {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.dashboard-row.analytics-row {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.activity-panel, .summary-panel, .actions-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.chart-body {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chart-fixed { min-height: 300px; }
.chart-fixed-small { min-height: 240px; }

.chart-body canvas {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  align-items: center;
  max-height: 110px;
  overflow: auto;
}
.chart-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.chart-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.chart-empty.hidden {
  display: none;
}

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

.panel-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 600;
}

.refresh-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  background-color: var(--hover-bg);
  color: var(--accent-main);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background-color: var(--hover-bg);
}

.activity-icon {
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-bg);
  color: var(--accent-main);
  flex-shrink: 0;
}

.activity-icon.invoice { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.activity-icon.client { background-color: var(--accent-bg); color: var(--accent-main); }
.activity-icon.stock { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.activity-text {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
  margin-bottom: 4px;
}

.activity-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  background-color: var(--accent-bg);
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-main);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.actions-panel {
  grid-column: 1 / -1;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-btn.primary {
  background: var(--accent-main);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.action-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

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

.action-btn.secondary:hover {
  background: var(--hover-bg);
  border-color: var(--accent-main);
  color: var(--accent-main);
}

.action-icon {
  font-size: 18px;
}

.action-text {
  font-size: 14px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  
  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  
  .stat-item {
    padding: 12px 8px;
  }
  
  .stat-number {
    font-size: 18px;
  }
}

/* Voice Input Modal Styling */
.voice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
}

.voice-input-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card, #1a1a1a);
  color: var(--text, #ffffff);
  border-radius: 12px;
  padding: 24px;
  width: min(640px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border, #333);
  z-index: 10001;
}

.voice-input-modal h3 {
  margin: 0 0 16px 0;
  color: var(--text, #ffffff);
  font-size: 1.25rem;
}

.voice-input-modal textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
  background: var(--bg-secondary, #2a2a2a);
  color: var(--text, #ffffff);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}

.voice-input-modal textarea:focus {
  outline: none;
  border-color: var(--primary, #22c55e);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.voice-input-modal .buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}

.voice-input-modal button {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-input-modal button.secondary {
  background: var(--bg-secondary, #2a2a2a);
  color: var(--text, #ffffff);
  border: 1px solid var(--border, #333);
}

.voice-input-modal button.secondary:hover {
  background: var(--border, #333);
}

.voice-input-modal button.primary {
  background: var(--primary, #22c55e);
  color: white;
}

.voice-input-modal button.primary:hover {
  background: #16a34a;
}

.support-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.support-section {
  border-top: 1px solid var(--border, #333);
  padding-top: 12px;
}

.support-section h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.support-label {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.support-section input,
.support-section select,
.support-section textarea {
  margin-top: 4px;
  margin-bottom: 4px;
}

.support-section .row {
  flex-wrap: wrap;
}

/* Dashboard widget layout helpers */
.dashboard-widget.hidden { display: none !important; }
.dashboard-widget.size-small { grid-column: span 1; }
.dashboard-widget.size-medium { grid-column: span 2; }
.dashboard-widget.size-large { grid-column: span 3; }

/* Business Snapshot */
.snapshot-container { display: flex; flex-direction: column; gap: 16px; }
.snapshot-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.snapshot-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 12px; }
.snapshot-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }
.card-title { font-weight: 600; color: #111827; margin-bottom: 8px; }
.kpi { font-size: 28px; font-weight: 700; color: #0a9f4d; }
.muted { color: #6b7280; }
.muted.small { font-size: 12px; }
.bar { height: 12px; border-radius: 6px; overflow: hidden; background: #e5e7eb; }
.bar-pair .bar div { height: 100%; border-radius: 6px; }
.stack-bar { height: 14px; border-radius: 8px; overflow: hidden; display: flex; background: #e5e7eb; }
.stack-seg { height: 100%; }
.stack-seg.assets { background: rgba(34,197,94,0.4); }
.stack-seg.liabilities { background: rgba(239,68,68,0.5); }
.stack-seg.equity { background: rgba(59,130,246,0.5); }
.snapshot-card .row.between { align-items: center; }
.ratio-card .kpi { font-size: 22px; }
.mini-chart { height: 60px; }

/* Voice UI overrides to keep floating buttons on-brand green */
.voice-mic-btn,
.voice-text-btn {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: #fff !important;
  border: 2px solid rgba(34,197,94,0.35) !important;
  box-shadow: 0 8px 20px rgba(34,197,94,0.55) !important;
}
.voice-text-btn:hover:not(:disabled),
.voice-mic-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.voice-text-btn:disabled,
.voice-mic-btn:disabled {
  background: #9ca3af !important;
  box-shadow: none !important;
}


.ocr-line-row{display:grid;grid-template-columns:2fr 0.6fr 0.8fr 0.8fr;gap:8px;margin-bottom:8px}

/* Legal modal styling */
#termsModal .modal-content {
  border-radius: 16px;
  padding: 24px 24px 16px;
  max-width: 900px;
}
.terms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.terms-hero {
  text-align: center;
  margin-bottom: 14px;
  position: relative;
}
.terms-hero p { margin: 6px 0 8px; }
.terms-hero .terms-version {
  display: inline-block;
  margin-top: 6px;
}
.terms-header h2 {
  margin: 0;
  font-weight: 700;
  font-size: 26px;
}
.terms-version {
  background: #f4f6fb;
  color: #5c6bc0;
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 12px;
}
.terms-alert {
  background: #fff4e5;
  border: 1px solid #ffd8a8;
  color: #b35b00;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 16px;
  display: flex;
  gap: 10px;
}
.terms-alert .alert-icon {
  font-weight: 800;
  font-size: 16px;
  line-height: 20px;
}
.terms-alert .alert-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.terms-list {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 18px;
}
.terms-card {
  margin-bottom: 12px;
  width: 100%;
}
.terms-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.terms-row input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}
.terms-row input:checked + div .terms-name {
  color: #0f7a3d;
}
.terms-row input:checked + div .terms-name .required { color: #0f7a3d; }
.terms-row input:checked + div .terms-name .recommended { color: #0f7a3d; }
.terms-row input:checked + div .terms-desc { color: #065f46; }
.terms-name {
  font-weight: 700;
  margin: 0 0 4px;
}
.terms-name .required { color: #c62828; font-weight: 800; }
.terms-name .recommended { color: #ff9800; font-weight: 800; }
.terms-desc {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 14px;
}
.terms-row input:checked ~ .terms-desc {
  color: #065f46;
}
.terms-card .btn.small.primary-outline {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}
.terms-card:hover {
  border-color: #c7ccd5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.terms-row input:checked ~ div {
  background: linear-gradient(90deg, rgba(34,197,94,0.08), rgba(34,197,94,0.02));
  border-radius: 10px;
  padding: 2px 6px 4px;
}
.terms-note {
  background: #fff8e1;
  border: 1px solid #ffe0b2;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0 14px;
  color: #6b4f1d;
  font-size: 14px;
}
.terms-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 12px;
}
.terms-actions .btn-primary {
  background: #2f80ed;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
}
.terms-actions .btn-secondary {
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
}
.btn-primary { background: #2f80ed; color: #fff; border: none; }
.btn-secondary { background: #e5e7eb; color: #111827; border: none; }
.terms-footer {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
}
.terms-footer a { color: #2f80ed; }

/* Notifications */
.badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 2px;
}
.hidden { display: none !important; }
.notify-panel {
  position: absolute;
  right: 16px;
  top: 52px;
  width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 2000;
}
.notify-header {
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
}
.notify-list {
  max-height: 320px;
  overflow-y: auto;
}
.notify-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.notify-item:last-child { border-bottom: none; }
.notify-item .title { font-weight: 700; margin-bottom: 4px; }
.notify-item .desc { color: #4b5563; font-size: 13px; }
.notify-item.warn { border-left: 4px solid #f59e0b; }
.notify-item.crit { border-left: 4px solid #ef4444; }
.notify-item.ok { border-left: 4px solid #10b981; }

/* Tasks + Calendar (To Do tab) */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.calendar-weekday {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0 6px;
}
.calendar-day {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 96px;
  cursor: pointer;
}
.calendar-day:hover {
  border-color: var(--primary);
}
.calendar-day.outside {
  opacity: 0.45;
}
.calendar-day.today {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}
.calendar-day.selected {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.65);
}
.calendar-day-num {
  font-weight: 700;
}
.calendar-day-count {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.calendar-task-preview {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
