/* ============================================================================
   FOREST ACADEMY THEME — Proyecto Árbol UNAM 475
   Earth tones, organic shapes, refined typography, ambient animations.
   ============================================================================ */

:root {
  /* Earth tones */
  --primary: #2d5016;
  --primary-light: #4a7c2a;
  --primary-dark: #1b3a0a;
  --secondary: #8b6f47;
  --accent: #d4a574;
  --moss: #708a3e;
  --leaf: #95b86c;
  --bark: #5d4e37;
  --soil: #3d2817;
  /* Background */
  --bg-cream: #faf6ef;
  --bg-warm: #f5ede0;
  --bg-card: rgba(255,253,247,0.85);
  --bg-dark: #1c2912;
  /* Text */
  --text-dark: #2d2418;
  --text-light: #6a5d4d;
  --text-muted: #a09584;
  /* Status */
  --success: #5e9c43;
  --danger: #b54f3a;
  --warning: #d49b3a;
  --info: #5b8b7d;
  /* Borders, shadows */
  --border-light: rgba(139,111,71,0.18);
  --shadow-soft: 0 4px 20px rgba(45,80,22,0.08);
  --shadow-medium: 0 8px 30px rgba(45,80,22,0.12);
  --shadow-deep: 0 16px 50px rgba(45,80,22,0.18);
  /* Radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-organic: 24px 22px 28px 20px;
  /* Transitions */
  --transition: 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 600ms cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .forest-backdrop, .root-decoration { display: none !important; }
}

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

/* ============================================================================
   Background animado — transiciones intensas de color
   Paleta extendida: verde forest + crema + durazno + lila + rosa + menta
   Animación rápida (18s) con MUCHOS keyframes para movimiento dinámico.
   Opacidad alta (0.45-0.60) para que los colores se vean fuertes.
   ============================================================================ */
