/* ============================================================
   JHNY.ME Portal — Design System
   Fonts: DM Sans (UI) · DM Mono (numbers/stats)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg:           #f9f8f6;
  --surface:      #ffffff;
  --surface-alt:  #f4f3f1;
  --border:       #e8e5df;
  --border-mid:   #d9d5ce;
  --text:         #141410;
  --text-muted:   #6b6860;
  --text-light:   #9b9890;

  --green:        #16a34a;
  --green-bg:     #f0fdf4;
  --green-border: #bbf7d0;
  --amber:        #d97706;
  --amber-bg:     #fffbeb;
  --amber-border: #fde68a;
  --red:          #dc2626;
  --red-bg:       #fef2f2;
  --red-border:   #fecaca;
  --blue:         #2563eb;
  --blue-bg:      #eff6ff;
  --blue-border:  #bfdbfe;
  --gray:         #6b7280;
  --gray-bg:      #f3f4f6;
  --gray-border:  #e5e7eb;

  --sidebar-w:    240px;
  --right-panel-w: 280px;
  --radius:       8px;
  --radius-sm:    5px;
  --shadow-sm:    0 1px 3px rgba(20,20,16,.06);
  --shadow:       0 2px 8px rgba(20,20,16,.10);
  --transition:   140ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ---------- Mono numerals ---------- */
.mono, .stat-value, td.mono, .invoice-amount, .revenue-num {
  font-family: 'DM Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   LAYOUT
   ============================================================ */

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

/* Page wrapper */
.page-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

/* Main content */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 0 0 48px;
}

/* Right panel */
.right-panel {
  width: var(--right-panel-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* ============================================================
   SIDEBAR INTERNALS
   ============================================================ */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 30px; height: 30px;
  background: var(--text);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--bg);
  letter-spacing: -.5px;
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: var(--text-light); }

/* Nav */
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 10px 18px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-muted);
  border-radius: 0;
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--bg); }
.nav-item.active {
  color: var(--text);
  font-weight: 500;
  background: var(--bg);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--text);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { opacity: .65; flex-shrink: 0; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 28px; height: 28px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 12.5px; font-weight: 500; }
