/* =============================================
   TG CRECIMIENTO — admin.css (Panel Admin)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:       #080f1a;
  --bg2:      #0a1423;
  --surface:  #0f1d30;
  --surface2: #152438;
  --surface3: #1a2e45;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(0,196,212,0.18);

  /* TG Brand Colors */
  --primary:  #1a4276;
  --primary-l:#2563a8;
  --secondary:#00c4d4;
  --accent:   #00c4d4;
  --success:  #22c55e;
  --danger:   #ef4444;
  --warning:  #f59e0b;

  --text:     #f0f6ff;
  --muted:    #8eb4d4;
  --faint:    #4e7498;

  --grad:     linear-gradient(135deg,#1a4276,#00c4d4);
  --grad-warm:linear-gradient(135deg,#1a6db5,#00e0f0);

  --sidebar-w: 240px;
  --sidebar-c: 64px;
  --radius:    10px;
  --radius-lg: 16px;
  --transition:all 0.25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter','Outfit',sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .55rem 1.2rem; border-radius: 8px;
  font-family: 'Outfit',sans-serif; font-weight: 600; font-size: .85rem;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,.3);
}
.btn-primary:hover { opacity:.9; transform:translateY(-1px); }
.btn-danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-ghost   { border: 1px solid var(--border2); color: var(--muted); background: transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-success { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.btn-sm      { padding: .35rem .85rem; font-size: .78rem; }
.btn-full    { width: 100%; justify-content: center; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top left,rgba(124,58,237,.15),transparent 60%),
              radial-gradient(ellipse at bottom right,rgba(6,182,212,.1),transparent 60%);
}
.login-orb {
  position: absolute; border-radius: 50%; filter: blur(80px);
}
.orb-a { width:500px; height:500px; background:rgba(124,58,237,.12); top:-150px; left:-150px; }
.orb-b { width:400px; height:400px; background:rgba(6,182,212,.08); bottom:-100px; right:-100px; }
.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: min(420px, 90vw);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.login-logo {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem;
}
.login-logo-text .login-title {
  display: block; font-family: 'Outfit',sans-serif; font-size: 1.3rem; font-weight: 800;
}
.login-logo-text .login-subtitle {
  display: block; font-size: .78rem; color: var(--muted); font-weight: 500;
}
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: .9rem; font-size: .9rem; pointer-events: none; }
.input-wrapper input {
  width: 100%; padding: .75rem 1rem .75rem 2.6rem;
  background: rgba(255,255,255,.04); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .92rem; outline: none;
  transition: var(--transition);
}
.input-wrapper input:focus { border-color: var(--primary); background: rgba(124,58,237,.08); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.toggle-pw {
  position: absolute; right: .75rem; font-size: .9rem;
  color: var(--faint); transition: var(--transition);
}
.toggle-pw:hover { color: var(--text); }
.login-error {
  color: #f87171; font-size: .82rem; min-height: 1.2rem; margin-bottom: .75rem;
  background: rgba(239,68,68,.1); border-radius: 6px;
  padding: 0;
}
.login-error:not(:empty) { padding: .5rem .75rem; }
.login-hint { text-align: center; margin-top: 1.25rem; font-size: .78rem; color: var(--faint); }

/* ══════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════ */
.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: var(--transition);
}
.dashboard.collapsed { grid-template-columns: var(--sidebar-c) 1fr; }

