:root {
  /* Modern Deep Slate & Sapphire Palette */
  --bg-main: #090d16;
  --bg-sidebar: #0e1322;
  --bg-card: #13192b;
  --bg-card-hover: #1a2238;
  --bg-card-subtle: #0f1526;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Official Scout Colors */
  --scout-gold: #f59e0b;
  --scout-gold-light: #fbbf24;
  --scout-gold-bg: rgba(245, 158, 11, 0.12);

  --scout-red: #e11d48;
  --scout-red-light: #f43f5e;
  --scout-red-bg: rgba(225, 29, 72, 0.12);

  --scout-green: #10b981;
  --scout-green-light: #34d399;
  --scout-green-bg: rgba(16, 185, 129, 0.12);

  --scout-blue: #3b82f6;
  --scout-blue-light: #60a5fa;
  --scout-blue-bg: rgba(59, 130, 246, 0.12);

  --scout-manada: #f59e0b;
  --scout-tropa: #3b82f6;
  --scout-comandos: #e11d48;
  --scout-rovers: #10b981;
  --scout-kraal: #8b5cf6;

  --font-title: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 21, 38, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================
   SIDEBAR & NAVIGATION
   ========================================== */
/* Mobile Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.btn-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
}
.btn-sidebar-close:hover {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border-color: var(--scout-red);
}

.btn-burger-admin {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.btn-burger-admin span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.btn-burger-admin:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--scout-gold);
}
.btn-burger-admin:hover span {
  background: var(--scout-gold-light);
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  flex-shrink: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.admin-brand svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.3));
}

.admin-brand .brand-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
}

.admin-brand .brand-sub {
  display: block;
  font-size: 11px;
  color: var(--scout-gold);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--scout-gold-light);
  font-weight: 600;
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
}

.nav-badge {
  background: var(--scout-red);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sidebar-link {
  color: var(--text-muted);
  font-size: 12.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

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

/* ==========================================
   MAIN CONTENT & HEADER
   ========================================== */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

.admin-header {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.header-title {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px 4px 6px;
  border-radius: 30px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--scout-gold), var(--scout-red));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.btn-logout {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #fda4af;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--scout-red);
  color: #fff;
  border-color: var(--scout-red);
}

.admin-body {
  padding: 28px 32px;
  flex-grow: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================
   KPIS & DASHBOARD CARDS
   ========================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--scout-red);
}

.kpi-card.kpi-gold::before { background: var(--scout-gold); }
.kpi-card.kpi-green::before { background: var(--scout-green); }
.kpi-card.kpi-blue::before { background: var(--scout-blue); }

.kpi-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-value {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================
   TABLES & CONTROLS
   ========================================== */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  margin-top: 20px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.table-header-bar {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card-subtle);
  border-radius: 14px 14px 0 0;
}

