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

:root {
  --bg: #0b1221;
  --surface: #131c2e;
  --surface2: #1a2438;
  --border: #28344a;
  --text: #e6ebf5;
  --text2: #9aa5be;
  --muted: #5b6b85;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --accent-light: rgba(59,130,246,0.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --sidebar-w: 248px;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 13.5px;
}
a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════════════════ LOGIN */
#login-screen {
  position: fixed; inset: 0; z-index: 999;
  background: linear-gradient(135deg, #0b1221 0%, #1e3a5f 50%, #0b1221 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 440px; max-width: 95vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-brand { font-size: 22px; font-weight: 800; }
.login-brand span { color: var(--accent); }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-desc { font-size: 13px; color: var(--text2); margin-bottom: 28px; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 7px; }
.login-field input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; padding: 11px 14px; outline: none; transition: border-color 0.15s; font-family: inherit; }
.login-field input:focus { border-color: var(--accent); }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; color: var(--muted); }
.login-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--danger); margin-bottom: 14px; }
.demo-creds { margin-top: 24px; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); border-radius: 10px; padding: 16px 18px; }
.demo-creds-title { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.demo-creds-row { font-size: 13px; color: var(--text2); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-creds-row span { color: var(--muted); }
.demo-pwd { color: var(--text); font-size: 14px; letter-spacing: 0.5px; }
.copy-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text2); font-size: 11px; padding: 3px 8px; cursor: pointer; transition: all 0.15s; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.login-footer { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════ SIDEBAR */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
}
.sidebar-logo {
  padding: 20px 18px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 15px; font-weight: 700; }
.sidebar-logo .logo-text span { color: var(--accent); }
.sidebar-logo .version { font-size: 10px; color: var(--muted); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section { margin-bottom: 18px; }
.nav-section-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 0 10px; margin-bottom: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text2);
  transition: all 0.15s; margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-item .icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 600; }