@keyframes ambientShift {
  0%, 100% {
    background-position:
      0% 0%,
      100% 100%,
      50% 50%,
      20% 80%,
      80% 20%;
    background-size: 170% 170%, 200% 200%, 220% 220%, 180% 180%, 200% 200%;
  }
  14% {
    background-position:
      30% 15%,
      75% 90%,
      40% 60%,
      55% 35%,
      35% 65%;
    background-size: 200% 200%, 170% 170%, 200% 200%, 220% 220%, 180% 180%;
  }
  28% {
    background-position:
      55% 35%,
      45% 65%,
      20% 75%,
      85% 50%,
      15% 85%;
    background-size: 180% 180%, 230% 230%, 170% 170%, 200% 200%, 220% 220%;
  }
  42% {
    background-position:
      75% 55%,
      25% 45%,
      70% 30%,
      40% 70%,
      60% 30%;
    background-size: 220% 220%, 190% 190%, 240% 240%, 170% 170%, 200% 200%;
  }
  57% {
    background-position:
      45% 75%,
      55% 25%,
      85% 45%,
      25% 60%,
      75% 40%;
    background-size: 190% 190%, 210% 210%, 180% 180%, 250% 250%, 170% 170%;
  }
  71% {
    background-position:
      15% 60%,
      80% 35%,
      30% 80%,
      70% 25%,
      45% 75%;
    background-size: 230% 230%, 180% 180%, 200% 200%, 190% 190%, 230% 230%;
  }
  85% {
    background-position:
      35% 25%,
      65% 75%,
      55% 50%,
      45% 55%,
      55% 45%;
    background-size: 200% 200%, 220% 220%, 190% 190%, 200% 200%, 210% 210%;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px; line-height: 1.6;
  color: var(--text-dark);
  background-color: #fbf7ee;
  background-image:
    /* Verde forest — saturación subida */
    radial-gradient(circle at 15% 12%, rgba(74,124,42,0.55) 0px, transparent 50%),
    /* Durazno cálido */
    radial-gradient(circle at 85% 88%, rgba(255,165,120,0.50) 0px, transparent 55%),
    /* Lila vibrante */
    radial-gradient(circle at 50% 50%, rgba(190,145,225,0.48) 0px, transparent 55%),
    /* Rosa coral */
    radial-gradient(circle at 20% 80%, rgba(250,165,190,0.48) 0px, transparent 55%),
    /* Verde menta */
    radial-gradient(circle at 80% 20%, rgba(120,210,170,0.45) 0px, transparent 50%);
  background-attachment: fixed;
  background-size: 180% 180%;
  animation: ambientShift 18s ease-in-out infinite;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Respetar usuarios con preferencia de reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

h1, h2, h3, .navbar-brand-main, .login-logo-text {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-weight: 600; color: var(--primary-dark);
  letter-spacing: -0.01em; line-height: 1.2;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 0.5rem; font-family: 'Inter', sans-serif; }
h5 { font-size: 1rem; font-weight: 600; color: var(--primary-dark); }
p { margin-bottom: 0.75rem; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ============================================================
   Forest backdrop: falling leaves + ambient glow
   ============================================================ */
.forest-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;  /* fallback for old iOS */
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  -webkit-transform: translateZ(0);  /* iOS rendering hint */
}

/* Variante: leaves contained in a section (for login over photo) */
.forest-backdrop.contained {
  position: absolute;
  z-index: 2;  /* above .login-container::before overlay (z:1), below login-box */
}

.leaf-falling {
  position: absolute;
  top: -40px;
  width: 24px; height: 24px;
  opacity: 0;
  animation: leaf-fall linear infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes leaf-fall {
  0%   { transform: translateY(-40px) translateX(0)  rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.55; }
  50%  { transform: translateY(50vh)  translateX(30px) rotate(180deg); }
  90%  { opacity: 0.55; }
  100% { transform: translateY(110vh) translateX(-25px) rotate(540deg); opacity: 0; }
}

/* Decorative growing root SVG */
.root-decoration {
  position: absolute; pointer-events: none;
  opacity: 0.20;
}
.root-decoration path {
  fill: none; stroke: var(--primary);
  stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  animation: root-grow 3.2s 0.5s ease-out forwards;
}
@keyframes root-grow { to { stroke-dashoffset: 0; } }

/* Gentle sway used in tree icons */
@keyframes gentle-sway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 1280px; margin: 0 auto;
  padding: 0 1.5rem; position: relative; z-index: 1;
}

.main-content { padding: 2rem 0 4rem; position: relative; z-index: 1; }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: rgba(255,253,247,0.78);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 12px rgba(45,80,22,0.04);
}

.navbar-content {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.navbar-logo { display: flex; align-items: center; gap: 0.85rem; }
.navbar-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(45,80,22,0.20);
  transition: transform 200ms ease;
}
.navbar-logo-icon:hover { transform: scale(1.05); }

.navbar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.navbar-brand-main {
  font-size: 1.3rem; font-weight: 700;
  color: var(--primary-dark);
}
.navbar-brand-sub {
  font-size: 0.7rem; color: var(--text-light);
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.navbar-nav { display: flex; gap: 0.4rem; align-items: center; }

.nav-link {
  padding: 0.55rem 1rem;
  color: var(--text-dark); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
  border-radius: 12px;
  transition: var(--transition);
  position: relative;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.nav-link:hover { background: rgba(74,124,42,0.08); color: var(--primary-dark); }
.nav-link.active {
  background: var(--primary-dark); color: white;
  box-shadow: 0 4px 14px rgba(45,80,22,0.25);
}
.nav-link.active::after {
  content: ''; position: absolute;
  bottom: -4px; left: 50%;
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  transform: translateX(-50%);
}

/* User menu */
.navbar-user { position: relative; }
.user-dropdown { position: relative; }
.user-menu-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
}
.user-menu-btn:hover { background: var(--bg-card); box-shadow: var(--shadow-soft); }

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--moss));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-family: 'Playfair Display', serif;
}