.user-email { display: block; font-size: 11px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  display: flex; align-items: center;
  color: var(--text-light);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.logout-btn:hover { color: var(--red); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 0;
  margin-bottom: 24px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.breadcrumb-root { color: var(--text-light); }
.breadcrumb-sep { color: var(--border-mid); }
.breadcrumb-current { font-weight: 500; color: var(--text); }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.card-sm { padding: 16px 20px; }
.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 0 32px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -.5px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  padding: 0 32px;
  margin-bottom: 24px;
}
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.table-toolbar-right { margin-left: auto; display: flex; gap: 8px; }

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td {
  padding: 12px 18px;
  font-size: 13.5px;
  vertical-align: middle;
}
.cell-id {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}
.cell-muted { color: var(--text-muted); font-size: 13px; }

/* Empty state */
.table-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.table-empty svg { display: block; margin: 0 auto 12px; opacity: .3; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-green  { color: var(--green);  background: var(--green-bg);  border-color: var(--green-border);  }
.badge-amber  { color: var(--amber);  background: var(--amber-bg);  border-color: var(--amber-border);  }
.badge-red    { color: var(--red);    background: var(--red-bg);    border-color: var(--red-border);    }
.badge-blue   { color: var(--blue);   background: var(--blue-bg);   border-color: var(--blue-border);   }
.badge-gray   { color: var(--gray);   background: var(--gray-bg);   border-color: var(--gray-border);   }

/* Priority badges (no dot) */
.priority-high   { color: var(--red);   background: var(--red-bg);   border-color: var(--red-border);   font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; }
.priority-medium { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; }
.priority-low    { color: var(--gray);  background: var(--gray-bg);  border-color: var(--gray-border);  font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.btn-primary:hover { background: #2a2a24; }

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}
.btn-danger:hover { background: #fee2e2; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; gap: 0; }

/* Table action buttons */
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
tbody tr:hover .row-actions { opacity: 1; }

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--text);
}
textarea { resize: vertical; min-height: 80px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6860' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }

/* Progress input */
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row input[type="range"] {
  flex: 1; padding: 0; border: none;
  accent-color: var(--text);
}
.progress-display {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  width: 38px;
  text-align: right;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,20,16,.35);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
}
.modal.open { display: block; }
.modal-wide { max-width: 680px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  color: var(--text-light);
  font-size: 20px; line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky; bottom: 0;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: var(--surface-alt);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  min-width: 80px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 20px;
  transition: width .3s ease;
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-section { padding: 0 32px; margin-bottom: 28px; display: grid; gap: 16px; }
.chart-grid-2 { grid-template-columns: 1fr 1fr; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.chart-title { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.chart-wrap { position: relative; height: 220px; }

/* ============================================================
   RIGHT PANEL
   ============================================================ */
.rp-section { margin-bottom: 28px; }
.rp-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.rp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rp-item:last-child { border-bottom: none; }
.rp-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.rp-item-body { flex: 1; min-width: 0; }
.rp-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-item-meta { font-size: 11.5px; color: var(--text-light); margin-top: 1px; }
.rp-item-meta.overdue { color: var(--red); }
.rp-item-meta.soon { color: var(--amber); }

/* Client avatar list */
.client-list-sm .rp-item { align-items: center; }
.client-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 999;
}
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
  max-width: 320px;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-mid);
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-text { flex: 1; }
.activity-time { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }

/* ============================================================
   INVOICE VIEW (printable)
   ============================================================ */
.invoice-view-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.invoice-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
}
.invoice-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}
.invoice-brand { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.invoice-brand span { color: var(--text-muted); font-weight: 400; }
.invoice-meta { text-align: right; }
.invoice-number { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; }
.invoice-addresses {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; margin-bottom: 32px;
}
.invoice-addr-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.invoice-addr-value { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.invoice-dates {
  display: flex; gap: 32px;
  margin-bottom: 32px;
  font-size: 13px;
}
.invoice-dates dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 3px; }
.invoice-items-table { margin-bottom: 24px; }
.invoice-items-table thead th { background: var(--bg); }
.invoice-items-table td, .invoice-items-table th { padding: 11px 14px; }
.invoice-totals {
  display: flex; justify-content: flex-end;
}
.invoice-totals-inner { min-width: 240px; }
.invoice-total-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
}
.invoice-total-row.grand {
  border-top: 2px solid var(--text);
  margin-top: 8px; padding-top: 12px;
  font-weight: 600; font-size: 15px;
}
.invoice-notes { margin-top: 32px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 20px; }
.invoice-print-bar {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-bottom: 20px;
}

/* ============================================================
   REVENUE PAGE
   ============================================================ */
.revenue-table-card { padding: 0 32px; margin-bottom: 24px; }
.revenue-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 32px;
  margin-bottom: 28px;
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 0 32px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--bg); color: var(--text); font-weight: 500; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-section-title { font-size: 15px; font-weight: 600; margin-bottom: 20px; }

/* ============================================================
   DETAIL SECTIONS
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-item label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); display: block; margin-bottom: 3px; }
.detail-item value { font-size: 14px; color: var(--text); display: block; }

/* Search input in toolbar */
.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-input-wrap svg { position: absolute; left: 9px; color: var(--text-light); pointer-events: none; }
.search-input {
  padding-left: 30px !important;
  width: 220px;
}

/* Pagination */
.pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.page-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.page-info { font-size: 12px; color: var(--text-light); margin-left: auto; }

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-medium { font-weight: 500; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Line items (invoice builder) */
.line-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-items-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.line-items-table td { padding: 6px 4px; vertical-align: middle; }
.line-items-table td input { padding: 6px 8px; font-size: 13px; }
.line-items-table .col-desc { width: 46%; }
.line-items-table .col-qty  { width: 14%; }
.line-items-table .col-rate { width: 18%; }
.line-items-table .col-amt  { width: 16%; font-family: 'DM Mono', monospace; padding-right: 8px; }
.line-items-table .col-del  { width: 6%; text-align: center; }
.add-line-btn { margin-top: 8px; }
.line-total-section { margin-top: 12px; text-align: right; font-size: 13px; }
.line-total-row { display: flex; justify-content: flex-end; gap: 24px; padding: 3px 0; color: var(--text-muted); }
.line-total-row.grand-total { font-weight: 600; color: var(--text); font-size: 14px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.line-total-val { font-family: 'DM Mono', monospace; min-width: 90px; text-align: right; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .right-panel { display: none; }
}
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .page-wrapper { margin-left: 200px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .revenue-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); position: fixed; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .page-wrapper { margin-left: 0; }
  .page-header { padding: 16px 16px 0; }
  .stat-grid, .table-container, .chart-section, .revenue-table-card, .revenue-summary-grid { padding: 0 16px; }
  .invoice-doc { padding: 24px; }
  .settings-layout { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .invoice-addresses { grid-template-columns: 1fr; }
}
