/* ============================================================
   Portal CIDERT — Design System
   Tokens heredados de cidert.org
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Spline+Sans+Mono:wght@400;500&display=swap');

:root {
  --azul:      #0F3557;
  --azul-700:  #0c2b46;
  --azul-900:  #081d30;
  --verde:     #4E8B57;
  --verde-300: #9DC4A4;
  --tierra:    #B89A5D;
  --gris:      #3E4651;
  --paper:     #F6F4EF;
  --paper-2:   #FBFAF7;
  --line:      #E2DDD2;
  --line-dk:   rgba(255,255,255,.16);
  --ink:       #222831;
  --mut:       #8A8579;

  --r:    16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --nav-h: 60px;
  --sidebar-w: 248px;
}

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

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

body {
  font-family: 'Manrope', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--azul); text-decoration: none; }
a:hover { color: var(--azul-700); }

img { max-width: 100%; display: block; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ============================================================
   LAYOUT PORTAL (post-login)
   ============================================================ */

.portal-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--azul-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line-dk);
}

.sidebar-brand img {
  height: 78px;
  width: auto;
  max-width: 210px;
}

.sidebar-role {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255,255,255,.1);
  color: var(--verde-300);
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section-label {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
  display: block;
}

/* ── Collapsible nav sections ───────────────────────────── */
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding-right: 14px;
  transition: color .15s;
}
.nav-section-toggle:hover { color: rgba(255,255,255,.6); }

.nav-toggle-chevron {
  flex-shrink: 0;
  opacity: .5;
  transition: transform .24s var(--ease), opacity .15s;
}
.nav-section-toggle:hover .nav-toggle-chevron { opacity: .85; }
.nav-section-toggle.collapsed .nav-toggle-chevron {
  transform: rotate(-90deg);
}

.nav-collapse-body {
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height .28s var(--ease), opacity .2s;
}
.nav-collapse-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.18s, color 0.18s;
  position: relative;
}

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

.nav-item.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--verde);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.nav-item.active svg,
.nav-item:hover svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line-dk);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line-dk);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.sidebar-logout:hover {
  background: rgba(220,53,69,.2);
  color: #ff6b7a;
  border-color: rgba(220,53,69,.3);
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
.portal-header {
  height: var(--nav-h);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Header user dropdown ─────────────────────────────────── */
.header-user {
  position: relative;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.header-user-btn:hover {
  border-color: var(--azul);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,53,87,.08);
}

.header-user-btn[aria-expanded="true"] {
  border-color: var(--azul);
  background: #fff;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.header-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.header-user-role {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--azul);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
}

.header-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user-chevron {
  color: var(--mut);
  flex-shrink: 0;
  transition: transform 0.18s var(--ease);
}

.header-user-btn[aria-expanded="true"] .header-user-chevron {
  transform: rotate(180deg);
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,53,87,.13);
  overflow: hidden;
  display: none;
  z-index: 200;
}

.header-user-dropdown.open {
  display: block;
  animation: dropdownIn 0.15s ease;
}

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

.header-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
  font-weight: 500;
}

.header-user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--mut);
}

.header-user-dropdown-item:hover {
  background: var(--paper);
}

.header-user-dropdown-item.danger {
  color: #c0392b;
}

.header-user-dropdown-item.danger svg {
  color: #c0392b;
}

.header-user-dropdown-item.danger:hover {
  background: rgba(192,57,43,.06);
}

.header-user-dropdown-sep {
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* ── Sidebar nav dots ───────────────────────────────────── */
.nav-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0;
  margin-left: auto;
  flex-shrink: 0;
  background: #e74c3c;
  color: #fff;
}
.nav-dot-gold { background: var(--tierra); }

/* ── Profile card — CTA button inside banner ─────────────── */
.profile-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
  transition: background .18s, border-color .18s, color .18s;
}
.profile-card-cta:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.38);
  color: #fff;
}

/* ── Feature tile notification badge ─────────────────────── */
.feature-tile-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-tile-badge-gold { background: var(--tierra); }

/* ── Admin alert card ────────────────────────────────────── */
.admin-alert-card {
  background: rgba(231,76,60,.05);
  border: 1px solid rgba(231,76,60,.18);
  border-left: 4px solid #e74c3c;
  border-radius: var(--r-sm);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.admin-alert-icon {
  width: 36px;
  height: 36px;
  background: rgba(231,76,60,.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0392b;
  flex-shrink: 0;
}
.admin-alert-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 8px;
}
.admin-alert-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-alert-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
  text-decoration: none;
  line-height: 1.3;
}
.admin-alert-link:hover { text-decoration: underline; }

/* ── Upcoming events mini list ───────────────────────────── */
.ev-mini-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .12s;
  color: inherit;
}
.ev-mini-item:last-child { border-bottom: none; }
.ev-mini-item:hover { background: var(--paper); }
.ev-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.ev-mini-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.ev-mini-date {
  font-size: 12px;
  color: var(--mut);
  margin-top: 3px;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--ink);
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--paper); color: var(--azul); }

/* ── Header logo ─────────────────────────────────────────── */
.header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo {
  height: 50px;
  width: auto;
  display: block;
}
.header-logo-icon { display: none; }
.header-logo-fallback {
  display: none;
  font-weight: 800;
  font-size: 17px;
  color: var(--azul);
  letter-spacing: -0.02em;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-body {
  padding: 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--mut);
  font-size: 14px;
  margin-top: 4px;
}

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

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  transition: box-shadow 0.2s var(--ease);
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(15,53,87,.08);
}

.stat-card-label {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--azul);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--mut);
  margin-top: 6px;
}