.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
  min-width: 250px; padding: 0.5rem 0;
  display: none; z-index: 100;
}
.dropdown-menu.show { display: block; animation: dropdown-in 220ms ease-out; }
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.6rem 1.25rem;
  color: var(--text-dark); text-decoration: none;
  font-size: 0.9rem; background: transparent; border: none;
  cursor: pointer; text-align: left;
  transition: background var(--transition);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-warm); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 0.4rem 0; }

/* ============================================================
   Login screen — hero photo background + overlay
   ============================================================ */
.login-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; position: relative;
  /* Capa 1 (renderiza inmediato): gradient verde-tierra → mientras carga la foto
     Capa 2 (cuando termine de descargar): foto encima */
  background-color: #2d5016;
  background-image:
    url('img/background.jpg'),
    linear-gradient(180deg, #6a8d4a 0%, #4a6e2a 35%, #5d4e37 70%, #3d2817 100%);
  background-size: cover, cover;
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  overflow: hidden;
}

/* Overlay degradado para legibilidad del login-box.
   Vignette + tinte verde-cálido coherente con el tema. */
.login-container::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(15,30,5,0.20) 0%, rgba(15,30,5,0.55) 100%),
    linear-gradient(135deg, rgba(45,80,22,0.25) 0%, rgba(60,40,15,0.30) 100%);
  pointer-events: none; z-index: 1;
}

/* En móvil, evitar background-attachment:fixed (problemas de performance/iOS) */
@media (max-width: 768px) {
  .login-container { background-attachment: scroll; }
}

.login-box {
  background: rgba(255,253,247,0.42);          /* mucho más translúcido */
  backdrop-filter: blur(32px) saturate(170%);
  -webkit-backdrop-filter: blur(32px) saturate(170%);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem 2.5rem;
  width: 100%; max-width: 440px;
  /* Sombras pronunciadas para definir el borde sobre cualquier foto */
  box-shadow:
    0 30px 80px rgba(0,0,0,0.40),
    0 12px 30px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.05);
  position: relative; z-index: 5;
  animation: card-rise 700ms cubic-bezier(0.16,1,0.3,1);
}

/* Fallback para navegadores SIN backdrop-filter (Firefox viejos):
   se hace menos transparente para mantener legibilidad */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-box { background: rgba(255,253,247,0.92); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.01em; margin-bottom: 0.25rem;
}
.login-logo-subtitle {
  font-size: 0.78rem; color: var(--text-light);
  letter-spacing: 0.10em; text-transform: uppercase;
}

.login-form-group { margin-bottom: 1.25rem; }
.login-form-group label {
  display: block; font-size: 0.74rem;
  font-weight: 600; color: var(--primary-dark);
  margin-bottom: 0.4rem; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-form-group input {
  width: 100%; padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  background: rgba(255,253,247,0.7);
  font-size: 0.95rem; font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  transition: var(--transition);
}
.login-form-group input:focus {
  outline: none; border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(74,124,42,0.12);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn, .login-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border: none; border-radius: 12px;
  font-size: 0.92rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  position: relative; overflow: hidden;
}

.login-btn {
  width: 100%; margin-top: 0.5rem;
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 6px 20px rgba(45,80,22,0.25);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(45,80,22,0.35); }
.login-btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(45,80,22,0.20);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(45,80,22,0.32); color: white; }

.btn-secondary {
  background: var(--bg-warm); color: var(--primary-dark);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: white; box-shadow: var(--shadow-soft); }

.btn-outline {
  background: transparent; color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c5634d);
  color: white;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(181,79,58,0.30); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; border-radius: 8px; }

.login-footer { margin-top: 2rem; text-align: center; }

.error-message {
  background: rgba(181,79,58,0.10); color: var(--danger);
  padding: 0.75rem 1rem; border-radius: 10px;
  border-left: 3px solid var(--danger);
  margin-bottom: 1rem; font-size: 0.85rem;
  display: none;
}
.error-message:not(:empty) { display: block; }

/* ============================================================
   Sections + cards
   ============================================================ */
.page-section { display: none; }
.page-section.active { display: block; animation: section-in 500ms cubic-bezier(0.16,1,0.3,1); }
@keyframes section-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card, .tree-card, .tip-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  position: relative;
}
.card:hover, .tip-card:hover { box-shadow: var(--shadow-medium); transform: translateY(-2px); }

