/* ================================================================
   CALENDIO — HOJA DE ESTILOS UNIFICADA (style.css)
   ----------------------------------------------------------------
   Generado en la refactorización CSS (Fase 2). Sustituye los
   bloques <style> incrustados en las 8 vistas de views/.
   Cada bloque indica de qué vista(s) proviene originalmente.
   ================================================================ */


/* ================================================================
   1. TOKENS GLOBALES (:root)
   Origen: fusión de login.php, selector_cuenta.php, admin.php,
   perfil.php, calendar.php, completar_perfil.php (parcial)
   ================================================================ */
:root {
  /* Superficies y texto */
  --bg: #f8f7f4;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.06);
  --text: #1a1916;
  --text-muted: #74736f;
  --accent: #1a1916;

  /* Radios */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius: 12px;

  /* Espaciados */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-base: 20px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;

  /* Estados semánticos (alertas, tags, badges) */
  --success-bg: #f0fdf4;  --success-text: #15803d;
  --danger-bg: #fff1f2;   --danger-text: #be123c;
  --info-bg: #e6f0fa;     --info-text: #1e40af;
  --other-bg: #fbebeb;    --other-text: #c53030;
}


/* ================================================================
   2. RESET Y BASE
   Origen: bloque *,*::before,*::after repetido en 6 vistas +
   normalización de body (Arial/sans-serif → DM Sans) en
   alta_masiva.php y 404.php
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

/* Ajustes de layout específicos por página (sustituyen los distintos
   comportamientos de <body> que tenía cada vista antes de unificar) */
body.page-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-completar-perfil {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-2xl);
}

body.page-admin { padding: var(--space-md); }
@media (min-width: 640px) { body.page-admin { padding: var(--space-lg); } }

body.page-alta-masiva { padding: var(--space-lg); }

body.page-calendar { min-height: 100vh; padding-bottom: var(--space-2xl); }


/* ================================================================
   3. MARCA / LOGO (.brand-title, .logo-mark)
   Origen: views/partials/logo.php + login.php, selector_cuenta.php,
   completar_perfil.php, admin.php, perfil.php, calendar.php
   ================================================================ */
.brand-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--space-xl) 0; /* estándar unificado: 32px */
}
.brand-title span { color: var(--text-muted); font-weight: 400; }

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--text);
  border-radius: var(--radius-md);
}
.logo-mark svg { width: 18px; height: 18px; }


/* ================================================================
   4. TARJETAS DE AUTENTICACIÓN
   Origen: login.php, selector_cuenta.php, completar_perfil.php,
   perfil.php, 404.php (migrado)
   ================================================================ */
.login-container, .selector-container, .profile-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.login-card, .selector-card, .profile-card, .card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2xl) var(--space-xl); /* estándar unificado: 40px 32px */
  box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}
.login-card    { max-width: 400px; }
.selector-card { max-width: 450px; text-align: center; }
.profile-card  { max-width: 560px; }
.card          { max-width: 400px; text-align: center; }

.login-header { margin-bottom: var(--space-lg); text-align: center; }
.login-header p { font-size: 14px; color: var(--text-muted); }

.selector-header p {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: var(--space-lg); line-height: 1.5;
}

.perfil-subtitulo { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-base); }

/* 404.php: página de error, sin tarjeta, solo texto centrado */
.box { text-align: center; }
.box h1 { font-size: 3rem; margin-bottom: var(--space-sm); }
.box p  { color: var(--text-muted); margin-bottom: var(--space-lg); }
.box a  { color: var(--text); font-weight: 600; }

