/* ============================================================
   Qlinic — Premium Veterinary Management System
   Design System: Clean Medical + Warm Green
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  --primary:       #1a6b3a;
  --primary-light: #22883f;
  --primary-dark:  #14532d;
  --primary-50:    #f0fdf4;
  --primary-100:   #dcfce7;
  --primary-200:   #bbf7d0;
  --accent:        #f59e0b;
  --accent-light:  #fef3c7;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #0ea5e9;
  --success:       #22c55e;

  --bg:            #f4f6f9;
  --bg-card:       #ffffff;
  --border:        #e5e7eb;
  --border-light:  #f3f4f6;

  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.1), 0 4px 16px rgba(0,0,0,.06);
  --shadow-green:  0 4px 20px rgba(26,107,58,.25);

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

  --nav-h:         62px;
  --sidebar-w:     0px;

  --font-main:     'Cairo', 'Tajawal', sans-serif;
}


/* ============================================================
   STICKY FOOTER LAYOUT
   ============================================================ */

html {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > .container.mt-4 {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
  margin-top: auto !important;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c5d9c9; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   NAVBAR — Complete Redesign
   ============================================================ */

.navbar {
  background: var(--primary-dark) !important;
  height: var(--nav-h);
  padding: 0 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 2px solid rgba(255,255,255,.08);
}

/* Brand */
.navbar-brand {
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff !important;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand::before {
  content: '';
  display: inline-block;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(74,222,128,.4);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3.5 8.5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm0 2a3.5 3.5 0 100-7 3.5 3.5 0 000 7zM8.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm0 2a3.5 3.5 0 100-7 3.5 3.5 0 000 7zm7 3a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm0 2a3.5 3.5 0 100-7 3.5 3.5 0 000 7zm-7 3a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm0 2a3.5 3.5 0 100-7 3.5 3.5 0 000 7z'/%3E%3C/svg%3E");
  background-size: 60%;
  background-repeat: no-repeat;
  background-position: center;
}

/* Nav links */
.navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 10px !important;
  border-radius: var(--radius-sm);
  transition: all .18s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.navbar .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.12);
}

.navbar .nav-link.active,
.navbar .nav-link.fw-bold {
  color: #fff !important;
  background: rgba(255,255,255,.15);
  font-weight: 600 !important;
}

/* Dropdown */
.navbar .dropdown-menu {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 200px;
  margin-top: 6px !important;
}

.navbar .dropdown-item {
  border-radius: var(--radius-sm);
  font-size: .83rem;
  padding: 8px 12px;
  color: var(--text-primary);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar .dropdown-item:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.navbar .dropdown-divider {
  margin: 4px 8px;
  border-color: var(--border-light);
}

/* Nav badge pill */
.navbar .badge {
  font-size: .6rem;
  padding: 2px 5px;
  border-radius: 99px;
}

/* Notification bell dropdown */
.navbar .dropdown-menu[style*="340px"] {
  min-width: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Language switcher */
.navbar .btn-outline-light {
  border-color: rgba(255,255,255,.35) !important;
  color: rgba(255,255,255,.85) !important;
  font-size: .76rem !important;
  padding: 3px 10px !important;
  border-radius: 99px !important;
  transition: all .18s;
}

.navbar .btn-outline-light:hover {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
}

/* Username chip */
.navbar .text-warning {
  color: #fbbf24 !important;
  font-size: .8rem !important;
  background: rgba(251,191,36,.12);
  border-radius: 99px;
  padding: 3px 10px !important;
}

/* Logout */
.navbar .text-danger {
  color: #fca5a5 !important;
}
.navbar .text-danger:hover {
  color: #fff !important;
  background: rgba(239,68,68,.2) !important;
}

/* Toggler */
.navbar-toggler {
  border: none !important;
  padding: 4px 8px !important;
}
.navbar-toggler:focus { box-shadow: none !important; }

/* Gap between nav items */
.navbar-nav.gap-1 { gap: 2px !important; }

/* ============================================================
   MAIN CONTAINER
   ============================================================ */

.container.mt-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 3rem;
  max-width: 1320px;
}

/* ============================================================
   PAGE HEADER / TITLES
   ============================================================ */

h2 {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  padding: 0;
  border: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.4rem;
  background: linear-gradient(to bottom, var(--primary-light), var(--primary-dark));
  border-radius: 99px;
  flex-shrink: 0;
}

[dir="rtl"] h2 { flex-direction: row-reverse; justify-content: flex-end; }
[dir="rtl"] h2::before { display: none; }
[dir="rtl"] h2::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.4rem;
  background: linear-gradient(to bottom, var(--primary-light), var(--primary-dark));
  border-radius: 99px;
  flex-shrink: 0;
  order: 1;
}

h5, h6 { font-weight: 600; color: var(--text-primary); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-header {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 14px 18px !important;
  font-weight: 600;
}

.card-body { padding: 18px !important; }
.card.p-3 { padding: 20px !important; }
.card.p-4 { padding: 24px !important; }

/* ============================================================
   STAT CARDS — Dashboard
   ============================================================ */

.stat-card {
  border-radius: var(--radius-xl) !important;
  padding: 24px 22px !important;
  color: #fff;
  border: none !important;
  box-shadow: var(--shadow) !important;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Decorative circle */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}
.stat-card::before {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -10px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}

.stat-card .stat-number {
  font-size: 2.8rem !important;
  font-weight: 800 !important;
  margin: 0 0 4px !important;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.stat-card .stat-label {
  font-size: .85rem !important;
  opacity: .9 !important;
  margin: 0 !important;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Stat card colors */
.stat-card.bg-primary { background: linear-gradient(135deg, #1a6b3a, #22883f) !important; }
.stat-card.bg-success { background: linear-gradient(135deg, #16a34a, #22c55e) !important; }
.stat-card.bg-info    { background: linear-gradient(135deg, #0369a1, #0ea5e9) !important; }
.stat-card.bg-warning { background: linear-gradient(135deg, #d97706, #f59e0b) !important; }
.stat-card.bg-danger  { background: linear-gradient(135deg, #b91c1c, #ef4444) !important; }
.stat-card.bg-secondary { background: linear-gradient(135deg, #4b5563, #6b7280) !important; }
.stat-card.bg-dark    { background: linear-gradient(135deg, #1f2937, #374151) !important; }

/* ============================================================
   TABLES
   ============================================================ */

.table {
  background: transparent;
  border-radius: 0;
  margin: 0;
}

.table-responsive {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.table thead th {
  background: #f8faf9 !important;
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
  font-size: .78rem !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px !important;
  border-bottom: 2px solid var(--border) !important;
  border-top: none !important;
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--border-light) !important;
  vertical-align: middle;
  font-size: .875rem;
  color: var(--text-primary);
}

.table tbody tr:last-child td { border-bottom: none !important; }

.table tbody tr {
  transition: background .15s;
}
.table tbody tr:hover {
  background: var(--primary-50) !important;
}

.table-striped tbody tr:nth-child(odd) {
  background: #fafafa;
}

.table-light { background: #f8faf9 !important; }

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
  font-weight: 600;
  font-size: .83rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius) !important;
  padding: 9px 14px !important;
  font-size: .875rem !important;
  color: var(--text-primary) !important;
  background: #fff !important;
  transition: all .18s;
  font-family: var(--font-main);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(26,107,58,.12) !important;
  outline: none;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.form-control-sm, .form-select-sm {
  padding: 6px 10px !important;
  font-size: .82rem !important;
}

textarea.form-control { line-height: 1.6; }

/* Input groups */
.input-group .form-control { border-radius: 0 !important; }
.input-group .form-control:first-child { border-radius: var(--radius) 0 0 var(--radius) !important; }
.input-group .form-control:last-child  { border-radius: 0 var(--radius) var(--radius) 0 !important; }
[dir="rtl"] .input-group .form-control:first-child { border-radius: 0 var(--radius) var(--radius) 0 !important; }
[dir="rtl"] .input-group .form-control:last-child  { border-radius: var(--radius) 0 0 var(--radius) !important; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  font-weight: 600;
  font-size: .84rem;
  border-radius: var(--radius) !important;
  padding: 8px 18px !important;
  transition: all .18s ease;
  border-width: 1.5px !important;
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.btn:active { transform: scale(.97); }

.btn-sm {
  font-size: .79rem !important;
  padding: 5px 12px !important;
  border-radius: 7px !important;
}

.btn-lg {
  font-size: .95rem !important;
  padding: 11px 24px !important;
  border-radius: var(--radius-lg) !important;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)) !important;
  border-color: var(--primary-dark) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(26,107,58,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0f3d1f) !important;
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(22,163,74,.25);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22,163,74,.35); }

/* Warning */
.btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
  border-color: #d97706 !important;
  color: #fff !important;
}
.btn-warning:hover { transform: translateY(-1px); }

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

/* Outlines */
.btn-outline-primary { border-color: var(--primary) !important; color: var(--primary) !important; }
.btn-outline-primary:hover { background: var(--primary) !important; color: #fff !important; }

.btn-outline-secondary { border-color: var(--border) !important; color: var(--text-secondary) !important; background: #fff !important; }
.btn-outline-secondary:hover { background: #f3f4f6 !important; color: var(--text-primary) !important; }

.btn-outline-success { border-color: #16a34a !important; color: #16a34a !important; }
.btn-outline-success:hover { background: #16a34a !important; color: #fff !important; }

.btn-outline-warning { border-color: #d97706 !important; color: #d97706 !important; }
.btn-outline-warning:hover { background: #d97706 !important; color: #fff !important; }

.btn-outline-danger { border-color: var(--danger) !important; color: var(--danger) !important; }
.btn-outline-danger:hover { background: var(--danger) !important; color: #fff !important; }

.btn-outline-info { border-color: var(--info) !important; color: var(--info) !important; }
.btn-outline-info:hover { background: var(--info) !important; color: #fff !important; }

.btn-outline-dark { border-color: #374151 !important; color: #374151 !important; }
.btn-outline-dark:hover { background: #374151 !important; color: #fff !important; }

.btn-light {
  background: #f3f4f6 !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  font-weight: 600;
  font-size: .72rem;
  padding: 4px 9px;
  border-radius: 99px !important;
  letter-spacing: .2px;
}

.badge.bg-primary   { background: var(--primary) !important; }
.badge.bg-success   { background: #16a34a !important; }
.badge.bg-warning   { background: var(--warning) !important; color: #fff !important; }
.badge.bg-danger    { background: var(--danger) !important; }
.badge.bg-info      { background: var(--info) !important; }
.badge.bg-secondary { background: #6b7280 !important; }
.badge.bg-dark      { background: #1f2937 !important; }
.badge.bg-light     { background: #f3f4f6 !important; color: var(--text-secondary) !important; }

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  border-radius: var(--radius-lg) !important;
  border: none !important;
  padding: 14px 18px !important;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success  { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e !important; }
.alert-danger   { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444 !important; }
.alert-warning  { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b !important; }
.alert-info     { background: #f0f9ff; color: #075985; border-left: 4px solid #0ea5e9 !important; }

[dir="rtl"] .alert-success  { border-left: none !important; border-right: 4px solid #22c55e !important; }
[dir="rtl"] .alert-danger   { border-left: none !important; border-right: 4px solid #ef4444 !important; }
[dir="rtl"] .alert-warning  { border-left: none !important; border-right: 4px solid #f59e0b !important; }
[dir="rtl"] .alert-info     { border-left: none !important; border-right: 4px solid #0ea5e9 !important; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */

.progress {
  border-radius: 99px;
  background: var(--border-light);
  overflow: hidden;
}
.progress-bar { border-radius: 99px; }
.progress-bar.bg-success { background: linear-gradient(to right, #16a34a, #22c55e) !important; }
.progress-bar.bg-danger  { background: linear-gradient(to right, #b91c1c, #ef4444) !important; }
.progress-bar.bg-warning { background: linear-gradient(to right, #d97706, #f59e0b) !important; }
.progress-bar.bg-info    { background: linear-gradient(to right, #0369a1, #0ea5e9) !important; }

/* ============================================================
   LIST GROUPS
   ============================================================ */

.list-group { border-radius: var(--radius-lg) !important; overflow: hidden; }
.list-group-item {
  border-color: var(--border-light) !important;
  padding: 12px 16px !important;
  font-size: .875rem;
  transition: background .15s;
}
.list-group-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; }
.list-group-item:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important; }
.list-group-item-action:hover { background: var(--primary-50) !important; }
.list-group-item-light { background: #fafafa !important; }
.list-group-item-danger { background: #fef2f2 !important; }

/* ============================================================
   MODALS
   ============================================================ */

.modal-content {
  border: none !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none !important;
  padding: 16px 22px !important;
}
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-header .btn-close { filter: invert(1); }
.modal-body { padding: 22px !important; }
.modal-footer { border-top: 1px solid var(--border-light) !important; padding: 14px 22px !important; }

/* ============================================================
   PAGINATION
   ============================================================ */

.page-link {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  padding: 6px 12px !important;
  font-size: .83rem;
  margin: 0 2px;
  transition: all .15s;
}
.page-link:hover { background: var(--primary-50) !important; color: var(--primary) !important; border-color: var(--primary) !important; }
.page-item.active .page-link { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumb { font-size: .82rem; margin-bottom: 1rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============================================================
   TOOLTIPS & POPOVERS
   ============================================================ */

.tooltip-inner { border-radius: var(--radius-sm); font-size: .8rem; }

/* ============================================================
   DROPDOWN MENUS (general)
   ============================================================ */

.dropdown-menu {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 6px !important;
  font-size: .875rem;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 8px 12px !important;
  transition: all .15s;
}
.dropdown-item:hover { background: var(--primary-50) !important; color: var(--primary) !important; }
.dropdown-divider { border-color: var(--border-light) !important; margin: 4px 8px !important; }

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background: var(--primary-dark) !important;
  color: rgba(255,255,255,.7) !important;
  padding: 20px 0 !important;
  margin-top: 60px !important;
}

footer .text-center {
  color: rgba(255,255,255,.6) !important;
  font-size: .82rem !important;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Text */
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--text-muted) !important; }

/* Borders */
.border { border-color: var(--border) !important; }
.border-start.border-primary { border-left-color: var(--primary) !important; }
.border-start.border-success { border-left-color: #22c55e !important; }
.border-start.border-danger  { border-left-color: #ef4444 !important; }
.border-start.border-warning { border-left-color: #f59e0b !important; }
.border-start.border-info    { border-left-color: #0ea5e9 !important; }
.border-top.border-3 { border-width: 3px !important; }

/* Backgrounds */
.bg-light   { background: #f8faf9 !important; }
.bg-primary { background: var(--primary) !important; }
.bg-success { background: #16a34a !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger  { background: var(--danger) !important; }
.bg-info    { background: var(--info) !important; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow    { box-shadow: var(--shadow) !important; }

/* Sticky */
.sticky-top { position: sticky !important; top: 80px !important; z-index: 10; }

/* ============================================================
   SPECIAL COMPONENTS
   ============================================================ */

/* QR Box */
.qr-box {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-top: 15px;
  border: 1px solid var(--border);
}

/* Stat badge */
.badge-pending   { background-color: #fef3c7 !important; color: #92400e !important; }
.badge-progress  { background-color: #dbeafe !important; color: #1e40af !important; }
.badge-completed { background-color: #dcfce7 !important; color: #166534 !important; }

/* Page header bar */
.page-header {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Table in card wrapper */
.card .table-responsive {
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.card .table thead th { background: #f8faf9 !important; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .95rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991.98px) {
  .navbar {
    height: auto;
    padding: 12px 16px;
  }
  .navbar-collapse {
    background: var(--primary-dark);
    border-radius: var(--radius-lg);
    padding: 10px;
    margin-top: 8px;
    box-shadow: var(--shadow-lg);
  }
  .navbar .nav-link {
    padding: 8px 12px !important;
    font-size: .88rem;
  }
  .navbar .dropdown-menu {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.1) !important;
    box-shadow: none !important;
  }
  .navbar .dropdown-item {
    color: rgba(255,255,255,.8);
  }
  .navbar .dropdown-item:hover {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
  }
}

@media (max-width: 767.98px) {
  :root { --nav-h: auto; }
  .stat-card .stat-number { font-size: 2rem !important; }
  .stat-card { padding: 18px !important; }
  h2 { font-size: 1.2rem; }
  .container.mt-4 { padding-top: 1rem !important; }
  .card.p-3 { padding: 14px !important; }
  .table thead th { font-size: .72rem !important; padding: 10px 10px !important; }
  .table tbody td { padding: 10px 10px !important; font-size: .82rem; }
  .btn { font-size: .82rem !important; }
}

@media (max-width: 575.98px) {
  .stat-card .stat-number { font-size: 1.7rem !important; }
  .stat-card { padding: 14px 16px !important; }
  h2 { font-size: 1.1rem; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,107,58,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(26,107,58,0); }
}

.fade-in { animation: fadeInUp .35s ease both; }
.card { animation: fadeInUp .3s ease both; }

/* Stagger cards */
.row > [class*="col"]:nth-child(1) .card,
.row > [class*="col"]:nth-child(1) .stat-card { animation-delay: .05s; }
.row > [class*="col"]:nth-child(2) .card,
.row > [class*="col"]:nth-child(2) .stat-card { animation-delay: .10s; }
.row > [class*="col"]:nth-child(3) .card,
.row > [class*="col"]:nth-child(3) .stat-card { animation-delay: .15s; }
.row > [class*="col"]:nth-child(4) .card,
.row > [class*="col"]:nth-child(4) .stat-card { animation-delay: .20s; }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .navbar, footer, .btn, .no-print { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { font-size: 12pt; background: #fff; }
}