/* ── SIDEBAR ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  width: var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  overflow: hidden; transition: var(--transition);
  z-index: 100;
}
.dashboard.collapsed .sidebar { width: var(--sidebar-c); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem; border-bottom: 1px solid var(--border);
  min-height: 72px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: .75rem; overflow: hidden;
}
.sidebar-brand {
  font-family: 'Outfit',sans-serif; font-weight: 800; font-size: .95rem; white-space: nowrap;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-role {
  font-size: .68rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em;
}
.sidebar-toggle-btn {
  color: var(--faint); font-size: 1.2rem; padding: .25rem .4rem; border-radius: 6px;
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle-btn:hover { color: var(--text); background: var(--surface2); }
.dashboard.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: .75rem .5rem;
}
.nav-section-label {
  font-size: .65rem; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .1em;
  padding: .75rem .5rem .3rem; white-space: nowrap; overflow: hidden;
}
.dashboard.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: var(--radius);
  color: var(--muted); font-size: .88rem; font-weight: 500;
  transition: var(--transition); white-space: nowrap;
  position: relative; overflow: hidden;
}
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active {
  color: var(--text); background: rgba(124,58,237,.15);
  border-left: 3px solid var(--primary);
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-label { transition: var(--transition); }
.dashboard.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700; padding: .15rem .45rem;
  border-radius: 99px; min-width: 18px; text-align: center;
}
.nav-badge[data-count="0"] { display: none; }
.dashboard.collapsed .nav-badge { position: absolute; top: 4px; right: 4px; }

.superadmin-only { display: none; }
.superadmin-only.visible { display: flex; }
.nav-section-label.superadmin-only.visible { display: block; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: .75rem;
  display: flex; align-items: center; gap: .75rem;
  overflow: hidden;
}
.admin-info { display: flex; align-items: center; gap: .75rem; flex: 1; overflow: hidden; }
.admin-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit',sans-serif; font-size: .78rem; font-weight: 800; color: #fff;
}
.admin-details { overflow: hidden; }
.admin-name { font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-email { font-size: .7rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard.collapsed .admin-info { display: none; }
.logout-btn {
  font-size: 1.1rem; color: var(--faint); padding: .4rem;
  border-radius: 6px; transition: var(--transition); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* ── MAIN CONTENT ── */
.main-content {
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 100vh;
}