/* 4.1 Componentes específicos de perfil.php (pantallas internas) */
.pantalla { display: none; opacity: 0; transition: opacity 0.25s ease; }
.pantalla.activa { display: block; opacity: 1; }
.pantalla-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); gap: var(--space-md); }
.pantalla-header-titulo { font-size: 15px; font-weight: 700; color: var(--text); }
.pantalla-footer { margin-top: var(--space-lg); text-align: center; }
.inicio-footer { margin-top: var(--space-base); text-align: center; }
.link-nav { font-size: 13px; color: var(--text-muted); text-decoration: none; font-weight: 500; cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
.link-nav:hover { color: var(--text); text-decoration: underline; }
.menu-inicial { display: flex; flex-direction: column; gap: var(--space-sm); }
.emails-section-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: var(--space-md); }
.email-item { display: flex; align-items: stretch; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) var(--space-base); background: #fafaf9; border: 1px solid rgba(0,0,0,0.08); border-radius: var(--radius-sm); margin-bottom: var(--space-xs); min-width: 0; overflow: hidden; }
.email-item-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; flex: 1; min-width: 0; }
.email-item-etiqueta { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.email-item-address { font-size: 13px; color: var(--text); display: block; width: 100%; max-width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 3px; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.18) transparent; }
.email-item-address::-webkit-scrollbar { height: 3px; }
.email-item-address::-webkit-scrollbar-track { background: transparent; }
.email-item-address::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 2px; }
.email-item-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; justify-content: center; }
.btn-email-action { background: none; border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 4px var(--space-sm); font-family: inherit; font-size: 11px; font-weight: 500; cursor: pointer; transition: all 0.2s; color: var(--text-muted); white-space: nowrap; text-align: center; min-width: 68px; }
.btn-email-action:hover { background: #f5f4f0; color: var(--text); border-color: rgba(0,0,0,0.15); }
.btn-email-action.activo { color: var(--success-text); border-color: rgba(21,128,61,0.2); background: var(--success-bg); }
.btn-email-action.btn-editar:hover  { background: var(--info-bg); color: var(--info-text); border-color: rgba(30,64,175,0.2); }
.btn-email-action.btn-eliminar:hover { background: var(--danger-bg); color: var(--danger-text); border-color: rgba(225,29,72,0.15); }
.email-edit-form { display: none; margin-top: var(--space-sm); padding: var(--space-sm); background: #f5f4f0; border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,0.07); }
.email-edit-form .form-group { margin-bottom: var(--space-sm); }
.email-edit-form .form-group:last-of-type { margin-bottom: 0; }
.email-edit-form input { width: 100%; padding: 9px var(--space-sm); font-family: inherit; font-size: 13px; border: 1px solid rgba(0,0,0,0.12); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); transition: all 0.2s; }
.email-edit-form input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.email-edit-actions { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); }
.btn-guardar-edit  { flex: 1; padding: var(--space-xs); background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-guardar-edit:hover { background: #333; }
.btn-cancelar-edit { flex: 1; padding: var(--space-xs); background: none; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-cancelar-edit:hover { background: #ebebeb; color: var(--text); }
.alert-edit { padding: var(--space-xs) 10px; border-radius: var(--radius-sm); font-size: 12px; margin-top: var(--space-xs); line-height: 1.4; display: none; }
.btn-anyadir-email { display: flex; align-items: center; gap: 7px; background: none; border: 1px dashed rgba(0,0,0,0.18); border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md); width: 100%; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s; margin-top: 4px; }
.btn-anyadir-email:hover { border-color: var(--text); color: var(--text); background: #fafaf9; }
.btn-anyadir-email .icon-add { width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; flex-shrink: 0; }
.form-anyadir-email { background: #fafaf9; border: 1px solid rgba(0,0,0,0.08); border-radius: var(--radius-sm); padding: var(--space-md); margin-top: 4px; display: none; }
.form-anyadir-email .form-group { margin-bottom: var(--space-sm); }
.form-anyadir-email-actions { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); }
.btn-guardar-email  { flex: 1; padding: var(--space-sm); background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-guardar-email:hover { background: #333; }
.btn-cancelar-email { flex: 1; padding: var(--space-sm); background: none; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-cancelar-email:hover { background: #f5f4f0; color: var(--text); }
.alert-inline { padding: 10px var(--space-sm); border-radius: var(--radius-sm); font-size: 13px; margin-top: var(--space-sm); line-height: 1.4; display: none; }


/* ================================================================
   5. CONTENEDORES DE PANEL / DASHBOARD
   Origen: admin.php, alta_masiva.php (migrado), calendar.php
   ================================================================ */
.admin-header {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  justify-content: space-between; align-items: center;
  background: var(--surface); padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: var(--space-lg); /* estándar unificado */
}
.admin-header .brand-title { margin: 0; font-size: 22px; }

.admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); width: 100%; }
.admin-tools form { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; flex: 1; min-width: 0; }
.account-selector { flex: 1; min-width: 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); border: 1px solid var(--border); font-family: inherit; font-size: 14px; }
.btn-logout { flex-shrink: 0; background: var(--danger-bg); color: #991b1b; text-decoration: none; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; white-space: nowrap; }

.admin-content { background: var(--surface); padding: var(--space-md); border-radius: var(--radius); border: 1px solid var(--border); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-md); border-bottom: 1px solid var(--border); padding-bottom: var(--space-sm); }
.tab-btn { background: none; border: none; font-size: 15px; font-weight: 600; color: var(--text-muted); cursor: pointer; padding: var(--space-xs) 14px; border-radius: var(--radius-sm); white-space: nowrap; }
.tab-btn.active { background: var(--bg); color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.sub-tabs-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-md); }

@media (min-width: 640px) {
  .admin-header { padding: var(--space-lg) var(--space-xl); flex-wrap: nowrap; }
  .admin-tools { width: auto; flex-wrap: nowrap; }
  .admin-tools form { flex-wrap: nowrap; }
  .admin-content { padding: var(--space-lg); }
  .tab-btn { font-size: 16px; padding: 10px var(--space-lg); }
}

/* alta_masiva.php: contenedor migrado del sistema legacy */
.container {
  max-width: 900px;
  background: var(--surface);
  padding: var(--space-lg); /* estándar unificado (móvil) */
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  margin: 0 auto;
}
.container h1 { font-size: 24px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: var(--space-sm); margin-bottom: var(--space-md); }
.back-link { display: inline-block; margin-bottom: var(--space-md); font-size: 13px; color: var(--text-muted); }
.back-link:hover { text-decoration: underline; }
.ayuda { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-base); display: block; }
@media (min-width: 640px) { .container { padding: var(--space-xl); } }

/* calendar.php: contenedores de página */
.brand-container  { max-width: 1200px; margin: var(--space-xl) auto var(--space-lg) auto; padding: 0 var(--space-md); }
.brand-container .brand-title { margin: 0; }
.header-container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }
.calendar-container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }

.app-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px var(--space-lg); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.01); margin-bottom: var(--space-lg); }
.header-context { display: flex; align-items: center; gap: var(--space-xs); font-size: 14px; }
.badge-context { background: var(--text); color: #fff; padding: 4px var(--space-sm); border-radius: var(--radius-sm); font-weight: 700; font-size: 12px; letter-spacing: 0.05em; }
.header-nav { display: flex; align-items: center; gap: var(--space-sm); }
.header-link { color: var(--text-muted); padding: var(--space-xs) 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; transition: all 0.2s; border: 1px solid transparent; }
.header-link:hover { color: var(--text); background: #f5f4f0; border-color: var(--border); }
.header-link.btn-logout { color: #e11d48; }
.header-link.btn-logout:hover { background: var(--danger-bg); border-color: rgba(225,29,72,0.1); }

.calendar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,0.02); overflow: hidden; }
.cal-inner-header { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border); background: #fafaf9; }

.info-notice { max-width: 1200px; margin: var(--space-sm) auto; padding: 0 var(--space-md); }
.info-notice p { display: flex; align-items: center; gap: var(--space-sm); background: var(--info-bg); border: 1px solid #bfdbfe; border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); font-size: 13px; color: var(--info-text); font-weight: 500; max-width: 1200px; margin: 0 auto; }
.info-notice p::before { content: "i"; font-size: 13px; flex-shrink: 0; background: var(--info-text); color: #fff; width: 18px; height: 18px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; }


/* ================================================================
   6. FORMULARIOS (.form-group, inputs)
   Origen: login.php, perfil.php, admin.php, completar_perfil.php,
   alta_masiva.php (migrado)
   ================================================================ */
.form-group { margin-bottom: var(--space-base); } /* estándar unificado: 20px */
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: var(--space-xs); color: var(--text); }
.form-group input {
  width: 100%; padding: var(--space-sm) 14px; font-family: inherit; font-size: 14px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: var(--radius-sm); background: #fafaf9;
  color: var(--text); transition: all 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--text); background: var(--surface); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }

/* completar_perfil.php: inputs/labels sueltos (fuera de .form-group) */
.card input { width: 100%; padding: var(--space-sm); margin: var(--space-sm) 0 var(--space-base); border: 1px solid var(--border); border-radius: var(--radius-sm); box-sizing: border-box; font-family: inherit; }

/* admin.php: formularios dentro de modales */
.modal-form .form-group { margin-bottom: 14px; }
.modal-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: var(--space-xs); }
.modal-form input, .modal-form select { width: 100%; padding: var(--space-sm) 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; background: #fafaf9; }

/* alta_masiva.php: textarea/select propios */
textarea { width: 100%; height: 150px; padding: var(--space-sm); border: 1px solid rgba(0,0,0,0.15); border-radius: var(--radius-sm); box-sizing: border-box; font-family: monospace; resize: vertical; margin-bottom: 5px; }
select { padding: var(--space-xs); border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,0.15); width: 200px; }
label { display: block; font-weight: bold; margin-bottom: 5px; }


