/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-width: 260px;
  --header-height: 64px;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 56px; height: 56px;
  background: var(--primary-light);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--primary);
}
.logo-icon svg { width: 28px; height: 28px; }

.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.login-logo p { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap > svg {
  position: absolute; left: 12px;
  width: 16px; height: 16px;
  color: var(--text-light); pointer-events: none;
}
.input-icon-wrap input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color .2s;
  outline: none;
}
.input-icon-wrap input:focus { border-color: var(--primary); }

.toggle-pass {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-light); padding: 4px;
}
.toggle-pass svg { width: 16px; height: 16px; }

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--danger);
}

.btn-login {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: background .2s, transform .1s;
}
.btn-login:hover { background: var(--primary-dark); }
.btn-login:active { transform: scale(.98); }
.btn-login svg { width: 18px; height: 18px; }

/* ===== APP LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.05rem; color: #fff;
}
.sidebar-logo svg { width: 22px; height: 22px; color: #60a5fa; }

.sidebar-toggle {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  padding: 4px; display: none;
}
.sidebar-toggle svg { width: 20px; height: 20px; }

.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.user-avatar {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
  flex-shrink: 0;
}

.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 0.875rem; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: #64748b; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; }

.nav-section { margin-bottom: 0.5rem; }
.nav-section-title {
  font-size: 0.7rem; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0.4rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #94a3b8;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
  margin-bottom: 2px;
  white-space: nowrap;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-item.active { background: rgba(37,99,235,.25); color: #60a5fa; font-weight: 500; }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.btn-logout {
  width: 100%;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: none; border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: #94a3b8; font-size: 0.85rem; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all .15s;
}
.btn-logout:hover { background: rgba(220,38,38,.15); color: #fca5a5; border-color: rgba(220,38,38,.3); }
.btn-logout svg { width: 16px; height: 16px; }

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

.main-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.menu-toggle {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: none; padding: 6px; border-radius: var(--radius-sm);
}
.menu-toggle svg { width: 22px; height: 22px; }
.menu-toggle:hover { background: var(--bg); color: var(--text); }

.header-title { font-weight: 600; font-size: 1rem; color: var(--text); flex: 1; }
.header-date { font-size: 0.8rem; color: var(--text-muted); }

.page-content { flex: 1; padding: 1.5rem; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-header-left h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.page-header-left p { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }
.page-header-right { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== CARDS / STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background: var(--info-light); color: var(--info); }

.stat-info .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-info .stat-label { font-size: 0.775rem; color: var(--text-muted); margin-top: 2px; }

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.75rem;
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.card-body { padding: 1.25rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer; border: none;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #b45309; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-sm svg { width: 13px; height: 13px; }

.btn-icon {
  padding: 0.4rem; background: none; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-muted); transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-light); color: var(--danger); }
.btn-icon.success:hover { background: var(--success-light); color: var(--success); }
.btn-icon.warning:hover { background: var(--warning-light); color: var(--warning); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.86rem;
}
thead th {
  background: var(--bg);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
thead th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

tbody tr { border-bottom: 1px solid var(--border-light); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody tr.selected { background: #eff6ff; }

tbody td { padding: 0.75rem 0.85rem; color: var(--text); vertical-align: middle; }
tbody td .actions { display: flex; gap: 4px; align-items: center; }

/* Checkbox */
input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--primary);
}

