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

:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --panel: #161a23;
  --panel-2: #1c2230;
  --border: #242a38;
  --text: #e8ecf3;
  --text-dim: #8a93a6;
  --primary: #6366f1;
  --primary-hover: #7c7fff;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --devis: #06b6d4;
  --factures: #8b5cf6;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

svg { width: 18px; height: 18px; }

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  z-index: 50;
  transition: transform .3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
}

.brand .logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  color: white;
}

.brand h1 { font-size: 16px; font-weight: 700; }
.brand p { font-size: 12px; color: var(--text-dim); }

nav { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all .15s;
  font-weight: 500;
}

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

.nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.12));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.3);
}

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}

.user-card strong { display: block; font-size: 13px; }
.user-card span { font-size: 11px; color: var(--text-dim); }

/* MENU TOGGLE MOBILE */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 100;
  width: 44px; height: 44px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.menu-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .25s;
}

/* CONTENT */
.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 100%;
  overflow-x: hidden;
}

.view { display: none; animation: fadeIn .3s ease; }
.view.active { display: block; }

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header h2 { font-size: 26px; font-weight: 700; }
.page-header p { color: var(--text-dim); font-size: 14px; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,.45); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--panel); color: var(--text); }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,.3); }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(99,102,241,.1), transparent);
}

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.devis { background: rgba(6,182,212,.15); color: var(--devis); }
.kpi-icon.factures { background: rgba(139,92,246,.15); color: var(--factures); }
.kpi-icon.revenue { background: rgba(16,185,129,.15); color: var(--success); }
.kpi-icon.clients { background: rgba(245,158,11,.15); color: var(--warning); }

.kpi-info { display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 26px; font-weight: 700; }
.kpi-trend { font-size: 11px; color: var(--text-dim); }
.kpi-trend.up { color: var(--success); }

/* PANEL */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

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

.panel-header h3 { font-size: 16px; font-weight: 600; }