.table-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input, .select-filter {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.search-input:focus, .select-filter:focus {
  outline: none;
  border-color: var(--scout-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.admin-table th {
  background: rgba(14, 19, 34, 0.9);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.clickable-row:hover td {
  background: rgba(245, 158, 11, 0.06) !important;
}

/* Scout Clickable Chips */
.scout-chip-clickable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 3px 4px 3px 0;
}

.scout-chip-clickable:hover {
  border-color: var(--scout-gold);
  background: rgba(245, 158, 11, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Rama Filter Buttons Bar */
.rama-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(10, 14, 24, 0.95);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.rama-filter-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.btn-rama-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-rama-filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-rama-filter .filter-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.btn-rama-filter.active {
  font-weight: 700;
}

.btn-rama-filter.active[data-rama="todos"] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.btn-rama-filter.active[data-rama="todos"] .filter-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-rama-filter.active.btn-rama-manada {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}
.btn-rama-filter.active.btn-rama-manada .filter-count-badge {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.btn-rama-filter.active.btn-rama-tropa {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}
.btn-rama-filter.active.btn-rama-tropa .filter-count-badge {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.btn-rama-filter.active.btn-rama-comandos {
  background: rgba(225, 29, 72, 0.16);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.5);
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.2);
}
.btn-rama-filter.active.btn-rama-comandos .filter-count-badge {
  background: rgba(225, 29, 72, 0.3);
  color: #fda4af;
}

.btn-rama-filter.active.btn-rama-rovers {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}
.btn-rama-filter.active.btn-rama-rovers .filter-count-badge {
  background: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ==========================================
   STATUS BADGES & PILLS
   ========================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.status-pendiente { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.status-contactado { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.status-admitido { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-completado { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-descartado { background: rgba(225, 29, 72, 0.15); color: #fda4af; border: 1px solid rgba(225, 29, 72, 0.35); }

/* Branch Badges */
.status-manada { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid #f59e0b; }
.status-tropa { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid #3b82f6; }
.status-comandos { background: rgba(225, 29, 72, 0.18); color: #fda4af; border: 1px solid #e11d48; }
.status-rovers { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid #10b981; }
.status-kraal, .status-apoyo, .status-general { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border: 1px solid #8b5cf6; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn-admin {
  background: var(--scout-red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
}

.btn-admin:hover {
  background: var(--scout-red-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

.btn-admin-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-admin-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-admin-gold {
  background: var(--scout-gold);
  color: #090d16;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.btn-admin-gold:hover {
  background: var(--scout-gold-light);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.btn-admin-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 600;
}
.btn-admin-success:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.btn-admin-danger {
  background: rgba(225, 29, 72, 0.15);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
  font-weight: 600;
}
.btn-admin-danger:hover {
  background: #e11d48;
  color: #fff;
  border-color: #e11d48;
}

/* =========================================================
   EXPEDIENTE STUDIO MODAL (AMPLIO, DINÁMICO Y ELEGANTE)
   ========================================================= */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 16, 0.82);
  backdrop-filter: blur(10px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.drawer-panel {
  width: min(1140px, 95vw);
  height: min(880px, 90vh);
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(227, 168, 21, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active .drawer-panel {
  transform: scale(1) translateY(0);
}

/* Studio Top Bar */
.drawer-top-bar {
  padding: 14px 24px;
  background: rgba(14, 19, 32, 0.98);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.drawer-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-drawer-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-drawer-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-drawer-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-drawer-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.btn-drawer-close:hover {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border-color: var(--scout-red);
}

/* Studio 2-Column Responsive Layout */
.drawer-studio-layout {
  display: flex;
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 860px) {
  .drawer-studio-layout {
    flex-direction: column;
  }
  .drawer-sidebar-col {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    max-height: 260px;
  }
}

/* Sidebar Column: Profile & Info */
.drawer-sidebar-col {
  width: 340px;
  flex-shrink: 0;
  background: rgba(14, 19, 32, 0.5);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-profile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--scout-gold);
  color: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.drawer-scout-name {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-scout-meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Quick Contact Chips (Minimalist, No Tacky Emojis) */
.contact-chips-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.2s;
}

.contact-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.contact-chip.chip-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.35);
  color: #4ade80;
}
.contact-chip.chip-whatsapp:hover {
  background: rgba(37, 211, 102, 0.22);
}

.contact-chip.chip-phone {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* Compliance Status Badges List */
.compliance-badges-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.compliance-badge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.compliance-badge-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* Allergy / Medical Notice */
.medical-notice-bar {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.medical-notice-alert {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: #fda4af;
}

.medical-notice-ok {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* Main Studio Column: Documents & Actions */
.drawer-main-col {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #0d121e;
}

/* Progress & Filter Bar */
.drawer-progress-box {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--scout-gold), #10b981);
  transition: width 0.4s ease;
}

.progress-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.drawer-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.drawer-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.drawer-filter-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.drawer-section-title {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Modern Document Cards Grid (Spacious Responsive) */
.doc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.doc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.doc-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.doc-card-clickable {
  cursor: pointer;
}

.doc-card-clickable:hover {
  border-color: var(--scout-gold);
  background: rgba(245, 158, 11, 0.04);
}

.doc-card-pending {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
}

.doc-card-pending:hover {
  border-color: var(--scout-gold);
  background: rgba(245, 158, 11, 0.05);
}

.doc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.doc-card-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 0%;
  min-width: 0;
}

.doc-card-info > div {
  min-width: 0;
  flex: 1 1 auto;
}

.doc-card-status-badge {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.doc-card-icon {
  font-size: 26px;
  line-height: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  flex-shrink: 0;
}

.doc-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
}


.doc-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.doc-card-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-reject-banner {
  background: rgba(225, 29, 72, 0.1);
  border-left: 3px solid var(--scout-red);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #fda4af;
}

/* Document Action Buttons Bar */
.doc-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-actions-left {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.doc-actions-right {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

/* Inline Upload Dropzone */
.drawer-upload-box {
  background: rgba(245, 158, 11, 0.04);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 10px;
}

.drawer-upload-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--scout-gold-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   IN-APP DOCUMENT LIGHTBOX PREVIEWER
   ========================================== */
.doc-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.doc-preview-overlay.active {
  display: flex;
}

.doc-preview-modal {
  width: 94vw;
  max-width: 1080px;
  height: 90vh;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.doc-preview-header {
  padding: 14px 22px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

.doc-preview-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doc-preview-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.doc-preview-content {
  flex-grow: 1;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 16px;
}

.doc-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  border-radius: 8px;
}

.doc-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   STANDARD MODALS & FORMS
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal-card-lg {
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover { 
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border-color: var(--scout-red);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Global Dark & Modern Form Controls */
.modal-card input,
.modal-card select,
.modal-card textarea,
.form-group input,
.form-group select,
.form-group textarea {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  color-scheme: dark;
  width: 100%;
  box-sizing: border-box;
}

.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--scout-gold);
  background: #0d1424;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.modal-card select,
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fbbf24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 14px;
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
}

.modal-card input::placeholder,
.form-group input::placeholder {
  color: #64748b;
}

/* Modern Sibling Row Cards (Hijos / Hermanos) */
.sibling-row {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 36px;
  gap: 10px;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.sibling-row:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(23, 32, 48, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.sibling-row .btn-remove-sibling {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #fda4af;
  width: 36px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s ease;
  line-height: 1;
}

.sibling-row .btn-remove-sibling:hover {
  background: #e11d48;
  color: #fff;
  border-color: #e11d48;
  transform: scale(1.06);
}

@media (max-width: 640px) {
  .sibling-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==========================================
   GENERIC MODALS & OVERLAYS
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.modal-title {
  font-family: var(--font-title);
  font-size: 17px;
  color: #fff;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: #fff;
}

/* Document Lightbox Previewer */
.doc-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.9);
  backdrop-filter: blur(14px);
  z-index: 3500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.doc-preview-overlay.active {
  display: flex !important;
}

.doc-preview-modal {
  background: #111726;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  height: min(880px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.doc-preview-header {
  padding: 16px 20px;
  background: rgba(14, 19, 32, 0.98);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.doc-preview-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.doc-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-preview-content {
  flex: 1;
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.doc-preview-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.doc-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Login Screen Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #10172a 0%, #060911 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4));
}

.login-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-credentials-hint {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  color: #fbbf24;
  margin-bottom: 20px;
  text-align: left;
}

/* Quick Reason Selection Pills */
.quick-reason-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-reason-pill {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-reason-pill:hover {
  background: rgba(225, 29, 72, 0.15);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 16px;
  }
  .admin-header {
    padding: 0 16px;
  }
  .admin-body {
    padding: 16px;
  }
  .drawer-panel {
    max-width: 100%;
  }
  .drawer-hero {
    padding: 16px;
  }
  .drawer-scroll-body {
    padding: 16px;
  }
  .doc-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .doc-actions-right {
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* Spinner & Loading Feedback for Cloud Drive Sync */
.btn-loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.85 !important;
  cursor: not-allowed !important;
}

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: btn-spin-anim 0.65s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

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

/* Password Input Toggle Minimalist */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrap input {
  width: 100%;
  padding-right: 44px !important;
}
.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: color 0.18s ease, transform 0.15s ease;
  z-index: 2;
}
.btn-toggle-password:hover {
  color: #fbbf24;
  transform: translateY(-50%) scale(1.08);
}
.btn-toggle-password svg {
  display: block;
}

/* Minimalist Action Icon Buttons in Tables */
.btn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}
.btn-action-icon:hover {
  transform: translateY(-1px);
}
.btn-action-add:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.btn-action-edit:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}
.btn-action-delete:hover {
  background: rgba(225, 29, 72, 0.15);
  border-color: rgba(225, 29, 72, 0.45);
  color: #fda4af;
}

/* ==========================================
   GESTOR DE FOTOS DE ÁLBUM (MODAL STUDIO)
   ========================================== */
#modal-admin-album-photos .modal-card {
  max-width: 1160px;
  width: 95vw;
  height: 88vh;
  max-height: 88vh;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 20px 24px;
  box-sizing: border-box;
}

.admin-album-photos-scroll-wrap {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  padding: 6px 10px 20px 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scout-gold) rgba(0, 0, 0, 0.3);
}

.admin-album-photos-scroll-wrap::-webkit-scrollbar {
  width: 8px;
  display: block;
}
.admin-album-photos-scroll-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}
.admin-album-photos-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--scout-gold);
  border-radius: 8px;
}
.admin-album-photos-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--scout-gold-light);
}

#admin-album-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  width: 100%;
  height: auto;
  align-content: start;
}

.admin-photo-card {
  background: #0b101d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
}
.admin-photo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   RESPONSIVE DESIGN SYSTEM (TABLETS & SMARTPHONES)
   ========================================================= */

@media (max-width: 992px) {
  body {
    overflow-x: hidden;
  }

  /* Off-canvas Mobile Sidebar */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
    padding: 20px 16px;
    background: #0b101e;
  }

  .admin-sidebar.mobile-open {
    transform: translateX(0);
  }

  .btn-sidebar-close {
    display: flex;
  }

  .btn-burger-admin {
    display: flex;
  }

  .admin-main {
    width: 100%;
    min-width: 0;
  }

  .admin-header {
    padding: 0 16px;
    height: 58px;
  }

  .admin-body {
    padding: 18px 14px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Table Controls Stack */
  .table-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .table-controls {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .table-controls .search-input,
  .table-controls .select-filter,
  .table-controls .btn-admin,
  .table-controls .btn-admin-secondary {
    width: 100%;
    box-sizing: border-box;
  }

  /* Subtabs and pills horizontal scrolling */
  .rama-filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 10px 14px;
    gap: 6px;
  }

  .btn-rama-filter {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  /* Login Box Mobile Optimization */
  .login-overlay {
    padding: 14px;
    align-items: center;
  }

  .login-box {
    padding: 24px 16px;
    max-width: 100%;
    width: 100%;
    border-radius: 16px;
  }

  .login-title {
    font-size: 20px;
  }

  .login-credentials-hint {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Header Optimization */
  .admin-header {
    padding: 0 12px;
    height: 54px;
  }

  .header-title {
    font-size: 16px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 8px;
  }

  .header-user {
    gap: 8px;
  }

  .user-badge {
    padding: 3px 6px;
    border: none;
    background: transparent;
  }

  .user-badge span#current-user-name {
    display: none;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .btn-logout {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 6px;
  }

  /* Admin Body & Cards */
  .admin-body {
    padding: 12px 10px;
  }

  .kpi-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .kpi-sub {
    font-size: 11px;
  }

  /* Tables Scrollable Container */
  .table-container {
    border-radius: 10px;
    margin-top: 12px;
    box-shadow: none;
    border: 1px solid var(--border);
  }

  .admin-table {
    min-width: 620px;
    font-size: 12.5px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  /* Modal Cards & Dialogs */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card,
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    padding: 20px 14px !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
    width: 100%;
  }

  .modal-actions button,
  .modal-actions .btn-admin,
  .modal-actions .btn-admin-secondary {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Studio Drawer Fullscreen on Mobile */
  .drawer-overlay {
    padding: 0;
  }

  .drawer-panel {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
  }

  .drawer-top-bar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .drawer-studio-layout {
    flex-direction: column;
    overflow-y: auto;
  }

  .drawer-sidebar-col {
    width: 100% !important;
    max-height: none;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding: 14px;
  }

  .drawer-content-col {
    width: 100% !important;
    padding: 14px;
    min-height: 380px;
  }

  /* Form Layouts */
  .form-grid-2,
  .form-grid-3,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Photo Studio Grid */
  #admin-album-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
    gap: 8px !important;
  }

  #modal-admin-album-photos .modal-card {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 14px 10px !important;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .header-title {
    font-size: 15px;
    max-width: 120px;
  }

  .btn-admin,
  .btn-admin-secondary {
    font-size: 13px;
    padding: 8px 12px;
  }

  .admin-table {
    min-width: 560px;
  }
}

/* =========================================================================
   SCOUTER GESTOR (JEFAZO) ROLE RESTRICTIONS:
   Read-only everywhere except Galería de Fotos & Documentación del Kraal
   ========================================================================= */
body.role-scouter-gestor .admin-only-action {
  display: none !important;
}

body.role-scouter-gestor .admin-only-disabled {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.role-badge-gestor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

/* =========================================================================
   LIGA KRAAL & COMPETICIÓN DE SCOUTERS (GAMIFICACIÓN)
   ========================================================================= */

/* Podio TOP 3 Grid */
.kraal-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 16px;
  align-items: end;
  max-width: 820px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .kraal-podium-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
  }
}

.podium-card {
  position: relative;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.podium-card:hover {
  transform: translateY(-4px);
}

.podium-card-gold {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.18) 0%, rgba(20, 24, 33, 0.95) 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
  z-index: 2;
}

@media (max-width: 768px) {
  .podium-card-gold {
    transform: none;
    order: -1;
  }
}

.podium-card-silver {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.15) 0%, rgba(20, 24, 33, 0.95) 100%);
  border: 1.5px solid #94a3b8;
  box-shadow: 0 6px 20px rgba(148, 163, 184, 0.15);
}

.podium-card-bronze {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.15) 0%, rgba(20, 24, 33, 0.95) 100%);
  border: 1.5px solid #d97706;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.15);
}

.podium-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}

.podium-rank-gold {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.podium-rank-silver {
  background: #94a3b8;
  color: #000;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
}

.podium-rank-bronze {
  background: #d97706;
  color: #fff;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.podium-card-gold .podium-avatar {
  width: 76px;
  height: 76px;
  font-size: 24px;
  border-color: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.4);
}

.podium-name {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-card-gold .podium-name {
  font-size: 18px;
  color: #fbbf24;
}

.podium-rol {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.podium-points {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 6px;
}

.podium-card-gold .podium-points {
  font-size: 24px;
  color: #f59e0b;
}

.podium-level-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Gráfica de Barras Comparativa */
.kraal-bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}

.kraal-bar-scouter-info {
  width: 170px;
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.kraal-bar-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.kraal-bar-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kraal-bar-track {
  flex: 1;
  height: 22px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.kraal-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 50%, #f59e0b 100%);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 8px;
}

.kraal-bar-pts-tag {
  width: 75px;
  min-width: 75px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--scout-gold);
}

/* Scouter Checklist Chips in Modal */
.scouter-check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.scouter-check-card:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

.scouter-check-card.checked {
  background: rgba(245, 158, 11, 0.14);
  border-color: #f59e0b;
}

.scouter-check-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #f59e0b;
  cursor: pointer;
}



