@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&family=Work+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --paper: #FFFAF3;
  --paper-card: #FFFFFF;
  --ink: #241826;
  --ink-soft: #6B5A66;
  --ink-light: #9B8C96;
  --bottle: #1E7A3F;
  --bottle-hover: #176332;
  --bottle-dark: #5C1650;
  --brass: #F2901E;
  --brass-light: #F7C948;
  --clay: #D6127A;
  --teal: #29ABE2;
  --line: rgba(36,24,38,0.12);
  --line-strong: rgba(36,24,38,0.22);
  --shadow-sm: 0 1px 3px rgba(36,24,38,0.06);
  --shadow-md: 0 4px 12px rgba(36,24,38,0.08);
  --shadow-lg: 0 12px 30px rgba(36,24,38,0.14);
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #F8F5F0;
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---------- Top Navbar ---------- */
.admin-nav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
}
.nav-container {
  max-width: 1360px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.nav-logo {
  height: 32px; width: auto; object-fit: contain; flex-shrink: 0;
}
.nav-title {
  font-family: 'Fraunces', serif;
  font-size: 18px; letter-spacing: 0.02em; color: var(--bottle-dark);
  display: flex; align-items: center; gap: 8px;
}
.nav-title span {
  font-family: 'Work Sans', sans-serif;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brass); font-weight: 700; background: rgba(242,144,30,0.12);
  padding: 2px 7px; border-radius: 4px;
}

.nav-links {
  display: flex; align-items: center; gap: 6px; list-style: none;
}
.nav-link {
  padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft); border-radius: var(--radius);
  transition: all .2s; display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: rgba(36,24,38,0.04); }
.nav-link.active {
  color: var(--bottle); font-weight: 600; background: rgba(30,122,63,0.08);
}

.nav-user {
  display: flex; align-items: center; gap: 12px;
}
.user-badge {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 30px;
  text-decoration: none; transition: all .2s ease;
}
.user-badge:hover {
  border-color: var(--bottle); background: #fff;
  box-shadow: 0 2px 6px rgba(36,24,38,0.06);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bottle-dark);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.user-info { font-size: 12px; }
.user-name { font-weight: 600; color: var(--ink); line-height: 1.2; }
.user-role { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* Mobile Actions on Header */
.nav-mobile-actions {
  display: none;
  align-items: center;
  gap: 10px;
}
.mobile-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bottle-dark); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; text-decoration: none;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.admin-burger-btn {
  display: inline-flex;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-burger-btn:hover, .admin-burger-btn:focus-visible {
  background: rgba(30,122,63,0.08);
  border-color: var(--bottle);
}
.burger-box {
  width: 20px; height: 15px;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
}
.burger-bar {
  width: 100%; height: 2px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1), opacity .2s ease, background-color .2s ease;
}
.admin-burger-btn.is-active .burger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.admin-burger-btn.is-active .burger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.admin-burger-btn.is-active .burger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- Admin Mobile Drawer & Backdrop ---------- */
.admin-mobile-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(36,24,38,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.admin-mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--paper-card);
  z-index: 999;
  box-shadow: -10px 0 35px rgba(36,24,38,0.18);
  transform: translateX(105%);
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.admin-mobile-drawer.is-open {
  transform: translateX(0);
}
.admin-drawer-inner {
  display: flex; flex-direction: column; height: 100%;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.admin-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: #F8F5F0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.drawer-user-card {
  display: flex; align-items: center; gap: 12px;
}
.drawer-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bottle-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.drawer-user-name {
  font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.2;
}
.drawer-user-badge-row {
  display: flex; align-items: center; gap: 8px; margin-top: 3px;
}
.drawer-role-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 4px;
}
.role-super { background: rgba(242,144,30,0.14); color: var(--brass); }
.role-admin { background: rgba(30,122,63,0.12); color: var(--bottle); }
.drawer-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #28a745;
  box-shadow: 0 0 0 2px rgba(40,167,69,0.25);
}
.admin-drawer-close {
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); cursor: pointer; transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-drawer-close:hover {
  background: rgba(214,18,122,0.08); color: var(--clay); border-color: var(--clay);
}