.tree-card {
  border-radius: var(--radius-organic);
  background: linear-gradient(135deg, rgba(255,253,247,0.95), rgba(245,237,224,0.85));
}

.tree-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.25rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.tree-icon {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary-light), var(--moss));
  color: white;
  border-radius: 18px 16px 20px 14px;
  box-shadow: 0 6px 18px rgba(74,124,42,0.30);
  animation: gentle-sway 5s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.tree-header-content h3 { margin-bottom: 0.2rem; }

.tree-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 1rem;
}

.detail-item {
  background: rgba(255,253,247,0.6);
  border: 1px solid var(--border-light);
  border-radius: 10px; padding: 0.75rem 1rem;
}
.detail-label {
  font-size: 0.68rem; color: var(--text-light);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.25rem; font-weight: 600;
}
.detail-value {
  font-size: 0.95rem; font-weight: 600;
  color: var(--primary-dark);
}

.health-score {
  font-size: 2rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: var(--primary-dark);
}

/* mi-arbol tabs */
.mi-arbol-tab {
  background: var(--bg-warm); color: var(--primary-dark);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem; border-radius: 10px;
  cursor: pointer; font-size: 0.88rem; font-weight: 500;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.mi-arbol-tab.active, .mi-arbol-tab.btn-primary {
  background: var(--primary-dark); color: white; border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(45,80,22,0.25);
}
.mi-arbol-tab-content { display: none; }
.mi-arbol-tab-content.active { display: block; animation: section-in 320ms ease-out; }

/* ============================================================
   Admin panel
   ============================================================ */
.admin-panel {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-tab {
  background: var(--bg-warm); color: var(--primary-dark);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem; border-radius: 10px;
  cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.admin-tab:hover { background: white; }
.admin-tab.active {
  background: var(--primary-dark); color: white; border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(45,80,22,0.22);
  position: relative;
}
.admin-tab.active::after {
  content: ''; position: absolute;
  bottom: -1.05rem; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: section-in 320ms ease-out; }

.admin-form {
  background: rgba(255,253,247,0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-form h4 {
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--primary-dark);
}

/* ─── Secciones colapsables (<details class="admin-collapsible">) ─── */
.admin-collapsible > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  margin: -0.25rem 0 0;
}
.admin-collapsible > summary::-webkit-details-marker { display: none; }
.admin-collapsible > summary > h4 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
  transition: padding-bottom 0.2s ease, border-color 0.2s ease, margin-bottom 0.2s ease;
}
.admin-collapsible > summary > h4::before {
  content: '▶';
  display: inline-block;
  font-size: 0.7rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.admin-collapsible[open] > summary > h4::before { transform: rotate(90deg); }
.admin-collapsible[open] > summary > h4 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.admin-collapsible > summary:hover > h4 { color: var(--primary); }
.admin-collapsible:not([open]) { padding-top: 1rem; padding-bottom: 1rem; }

/* ─── Sort headers en tablas admin ─── */
/* El thead tiene fondo verde con color:white, así que las flechitas son blancas */
.sort-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: space-between;
  padding: 0.15rem 0.1rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.sort-header:hover {
  background: rgba(255,255,255,0.18);   /* overlay blanco sobre el verde */
}
.sort-header .sort-ind {
  font-size: 0.78rem;
  color: #ffffff;                       /* blanco explícito */
  opacity: 0.75;                        /* siempre visible */
  transition: opacity 0.15s ease, text-shadow 0.15s ease;
  letter-spacing: -0.02em;
  text-shadow: 0 0 2px rgba(0,0,0,0.3); /* leve contraste contra el verde */
  font-weight: 700;
}
.sort-header:hover .sort-ind {
  opacity: 1;
}
/* Cuando está activa (asc/desc), totalmente sólida */
.sort-header[data-sort-active] .sort-ind {
  opacity: 1;
  text-shadow: 0 0 4px rgba(255,255,255,0.5), 0 0 2px rgba(0,0,0,0.4);
}

.admin-content { padding: 0; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { margin-bottom: 0; }
.form-group label {
  display: block; font-size: 0.74rem; font-weight: 600;
  color: var(--primary-dark); margin-bottom: 0.35rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.form-group input, .form-group select, .form-group textarea,
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border-light);
  border-radius: 10px; background: white;
  font-size: 0.92rem; color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,124,42,0.10);
}
.form-group textarea, .admin-form textarea { resize: vertical; min-height: 60px; }

/* Tables */
.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: white; border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.admin-table thead {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
}
.admin-table th {
  padding: 0.85rem 1rem; text-align: left;
  font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 600;
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem; color: var(--text-dark);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: var(--bg-warm); }

/* Badges */
.badge {
  display: inline-block; padding: 0.18rem 0.55rem;
  border-radius: 8px; font-size: 0.7rem;
  font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-danger  { background: var(--danger); color: white; }
.badge-info    { background: var(--info); color: white; }

/* Tips */
.tips-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.tip-card {
  border-radius: var(--radius-organic);
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, rgba(255,253,247,0.95), rgba(245,237,224,0.6));
  display: flex; gap: 1rem;
}
.tip-icon {
  font-size: 2.3rem;
  filter: drop-shadow(0 4px 8px rgba(45,80,22,0.15));
  flex-shrink: 0;
}
.tip-content h4 { margin-bottom: 0.4rem; }
.tip-content ul { list-style: none; padding-left: 0; margin-top: 0.5rem; }
.tip-content ul li {
  padding: 0.2rem 0 0.2rem 1.25rem; position: relative;
  font-size: 0.85rem; color: var(--text-light);
}
.tip-content ul li::before {
  content: '🌿'; position: absolute; left: 0; font-size: 0.8rem;
}

/* PUM-AI */
.pum-ai-container {
  background: var(--bg-card); backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  height: 75vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-soft); overflow: hidden;
}
.pum-ai-messages { flex: 1; padding: 1.5rem; overflow-y: auto; }
.pum-ai-input-bar {
  border-top: 1px solid var(--border-light);
  padding: 1rem; background: white;
}

/* Specialist */
.specialist-container {
  display: grid; grid-template-columns: 380px 1fr;
  gap: 1.5rem;
}
.trees-list-panel, .tracking-panel {
  background: var(--bg-card); backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 1.5rem; border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
}
.tree-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; background: white;
  border: 1px solid var(--border-light);
  border-radius: 10px; margin-bottom: 0.5rem;
  cursor: pointer; transition: var(--transition);
}
.tree-list-item:hover {
  background: var(--bg-warm); border-color: var(--primary-light);
  transform: translateX(2px);
}
.tree-list-item-name { font-weight: 600; color: var(--primary-dark); }
.tree-list-item-code { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }

/* Grid utilities */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* Text utilities */
.text-small { font-size: 0.82rem; }
.text-muted { color: var(--text-light); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Toast */
#toast-container {
  position: fixed; top: 80px; right: 1.5rem;
  z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem;
}

@keyframes slideIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(20px); } }

/* Loading */
.loading {
  display: inline-block; width: 20px; height: 20px;
  border: 3px solid rgba(74,124,42,0.2);
  border-radius: 50%; border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 40px; height: 40px;
  border: 4px solid var(--bg-warm);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* Modal genérico (usado por showModal/closeModal) */
.modal {
  position: fixed; inset: 0;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(28,41,18,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 240ms ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  font-family: 'Inter', sans-serif;
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-deep);
  position: relative;
  animation: card-rise 320ms cubic-bezier(0.16,1,0.3,1);
}
.modal-header h3 {
  font-family: 'Playfair Display', serif;
  color: var(--primary-dark);
  margin: 0;
}
.modal-close {
  background: none; border: none;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer; color: var(--text-light);
  padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-warm); color: var(--primary-dark); }

@media (max-width: 768px) {
  .modal-content { max-width: 95vw; padding: 1.25rem; }
}

/* Empty / hidden */
.hidden { display: none !important; }
.visible { display: block !important; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state-icon {
  font-size: 4rem; margin-bottom: 1rem;
  color: var(--primary); opacity: 0.4;
  animation: gentle-sway 4s ease-in-out infinite;
}

/* Assignment badge */
.assignment-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 0.8rem; font-weight: 500;
}
.assignment-badge-user  { background: rgba(74,124,42,0.12);  color: var(--primary-dark); }
.assignment-badge-group { background: rgba(212,165,116,0.20); color: #8b5a30; }

/* Login footer */
.login-footer { margin-top: 2rem; text-align: center; }
.login-footer p { color: var(--text-light); font-size: 0.82rem; margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .specialist-container { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .navbar-content { flex-wrap: wrap; gap: 0.75rem; }
  .navbar-brand-text { display: none; }

  .navbar-nav {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    width: 100%; gap: 0.25rem; padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
  }
  .nav-link { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; font-size: 0.85rem; padding: 0.4rem 0.75rem; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr !important; }
  .tree-details { grid-template-columns: 1fr 1fr; }

  /* Admin tabs scroll horizontal */
  .admin-tabs {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; gap: 0.25rem;
    padding: 0 0.5rem 0.75rem; margin: 0 -0.5rem 1rem;
  }
  .admin-tab {
    flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start;
    font-size: 0.78rem; padding: 0.45rem 0.75rem;
  }
  .admin-tab.active::after { display: none; }

  /* Tablas → tarjetas verticales */
  .admin-table { display: block; box-shadow: none; background: transparent; }
  .admin-table thead { display: none; }
  .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    background: white; border-radius: 10px; margin-bottom: 0.75rem;
    padding: 0.75rem; box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
  }
  .admin-table td {
    padding: 0.4rem 0; border: none;
    padding-left: 40%; position: relative; min-height: 1.5rem;
  }
  .admin-table td::before {
    content: attr(data-label);
    position: absolute; left: 0; width: 38%;
    font-weight: 600; color: var(--text-light);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  }
  .admin-table td:last-child {
    padding-left: 0; margin-top: 0.5rem;
    border-top: 1px solid var(--border-light); padding-top: 0.5rem;
    display: flex; gap: 0.4rem; flex-wrap: wrap;
  }
  .admin-table td:last-child::before { display: none; }
  .admin-table .btn-sm { flex: 1; min-width: 60px; padding: 0.4rem 0.5rem; }

  .login-box { padding: 2rem 1.5rem; }
  .modal-content { max-width: 95vw !important; padding: 1rem !important; }

  /* iOS no zoom */
  input, select, textarea { font-size: 16px !important; }

  .pum-ai-container { height: auto; min-height: 70vh; }

  .tip-card { flex-direction: column; }

  .navbar-user .dropdown-menu { right: 0; left: auto; }
}

/* ============================================================
   Dashboard tree visualization (Bosque UNAM)
   ============================================================ */
.dashboard-tree-vis {
  background:
    radial-gradient(ellipse at top, rgba(255,220,140,0.10), transparent 50%),
    linear-gradient(180deg, #faf6ef 0%, #f0e7d2 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.dashboard-tree-vis::before {
  /* sun rays sutil */
  content: ''; position: absolute;
  top: -50%; left: 50%; width: 80%; height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255,220,140,0.18), transparent 60%);
  pointer-events: none;
}

