/* ============================================================
   main.css — Sistema de diseño completo
   Plataforma Empresarial — La Masó Sports
   Fuente: Source Sans Pro
   ============================================================ */

/* ── 1. VARIABLES ─────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sidebar-bg:       #263445;
  --sidebar-hover:    #1f2d3d;
  --sidebar-active:   #1a2535;
  --sidebar-border:   rgba(255,255,255,.05);
  --sidebar-text:     rgba(255,255,255,.80);
  --sidebar-text-dim: rgba(255,255,255,.45);
  --sidebar-width:    240px;

  /* Colores principales */
  --accent:       #4A90A4;
  --accent-hover: #3a7a8e;
  --accent-dim:   rgba(74,144,164,.12);

  /* Fondos */
  --bg:       #f4f6f8;
  --surface:  #ffffff;
  --surface2: #f8fafc;

  /* Texto */
  --text:     #2C3E50;
  --text-mid: #4a5568;
  --muted:    #7F8C9A;
  --border:   #e1e6ea;
  --border2:  #dde3e9;

  /* Estados */
  --success:     #27ae60;
  --success-dim: rgba(39,174,96,.12);
  --warning:     #f39c12;
  --warning-dim: rgba(243,156,18,.12);
  --danger:      #e74c3c;
  --danger-dim:  rgba(231,76,60,.12);
  --info:        #3498db;
  --info-dim:    rgba(52,152,219,.12);

  /* Tipografía — AUMENTADA */
  --font:        'Source Sans Pro', sans-serif;
  --font-size:   14px;
  --line-height: 1.55;

  /* Espaciado */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow:    0 2px 12px rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);

  /* Topbar */
  --topbar-h: 60px;

  /* Bottom nav móvil */
  --bottomnav-h: 64px;

  /* Transiciones */
  --transition: .18s ease;
}

/* ── 2. RESET Y BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--font-size); scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: var(--line-height);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

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

/* ── 3. LAYOUT PRINCIPAL ──────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
}

.page-content {
  flex: 1;
  padding: 28px;
  padding-top: calc(var(--topbar-h) + 28px);
}

/* ── 4. SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition), width var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-logo-img {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  object-fit: contain;
  background: rgba(255,255,255,.1);
  padding: 4px;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sidebar-text-dim);
  padding: 16px 18px 5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: rgba(255,255,255,.2);
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar-item .si-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-item .si-label { flex: 1; }
.sidebar-item .si-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-submenu { display: none; background: rgba(0,0,0,.15); padding: 4px 0; }
.sidebar-submenu.open { display: block; }
.sidebar-submenu .sidebar-item { padding-left: 48px; font-size: 13px; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 16px;
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 12px; color: var(--sidebar-text-dim); }

/* ── 5. AVATAR ────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 68px; height: 68px; font-size: 24px; border-radius: var(--radius-lg); }

.status-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}
.status-dot.activo       { background: var(--success); }
.status-dot.ausente      { background: var(--warning); }
.status-dot.no_molestar  { background: var(--danger); }
.status-dot.desconectado { background: var(--muted); }

/* ── 6. TOPBAR ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 100;
  transition: left var(--transition);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.topbar-toggle:hover { background: var(--surface2); color: var(--text); }

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-notif {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  transition: all var(--transition);
}
.topbar-notif:hover { background: var(--surface2); color: var(--text); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(74,144,164,.04); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.notif-item-text  { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time  { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── 7. CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body   { padding: 20px; }
.card-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* KPI Cards */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kpi-val { font-size: 28px; font-weight: 700; line-height: 1; color: var(--text); }
.kpi-lbl { font-size: 12px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }

/* ── 8. GRID ──────────────────────────────────────────────── */
.grid   { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── 9. TABLAS ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead tr { border-bottom: 2px solid var(--border); }
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface2);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-mid);
}
.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr:last-child td { border-bottom: none; }

