/* ============================================================
   ALDJANA — Design System Global
   Thème Clair | Blanc & Vert | Version 2.1
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   1. VARIABLES (Design Tokens — Light Theme)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-primary:   #f0f7f2;
  --bg-card:      #ffffff;
  --bg-sidebar:   #ffffff;
  --bg-hover:     #f0f7f2;
  --bg-input:     #f8fafb;
  --bg-modal:     #ffffff;

  /* Brand — Vert Aldjana */
  --accent:         #16a34a;
  --accent-hover:   #15803d;
  --accent-light:   rgba(22, 163, 74, 0.10);
  --accent-dark:    #14532d;
  --accent-2:       #22c55e;
  --accent-2-light: rgba(34, 197, 94, 0.12);

  /* Semantic */
  --success:        #16a34a;
  --danger:         #dc2626;
  --danger-light:   rgba(220, 38, 38, 0.10);
  --warning:        #d97706;
  --warning-light:  rgba(217, 119, 6, 0.10);
  --info:           #2563eb;
  --info-light:     rgba(37, 99, 235, 0.10);

  /* Text */
  --text-primary:   #1e293b;
  --text-muted:     #64748b;
  --text-light:     #475569;

  /* Borders */
  --border:         #e2e8f0;
  --border-focus:   rgba(22, 163, 74, 0.4);

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-accent:0 4px 16px rgba(22, 163, 74, 0.25);

  /* Dimensions */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition:      all 0.22s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s  cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.app-wrapper   { display: flex; min-height: 100vh; }
.main-content  { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.page-content  { padding: 28px 32px; flex: 1; margin-top: var(--topbar-height); }

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1000;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  box-shadow: var(--shadow-sm);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.sidebar-brand-logo {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--accent);
  padding: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.sidebar-brand-logo:hover {
  transform: scale(1.05);
}

.header-logo {
  height: 36px; width: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--accent);
  padding: 5px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.header-logo:hover {
  transform: scale(1.05);
}

.sidebar-brand-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.sidebar-brand-tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-section-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 20px 20px 6px;
}

.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-nav ul { list-style: none; }

.sidebar-nav-item a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; margin: 2px 8px;
  color: var(--text-light);
  font-size: 0.875rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar-nav-item a:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.sidebar-nav-item.active a {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-nav-item .nav-icon {
  font-size: 0.95rem; width: 20px;
  text-align: center; flex-shrink: 0;
}

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

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-user:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: white; flex-shrink: 0;
}

.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-muted); }

.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-logout:hover { background: var(--danger); color: white; }

/* ============================================================
   5. TOPBAR
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; z-index: 900;
  box-shadow: var(--shadow-sm);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.topbar-breadcrumb .current { color: var(--accent); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.lang-switcher {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-btn {
  padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  transition: var(--transition);
}
.lang-btn.active { background: var(--accent); color: white; }

/* ============================================================
   6. CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.card-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
}

/* KPI Cards */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.kpi-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}

.kpi-info { flex: 1; }
.kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.kpi-value { font-family: 'JetBrains Mono', monospace; font-size: 1.45rem; font-weight: 700; color: var(--text-primary); letter-spacing: -1px; }
.kpi-currency { font-size: 0.7rem; color: var(--text-muted); margin-left: 2px; font-family: 'Inter', sans-serif; }

/* KPI variants */
.kpi-danger  { border-left: 4px solid var(--danger); }
.kpi-danger  .kpi-icon { background: var(--danger-light); color: var(--danger); }
.kpi-success { border-left: 4px solid var(--success); }
.kpi-success .kpi-icon { background: var(--accent-2-light); color: var(--success); }
.kpi-warning { border-left: 4px solid var(--warning); }
.kpi-warning .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-info    { border-left: 4px solid var(--info); }
.kpi-info    .kpi-icon { background: var(--info-light); color: var(--info); }

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; font-family: 'Inter', sans-serif;
  border: 1px solid transparent; cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: white; box-shadow: var(--shadow-accent); transform: translateY(-1px); }

