/* ========== VARIABLES ========== */
:root {
  --header-bg: #EBEBEC;
  --hero-from: #2B4FC4;
  --hero-to: #5B7FE0;
  --primary: #2B52CC;
  --primary-dark: #1E3A6E;
  --success: #2D7A50;
  --card-bg: #FFFFFF;
  --body-bg: #F4F5F7;
  --border: #E2E8F0;
  --text-dark: #1A1A2E;
  --text-muted: #6B7280;
  --footer-bg: #2D3748;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--body-bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== HEADER ========== */
.header {
  background: var(--header-bg);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D8D9DA;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-shield {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.logo-text p {
  font-size: 12px;
  color: #5B7280;
  font-style: italic;
}

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

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  border: 1px solid #C8C9CA;
  background: white;
  color: var(--text-dark);
}

.nav-btn:hover { background: #F0F0F1; }
.nav-btn.danger { color: #DC2626; border-color: #FCA5A5; }
.nav-btn.danger:hover { background: #FEF2F2; }
.nav-btn svg { width: 14px; height: 14px; }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
  padding: 40px 32px 60px;
  text-align: center;
  color: white;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.hero h2 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 15px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
}

/* ========== MAIN CONTENT ========== */
main { flex: 1; padding: 0 32px 40px; }

.section-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-top: -28px;
  margin-bottom: 32px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-card p { font-size: 14px; color: var(--text-muted); }

/* ========== SERVICE GRID ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 40px;
}

.service-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: block;
  border: 1px solid #F0F0F2;
  position: relative;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(43,82,204,0.15);
}

.service-card.disabled {
  cursor: default;
  opacity: 0.7;
}

.service-card.disabled:hover { transform: none; box-shadow: var(--shadow); }

.service-icon {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  background: #EEF2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.service-icon svg { width: 36px; height: 36px; }

.service-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}

.service-card.disabled h4 { color: #9CA3AF; }

.cupos-badge {
  display: inline-block;
  background: #F3F4F6;
  color: #6B7280;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 50px;
  margin-top: 8px;
  border: 1px solid #E5E7EB;
}

/* ========== CONTACT ========== */
.contact-line {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.contact-line a { color: var(--primary); text-decoration: none; }

/* ========== FOOTER ========== */
footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 16px;
  font-size: 13px;
}

/* ========== TRAMITE CARDS (page 2) ========== */
.tramite-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 32px;
}

.tramite-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 24px 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: block;
  border: 1px solid #F0F0F2;
}

.tramite-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(43,82,204,0.15);
}

.tramite-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #EEF2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.tramite-icon svg { width: 30px; height: 30px; color: var(--primary); }

.tramite-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.tramite-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 50px;
  border: 1px solid #C8C9CA;
  background: white;
  color: var(--text-dark);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-volver:hover { background: #F4F5F7; }

.center { text-align: center; }

/* ========== CALENDAR ========== */
.calendar-wrap {
  max-width: 760px;
  margin: 0 auto 32px;
}

.legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.legend-dot.available { background: var(--primary); }
.legend-dot.unavailable { background: #D1D5DB; }

.calendar {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calendar-header {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.calendar-header button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-header button:hover { background: rgba(255,255,255,0.35); }

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #F8F9FB;
  border-bottom: 1px solid var(--border);
}

.calendar-days-header span {
  text-align: center;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 12px;
  gap: 6px;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 52px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  padding: 4px;
}

.cal-day.empty { background: transparent; }

.cal-day.unavailable {
  background: white;
  border: 1px solid #E5E7EB;
  color: #CBD5E1;
  cursor: default;
}

.cal-day.available {
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-day.available:hover { background: var(--primary-dark); }

.cal-day.other-month { color: #CBD5E1; }

.cal-day .cupos-text {
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.9;
}

.cal-day.unavailable .cupos-text { color: #CBD5E1; }

/* ========== TIME SLOTS ========== */
.slots-wrap {
  max-width: 600px;
  margin: 0 auto 32px;
}

.slot-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.slot-header {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
}

.slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #F0F0F2;
}

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

.slot-info { flex: 1; }

.slot-time {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
}

.slot-time svg { width: 16px; height: 16px; }

.slot-badges {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
}

.badge.total { background: #F3F4F6; color: #4B5563; border: 1px solid #E5E7EB; }
.badge.disponibles { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.badge svg { width: 12px; height: 12px; }

.btn-elegir {
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  margin-left: 16px;
}

.btn-elegir:hover { background: #162C52; }

/* ========== HEALTH INFO ========== */
.content-wrap {
  max-width: 780px;
  margin: 0 auto 32px;
}

.alert-box {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  border-left: 4px solid #EF4444;
  border-radius: 8px;
  padding: 14px 18px;
  color: #991B1B;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.alert-box.show { display: block; }

.info-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.info-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 1.4;
}

.info-card p {
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 12px;
}

.info-card p:last-child { margin-bottom: 0; }

.btn-revisar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 20px;
}

.btn-revisar:hover { background: var(--primary-dark); }

.accept-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.toggle-wrap { flex-shrink: 0; margin-top: 3px; }

.toggle {
  display: block;
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: 50px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.accept-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.accept-text p { font-size: 12px; color: #6B7280; }

.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  padding: 12px 32px;
  border-radius: 50px;
  border: 1px solid #D1D5DB;
  background: white;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover { background: #F4F5F7; }

.btn-success {
  padding: 12px 32px;
  border-radius: 50px;
  border: none;
  background: #166534;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-success:hover { background: #14532D; }

/* ========== DOCUMENTS FORM ========== */
.form-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.form-section-header {
  background: var(--primary);
  color: white;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
}

.form-section-body { padding: 20px; }

.resumen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.resumen-item {
  background: #F8F9FB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 12px 16px;
}

.resumen-item label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.resumen-item span {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.resumen-item span.dark { color: var(--text-dark); }

.docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.doc-item {
  background: #F8F9FB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 16px;
}

.doc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.doc-badge.obligatorio { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.doc-badge.opcional { background: #F3F4F6; color: #6B7280; border: 1px solid #E5E7EB; }

.doc-item h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.doc-item .doc-type {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.file-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.btn-file {
  padding: 6px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.file-name {
  font-size: 12px;
  color: var(--text-muted);
}

.doc-hint {
  font-size: 11px;
  color: #9CA3AF;
}

.form-user-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--primary); }

.form-bottom {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid #F0F0F2;
}

.btn-dark {
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  background: #374151;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-dark:hover { background: #1F2937; }

.btn-primary {
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  background: var(--primary-dark);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: #162C52; }

/* ========== CONFIRMATION ========== */
.confirm-bg {
  flex: 1;
  background: linear-gradient(135deg, #D4DCF4 0%, #C8D4F0 30%, #D8D9E8 60%, #E4E4EC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.confirm-bg::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border: 30px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  top: -80px;
  right: -80px;
  transform: rotate(20deg);
}

.confirm-bg::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border: 20px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  bottom: -60px;
  left: 10%;
}

.confirm-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 540px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 40px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon svg { width: 32px; height: 32px; color: white; }

.confirm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  color: #4B5563;
  margin-bottom: 16px;
}

.confirm-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.confirm-card > p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-card > p strong { color: var(--text-dark); }

.confirm-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.confirm-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
}

.confirm-info-row.blue {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.confirm-info-row svg { width: 16px; height: 16px; flex-shrink: 0; color: #166534; }
.confirm-info-row.blue svg { color: #1D4ED8; }

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-home:hover { background: #162C52; }

/* ========== MIS SOLICITUDES ========== */
.search-card {
  max-width: 500px;
  margin: 0 auto 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.search-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-row input:focus { border-color: var(--primary); }

.search-row button {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.solicitud-list {
  max-width: 700px;
  margin: 0 auto;
}

.solicitud-item {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sol-info h4 { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; }
.sol-info p { font-size: 12px; color: var(--text-muted); }

.estado-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.estado-badge.pendiente { background: #FEF9C3; color: #854D0E; border: 1px solid #FDE68A; }
.estado-badge.aceptado { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.estado-badge.rechazado { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ========== ADMIN ========== */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 120px);
}

.admin-sidebar {
  background: var(--primary-dark);
  color: white;
  padding: 24px 0;
}

.admin-sidebar h3 {
  padding: 0 20px 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.admin-nav-item:hover { background: rgba(255,255,255,0.08); }
.admin-nav-item.active { background: rgba(255,255,255,0.12); border-left-color: white; }
.admin-nav-item svg { width: 18px; height: 18px; opacity: 0.8; }

.admin-content { padding: 28px; background: var(--body-bg); }

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

.admin-header h2 { font-size: 22px; font-weight: 700; color: var(--text-dark); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Admin calendar */
.admin-cal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
}

.admin-cal-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-cal-header h3 { font-size: 16px; font-weight: 600; }

.admin-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-cal-nav button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-cal-nav button:hover { background: rgba(255,255,255,0.35); }
.admin-cal-nav span { font-size: 15px; font-weight: 600; min-width: 140px; text-align: center; }

.admin-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 16px;
  gap: 8px;
}

.admin-cal-day-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 16px 0;
  background: #F8F9FB;
  border-bottom: 1px solid var(--border);
}

.admin-cal-day-header span {
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.a-cal-day {
  min-height: 70px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  padding: 6px;
  cursor: default;
  background: white;
}

.a-cal-day.has-data { cursor: pointer; transition: background 0.15s; }
.a-cal-day.has-data:hover { background: #F0F4FF; }
.a-cal-day.today { border-color: var(--primary); }
.a-cal-day.empty { background: transparent; border-color: transparent; }

.a-cal-day .a-day-num {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.a-cal-day.today .a-day-num { color: var(--primary); }

.a-day-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.a-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.a-dot.pendiente { background: #EAB308; }
.a-dot.aceptado { background: var(--success); }
.a-dot.rechazado { background: #EF4444; }

/* Solicitud table */
.sol-table-wrap {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sol-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sol-table-header h3 { font-size: 16px; font-weight: 700; color: var(--text-dark); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-row select, .filter-row input {
  padding: 7px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
}

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

th {
  background: #F8F9FB;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #F0F0F2;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFC; }

.btn-detail {
  padding: 5px 12px;
  background: #EEF2FF;
  color: var(--primary);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-detail:hover { background: #E0E7FF; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  margin: auto;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  background: var(--primary);
  color: white;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-body { padding: 24px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-item { background: #F8F9FB; border-radius: 8px; padding: 12px; }
.detail-item label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.detail-item span { font-size: 14px; font-weight: 600; color: var(--text-dark); }

.docs-list { margin-bottom: 20px; }
.docs-list h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text-dark); }

.doc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #EEF2FF;
  border-radius: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.doc-link:hover { background: #E0E7FF; }
.doc-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.action-row {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #F0F0F2;
}

.btn-accept {
  flex: 1;
  padding: 11px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-accept:hover { background: #145A3A; }

.btn-reject {
  flex: 1;
  padding: 11px;
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-reject:hover { background: #FECACA; }

.reject-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}

.reject-form.show { display: flex; }

.reject-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  font-family: inherit;
}

.reject-form textarea:focus { border-color: #EF4444; }

.reject-form button {
  padding: 10px;
  background: #DC2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Horarios admin */
.horario-form {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.horario-form h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.horario-form-grid { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 10px; align-items: end; }
.horario-form-grid label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 4px; }
.horario-form-grid input, .horario-form-grid select {
  padding: 8px 10px;
  border: 1px solid #D1D5DB;
  border-radius: 7px;
  font-size: 13px;
  width: 100%;
  outline: none;
}
.horario-form-grid .btn-add {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Admin login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  text-align: center;
}

.login-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.login-card input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}

.login-card input:focus { border-color: var(--primary); }

.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button:hover { background: var(--primary-dark); }

.login-error {
  background: #FEE2E2;
  color: #991B1B;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.login-error.show { display: block; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header { padding: 10px 16px; }
  .logo-text h1 { font-size: 18px; }
  .hero h2 { font-size: 28px; }
  main { padding: 0 16px 32px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tramite-cards { grid-template-columns: 1fr; }
  .resumen-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .form-user-inputs { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .action-row { flex-direction: column; }
}

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

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

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1A1A2E;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: #DC2626; }