.td-name { font-weight: 600; color: var(--text); font-size: 14px; }
.td-sub  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── 10. FORMULARIOS ──────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 7px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,144,164,.15);
  background: var(--surface);
}
.form-control::placeholder { color: #b0bec5; }
.form-control:disabled { opacity: .6; cursor: not-allowed; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237F8C9A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%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; }

.form-row   { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint  { font-size: 13px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 5px; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-group .input-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

/* ── 11. BOTONES ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(.98); }

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

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surface2); color: var(--text); }

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

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

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

.btn-ghost        { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover  { background: var(--accent-dim); }

.btn-ghost-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-dim); }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ── 12. BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-primary   { background: var(--accent-dim);          color: var(--accent); }
.badge-success   { background: var(--success-dim);         color: var(--success); }
.badge-warning   { background: var(--warning-dim);         color: var(--warning); }
.badge-danger    { background: var(--danger-dim);          color: var(--danger); }
.badge-info      { background: var(--info-dim);            color: var(--info); }
.badge-secondary { background: rgba(127,140,154,.12);      color: var(--muted); }
.badge-superadmin{ background: rgba(142,68,173,.12);       color: #8e44ad; }
.badge-admin     { background: var(--accent-dim);          color: var(--accent); }

/* ── 13. ALERTAS ──────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-dim); border-color: rgba(39,174,96,.25);  color: #1e7e45; }
.alert-danger  { background: var(--danger-dim);  border-color: rgba(231,76,60,.25);  color: #a93226; }
.alert-warning { background: var(--warning-dim); border-color: rgba(243,156,18,.25); color: #9a6700; }
.alert-info    { background: var(--info-dim);    border-color: rgba(52,152,219,.25); color: #1a6fa3; }

/* ── 14. MODALES ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(38,52,69,.6);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.98);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 820px; }
.modal-sm { max-width: 420px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-title  { font-size: 17px; font-weight: 700; }
.modal-close  {
  background: none; border: none;
  color: var(--muted); font-size: 22px;
  cursor: pointer; border-radius: 6px;
  padding: 3px 8px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── 15. CABECERA DE PÁGINA ───────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.page-header-left p {
  font-size: 14px;
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { opacity: .5; }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ── 16. HORARIO ──────────────────────────────────────────── */
.horario-table { width: 100%; border-collapse: collapse; }
.horario-table th {
  background: var(--accent);
  color: #fff;
  padding: 10px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
}
.horario-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
.horario-table tbody tr:hover { background: var(--surface2); }
.horario-dia {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left !important;
  padding-left: 14px !important;
}
.horario-table input[type="time"] {
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface2);
  width: 100px;
  transition: border-color var(--transition);
}
.horario-table input[type="time"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74,144,164,.15);
}

/* ── 17. CHAT / MENSAJES ──────────────────────────────────── */
.chat-bubble {
  display: flex;
  gap: 10px;
  padding: 5px 16px;
  transition: background var(--transition);
}
.chat-bubble:hover { background: var(--surface2); }
.bubble-body { flex: 1; min-width: 0; }
.bubble-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.bubble-author { font-weight: 700; font-size: 14px; cursor: pointer; }
.bubble-time   { font-size: 12px; color: var(--muted); }
.bubble-text   { font-size: 15px; line-height: 1.55; word-wrap: break-word; }

.chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-box {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,144,164,.1);
}
.chat-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px 10px;
}
.chat-textarea {
  flex: 1; background: none; border: none;
  font-family: var(--font); font-size: 15px;
  color: var(--text); resize: none; outline: none;
  min-height: 24px; max-height: 180px; line-height: 1.5;
}
.chat-textarea::placeholder { color: #b0bec5; }
.chat-send-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--accent);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.chat-send-btn:hover { background: var(--accent-hover); transform: scale(1.05); }
.chat-send-btn:disabled { background: var(--border); cursor: not-allowed; transform: none; }

/* ── 18. CALENDARIO ───────────────────────────────────────── */

/* ── 19. UTILIDADES ───────────────────────────────────────── */
.text-muted   { color: var(--muted) !important; }
.text-accent  { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 12px; }

.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; }

.mt-1 { margin-top: 4px; }   .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }  .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }  .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }

.w-full  { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden  { display: none !important; }
.relative { position: relative; }

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.empty-state {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state-icon { font-size: 52px; margin-bottom: 14px; opacity: .4; }
.empty-state h3   { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p    { font-size: 14px; max-width: 300px; margin: 0 auto; line-height: 1.6; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  transform: translateY(100px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── 20. BOTTOM NAV MÓVIL ─────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.bottom-nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
  min-width: 58px;
}
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:hover  { color: var(--text); background: var(--surface2); }
.bottom-nav-icon  { font-size: 22px; }
.bottom-nav-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.bottom-nav-badge {
  position: absolute; top: 4px; right: 8px;
  background: var(--danger);
  color: #fff; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ── 21. SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── 22. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --font-size: 15px;
  }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }

  .app-content  { margin-left: 0; }
  .topbar       { left: 0; }
  .topbar-toggle { display: flex; }

  .page-content {
    padding: 16px;
    padding-top: calc(var(--topbar-h) + 16px);
    padding-bottom: calc(var(--bottomnav-h) + 16px);
  }

  .bottom-nav { display: flex; }

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

  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .notif-dropdown { right: -60px; width: 300px; }
  .hide-mobile { display: none !important; }
}

/* ── 23. PRINT ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print { display: none !important; }
  .app-content  { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff; }
}