.btn-secondary { background: #fff; color: var(--text-light); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-success { background: var(--accent-2-light); color: var(--success); border-color: rgba(34,197,94,0.3); }
.btn-success:hover { background: var(--success); color: white; }

.btn-danger { background: var(--danger-light); color: var(--danger); border-color: rgba(220,38,38,0.3); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ============================================================
   8. FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--text-light); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: #fff; }
.form-control::placeholder { color: #94a3b8; }
select.form-control { cursor: pointer; }

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

/* ============================================================
   9. TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }

.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.table thead tr { background: #f8fafc; border-bottom: 1px solid var(--border); }
.table th { padding: 12px 16px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); white-space: nowrap; text-align: left; }
.table td { padding: 12px 16px; color: var(--text-primary); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.badge-success { background: rgba(22,163,74,0.10); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-accent  { background: var(--accent-light);  color: var(--accent); }

/* Amounts */
.amount { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.85rem; }
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }
.amount-neutral  { color: var(--text-primary); }

/* ============================================================
   10. MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px; width: 90%; max-width: 540px; max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); border-color: rgba(220,38,38,0.2); }

/* ============================================================
   11. LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh; background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}

/* Decorative circles */
.login-bg-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.login-bg-orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(22,163,74,0.12), transparent 70%); top: -200px; left: -200px; }
.login-bg-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(34,197,94,0.10), transparent 70%); bottom: -100px; right: -100px; }

.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(22,163,74,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(22,163,74,0.04) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none;
}

.login-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  animation: fadeInUp 0.5s ease both;
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img {
  height: 56px; width: 56px;
  margin-bottom: 12px;
  background: var(--accent);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: contain;
  transition: var(--transition);
}
.login-logo img:hover {
  transform: scale(1.05);
}
.login-logo-title { font-size: 1.7rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.login-logo-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.login-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 28px; }
.login-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.login-footer { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 24px; }

.error-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--danger-light);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--radius-sm); color: var(--danger);
  font-size: 0.82rem; font-weight: 500; margin-bottom: 20px;
  animation: fadeInUp 0.3s ease;
}