.admin-drawer-body {
  padding: 18px;
  flex: 1;
}
.admin-drawer-title {
  display: block;
  font-family: 'Work Sans', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-light); margin: 16px 0 8px;
}
.admin-drawer-title:first-child { margin-top: 0; }
.admin-drawer-menu {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
}
.admin-drawer-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-drawer-link:hover, .admin-drawer-link:active {
  background: rgba(30,122,63,0.06); border-color: var(--bottle);
  color: var(--bottle); transform: translateX(3px);
}
.admin-drawer-link.active {
  background: rgba(30,122,63,0.1); border-color: var(--bottle);
  color: var(--bottle); font-weight: 600;
}
.drawer-link-icon { font-size: 16px; flex-shrink: 0; }
.drawer-link-text { flex: 1; }
.drawer-active-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  background: var(--bottle); color: #fff; padding: 2px 6px; border-radius: 4px;
}
.drawer-link-arrow { color: var(--ink-light); font-size: 13px; }

.admin-drawer-actions {
  display: flex; flex-direction: column; gap: 8px; margin-top: 6px;
}
.drawer-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-action-create {
  background: var(--bottle); color: #fff;
  box-shadow: 0 3px 10px rgba(30,122,63,0.25);
}
.btn-action-create:hover, .btn-action-create:active {
  background: var(--bottle-hover); opacity: 0.95;
}
.drawer-export-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.drawer-export-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink);
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: all .2s ease;
}
.drawer-export-btn:hover {
  background: rgba(36,24,38,0.04); border-color: var(--bottle-dark);
}

.admin-drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #FAF8F5;
}
.btn-block-logout {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.admin-drawer-info {
  margin-top: 10px; font-size: 11px; color: var(--ink-light); text-align: center;
}

/* ---------- Admin Mobile Bottom Navigation Bar ---------- */
.admin-bottom-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 950;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(36,24,38,0.08);
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
}
.admin-bottom-bar-inner {
  display: flex; align-items: center; justify-content: space-around;
  max-width: 500px; margin: 0 auto;
}
.admin-bar-item {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 11px; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; background: transparent; border: none; cursor: pointer;
  min-width: 54px; gap: 3px; transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-bar-item .bar-icon { font-size: 18px; line-height: 1; transition: transform .15s ease; }
.admin-bar-item .bar-label { font-size: 10.5px; font-weight: 500; }
.admin-bar-item:hover, .admin-bar-item.active {
  color: var(--bottle);
}
.admin-bar-item.active .bar-label { font-weight: 700; }
.admin-bar-item:active .bar-icon { transform: scale(0.9); }

.admin-bar-item.btn-bar-primary {
  color: var(--bottle);
  padding: 0 8px;
}
.bar-primary-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bottle); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(30,122,63,0.35);
  margin-top: -12px; margin-bottom: 2px;
  transition: transform .15s ease, background-color .15s ease;
}
.admin-bar-item.btn-bar-primary:active .bar-primary-icon {
  transform: scale(0.92);
}

/* ---------- Main Container ---------- */
.admin-main {
  max-width: 1360px; width: 100%; margin: 28px auto; padding: 0 24px;
  flex: 1;
}

/* ---------- Flash Alerts ---------- */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 22px;
  font-size: 13.5px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm); animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: #EBF7EE; border: 1px solid #BCE5C5; color: #155724; }
