/* ═══════════════════════════════════════════════
   eMakeBox — Sistema Comercial B2B
   CSS Principal — Design System
   ═══════════════════════════════════════════════ */

/* ─── RESET & BASE ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores principais — Identidade Visual e-make box */
  --primary: #D4145A;
  --primary-hover: #B8114E;
  --primary-light: #FDE8EF;
  --primary-dark: #9E0F42;
  --accent: #EDAE00;
  --accent-hover: #D49D00;
  --accent-light: #FFF8E0;

  /* Status */
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #EDAE00;
  --warning-light: #FFF8E0;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #0891B2;
  --info-light: #CFFAFE;

  /* Neutros */
  --bg: #FBF8F5;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1A0A10;
  --text: #1E1018;
  --text-secondary: #6B5A63;
  --text-muted: #A0919A;
  --border: #EDE4E8;
  --border-focus: #D4145A;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 15px rgba(0,0,0,0.1);

  /* Fontes */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── TIPOGRAFIA ──────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* ─── LAYOUT PRINCIPAL ────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo h1 {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-logo span {
  font-size: 0.65rem;
  color: var(--primary);
  background: rgba(37,99,235,0.15);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #E2E8F0;
}

.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 6px;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: #64748B; text-transform: capitalize; }

/* ─── MAIN CONTENT ────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ─── TOPBAR ──────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  width: 280px;
}

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  flex: 1;
  color: var(--text);
}

.mobile-menu-btn {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* ─── PAGE CONTENT ────────────────────────────── */
.page-content {
  padding: 24px;
  max-width: 1400px;
}

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

.page-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── CARDS ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

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

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.kpi-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.kpi-change { font-size: 0.8rem; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.yellow { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

/* ─── TABELA ──────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:hover td { background: rgba(37,99,235,0.02); }
tr:last-child td { border-bottom: none; }

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

/* ─── BADGES ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active, .badge-approved { background: var(--success-light); color: var(--success); }
.badge-inactive, .badge-cancelled { background: #F1F5F9; color: #64748B; }
.badge-prospect, .badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-blocked, .badge-under_review { background: var(--danger-light); color: var(--danger); }
.badge-draft { background: var(--info-light); color: var(--info); }
.badge-invoiced { background: #E0E7FF; color: #4338CA; }

.badge-A { background: var(--success-light); color: var(--success); }
.badge-B { background: var(--warning-light); color: var(--warning); }
.badge-C { background: var(--danger-light); color: var(--danger); }

/* ─── BOTÕES ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: none; color: var(--text-secondary); border: none; padding: 8px; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; }

.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── FORMS ───────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-required::after { content: ' *'; color: var(--danger); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.15s ease;
  font-family: var(--font);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input.error { border-color: var(--danger); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

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

.form-textarea { min-height: 80px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ─── TOOLBAR (filtros acima da tabela) ────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar .form-input, .toolbar .form-select {
  width: auto;
  min-width: 180px;
}

.toolbar-search {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.toolbar-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.toolbar-search input {
  padding-left: 38px;
}

/* ─── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal { transform: translateY(0); }

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

.modal-header h3 { font-size: 1.1rem; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ─── DRAWER (painel lateral) ─────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.drawer-overlay.active { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  right: -480px;
  top: 0;
  bottom: 0;
  width: 480px;
  max-width: 95vw;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.drawer.active { right: 0; }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }

/* ─── PAGINATION ──────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.1s ease;
}

.pagination-btn:hover { background: var(--bg); }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── LOADING ─────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-lg);
}

.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── TOAST NOTIFICATIONS ─────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; color: var(--text-muted); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { max-width: 400px; margin: 0 auto; }

/* ─── LOGIN PAGE ──────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1A0A10 0%, #2D1520 50%, #1A0A10 100%);
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--primary);
}

.login-card p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }

/* ─── CHART CONTAINER ─────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

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

/* ─── ORDER FORM ──────────────────────────────── */
.order-form { display: flex; gap: 24px; }
.order-form-main { flex: 1; }
.order-form-sidebar { width: 320px; }

.order-items-list { margin-top: 16px; }

.order-item {
  display: grid;
  grid-template-columns: 1fr 80px 100px 100px 40px;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.order-summary {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
}

.order-summary-total {
  font-size: 1.25rem;
  font-weight: 700;
  border-top: 2px solid var(--text);
  margin-top: 8px;
  padding-top: 12px;
}

/* ─── KANBAN CRM ──────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}

.kanban-column {
  min-width: 280px;
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-column-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-column-count {
  margin-left: auto;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.kanban-column-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  max-height: 500px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
}

.kanban-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(212,20,90,0.1);
  transform: translateY(-1px);
}

.kanban-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.kanban-card-client {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.kanban-card-value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--success);
}

.kanban-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* Drag & Drop */
.kanban-card[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.kanban-card[draggable="true"]:active {
  cursor: grabbing;
}

.kanban-column-dragover {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  border-style: dashed !important;
}

.kanban-column-dragover .kanban-column-body {
  min-height: 100px;
}

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }

  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }

  .topbar-search { display: none; }

  .order-form { flex-direction: column; }
  .order-form-sidebar { width: 100%; }
  .order-item { grid-template-columns: 1fr; gap: 4px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .form-input, .toolbar .form-select { min-width: 100%; }

  .drawer { width: 100%; }

  .form-row { grid-template-columns: 1fr; }

  .table-container { font-size: 0.8rem; }
  th, td { padding: 8px 12px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.4rem; }
  .login-card { margin: 16px; padding: 24px; }
}

/* ─── UTILITIES ───────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