/* ===== BADGES / STATUS ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-validated { background: var(--success-light); color: var(--success); }
.badge-cancelled { background: #f1f5f9; color: var(--text-muted); }
.badge-auto-cancelled { background: #fce7f3; color: #db2777; }
.badge-modified { background: var(--info-light); color: var(--info); }

/* ===== FORMS ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }

.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: 0.83rem; font-weight: 500;
  color: var(--text); margin-bottom: 0.35rem;
}
.field label .required { color: var(--danger); margin-left: 2px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--primary); }
.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  background: var(--bg); color: var(--text-muted); cursor: not-allowed;
}
.field textarea { resize: vertical; min-height: 80px; }
.field .field-hint { font-size: 0.775rem; color: var(--text-muted); margin-top: 0.25rem; }
.field .field-error { font-size: 0.775rem; color: var(--danger); margin-top: 0.25rem; }

/* Checkbox group */
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
}
.checkbox-item:hover { border-color: var(--primary); background: var(--primary-light); }
.checkbox-item.checked { border-color: var(--primary); background: var(--primary-light); }
.checkbox-item label { cursor: pointer; font-size: 0.875rem; font-weight: 500; }
.checkbox-item input { flex-shrink: 0; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal.modal-lg { max-width: 720px; }
.modal.modal-sm { max-width: 420px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; border-radius: 6px; transition: all .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 999;
}
.toast {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  min-width: 280px; max-width: 360px;
  animation: slideIn .25s ease;
  font-size: 0.875rem;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--primary); }
.toast-icon svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--primary); }
.toast-message { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-body { color: var(--text-muted); font-size: 0.82rem; }

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

/* ===== TOOLBAR (bulk actions) ===== */
.toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  border: 1px solid #bfdbfe;
  flex-wrap: wrap;
}
.toolbar .toolbar-count {
  font-size: 0.85rem; font-weight: 600; color: var(--primary);
  margin-right: 0.5rem;
}

/* ===== SEARCH / FILTER ===== */
.filters-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  flex: 1; min-width: 200px;
}
.search-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  border: none; outline: none;
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  color: var(--text); background: transparent; width: 100%;
}
.filter-select {
  padding: 0.45rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--bg-card); outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px; height: 48px; margin: 0 auto 1rem;
  color: var(--text-light);
}
.empty-state h4 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; max-width: 300px; margin: 0 auto; }

/* ===== ALERT ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin-bottom: 1rem;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid #a5f3fc; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }

/* ===== IMPORT ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.drop-zone:hover, .drop-zone.active {
  border-color: var(--primary); background: var(--primary-light);
}
.drop-zone svg { width: 40px; height: 40px; color: var(--text-light); margin: 0 auto 0.75rem; }
.drop-zone p { font-size: 0.875rem; color: var(--text-muted); }
.drop-zone strong { color: var(--primary); }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem; font-weight: 500;
  font-family: 'Inter', sans-serif;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); cursor: pointer;
  white-space: nowrap;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.83rem; color: var(--text-muted);
  flex-wrap: wrap; gap: 0.5rem;
}
.pagination-btns { display: flex; gap: 0.25rem; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.83rem;
  background: var(--bg-card); color: var(--text); transition: all .15s;
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== ACOMPTE PAGE ===== */
.acompte-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.acompte-amount-display {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.acompte-amount-display .amount-value {
  font-size: 2rem; font-weight: 700; line-height: 1.2;
}
.acompte-amount-display .amount-label {
  font-size: 0.875rem; opacity: .85; margin-top: 4px;
}
.amount-locked {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.amount-locked svg { width: 32px; height: 32px; margin: 0 auto 0.5rem; color: var(--text-light); }

/* ===== SETTINGS ===== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.setting-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.setting-item label { font-weight: 600; font-size: 0.875rem; display: block; margin-bottom: 0.5rem; }
.setting-item p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.visible { display: block; }

  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }

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

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .page-header { flex-direction: column; }
  .page-header-right { flex-wrap: wrap; }

  .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  thead { display: none; }
  tbody td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.75rem; font-size: 0.83rem;
  }
  tbody td::before {
    content: attr(data-label);
    font-weight: 600; font-size: 0.78rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
    flex-shrink: 0; margin-right: 0.5rem;
  }
  tbody td .actions { flex-wrap: wrap; }
  tbody tr { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
  .header-date { display: none; }
}

/* ===== PRINT ===== */
@media print {
  .sidebar, .main-header, .page-header-right { display: none; }
  .main-content { margin-left: 0; }
}