.badge {
  background: var(--panel-2);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

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

/* ACTIVITY */
.activity-list { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.activity-item:hover { background: var(--bg-2); }

.activity-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 12px;
}
.activity-icon.devis { background: rgba(6,182,212,.15); color: var(--devis); }
.activity-icon.facture { background: rgba(139,92,246,.15); color: var(--factures); }

.activity-info { flex: 1; min-width: 0; }
.activity-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-info span { font-size: 11px; color: var(--text-dim); }
.activity-amount { font-weight: 700; font-size: 14px; }

.empty { color: var(--text-dim); text-align: center; padding: 32px 16px; font-size: 13px; }

/* CHART */
.chart { display: flex; flex-direction: column; gap: 18px; }
.chart-bar { display: grid; grid-template-columns: 80px 1fr 50px; gap: 12px; align-items: center; }
.chart-label { font-size: 13px; color: var(--text-dim); }
.chart-track { background: var(--panel-2); height: 10px; border-radius: 999px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 999px; transition: width .8s ease; }
.devis-fill { background: linear-gradient(90deg, var(--devis), #22d3ee); }
.factures-fill { background: linear-gradient(90deg, var(--factures), #a78bfa); }
.conversion-fill { background: linear-gradient(90deg, #10b981, #22d3ee); }
.chart-pct { font-size: 13px; font-weight: 600; text-align: right; }

/* VOICE */
.voice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.voice-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.record-btn {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  color: white;
  box-shadow: 0 8px 32px rgba(99,102,241,.45);
  transition: transform .2s;
}
.record-btn svg { width: 40px; height: 40px; }
.record-btn:hover { transform: scale(1.05); }

.record-btn.recording {
  background: linear-gradient(135deg, var(--danger), #f97316);
  box-shadow: 0 8px 32px rgba(239,68,68,.5);
}

.pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  opacity: 0;
}
.record-btn.recording .pulse {
  animation: pulse 1.5s infinite;
  border-color: var(--danger);
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.record-status { color: var(--text-dim); margin-top: 16px; font-size: 13px; }
.record-timer { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.record-wave { display: flex; gap: 4px; align-items: center; margin-top: 14px; height: 30px; }
.record-wave span {
  width: 3px; height: 6px;
  background: var(--text-dim);
  border-radius: 3px;
  transition: height .15s;
}
.record-btn.recording ~ .record-wave span { background: var(--danger); }

.transcript-block label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

#transcript {
  width: 100%;
  min-height: 140px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
#transcript:focus { outline: none; border-color: var(--primary); }

.voice-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.select {
  padding: 11px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot.processing { background: var(--warning); animation: blink 1s infinite; }
.status-dot.ready { background: var(--success); }
@keyframes blink { 50% { opacity: .3; } }

.result-area { min-height: 360px; }
.result-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.result-empty svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: .4; }
.result-empty p { font-size: 14px; margin-bottom: 6px; }
.result-empty small { font-size: 12px; opacity: .8; }

.doc-preview { font-size: 13px; }
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.doc-title { font-size: 22px; font-weight: 700; color: var(--primary); }
.doc-number { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.doc-section { margin-bottom: 16px; }
.doc-section h4 { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; letter-spacing: .5px; }
.doc-section p { line-height: 1.6; }

.doc-items { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc-items th, .doc-items td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.doc-items th { color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.doc-items td.num { text-align: right; font-variant-numeric: tabular-nums; }

.doc-totals {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}
.doc-total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.doc-total-row.grand {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.doc-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hint-card {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.06));
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.hint-card strong { color: var(--text); }

/* DOCS LIST */
.docs-filters { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: all .15s;
}
.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-color: transparent;
}

.docs-table { display: flex; flex-direction: column; gap: 8px; }
.doc-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 16px;
  padding: 14px;
  background: var(--panel-2);
  border-radius: 10px;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.doc-row:hover { background: var(--bg-2); transform: translateX(2px); }
.doc-actions-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 6px 10px !important; font-size: 12px !important; }
.btn-danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.15); border-color: #ef4444; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.kpi-card { transition: transform .15s, box-shadow .15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.25); }
.kpi-chart-svg { width: 100%; height: auto; max-height: 320px; display: block; }
.kpi-chart-panel .panel-header { display: flex; justify-content: space-between; align-items: center; }
.kpi-chart-panel .modal-close { position: static; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.kpi-chart-panel .modal-close:hover { background: var(--bg-2); }
.kpi-chart-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.kpi-granularity { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.kpi-granularity button { background: transparent; border: 0; color: var(--text-dim); padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.kpi-granularity button:hover { color: var(--text); }
.kpi-granularity button.active { background: var(--primary); color: #fff; }

@media (max-width: 768px) {
  .kpi-chart-panel .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    position: relative;
    padding-right: 40px;
  }
  .kpi-chart-panel .panel-header h3 {
    text-align: left;
    margin: 0;
  }
  .kpi-chart-controls {
    width: 100%;
    gap: 8px;
  }
  .kpi-granularity {
    flex: 1;
    justify-content: space-between;
  }
  .kpi-granularity button {
    flex: 1;
    padding: 6px 4px;
    font-size: 11px;
    text-align: center;
  }
  .kpi-chart-panel .modal-close {
    position: absolute !important;
    top: 0; right: 0;
    width: 28px; height: 28px; font-size: 16px;
  }
}
.doc-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 0 8px; border-top: 1px solid var(--border); margin-top: 18px; justify-content: center; }

.send-dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.send-dialog {
  position: relative;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; min-width: 340px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  text-align: center;
}
.send-dialog h3 { font-size: 18px; margin-bottom: 4px; }
.send-dialog-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 22px; }
.send-dialog-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
}
.send-dialog-close:hover { background: var(--bg-2); }
.send-channels { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.send-channel {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 18px; min-width: 88px;
  border-radius: 12px; border: 1px solid var(--border);
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px;
  color: #fff; transition: transform .15s, box-shadow .15s;
}
.send-channel svg { width: 28px; height: 28px; }
.send-channel:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.send-whatsapp { background: #25d366; border-color: #25d366; }
.send-sms { background: #3b82f6; border-color: #3b82f6; }
.send-email { background: #ef4444; border-color: #ef4444; }

.send-compose { min-width: 420px; max-width: 540px; text-align: left; }
.send-compose h3 { text-align: center; margin-bottom: 18px; }
.send-compose-form { display: flex; flex-direction: column; gap: 12px; }
.send-compose-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.send-compose-form input, .send-compose-form textarea {
  padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit; resize: vertical;
}
.send-compose-form input:focus, .send-compose-form textarea:focus { outline: none; border-color: var(--primary); }
.send-compose-note { font-size: 12px; color: var(--text-dim); margin: 4px 0; padding: 10px 12px; background: var(--panel-2); border-radius: 8px; border-left: 3px solid var(--primary); }
.send-compose-form .btn { margin-top: 6px; align-self: stretch; justify-content: center; }
@media (max-width: 540px) { .send-compose { min-width: auto; width: calc(100vw - 32px); } }
.doc-row .type-tag {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
}
.doc-row .type-tag.devis { background: rgba(6,182,212,.2); color: var(--devis); }
.doc-row .type-tag.facture { background: rgba(139,92,246,.2); color: var(--factures); }
.doc-row .doc-name { font-weight: 600; font-size: 14px; }
.doc-row .doc-client { font-size: 12px; color: var(--text-dim); }
.doc-row .doc-date { font-size: 12px; color: var(--text-dim); }
.doc-row .doc-amount { font-weight: 700; font-size: 14px; }

/* SETTINGS */
.settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); }
.settings-form input {
  padding: 11px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.settings-form input:focus { outline: none; border-color: var(--primary); }
.settings-form button { grid-column: 1 / -1; justify-self: start; }

/* MODAL */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal.show { display: flex; animation: fadeIn .2s; }
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: var(--panel-2);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}
.modal-close:hover { background: var(--bg-2); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform .3s ease;
  z-index: 300;
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: var(--danger); }

/* AI FORM */
.ai-form { display: flex; flex-direction: column; gap: 16px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
}
.form-grid label.span2 { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  resize: vertical;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--primary); }

.form-section-title {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 8px;
}

.form-supplies { display: flex; flex-direction: column; gap: 8px; }
.supply-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.supply-remove {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: #ef4444; font-size: 20px; line-height: 1; cursor: pointer;
  font-family: inherit;
}
.supply-remove:hover { background: rgba(239,68,68,0.15); border-color: #ef4444; }
.supply-row input {
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.supply-row input:focus { outline: none; border-color: var(--primary); }

.form-totals {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .voice-layout { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .content { padding: 28px 24px; }
}

html, body { overflow-x: hidden; }
.content, .view, .panel { max-width: 100%; }
.panel, .voice-panel, .result-panel { min-width: 0; }
textarea, input, select { max-width: 100%; box-sizing: border-box; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .content { padding: 72px 14px 24px; }
  .page-header h2 { font-size: 22px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 22px; }
  .doc-row { grid-template-columns: 1fr auto; gap: 6px; }
  .doc-row .type-tag, .doc-row .doc-date { display: none; }
  .voice-layout { gap: 12px; }
  .panel { padding: 16px; }
  .voice-actions { flex-direction: column; align-items: stretch; }
  .voice-actions .btn { width: 100%; justify-content: center; }
  .record-wave { max-width: 100%; flex-wrap: wrap; }
  textarea#transcript { min-height: 140px; width: 100%; }
  .doc-actions, .doc-actions-row { flex-direction: column; align-items: stretch; }
  .doc-actions .btn, .doc-actions-row .btn { width: 100%; justify-content: center; }
  .supply-row { grid-template-columns: 1fr auto; }
  .supply-row .supply-name { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .content { padding: 72px 12px 24px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .panel { padding: 14px; }
  .record-btn { width: 84px; height: 84px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .modal-content { width: 100%; padding: 16px; }
}
