/* ═══════════════════════════════════════════
   CRM Cristal'ID — Design System Client
   ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────── */
:root {
  --brand:       #FF7A00;
  --brand-light: #FFF0E0;
  --brand-dark:  #E06800;

  --bg:          #F7F8FA;
  --surface:     #FFFFFF;
  --surface2:    #F0F2F5;
  --border:      #E5E7EB;
  --border2:     #D1D5DB;

  --text-1:      #111827;
  --text-2:      #374151;
  --text-3:      #6B7280;
  --text-4:      #9CA3AF;

  --green:       #10B981;
  --green-bg:    #ECFDF5;
  --red:         #EF4444;
  --red-bg:      #FEF2F2;
  --orange:      #F59E0B;
  --orange-bg:   #FFFBEB;
  --blue:        #3B82F6;
  --blue-bg:     #EFF6FF;

  --sidebar-w:   260px;
  --topbar-h:    60px;

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);

  --transition:  .2s ease;
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #fff5ec 0%, #fff 50%, #f0f4ff 100%);
  z-index: 0;
}
.login-bg::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,0,.12) 0%, transparent 70%);
}
.login-bg::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,0,.08) 0%, transparent 70%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.04);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-1);
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.login-sub {
  color: var(--text-3);
  margin-bottom: 28px;
  line-height: 1.6;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,122,0,.12);
}
.field textarea { resize: vertical; min-height: 80px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(255,122,0,.3);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(255,122,0,.4); }
.btn-primary:active { transform: scale(.98); }
.btn-primary.loading { opacity: .7; pointer-events: none; }
.w-full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.btn-ghost:hover { color: var(--text-1); background: var(--surface2); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  transition: all var(--transition);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  transition: all var(--transition);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

.success-icon { font-size: 48px; text-align: center; margin-bottom: 16px; }
.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--text-1); }
.login-help { margin-top: 24px; color: var(--text-4); font-size: 12px; text-align: center; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}
.alert-error { background: var(--red-bg); color: var(--red); border-left: 3px solid var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); border-left: 3px solid var(--green); }
.alert-info { background: var(--blue-bg); color: var(--blue); border-left: 3px solid var(--blue); }

/* ═══════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-1);
}

.sidebar-client {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--brand-light);
  border-bottom: 1px solid rgba(255,122,0,.15);
}
.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.client-name { font-weight: 600; font-size: 13px; color: var(--text-1); }
.client-company { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--text-1); }
.nav-item.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}
.nav-item svg { flex-shrink: 0; }

.badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
}
.logout-btn {
  width: 100%;
  color: var(--text-3);
}
.logout-btn:hover { background: var(--red-bg); color: var(--red); }

/* ── Main ────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  flex: 1;
}
.topbar-notifs { display: flex; align-items: center; gap: 8px; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Pages ───────────────────────────── */
.page {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}
.page-title small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Cards ───────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* ── Grid ────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Stat Widgets ────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.orange { background: var(--brand-light); }
.stat-icon.green  { background: var(--green-bg); }
.stat-icon.blue   { background: var(--blue-bg); }
.stat-icon.red    { background: var(--red-bg); }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Table ───────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ── Status chips ────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip-green   { background: var(--green-bg);  color: var(--green); }
.chip-red     { background: var(--red-bg);    color: var(--red); }
.chip-orange  { background: var(--orange-bg); color: var(--orange); }
.chip-blue    { background: var(--blue-bg);   color: var(--blue); }
.chip-gray    { background: var(--surface2);  color: var(--text-3); }

/* ── Empty state ─────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Document cards ──────────────────── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.doc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.doc-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-card.new { border-color: var(--brand); background: var(--brand-light); }
.doc-icon { font-size: 32px; }
.doc-name { font-weight: 600; font-size: 13px; color: var(--text-1); line-height: 1.4; }
.doc-meta { font-size: 11px; color: var(--text-4); display: flex; align-items: center; gap: 8px; }
.doc-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Site cards ──────────────────────── */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.site-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.site-favicon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.site-name { font-weight: 700; font-size: 15px; color: var(--text-1); margin-bottom: 4px; }
.site-url { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.site-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Chat IA ─────────────────────────── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 56px);
  max-height: 700px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.chat-msg {
  display: flex;
  gap: 10px;
  animation: fadeInUp .25s ease;
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-msg.user .chat-avatar { background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.chat-msg.assistant .chat-avatar { background: var(--surface); border: 1px solid var(--border); }
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
}
.chat-msg.user .chat-bubble { background: var(--brand); color: #fff; border-radius: 12px 2px 12px 12px; }
.chat-msg.assistant .chat-bubble { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); border-radius: 2px 12px 12px 12px; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin: 0; }
.chat-bubble code { background: rgba(0,0,0,.08); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat-input-row input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input-row input:focus { border-color: var(--brand); }
.chat-send-btn {
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-send-btn:hover { background: var(--brand-dark); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
}
.chat-suggestion {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
}
.chat-suggestion:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-4);
  animation: typing 1.2s infinite ease;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Devis builder ───────────────────── */
.devis-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.devis-line {
  display: grid;
  grid-template-columns: 1fr 70px 100px 80px 80px 36px;
  gap: 8px;
  align-items: center;
}
.devis-line input, .devis-line select {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-2);
}
.devis-line input:focus, .devis-line select:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,122,0,.1);
}
.devis-total-row {
  display: flex;
  justify-content: flex-end;
}
.devis-totals {
  min-width: 280px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}
.devis-total-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  color: var(--text-2);
}
.devis-total-line.grand {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.devis-total-line.grand span:last-child { color: var(--brand); }

/* ── Ticket thread ───────────────────── */
.ticket-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeInUp .25s ease;
}
.ticket-msg.admin { flex-direction: row-reverse; }
.ticket-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.ticket-msg.client .ticket-bubble { background: var(--bg); border: 1px solid var(--border); }
.ticket-msg.admin .ticket-bubble { background: var(--brand); color: #fff; }
.ticket-time { font-size: 11px; color: var(--text-4); margin-top: 4px; }

/* ── Modal ───────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-1); }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-3);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Tabs ────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  cursor: pointer;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── Loading ─────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Sidebar overlay (mobile) ────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

/* ── Scrollbar ───────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── Animations ──────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.fade-in { animation: fadeInUp .3s ease; }

/* ── Responsive ──────────────────────── */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay.open { display: block; }

  .menu-toggle { display: flex; }
  .main { width: 100%; }
  .page { padding: 16px; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .devis-line { grid-template-columns: 1fr; }
  .modal { max-width: 100%; max-height: 95vh; }
}