.alert-danger  { background: #FDE8E8; border: 1px solid #F8B4B4; color: #9B1C1C; }
.alert-warning { background: #FEF8E7; border: 1px solid #FCE59F; color: #92400E; }
.alert-close {
  background: transparent; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* ---------- Header Page Bar ---------- */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-header h1 { font-size: 28px; color: var(--ink); margin-bottom: 4px; }
.page-header p { color: var(--ink-soft); font-size: 14px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Work Sans', sans-serif; font-size: 13px; font-weight: 600;
  padding: 9px 18px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: all .2s; outline: none;
}
.btn-bottle { background: var(--bottle); color: #fff; }
.btn-bottle:hover { background: var(--bottle-hover); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { opacity: 0.9; }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--paper); border-color: var(--ink); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 4px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; border-radius: 4px; }

/* ---------- KPI Grid ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.kpi-card {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.kpi-card.kpi-total::before    { background: var(--bottle-dark); }
.kpi-card.kpi-pending::before  { background: var(--brass); }
.kpi-card.kpi-contact::before  { background: var(--teal); }
.kpi-card.kpi-confirm::before  { background: var(--bottle); }
.kpi-card.kpi-enfant::before   { background: var(--clay); }
.kpi-card.kpi-pilates::before  { background: #8B5CF6; }

.kpi-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); font-weight: 600; margin-bottom: 8px;
}
.kpi-value {
  font-family: 'Fraunces', serif; font-size: 32px; line-height: 1;
  color: var(--ink); font-weight: 600;
}
.kpi-sub { font-size: 12px; color: var(--ink-light); margin-top: 6px; }

/* ---------- Panel & Table Card ---------- */
.panel {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 32px;
}

/* ---------- Toolbar (Filters & Search) ---------- */
.panel-toolbar {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: #FCFAF7; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-item { display: flex; align-items: center; gap: 6px; }
.filter-item label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; }

.form-select, .form-control {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-family: 'Work Sans', sans-serif; font-size: 13px;
  color: var(--ink); outline: none; transition: border-color .2s;
}
.form-select:focus, .form-control:focus {
  border-color: var(--bottle); box-shadow: 0 0 0 2px rgba(30,122,63,0.12);
}
.search-box { position: relative; min-width: 260px; }
.search-box input { width: 100%; padding-left: 32px; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-light); pointer-events: none;
}

/* ---------- Table ---------- */
.table-responsive { width: 100%; overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; text-align: left;
}
.table th {
  background: #F8F5F0; padding: 12px 16px; font-size: 11.5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px; border-bottom: 1px solid rgba(36,24,38,0.06);
  font-size: 13.5px; vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAF7F2; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px; font-size: 11.5px;
  font-weight: 600; white-space: nowrap; line-height: 1.2;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Status Badges */
.badge-status-en_attente { background: #FEF3C7; color: #92400E; }
.badge-status-en_attente .badge-dot { background: #F59E0B; }
.badge-status-contacte   { background: #DBEAFE; color: #1E40AF; }
.badge-status-contacte .badge-dot { background: #3B82F6; }
.badge-status-confirme   { background: #D1FAE5; color: #065F46; }
.badge-status-confirme .badge-dot { background: #10B981; }
.badge-status-annule     { background: #F3F4F6; color: #4B5563; }
.badge-status-annule .badge-dot { background: #9CA3AF; }

/* Parcours Badges */
.badge-parcours-enfant  { background: rgba(214,18,122,0.1); color: #9D174D; border: 1px solid rgba(214,18,122,0.2); }
.badge-parcours-pilates { background: rgba(92,22,80,0.1); color: #5C1650; border: 1px solid rgba(92,22,80,0.2); }
.badge-parcours-stage   { background: rgba(242,144,30,0.12); color: #C2410C; border: 1px solid rgba(242,144,30,0.25); }

/* Quick contact pills */
.contact-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.contact-link:hover { color: var(--bottle); text-decoration: underline; }
.wa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: #25D366;
  color: #fff; font-size: 11px; margin-left: 4px; text-decoration: none !important;
}

/* Action Dropdown / Buttons */
.action-buttons { display: flex; align-items: center; gap: 6px; }

/* Empty State */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--ink-soft);
}
.empty-state h3 { font-size: 20px; color: var(--ink); margin-bottom: 6px; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,24,38,0.65);
  backdrop-filter: blur(4px); z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-dialog {
  background: #fff; border-radius: var(--radius-lg); width: 100%;
  max-width: 640px; box-shadow: var(--shadow-lg); overflow: hidden;
  max-height: 85vh; max-height: 85dvh; display: flex; flex-direction: column;
  position: relative; margin: auto;
  animation: modalUp .25s ease;
}
@keyframes modalUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: #FCFAF7; flex-shrink: 0;
}
.modal-header h3 { font-size: 19px; color: var(--ink); }
.modal-close {
  background: transparent; border: none; font-size: 24px; line-height: 1;
  color: var(--ink-light); cursor: pointer; padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--ink); background: rgba(36,24,38,0.06); }

.modal-body {
  padding: 20px 24px;
  overflow-y: scroll !important;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--bottle) #F3EFEA;
}
.modal-body::-webkit-scrollbar {
  width: 8px;
  display: block;
}
.modal-body::-webkit-scrollbar-track {
  background: #F3EFEA;
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--bottle);
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--bottle-hover);
}

.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  background: #FCFAF7; flex-shrink: 0;
}

/* Detail Modal Grid */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;
}
.detail-item {
  padding: 12px 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.detail-item.full { grid-column: 1/-1; }
.detail-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); font-weight: 600; margin-bottom: 4px;
}
.detail-value { font-size: 14.5px; font-weight: 500; color: var(--ink); }

/* Form inputs in Modals */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 6px;
}
.form-group .form-control, .form-group .form-select { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Login Page specific styling */
.login-body {
  background: linear-gradient(135deg, #1E7A3F 0%, #5C1650 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--paper); border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(0,0,0,0.3); width: 100%; max-width: 440px;
  padding: 42px 36px; border: 1px solid rgba(255,255,255,0.2);
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand img { height: 48px; margin: 0 auto 12px; }
.login-brand h2 { font-size: 24px; color: var(--ink); }
.login-brand p { font-size: 13px; color: var(--ink-soft); }

/* Footer */
.admin-footer {
  text-align: center; padding: 24px; font-size: 12.5px; color: var(--ink-light);
  border-top: 1px solid var(--line); background: var(--paper-card); margin-top: auto;
}

/* ---------- Pagination ---------- */
.pagination-container {
  padding: 14px 20px;
  background: #FCFAF7;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.pagination-info {
  font-size: 13px;
  color: var(--ink-soft);
}
.pagination-info strong {
  color: var(--ink);
}
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.per-page-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.form-select-sm {
  padding: 4px 8px;
  font-size: 12px;
  height: 30px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all .2s;
}
.page-link:hover:not(.disabled):not(.active) {
  background: var(--paper);
  border-color: var(--bottle);
  color: var(--bottle);
}
.page-link.active {
  background: var(--bottle);
  border-color: var(--bottle);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.page-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.page-dots {
  color: var(--ink-light);
  padding: 0 4px;
  font-size: 12px;
}

@media (max-width: 860px) {
  body.admin-drawer-open { overflow: hidden; }
  .nav-links, .nav-user { display: none; }
  .nav-mobile-actions { display: flex; }
  .nav-container { height: 58px; padding: 0 16px; flex-direction: row; align-items: center; justify-content: space-between; }
  
  .admin-main { margin: 16px auto; padding: 0 14px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .page-header h1 { font-size: 22px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-actions .btn { flex: 1; text-align: center; min-width: 140px; }
  
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
  .detail-grid, .form-row { grid-template-columns: 1fr; }
  
  .filter-card .filter-form { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-group { width: 100%; }
  .filter-group select, .filter-group input { width: 100%; }
}

@media (max-width: 768px) {
  body { padding-bottom: 74px; }
  .admin-bottom-bar { display: block; }
  
  .pagination-container {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 16px;
  }
  .pagination-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .per-page-selector { justify-content: center; }
  .pagination { justify-content: center; flex-wrap: wrap; }
  
  .admin-footer {
    padding: 24px 16px 36px;
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-light);
  }
}

@media (max-width: 480px) {
  .nav-title span { display: none; }
  .nav-title { font-size: 16px; }
  .nav-logo { height: 28px; }
  
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 12px 10px; }
  .kpi-number { font-size: 22px; }
  .kpi-title { font-size: 10px; }
  
  .modal-dialog {
    max-width: 95vw;
    margin: 10px auto;
    max-height: 92vh;
    border-radius: var(--radius);
  }
  .modal-header { padding: 12px 14px; }
  .modal-header h3 { font-size: 16px; }
  .modal-body { padding: 14px; }
  .modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .btn { width: 100%; }
}