.stat-card.accent-verde .stat-card-value { color: var(--verde); }
.stat-card.accent-tierra .stat-card-value { color: var(--tierra); }
.stat-card.accent-pending .stat-card-value { color: #f59e0b; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.card-body { padding: 20px; }

/* ── Dashboard Grid ──────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-grid .col-full { grid-column: 1 / -1; }

/* ── Tables ──────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead th {
  background: var(--paper);
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--paper); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-suspended { background: #f3f4f6; color: #4b5563; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-admin    { background: #eff6ff; color: #1e40af; }
.badge-corporado { background: #ecfdf5; color: #065f46; }
.badge-aliado   { background: #f0f9ff; color: #075985; }
.badge-convenio { background: #fdf4ff; color: #6b21a8; }
.badge-vigente  { background: #d1fae5; color: #065f46; }
.badge-vencido  { background: #fee2e2; color: #991b1b; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--azul);
  color: #fff;
  border-color: var(--azul);
}

.btn-primary:hover {
  background: var(--azul-700);
  border-color: var(--azul-700);
  color: #fff;
}

.btn-success {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}

.btn-success:hover {
  background: #3d7045;
  color: #fff;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.btn-danger:hover { background: #b02a37; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--azul);
  border-color: var(--line);
}

.btn-outline:hover {
  background: var(--paper);
  border-color: var(--azul);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 7px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--gris);
  cursor: pointer;
  transition: all 0.18s;
}

.btn-icon:hover { background: var(--azul); color: #fff; border-color: var(--azul); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Activity Feed ───────────────────────────────────────── */
.activity-list { list-style: none; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--azul);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.green { background: var(--verde); }
.activity-dot.yellow { background: var(--tierra); }

.activity-text { color: var(--ink); flex: 1; line-height: 1.5; }
.activity-time { color: var(--mut); font-size: 11px; flex-shrink: 0; }

/* ── Profile Cards ───────────────────────────────────────── */
.profile-card {
  background: linear-gradient(135deg, var(--azul-900) 0%, var(--azul) 100%);
  border-radius: var(--r);
  padding: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.profile-card-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
}

.profile-card-meta {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  margin-top: 6px;
  position: relative;
}

.profile-card-badge {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  position: relative;
}

/* ── Feature Tiles ───────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.feature-tile {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  color: var(--ink);
}

.feature-tile:hover {
  border-color: var(--azul);
  box-shadow: 0 4px 20px rgba(15,53,87,.1);
  transform: translateY(-2px);
  color: var(--azul);
}

.feature-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: background 0.2s;
}

.feature-tile:hover .feature-tile-icon { background: var(--azul); }
.feature-tile:hover .feature-tile-icon svg { color: #fff; }

.feature-tile-icon svg { width: 22px; height: 22px; color: var(--azul); }
.feature-tile-label { font-size: 13px; font-weight: 600; }
.feature-tile-sub { font-size: 11px; color: var(--mut); margin-top: 3px; }

/* ── Empty States ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--mut);
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--gris); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ── Info Rows ───────────────────────────────────────────── */
.info-row {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.info-row:last-child { border-bottom: none; }
.info-label { font-weight: 600; color: var(--gris); min-width: 160px; flex-shrink: 0; }
.info-value { color: var(--ink); }

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

/* ── Sidebar rail (desktop collapsed) ────────────────────── */
.sidebar.rail {
  width: 64px;
}

.sidebar.rail .sidebar-nav {
  padding: 12px 6px;
}

.sidebar.rail .nav-section-label {
  display: none;
}

.sidebar.rail .nav-admin-grid {
  grid-template-columns: 1fr;
  padding: 2px 0;
}

.sidebar.rail .nav-tile {
  padding: 11px 6px;
  justify-content: center;
  gap: 0;
  border-radius: var(--r-sm);
}

.sidebar.rail .nav-tile span {
  display: none;
}

.sidebar.rail .nav-item {
  padding: 10px 0;
  justify-content: center;
  gap: 0;
}

.sidebar.rail .nav-item > span {
  display: none;
}

.sidebar.rail .nav-collapse-body {
  overflow: hidden;
}

.sidebar.rail .nav-section-toggle .nav-toggle-chevron {
  display: none;
}

.main-content.rail-content {
  margin-left: 64px;
}

/* Only apply rail margin on desktop */
@media (max-width: 1024px) {
  .main-content.rail-content {
    margin-left: 0;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    /* reset any rail width when in mobile overlay mode */
    width: var(--sidebar-w);
  }

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

  .main-content {
    margin-left: 0;
  }

  .header-logo-full { display: none; }
  .header-logo-icon { display: block; height: 36px; }
  .header-logo-fallback { display: none !important; }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .page-body { padding: 16px; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ── Sidebar overlay (mobile) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-mut   { color: var(--mut); }
.text-verde { color: var(--verde); }
.text-azul  { color: var(--azul); }
.text-tierra { color: var(--tierra); }
.fw-800 { font-weight: 800; }
.fw-600 { font-weight: 600; }
.mono {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mb-0  { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.ms-auto { margin-left: auto; }
.w-100 { width: 100%; }

/* ============================================================
   FORMS — base styles for all authenticated pages
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gris);
  margin-bottom: 6px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--azul);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,53,87,.08);
}

.form-control[disabled],
.form-control:disabled {
  background: var(--paper-2);
  opacity: .65;
  cursor: not-allowed;
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,53,69,.1);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8579' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

input[type="date"].form-control {
  cursor: pointer;
}

.form-text {
  font-size: 12px;
  color: var(--mut);
  margin-top: 5px;
  display: block;
}

.invalid-feedback {
  font-size: 12px;
  color: #dc3545;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gris);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--azul);
  cursor: pointer;
}

/* ── Profile form grid ──────────────────────────────────── */
.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.profile-form-grid .span-full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-grid .span-full { grid-column: 1 / -1; }
}