/* TOP BAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  min-height: 64px;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.page-title {
  font-family: 'Outfit',sans-serif; font-size: 1.1rem; font-weight: 700;
}
.mobile-menu-btn { display: none; font-size: 1.3rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-time { font-size: .78rem; color: var(--faint); }

/* SECTIONS */
.section { display: none; padding: 1.5rem; flex: 1; animation: fadeIn .25s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: var(--transition); cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.stat-icon { font-size: 2rem; }
.stat-num {
  font-family: 'Outfit',sans-serif; font-size: 1.6rem; font-weight: 900;
  line-height: 1;
}
.stat-label { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.stat-trend { margin-left: auto; color: var(--success); font-size: 1.2rem; }
.card-blue .stat-num   { color: #60a5fa; }
.card-green .stat-num  { color: var(--success); }
.card-yellow .stat-num { color: var(--accent); }
.card-purple .stat-num { color: var(--primary-l); }
.card-orange .stat-num { color: #fb923c; }
.card-teal .stat-num   { color: var(--secondary); }

/* ── DASHBOARD BOTTOM ── */
.dashboard-bottom {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem;
}
.recent-card, .quick-actions-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;
}
.card-header h3 { font-family: 'Outfit',sans-serif; font-size: .95rem; font-weight: 700; }
.quick-actions-card h3 {
  font-family: 'Outfit',sans-serif; font-size: .95rem; font-weight: 700; margin-bottom: 1rem;
}
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.quick-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem .75rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 600; color: var(--muted);
  transition: var(--transition); text-align: center;
}
.quick-btn span { font-size: 1.4rem; }
.quick-btn:hover { background: rgba(124,58,237,.12); border-color: var(--primary); color: var(--text); }

/* ── SECTION TOPBAR ── */
.section-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.section-filters { display: flex; gap: .75rem; flex-wrap: wrap; }
.search-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem 1rem; color: var(--text);
  font-size: .85rem; outline: none; transition: var(--transition);
  min-width: 220px;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem .9rem; color: var(--text);
  font-size: .85rem; outline: none; cursor: pointer;
}
.filter-select option { background: var(--surface); }

/* ── MINI STATS ── */
.mini-stats {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.mini-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .4rem .9rem;
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.mini-stat span { font-size: 1rem; font-weight: 800; color: var(--text); margin-right: .3rem; }
.mini-stat.nuevo      { border-color: rgba(96,165,250,.3); }
.mini-stat.contactado { border-color: rgba(245,158,11,.3); }
.mini-stat.inscrito   { border-color: rgba(34,197,94,.3); }
.mini-stat.cancelado  { border-color: rgba(239,68,68,.3); }

/* ── DATA TABLE ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
}
.data-table th {
  background: var(--surface2); padding: .75rem 1rem;
  font-size: .75rem; font-weight: 700; text-align: left;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .75rem 1rem; font-size: .83rem;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.loading-row { text-align: center; color: var(--faint); padding: 2rem !important; }
.empty-row { text-align: center; color: var(--faint); padding: 2.5rem !important; font-size: .9rem; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .65rem; border-radius: 99px; font-size: .72rem; font-weight: 700;
}
.badge-nuevo      { background: rgba(96,165,250,.15); color: #60a5fa; }
.badge-contactado { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-inscrito   { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-cancelado  { background: rgba(239,68,68,.15);  color: #f87171; }
.badge-activo     { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-inactivo   { background: rgba(239,68,68,.15);  color: #f87171; }
.badge-fullstack  { background: rgba(124,58,237,.15); color: var(--primary-l); }
.badge-comunicacion { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-data       { background: rgba(6,182,212,.15);  color: var(--secondary); }
.badge-taller     { background: rgba(236,72,153,.15); color: #f472b6; }
.badge-superadmin { background: var(--grad); color: #fff; }
.badge-admin      { background: rgba(124,58,237,.15); color: var(--primary-l); }
.badge-editor     { background: rgba(6,182,212,.15);  color: var(--secondary); }
.badge-gold   { background: rgba(245,158,11,.2); color: #fbbf24; }
.badge-silver { background: rgba(148,163,184,.2); color: #cbd5e1; }
.badge-purple { background: rgba(236,72,153,.2); color: #f472b6; }

/* ── OFFERS CARDS ── */
.offers-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 1.25rem;
}
.offer-admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: var(--transition);
}
.offer-admin-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.oac-header { display: flex; align-items: flex-start; justify-content: space-between; }
.oac-type-badge { font-size: .7rem; font-weight: 700; padding: .2rem .7rem; border-radius: 99px; }
.oac-discount {
  font-family: 'Outfit',sans-serif; font-size: 2rem; font-weight: 900;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.oac-title { font-family: 'Outfit',sans-serif; font-size: 1rem; font-weight: 700; }
.oac-desc { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.oac-price { display: flex; align-items: baseline; gap: .75rem; }
.oac-old { font-size: .8rem; color: var(--faint); text-decoration: line-through; }
.oac-new {
  font-family: 'Outfit',sans-serif; font-size: 1.3rem; font-weight: 900;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.oac-actions { display: flex; gap: .5rem; }

/* ── PAGINATION ── */
.pagination {
  display: flex; gap: .5rem; justify-content: center;
  align-items: center; padding: 1rem 0; flex-wrap: wrap;
}
.page-btn {
  padding: .35rem .75rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: .82rem; font-weight: 600;
  transition: var(--transition); cursor: pointer;
}
.page-btn:hover { background: var(--surface2); color: var(--text); }
.page-btn.active { background: var(--primary); color: #fff; border-color: transparent; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); width: min(560px,95vw);
  max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-lg { width: min(680px,95vw); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h2 { font-family: 'Outfit',sans-serif; font-size: 1.05rem; font-weight: 700; }
.modal-close {
  color: var(--faint); font-size: 1.1rem; padding: .3rem .5rem;
  border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.modal-body { padding: 1.5rem; }

/* MODAL FORM */
.modal-form { display: flex; flex-direction: column; gap: 1rem; }
.modal-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-form .form-group label {
  display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem;
}
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: .65rem .9rem; color: var(--text); font-size: .88rem; outline: none;
  transition: var(--transition);
}
.modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus {
  border-color: var(--primary); background: rgba(124,58,237,.08);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.modal-form select option { background: var(--surface2); }
.modal-form textarea { resize: vertical; min-height: 80px; }
.modal-form .form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: .5rem; }

/* Toggle switch */
.toggle-group { display: flex; align-items: center; justify-content: space-between; }
.toggle-switch {
  position: relative; width: 44px; height: 24px; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; background: var(--surface2); border-radius: 99px;
  border: 1px solid var(--border); transition: var(--transition);
}
.toggle-thumb {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: var(--faint); top: 3px; left: 3px; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked ~ .toggle-thumb { left: 23px; background: #fff; }

/* Benefits editor */
.benefits-editor { display: flex; flex-direction: column; gap: .5rem; }
.benefit-item-row { display: flex; gap: .5rem; align-items: center; }
.benefit-item-row input { flex: 1; }
.remove-benefit { color: var(--danger); font-size: 1.2rem; padding: .2rem .4rem; border-radius: 4px; }
.remove-benefit:hover { background: rgba(239,68,68,.1); }
.add-benefit { color: var(--success); font-size: .82rem; font-weight: 600; padding: .4rem; }
.add-benefit:hover { color: #4ade80; }

/* Detail view */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.detail-item { background: var(--surface2); border-radius: var(--radius); padding: .75rem; }
.detail-label { font-size: .7rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.detail-value { font-size: .9rem; font-weight: 600; }
.detail-full { grid-column: 1 / -1; }
.estado-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem .9rem; color: var(--text);
  font-size: .85rem; outline: none; cursor: pointer; width: 100%;
}
.notes-area {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .65rem .9rem; color: var(--text);
  font-size: .85rem; outline: none; resize: vertical; min-height: 80px;
  transition: var(--transition);
}
.notes-area:focus { border-color: var(--primary); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: .75rem 1.25rem;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(20px); opacity: 0;
  transition: var(--transition); z-index: 300;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,.4); color: #4ade80; }
.toast.error   { border-color: rgba(239,68,68,.4); color: #f87171; }
.toast.warning { border-color: rgba(245,158,11,.4); color: #fbbf24; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL — RESPONSIVE COMPLETO
   ═══════════════════════════════════════════════════════════════ */

/* ── 900px: Tablets ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard                { grid-template-columns: 1fr; }

  /* Sidebar se convierte en drawer */
  .sidebar {
    position: fixed; left: -100%; top: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 200;
    box-shadow: 4px 0 30px rgba(0,0,0,.5);
    transition: left .3s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open             { left: 0; }
  .mobile-menu-btn          { display: block; }

  /* Overlay para cerrar sidebar */
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 150;
    backdrop-filter: blur(4px);
  }
  .sidebar-overlay.open     { display: block; }

  /* Main ocupa todo el ancho */
  .main-content             { padding: 1rem; }
  .dashboard-bottom         { grid-template-columns: 1fr; }
  .quick-actions            { grid-template-columns: repeat(4, 1fr); gap: .6rem; }
  .modal-form .form-row     { grid-template-columns: 1fr; }
  .detail-grid              { grid-template-columns: 1fr; }
  .stats-grid               { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Topbar */
  .topbar                   { padding: .85rem 1.25rem; gap: .75rem; }
  .topbar-actions           { gap: .5rem; }
  .topbar h1                { font-size: 1.1rem; }

  /* Table: scroll horizontal */
  .table-wrapper            { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table                     { min-width: 600px; }

  /* Modal */
  .modal-overlay            { padding: 1rem; }
  .modal                    { width: min(600px, 95vw); }
}

/* ── 768px: Tablet pequeño ─────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid               { grid-template-columns: 1fr 1fr; gap: .85rem; }
  .stat-card                { padding: 1.1rem; }
  .stat-value               { font-size: 1.6rem; }

  .quick-actions            { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .quick-action-btn         { padding: 1rem; }
  .quick-action-btn .icon   { font-size: 1.3rem; }
  .quick-action-btn .label  { font-size: .78rem; }

  .section                  { padding: 1.25rem; border-radius: 12px; }
  .section-header           { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .section-header-actions   { width: 100%; display: flex; gap: .5rem; flex-wrap: wrap; }
  .section-header-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

  .modal                    { width: min(540px, 96vw); border-radius: 14px; }
  .modal-header             { padding: 1.1rem 1.25rem; }
  .modal-body               { padding: 1.25rem; }
  .modal-footer             { padding: .85rem 1.25rem; flex-direction: column; }
  .modal-footer .btn        { width: 100%; justify-content: center; }

  .topbar                   { padding: .75rem 1rem; }
  .topbar h1                { font-size: 1rem; }
  .search-bar               { display: none; }

  /* Filters */
  .filters-row              { flex-direction: column; gap: .75rem; }
  .filters-row select,
  .filters-row input        { width: 100%; }

  /* Enrollment detail */
  .enrollment-detail-grid   { grid-template-columns: 1fr; }
}

/* ── 640px: Móvil grande ────────────────────────────────────── */
@media (max-width: 640px) {
  .main-content             { padding: .85rem .75rem; }
  .topbar                   { padding: .65rem .85rem; }
  .topbar h1                { font-size: .95rem; }
  .mobile-menu-btn          { padding: .35rem; }

  .stats-grid               { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .stat-card                { padding: .9rem; border-radius: 10px; }
  .stat-value               { font-size: 1.4rem; }
  .stat-label               { font-size: .72rem; }
  .stat-icon                { width: 34px; height: 34px; font-size: .9rem; }

  .quick-actions            { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .quick-action-btn         { padding: .85rem .65rem; border-radius: 10px; }

  .section                  { padding: 1rem; border-radius: 10px; }
  .section-title            { font-size: .95rem; }

  /* Table compact */
  td, th                    { padding: .55rem .65rem; font-size: .78rem; }
  .badge                    { font-size: .68rem; padding: .2rem .55rem; }

  .modal                    { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; margin-top: auto; }
  .modal-overlay            { padding: 0; align-items: flex-end; }
  .modal-header             { padding: 1rem; }
  .modal-body               { padding: 1rem; }

  /* Login */
  .login-card               { width: min(400px, 94vw); padding: 1.75rem 1.25rem; }
  .login-header h1          { font-size: 1.3rem; }
}

/* ── 480px: Móvil estándar ──────────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid               { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat-value               { font-size: 1.25rem; }
  .stat-label               { font-size: .68rem; }

  .quick-actions            { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .quick-action-btn .label  { font-size: .72rem; }

  .section                  { padding: .85rem; }

  td, th                    { padding: .45rem .55rem; font-size: .75rem; }

  .btn                      { padding: .55rem .9rem; font-size: .82rem; }
  .btn-sm                   { padding: .35rem .65rem; font-size: .72rem; }

  .login-card               { padding: 1.5rem 1rem; width: 96vw; }
  .login-header img         { width: 50px; height: 50px; }
  .login-header h1          { font-size: 1.2rem; }

  .toast                    { left: .75rem; right: .75rem; max-width: 100%; font-size: .82rem; }
}

/* ── 380px: Móvil pequeño ───────────────────────────────────── */
@media (max-width: 380px) {
  .stats-grid               { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .stat-card                { padding: .75rem .6rem; }
  .stat-value               { font-size: 1.15rem; }
  .quick-actions            { grid-template-columns: 1fr 1fr; gap: .4rem; }
  td, th                    { padding: .35rem .45rem; font-size: .7rem; }
  .main-content             { padding: .65rem .5rem; }
}

/* ── Touch improvements ─────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn:hover, .stat-card:hover,
  .quick-action-btn:hover   { transform: none; }
  .btn:active               { transform: scale(0.97); opacity: .9; }
  .nav-item:active          { background: rgba(0,196,212,.1); }

  /* Larger tap targets */
  .nav-item                 { min-height: 44px; }
  .btn                      { min-height: 42px; }
  input, select             { min-height: 44px; }
}

/* ── Landscape móvil ────────────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  .sidebar                  { width: 200px; }
  .sidebar-logo             { padding: .75rem 1rem; }
  .nav-item                 { padding: .5rem 1rem; }
  .stat-card                { padding: .75rem; }
  .stat-value               { font-size: 1.3rem; }
}