/* ================================================================
   7. BOTONES (.btn-submit, .btn-action, .btn-nav, .btn-view...)
   Origen: todas las vistas
   ================================================================ */
.btn-submit {
  width: 100%; padding: 13px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; margin-top: var(--space-sm);
}
.btn-submit:hover { background: #333; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

.btn-cuenta {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-base); margin-bottom: var(--space-sm); background: #fafaf9;
  border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius-md); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-align: left;
}
.btn-cuenta:hover { background: var(--surface); border-color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.05); transform: translateY(-2px); }
.btn-cuenta:active { transform: translateY(0); }
.btn-cuenta .prefix { font-size: 12px; background: var(--text); color: #fff; padding: 4px var(--space-xs); border-radius: var(--radius-xs); font-weight: 700; letter-spacing: 0.05em; }

.link-cancelar { display: inline-block; margin-top: var(--space-base); font-size: 13px; color: var(--text-muted); font-weight: 500; }
.link-cancelar:hover { color: var(--text); text-decoration: underline; }

.btn-action { background: var(--accent); color: white; border: none; padding: 6px 10px; border-radius: var(--radius-xs); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
td .btn-action + .btn-action { margin-left: 4px; }
.btn-danger { background: #dc2626; }

.btn-nav { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-weight: 700; transition: all 0.2s; }
.btn-nav:hover { background: #f5f4f0; border-color: var(--text); }
.btn-nav.disabled { opacity: 0.3; pointer-events: none; }

.cal-view-selector { display: flex; background: #e2e2df; padding: 3px; border-radius: var(--radius-md); gap: 2px; }
.btn-view { padding: 6px 14px; border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); transition: all 0.2s; }
.btn-view.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.08); font-weight: 700; }

.btn-modal    { padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-cerrar   { background: #f5f4f0; color: var(--text); }
.btn-cerrar:hover { background: #e2e2df; }
.btn-confirmar { background: var(--text); color: #fff; }
.btn-confirmar:hover { opacity: 0.9; }

/* alta_masiva.php: botón principal migrado (antes verde Bootstrap #28a745) */
button { font-family: inherit; }
.container button[type="submit"] {
  background: var(--accent); color: #fff; border: none; padding: 12px var(--space-lg);
  border-radius: var(--radius-sm); font-size: 16px; cursor: pointer; font-weight: bold;
}
.container button[type="submit"]:hover { background: #333; }

/* completar_perfil.php: botones de modal */
.btn-row { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.btn-row button { flex: 1; padding: 13px; font-size: 15px; }
.btn-secondary { background: #fff !important; color: var(--text) !important; border: 1px solid var(--border) !important; }


/* ================================================================
   8. ALERTAS, BADGES Y TAGS (estados semánticos)
   Origen: login.php, perfil.php, admin.php, alta_masiva.php (migrado)
   ================================================================ */
.alert { padding: var(--space-sm); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: var(--space-base); line-height: 1.4; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid rgba(225,29,72,0.1); }
.alert-info    { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(21,128,61,0.1); }
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(21,128,61,0.1); }

.tag { padding: 4px var(--space-xs); border-radius: var(--radius-xs); font-size: 11px; font-weight: bold; }
.tag-cancel { background: var(--danger-bg);  color: var(--danger-text); }
.tag-active { background: var(--success-bg); color: var(--success-text); }

/* alta_masiva.php: badges migrados a la paleta semántica común */
.badge { padding: 4px var(--space-xs); border-radius: var(--radius-xs); font-size: 12px; font-weight: bold; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.password-cell { font-family: monospace; font-size: 14px; background: #f8f9fa; padding: 4px; border: 1px dashed #ccc; }

.reserva-item { padding: 6px var(--space-xs); border-radius: var(--radius-xs); font-size: 11px; font-weight: 600; line-height: 1.3; pointer-events: none; border: 1px solid transparent; text-align: center; }
.reserva-item.user-own   { background: var(--info-bg);  color: var(--info-text);  border-color: rgba(30,64,175,0.08); }
.reserva-item.user-other { background: var(--other-bg); color: var(--other-text); border-color: rgba(197,48,48,0.08); }

.cal-legend { display: flex; align-items: center; gap: var(--space-xs); }
.legend-pill { display: flex; align-items: center; padding: 5px var(--space-sm); border-radius: var(--radius-xs); font-size: 12px; font-weight: 600; }
.legend-pill.red  { background: var(--other-bg); color: var(--other-text); border: 1px solid rgba(197,48,48,0.2); }
.legend-pill.blue { background: var(--info-bg);  color: var(--info-text);  border: 1px solid rgba(30,64,175,0.2); }

.error-inline { color: #c0392b; font-size: 13px; font-weight: 700; margin: 0; display: none; }


/* ================================================================
   9. TABLAS
   Origen: admin.php, alta_masiva.php (migrado)
   ================================================================ */
.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: var(--space-base); font-size: 14px; }
th, td { text-align: left; padding: var(--space-sm); border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

/* admin.php: tabla dentro de panel con anchura mínima */
.admin-content table { min-width: 500px; }
.admin-content th, .admin-content td { white-space: nowrap; }


/* ================================================================
   10. MODALES
   Origen: admin.php, completar_perfil.php, calendar.php
   ================================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  align-items: center; justify-content: center; z-index: 1000; padding: var(--space-md);
  box-sizing: border-box; backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: flex; }

.modal-card {
  background: var(--surface); width: 100%; max-width: 420px; border-radius: var(--radius);
  padding: var(--space-lg); box-shadow: 0 20px 40px rgba(0,0,0,0.1); position: relative;
  animation: modalFadeIn 0.3s ease; max-height: 90vh; overflow-y: auto;
}
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: var(--space-base); color: var(--text); padding-right: var(--space-lg); }
.modal-desc  { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-base); line-height: 1.4; }
.modal-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; }

/* completar_perfil.php: modales propios (confirmación + normativa) */
.modal-box { background: var(--surface); padding: var(--space-xl); border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.08); width: 100%; max-width: 360px; text-align: center; }
.modal-icon { width: 52px; height: 52px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-base); font-size: 26px; }
.modal-box h2 { font-size: 18px; font-weight: 500; margin: 0 0 var(--space-sm); color: var(--text); }
.modal-box p  { color: var(--text-muted); font-size: 14px; margin: 0 0 var(--space-lg); line-height: 1.5; }
.modal-normativa { background: var(--surface); border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.08); width: 100%; max-width: 600px; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-normativa-header { padding: var(--space-lg) 28px var(--space-md); border-bottom: 1px solid #eee; flex-shrink: 0; }
.modal-normativa-header h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.modal-normativa-body { padding: 5px 28px 5px; overflow-y: auto; flex: 1; text-align: left; font-size: 14px; color: #444; line-height: 1.6; }
.modal-normativa-body h2 { font-size: 15px; font-weight: 600; color: var(--text); margin: var(--space-base) 0 var(--space-xs); }
.modal-normativa-body h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: var(--space-md) 0 6px; }
.modal-normativa-body ul { padding-left: var(--space-base); margin: 0 0 var(--space-sm); }
.modal-normativa-body li { margin-bottom: 6px; }
.modal-normativa-body p  { margin: 0 0 10px; }
.modal-normativa-actions { margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid #eee; }
.checkbox-row { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: 0; text-align: left; }
.checkbox-row input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--text); }
.checkbox-row label { font-size: 13px; font-weight: 700; color: #333; line-height: 1.5; cursor: pointer; }

@media (max-width: 480px) {
  .modal-normativa { max-height: 100vh; border-radius: 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
}


/* ================================================================
   11. CALENDARIO (grid mensual, anual, agenda)
   Origen: calendar.php (específico, sin duplicados en otras vistas)
   ================================================================ */
.grid-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: #f5f4f0; border-bottom: 1px solid var(--border); text-align: center; }
.weekday-label { padding: var(--space-sm); font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; overflow: hidden; }
.wd-short { display: none; }
.wd-long  { display: inline; }
.grid-days { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, auto); }
.day-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: var(--space-xs); position: relative; background: var(--surface); cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.day-cell:hover { background: #fafaf9; }
.day-cell:nth-child(7n) { border-right: none; }
.day-number { font-size: 13px; font-weight: 500; color: var(--text-muted); display: inline-block; pointer-events: none; position: absolute; top: var(--space-xs); left: var(--space-xs); }
.day-cell.today .day-number { background: var(--text); color: #fff; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; font-size: 11px; }
.day-cell.empty { background: #fafaf9; opacity: 0.5; cursor: default; }

.grid-annual { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); padding: var(--space-lg); background: var(--surface); }
.annual-month-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-sm); background: #fafaf9; }
.annual-month-title { font-size: 13px; font-weight: 700; text-transform: uppercase; margin-bottom: var(--space-sm); text-align: center; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.annual-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 9px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.annual-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 2px; }
.annual-day-dot { font-size: 10px; font-weight: 500; padding: 3px 0; border-radius: var(--radius-xs); color: var(--text-muted); position: relative; cursor: pointer; transition: transform 0.1s; }
.annual-day-dot:hover { transform: scale(1.1); background: #eee; }
.annual-day-dot.has-res-own   { background: var(--info-bg);  color: var(--info-text);  font-weight: 700; }
.annual-day-dot.has-res-other { background: var(--other-bg); color: var(--other-text); font-weight: 700; }
.annual-day-dot[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 5px var(--space-xs); border-radius: var(--radius-xs); font-size: 10px; white-space: pre; z-index: 10; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.annual-day-dot[data-tooltip]:hover::after { opacity: 1; }

.agenda-view-container { padding: var(--space-lg); }
.agenda-empty { text-align: center; color: var(--text-muted); padding: var(--space-2xl) 0; font-size: 14px; }
.agenda-row { display: flex; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); gap: var(--space-lg); }
.agenda-row:last-child { border-bottom: none; }
.agenda-date-box { width: 100px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text); background: #f5f4f0; padding: 6px var(--space-sm); border-radius: var(--radius-sm); text-align: center; }
.agenda-list-items { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.agenda-item-card { display: flex; align-items: center; justify-content: space-between; padding: var(--space-sm) 14px; border-radius: var(--radius-sm); border-left: 4px solid var(--text); cursor: pointer; transition: transform 0.1s; }
.agenda-item-card:hover { transform: translateX(2px); }
.agenda-item-card.own   { background: var(--info-bg);  border-left-color: var(--info-text);  color: var(--info-text); }
.agenda-item-card.other { background: var(--other-bg); border-left-color: var(--other-text); color: var(--other-text); }


/* ================================================================
   12. RESPONSIVE / MEDIA QUERIES ADICIONALES
   Origen: admin.php, calendar.php
   (las media queries de contenedores/paneles ya están junto a su
   bloque en las secciones 5 y 10; aquí solo las de la cuadrícula
   del calendario, que son exclusivas de calendar.php)
   ================================================================ */
@media (max-width: 900px) {
  .cal-header-row1 { flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }
  .cal-controls-left { width: 100%; justify-content: center; }
  .cal-legend { width: 100%; justify-content: center; }
  .cal-view-selector { width: 100%; justify-content: center; }
}
.cal-header-row1 { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.cal-controls-left { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.cal-nav-buttons { display: flex; gap: 4px; }
.cal-dynamic-title { font-size: 18px; font-weight: 700; color: var(--text); }

@media (max-width: 768px) {
  .app-header { flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); }
  .header-nav { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .header-link { font-size: 12px; padding: 6px var(--space-sm); }
  .cal-inner-header { padding: var(--space-sm) var(--space-md); }
  .grid-days { grid-auto-rows: minmax(70px, auto); }
  .weekday-label { font-size: 9px; padding: var(--space-xs) 2px; letter-spacing: 0; }
  .wd-long { display: none; }
  .wd-short { display: inline; }