/* ============================================================
   12. PAGE HEADERS
   ============================================================ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.page-header-left h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.page-header-left p { font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   13. GRID UTILITIES
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

/* Custom KPI variants */
.kpi-purple { border-left: 4px solid #7c3aed; }
.kpi-purple .kpi-icon { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.kpi-gray { border-left: 4px solid #64748b; }
.kpi-gray .kpi-icon { background: rgba(100, 116, 139, 0.1); color: #64748b; }

/* Premium Header Gradient */
.page-header-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  color: white;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.page-header-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.page-header-gradient h1 {
  color: white !important;
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.page-header-gradient p {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
}
.btn-white-blur {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: white !important;
  backdrop-filter: blur(8px);
}
.btn-white-blur:hover {
  background: white !important;
  color: #2563eb !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

@media (max-width: 1400px) { .grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .main-content { margin-left: 0; } .topbar { left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .grid-6 { grid-template-columns: 1fr; }
  .grid-3, .grid-2, .grid-4, .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .page-header-gradient { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ============================================================
   14. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin     { to { transform: rotate(360deg); } }

.animate-fade-in    { animation: fadeIn    0.4s ease both; }
.animate-fade-in-up { animation: fadeInUp  0.4s ease both; }

.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }

/* ============================================================
   15. LOADER
   ============================================================ */
.page-loader { position: fixed; inset: 0; background: #fff; display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.4s ease; }
.page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

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

/* ============================================================
   17. UTILITIES
   ============================================================ */
.text-muted    { color: var(--text-muted) !important; }
.text-accent   { color: var(--accent) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }  .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mb-0  { margin-bottom: 0; }    .mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; } .mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }    .mt-24 { margin-top: 24px; }
.separator { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── DataTables & Bootstrap 5 Pagination overrides ───────────── */
.dataTables_wrapper { color: var(--text-primary); }
.dataTables_length select,
.dataTables_filter input {
  background: #fff !important; border: 1px solid var(--border) !important;
  color: var(--text-primary) !important; border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important; outline: none;
}
.dataTables_length select:focus,
.dataTables_filter input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent-light) !important; }
.dataTables_length label, .dataTables_filter label { color: var(--text-muted); font-size: 0.82rem; }
.dataTables_info { color: var(--text-muted); font-size: 0.78rem; margin-top: 16px; }

/* Bootstrap 5 Pagination Custom overrides */
.pagination {
  margin-top: 16px;
  justify-content: flex-end;
  gap: 4px;
}
.page-item .page-link {
  color: var(--text-light) !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px !important;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: none !important;
}
.page-item.active .page-link {
  color: #ffffff !important;
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  font-weight: 600;
}
.page-item .page-link:hover {
  color: var(--accent) !important;
  background-color: var(--bg-primary) !important;
  border-color: var(--accent) !important;
}
.page-item.disabled .page-link {
  color: var(--text-muted) !important;
  background-color: var(--bg-input) !important;
  border-color: var(--border) !important;
  opacity: 0.6;
}

/* ============================================================
   COLLAPSED SIDEBAR RULES (Desktop)
   ============================================================ */
.app-wrapper.sidebar-collapsed {
  --sidebar-width: 70px;
}

/* Hide brand text when collapsed */
.app-wrapper.sidebar-collapsed .sidebar-brand-text {
  display: none !important;
}

/* Center brand logo when collapsed */
.app-wrapper.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 20px 10px 18px;
}

/* Redesign category headers when collapsed: transition to simple dividers */
.app-wrapper.sidebar-collapsed .sidebar-section-label {
  font-size: 0 !important;
  height: 1px;
  padding: 0 !important;
  margin: 12px 14px 6px !important;
  background: var(--border);
  border: none;
}

/* Center navigation item contents when collapsed */
.app-wrapper.sidebar-collapsed .sidebar-nav-item a {
  justify-content: center;
  padding: 9px 0;
  margin: 2px 8px;
}

/* Hide standard navigation text labels */
.app-wrapper.sidebar-collapsed .sidebar-nav-item a > span {
  display: none !important;
}

/* Keep the flex container of disabled tabs visible so their icons display */
.app-wrapper.sidebar-collapsed .sidebar-nav-item.disabled-tab a > span {
  display: flex !important;
}

/* Hide the text inside the wrapper span of disabled tabs */
.app-wrapper.sidebar-collapsed .sidebar-nav-item.disabled-tab a > span > span {
  display: none !important;
}

/* Hide badges inside collapsed menus */
.app-wrapper.sidebar-collapsed .sidebar-nav-item .badge {
  display: none !important;
}

/* Footer padding adjustment */
.app-wrapper.sidebar-collapsed .sidebar-footer {
  padding: 12px 8px;
}

/* User block alignment */
.app-wrapper.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 8px 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  margin-bottom: 8px;
}
.app-wrapper.sidebar-collapsed .sidebar-user:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.app-wrapper.sidebar-collapsed .sidebar-user > div {
  display: none !important;
}

/* Logout button centered */
.app-wrapper.sidebar-collapsed .btn-logout {
  justify-content: center;
  padding: 10px 0;
}
.app-wrapper.sidebar-collapsed .btn-logout span {
  display: none !important;
}

/* Floating Sidebar Toggle Button (Notion style) */
.sidebar-toggle-btn {
  position: fixed;
  top: 41px;
  left: calc(var(--sidebar-width) - 12px);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 1020;
  transform: translateY(-50%);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s, color 0.22s, border-color 0.22s, box-shadow 0.22s, transform 0.22s;
}

.sidebar-toggle-btn:hover {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-50%) scale(1.1);
}

.sidebar-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

@media (max-width: 768px) {
  .sidebar-toggle-btn {
    display: none !important;
  }
}