.nav-item .badge.warn { background: var(--warning); color: #0b1221; }

.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar { width: 32px; height: 32px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; color: #fff; }
.avatar-info .name { font-size: 12px; font-weight: 600; }
.avatar-info .role { font-size: 10px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════ MAIN */
.main { flex: 1; overflow-y: auto; height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,18,33,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════════════════════ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-outline { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 11px; font-size: 11.5px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #0b1221; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-warn { background: var(--warning); color: #0b1221; }
.btn-warn:hover { background: #d97706; color: #fff; }
.btn-purple { background: #8b5cf6; color: #fff; }
.btn-purple:hover { background: #7c3aed; }

/* ═══════════════════════════════════════════════════════ PAGES */
.page { display: none; padding: 28px; }
.page.active { display: block; }

/* ═══════════════════════════════════════════════════════ GREETING */
.greeting {
  margin-bottom: 18px;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
}
.greeting-hi { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.greeting-date { font-size: 13px; color: var(--text2); }
.greeting-quote { font-size: 12.5px; color: var(--muted); font-style: italic; }

/* ═══════════════════════════════════════════════════════ TODO BANNER */
.todo-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  border-left: 3px solid var(--accent);
}
.todo-banner-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.todo-banner-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.todo-banner-empty { font-size: 12.5px; color: var(--muted); }
.todo-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.todo-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.todo-card:hover { border-color: var(--accent); }
.todo-icon { font-size: 20px; flex-shrink: 0; }
.todo-body { flex: 1; min-width: 0; }
.todo-label { font-size: 12.5px; color: var(--text); font-weight: 600; }
.todo-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.todo-count { background: var(--accent); color: #fff; border-radius: 20px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.todo-count.warn { background: var(--warning); color: #0b1221; }
.todo-count.danger { background: var(--danger); color: #fff; }

/* ═══════════════════════════════════════════════════════ KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; position: relative; overflow: hidden;
  min-height: 96px;
}
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-color, var(--accent));
}
.kpi-card.warn { --accent-color: var(--warning); }
.kpi-card.success { --accent-color: var(--success); }
.kpi-card.danger { --accent-color: var(--danger); }
.kpi-card.purple { --accent-color: #8b5cf6; }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.6px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; letter-spacing: -0.5px; }
.kpi-sub { font-size: 11px; color: var(--muted); }
.kpi-icon { position: absolute; right: 14px; top: 18px; font-size: 28px; opacity: 0.12; }

/* ═══════════════════════════════════════════════════════ GRID */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════ CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13.5px; font-weight: 700; }
.card-body { padding: 18px 20px; }

/* ═══════════════════════════════════════════════════════ STATUS */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-draft { background: rgba(154,165,190,0.12); color: #9aa5be; }
.status-sent { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-accepted { background: rgba(34,197,94,0.15); color: var(--success); }
.status-invoiced { background: rgba(59,130,246,0.15); color: var(--accent); }
.status-refused { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-confirmee { background: rgba(139,92,246,0.15); color: #a78bfa; }
.status-en_preparation { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-expediee { background: rgba(56,189,248,0.15); color: var(--info); }
.status-livree { background: rgba(34,197,94,0.15); color: var(--success); }
.status-annulee { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-prepare { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-signe { background: rgba(34,197,94,0.15); color: var(--success); }

/* ═══════════════════════════════════════════════════════ TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid rgba(40,52,74,0.6); color: var(--text2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); color: var(--text); }
.td-strong { font-weight: 600; color: var(--text); }
.td-amount { font-weight: 700; color: var(--text); font-size: 13px; white-space: nowrap; }
.actions-cell { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════ RECENT ITEMS */
.devis-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(40,52,74,0.6);
}
.devis-item:last-child { border-bottom: none; }
.devis-num { font-size: 12px; font-weight: 700; color: var(--text); min-width: 100px; }
.devis-client { font-size: 12.5px; color: var(--text2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devis-amount { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════ FILTER BAR */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; transition: border-color 0.15s; }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; flex: 1; font-family: inherit; }
.search-box input::placeholder { color: var(--muted); }
.search-icon { color: var(--muted); font-size: 14px; }

.filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-tab { padding: 6px 13px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text2); transition: all 0.15s; font-family: inherit; }
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════ FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; }
input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13.5px; padding: 9px 12px; outline: none;
  transition: border-color 0.15s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* Lines table */
.lines-table { width: 100%; margin-bottom: 10px; }
.lines-table th { padding: 8px 8px; font-size: 10.5px; color: var(--muted); background: var(--bg); }
.lines-table td { padding: 5px 5px; }
.lines-table input, .lines-table select { padding: 6px 8px; font-size: 12px; }

/* Totals */
.totals-box { background: var(--surface2); border-radius: 10px; padding: 16px 20px; display: grid; gap: 8px; min-width: 320px; }
.total-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.total-row.big { font-size: 18px; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; letter-spacing: -0.3px; }
.total-row.marge { color: var(--success); font-size: 12.5px; font-weight: 600; border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 4px; }
.total-label { color: var(--text2); }

/* Chart */
.chart-bars {
  display: flex; align-items: flex-end; gap: 14px;
  height: 140px; padding: 16px 6px 0; position: relative;
}
.chart-objective {
  position: absolute; left: 0; right: 0;
  border-top: 1.5px dashed var(--accent2);
  pointer-events: none;
}
.chart-objective::after {
  content: 'Objectif ' attr(data-label);
  position: absolute; right: 4px; top: -16px;
  font-size: 10px; color: var(--accent2); font-weight: 600;
  background: var(--surface); padding: 1px 6px; border-radius: 4px;
}
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.6s ease; }
.bar.over { background: var(--success); }
.bar.under { background: var(--warning); }
.bar-label { font-size: 10.5px; color: var(--muted); text-align: center; }
.bar-value { font-size: 10px; color: var(--text2); font-weight: 600; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--success); color: #0b1221; padding: 12px 20px;
  border-radius: 10px; font-size: 13px; font-weight: 700;
  transform: translateY(100px); opacity: 0; transition: all 0.3s; z-index: 9999;
  display: flex; align-items: center; gap: 8px; max-width: 380px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--accent); color: #fff; }

.badge { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════ MODAL DOCUMENT */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #f8fafc; width: 100%; max-width: 860px;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  margin: auto;
}
.modal-toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 18px; display: flex; align-items: center; justify-content: space-between;
}
.modal-doc-label { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ═══════════════════════════════════════════════════════ DOCUMENT PAPER */
.doc-paper {
  background: #fff; color: #1e293b;
  padding: 48px 52px; font-family: 'Inter', sans-serif; font-size: 13px; line-height: 1.5;
}
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 36px; }
.doc-company-name { font-size: 22px; font-weight: 800; color: #1e3a5f; margin-bottom: 6px; }
.doc-company-info { font-size: 11.5px; color: #64748b; line-height: 1.7; }
.doc-meta { text-align: right; }
.doc-type-badge {
  display: inline-block; background: #1e3a5f; color: #fff;
  font-size: 13px; font-weight: 700; padding: 6px 18px; border-radius: 6px; margin-bottom: 12px;
  letter-spacing: 1px; text-transform: uppercase;
}
.doc-type-badge.facture { background: #7f1d1d; }
.doc-num { font-size: 20px; font-weight: 800; color: #1e3a5f; margin-bottom: 4px; }
.doc-num.facture { color: #7f1d1d; }
.doc-dates { font-size: 11px; color: #64748b; line-height: 1.8; }

.doc-divider { border: none; border-top: 2px solid #e2e8f0; margin: 28px 0; }

.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 32px; }
.doc-party-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 8px; }
.doc-party-name { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.doc-party-info { font-size: 12px; color: #475569; line-height: 1.7; }

.doc-ref-box { background: #f1f5f9; border-left: 3px solid #3b82f6; padding: 10px 16px; border-radius: 0 6px 6px 0; margin-bottom: 28px; font-size: 12px; color: #475569; }

.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 12px; }
.doc-table th { background: #1e3a5f; color: #fff; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.doc-table.facture th { background: #7f1d1d; }
.doc-table td { padding: 9px 12px; border-bottom: 1px solid #e2e8f0; color: #334155; }
.doc-table tr:nth-child(even) td { background: #f8fafc; }
.doc-table .td-r { text-align: right; font-weight: 600; }
.doc-table .td-desc { font-weight: 500; }

.doc-totals { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.doc-totals-inner { width: 320px; }
.doc-total-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px solid #e2e8f0; color: #475569; }
.doc-total-row.total { border-bottom: none; border-top: 2px solid #1e3a5f; margin-top: 4px; padding-top: 10px; font-size: 16px; font-weight: 800; color: #1e3a5f; }
.doc-total-row.total.facture { border-top-color: #7f1d1d; color: #7f1d1d; }
.doc-total-row.acompte { color: #d97706; font-size: 12px; font-weight: 700; border-bottom: none; }
.doc-total-row.solde { color: #1e3a5f; font-size: 12px; font-weight: 700; border-bottom: none; }

.doc-note { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px 16px; margin-bottom: 24px; font-size: 12px; color: #475569; line-height: 1.6; }
.doc-note-label { font-weight: 700; color: #1e293b; margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

.doc-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 32px; }
.doc-sign-box { border: 1px dashed #cbd5e1; border-radius: 6px; padding: 16px; min-height: 90px; }
.doc-sign-label { font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.doc-sign-date { font-size: 11px; color: #94a3b8; margin-top: 6px; }

.doc-bl-items { margin-bottom: 24px; }
.doc-bl-ok { color: #16a34a; font-weight: 700; font-size: 11px; }

.doc-footer-pro {
  margin-top: 36px; padding-top: 14px; border-top: 1px solid #e2e8f0;
  font-size: 9.5px; color: #64748b; text-align: center; line-height: 1.7;
}
.doc-footer-pro strong { color: #475569; }

/* ═══════════════════════════════════════════════════════ PRINT */
.print-only { display: none; }

@media print {
  * { visibility: hidden; }
  #print-zone, #print-zone * { visibility: visible; }
  #print-zone {
    display: block !important;
    position: absolute; top: 0; left: 0; width: 100%;
    background: #fff; padding: 0;
  }
  #print-content { padding: 20px 30px; }
  .no-print { display: none !important; }
}

/* ═══════════════════════════════════════════════════════ RESPONSIVE */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page { padding: 24px 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 14px; }
  .doc-paper { padding: 24px 20px; }
  .doc-parties, .doc-signatures { grid-template-columns: 1fr; }
}