.dashboard-tree-header {
  text-align: center;
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.dashboard-tree-header h3 {
  font-family: 'Playfair Display', serif;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.dashboard-tree-svg {
  width: 100%;
  max-width: 680px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(45,80,22,0.12));
}

/* Tabs de visualización */
.vis-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin: 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.vis-tab {
  background: var(--bg-warm); color: var(--primary-dark);
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.9rem; border-radius: 10px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: var(--transition);
  font-family: inherit;
}
.vis-tab:hover { background: white; }
.vis-tab.active {
  background: var(--primary-dark); color: white;
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(45,80,22,0.25);
}
.vis-pane { display: none; }
.vis-pane.active { display: block; animation: section-in 320ms ease-out; }

/* Container 3D (Three.js) */
.dashboard-tree-3d,
.dashboard-mapa-vis,
.dashboard-mosaico-vis,
.dashboard-heatmap-vis {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(45,80,22,0.18), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
  cursor: grab;
}
.dashboard-tree-3d {
  background: linear-gradient(180deg, #a8d4f0 0%, #f5ede0 60%, #d4b896 100%);
}
.dashboard-mapa-vis,
.dashboard-heatmap-vis {
  height: 520px; cursor: default;
  background: #e8e0c8;
}
/* Mosaico tiene su propio ancho: el escenario 3D del cielo aprovecha mucho
   más espacio horizontal y vertical que las otras vistas. */
.dashboard-mosaico-vis {
  max-width: 1400px;
  min-height: 720px;
  background: linear-gradient(180deg, #5fa8d8 0%, #8ecbed 45%, #c8e4f3 85%, #e8f3fb 100%);
}
.dashboard-tree-3d:active { cursor: grabbing; }
.dashboard-tree-3d canvas, .dashboard-mosaico-vis canvas { display: block; }

/* Loading state genérico */
.vis-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-light); font-size: 0.9rem;
}

/* Leaf slots — animación de "crecimiento" */
.leaf-slot {
  cursor: pointer;
  opacity: 0;
  transform-origin: center;
  transform: scale(0);
  transition:
    opacity 700ms ease-out,
    transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 200ms ease;
}
.leaf-slot.show {
  opacity: 1;
  transform: scale(1);
}
.leaf-slot.empty {
  opacity: 0.10;
  transform: scale(0.6);
  fill: #c5b5a0 !important;
  cursor: default;
}
.leaf-slot:not(.empty):hover {
  filter: drop-shadow(0 0 12px currentColor) brightness(1.20);
  /* sin scale: el path SVG salta porque transform-origin es relativo al viewBox,
     no al bounding box del path. Glow solo, suficiente UX feedback. */
}

/* Branches & roots subtle entrance */
.dashboard-branches path,
.dashboard-roots path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: draw-branch 1.4s ease-out forwards;
}
.dashboard-branches path:nth-child(1) { animation-delay: 0.1s; }
.dashboard-branches path:nth-child(2) { animation-delay: 0.25s; }
.dashboard-branches path:nth-child(3) { animation-delay: 0.4s; }
.dashboard-branches path:nth-child(4) { animation-delay: 0.55s; }
.dashboard-branches path:nth-child(5) { animation-delay: 0.1s; }
.dashboard-branches path:nth-child(6) { animation-delay: 0.25s; }
.dashboard-branches path:nth-child(7) { animation-delay: 0.4s; }
.dashboard-branches path:nth-child(8) { animation-delay: 0.55s; }

@keyframes draw-branch { to { stroke-dashoffset: 0; } }

/* Legend */
.dashboard-tree-legend {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: center;
  padding: 1rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  margin-top: 1rem;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.legend-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Tooltip flotante de hoja */
.dashboard-tree-tooltip {
  position: fixed;
  background: rgba(28,41,18,0.95);
  color: white;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  max-width: 220px;
  line-height: 1.4;
  transform: translate(-50%, calc(-100% - 12px));
}
.dashboard-tree-tooltip strong { color: var(--leaf); display: block; margin-bottom: 0.2rem; }
.dashboard-tree-tooltip::after {
  content: ''; position: absolute;
  bottom: -6px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(28,41,18,0.95);
}

@media (max-width: 768px) {
  .dashboard-tree-vis { padding: 1.25rem 0.75rem 1rem; }
  .dashboard-tree-legend { font-size: 0.72rem; gap: 0.5rem; }
  .legend-dot { width: 10px; height: 10px; }
}

/* Print */
@media print {
  .forest-backdrop, .root-decoration { display: none !important; }
  body { background: white !important; }
  .navbar, .login-container { display: none !important; }
}

/* ─────────────────────────────────────────────────────────────────────────
   ROL RECTORIA — read-only en todo el admin
   El rector ve TODOS los tabs pero NO puede crear/editar/borrar fuera de
   su árbol asignado. La excepción "su árbol" vive en mi-arbol.js (form
   normal de seguimiento). PUM-AI y exportar reportes siguen disponibles.
   ───────────────────────────────────────────────────────────────────────── */
body.role-rectoria #section-admin .btn-danger,
body.role-rectoria #section-admin .btn-primary[onclick*="save"],
body.role-rectoria #section-admin .btn-primary[onclick*="Save"],
body.role-rectoria #section-admin .btn-primary[onclick*="create"],
body.role-rectoria #section-admin .btn-primary[onclick*="Create"],
body.role-rectoria #section-admin .btn-primary[onclick*="add"],
body.role-rectoria #section-admin .btn-primary[onclick*="Add"],
body.role-rectoria #section-admin button[onclick*="edit"],
body.role-rectoria #section-admin button[onclick*="Edit"],
body.role-rectoria #section-admin button[onclick*="delete"],
body.role-rectoria #section-admin button[onclick*="Delete"],
body.role-rectoria #section-admin button[onclick*="remove"],
body.role-rectoria #section-admin button[onclick*="Remove"],
body.role-rectoria #section-admin button[onclick*="assign"],
body.role-rectoria #section-admin button[onclick*="Assign"],
body.role-rectoria #section-admin button[onclick*="suggest"],
body.role-rectoria #section-admin button[onclick*="Suggest"],
body.role-rectoria #section-admin button[onclick*="unblock"],
body.role-rectoria #section-admin button[onclick*="Unblock"],
body.role-rectoria #section-admin button[onclick*="resolve"],
body.role-rectoria #section-admin button[onclick*="Resolve"],
body.role-rectoria #section-admin .admin-form,
body.role-rectoria #section-admin details.admin-collapsible {
  display: none !important;
}
/* Excepciones que rectoria SÍ debe poder usar */
body.role-rectoria #section-admin button[onclick*="export"],
body.role-rectoria #section-admin button[onclick*="Export"],
body.role-rectoria #section-admin button[onclick*="download"],
body.role-rectoria #section-admin button[onclick*="Download"],
body.role-rectoria #section-admin button[onclick*="QR"],
body.role-rectoria #section-admin button[onclick*="qr"],
body.role-rectoria #section-admin button[onclick*="print"],
body.role-rectoria #section-admin button[onclick*="Print"] {
  display: inline-flex !important;
}
/* Inputs/selects de filtros siguen activos (lectura) */
body.role-rectoria #section-admin .filter-input { display: block !important; }
/* PUM-AI tab siempre visible */
body.role-rectoria #section-pumai { display: block; }
/* Badge "Solo lectura" arriba del admin para rectoria */
body.role-rectoria #section-admin::before {
  content: "🛡️  Modo solo lectura — Rectoría UNAM";
  display: block;
  background: linear-gradient(135deg, #2e5117, #4a7c2a);
  color: #ffd866;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADMIN TABLES — mobile (≤700px)
   Convierte cada <tr> en card vertical. Esconde <thead> con filtros (que
   se encimaban). Cada <td> muestra su data-label como prefijo en mayúsculas.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .admin-table,
  .admin-table thead,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .admin-table thead {
    position: absolute;
    left: -9999px;
    top: -9999px;
  }
  .admin-table tr {
    background: white;
    margin: 0 0 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
    word-break: break-word;
    min-height: auto;
  }
  .admin-table td:last-child {
    border-bottom: none;
    justify-content: center;
  }
  .admin-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 40%;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-light, #777);
    align-self: center;
  }
  .admin-table td:last-child::before { display: none; }
  .admin-table td:last-child button {
    margin: 2px 4px;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
  }
  .admin-table tr td[colspan]::before { display: none; }
  .admin-table tr td[colspan] { justify-content: center; }
  #admin-section, .admin-tab, .tab-pane {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}
