/* ============================================================
   DESIGN SYSTEM — Enterprise Dark Dashboard
   Fonts: Syne (headings) + DM Sans (body)
   Palette: Deep Navy + Orange accent
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:         #070b14;
  --bg2:        #0d1526;
  --bg3:        #101e35;
  --border:     #1a2e4a;
  --border2:    #243b5a;

  --accent:     #f97316;
  --accent-dim: rgba(249,115,22,.15);
  --accent2:    #fb923c;

  --text:       #e2e8f0;
  --text2:      #94a3b8;
  --text3:      #4f6880;

  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #f43f5e;
  --info:       #38bdf8;
  --purple:     #a78bfa;

  --sidebar-w:  248px;
  --header-h:   60px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --trans:      all .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(249,115,22,.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(56,189,248,.06) 0%, transparent 50%),
    var(--bg);
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 60px rgba(249,115,22,.05);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 56px; height: 56px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
}
.login-logo h1 {
  font-size: 1.6rem;
  color: var(--text);
  letter-spacing: -.5px;
}
.login-logo p { font-size: .85rem; color: var(--text3); margin-top: 4px; }

.login-form .form-group { margin-bottom: 16px; }
.login-form label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-form input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  transition: var(--trans);
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.login-form input::placeholder { color: var(--text3); }

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  transition: var(--trans);
}
.btn-login:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.login-error {
  background: rgba(244,63,94,.1);
  border: 1px solid rgba(244,63,94,.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .88rem;
  margin-top: 12px;
  display: none;
}
.login-error.show { display: block; }

.field-error {
  font-size: 0.78rem;
  color: var(--danger, #f43f5e);
  margin: 6px 0 0 0;
  line-height: 1.35;
}
.field-error:empty {
  display: none;
}
.form-group.has-error > input,
.form-group.has-error > select,
.form-group.has-error > textarea {
  border-color: var(--danger, #f43f5e);
}
.consent-box.has-error {
  border-color: rgba(244, 63, 94, 0.45);
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: .78rem;
  color: var(--text3);
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════════════════════════ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.2;
}
.brand-sub { font-size: .7rem; color: var(--text3); }

.sidebar-nav {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}
.sidebar-nav li { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text2);
  transition: var(--trans);
}
.nav-link:hover {
  background: var(--bg3);
  color: var(--text);
}
.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 8px 16px;
  border-top: 1px solid var(--border);
}
#btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--danger);
  background: transparent;
  transition: var(--trans);
}
#btn-logout:hover { background: rgba(244,63,94,.1); }

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

/* ── Top Header ────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
#page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
#user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-name { font-size: .9rem; font-weight: 600; text-align: right; }
.user-role {
  font-size: .74rem;
  color: var(--accent);
  text-align: right;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.avatar {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--accent);
}
.avatar-sm {
  width: 28px; height: 28px;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .8rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Page Content ──────────────────────────────────────────── */
#main-content {
  padding: 24px;
  flex: 1;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════ */

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--trans);
}
.card:hover { border-color: var(--border2); }
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.cards-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cards-row > * { flex: 1; min-width: 240px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ── KPI Grid ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}
.kpi-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
  transition: var(--trans);
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
}
.kpi-success::before { background: var(--success); }
.kpi-warning::before { background: var(--warning); }
.kpi-info::before    { background: var(--info); }
.kpi-accent::before  { background: var(--accent); }
.kpi-purple::before  { background: var(--purple); }
.kpi-muted::before   { background: var(--text3); }

.kpi-icon { font-size: 1.4rem; margin-bottom: 8px; }
.kpi-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label { font-size: .78rem; color: var(--text3); font-weight: 500; }

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.progress-label strong { color: var(--text); font-weight: 700; }
.progress-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-success  { background: rgba(34,197,94,.15);  color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.badge-warning  { background: rgba(245,158,11,.15); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.badge-danger   { background: rgba(244,63,94,.15);  color: var(--danger);  border: 1px solid rgba(244,63,94,.3); }
.badge-info     { background: rgba(56,189,248,.15); color: var(--info);    border: 1px solid rgba(56,189,248,.3); }
.badge-muted    { background: rgba(148,163,184,.1); color: var(--text2);   border: 1px solid var(--border); }

.badge-rol { text-transform: capitalize; }
.badge-asesor         { background: rgba(56,189,248,.15); color: var(--info); }
.badge-coordinador    { background: rgba(167,139,250,.15); color: var(--purple); }
.badge-supervisor     { background: rgba(249,115,22,.15); color: var(--accent); }
.badge-calidad        { background: rgba(52,211,153,.15);  color: #34d399; }
.badge-formacion      { background: rgba(99,102,241,.15);   color: #6366f1; }
.badge-gtr            { background: rgba(249,115,22,.20);   color: #f97316; }
.badge-jefe           { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-gerente        { background: rgba(251,146,60,.15);  color: #fb923c; }
.badge-administrador  { background: rgba(34,197,94,.15);  color: var(--success); }

/* Pills */
.summary-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
}
.pill-success { background: rgba(34,197,94,.12);  color: var(--success); }
.pill-warning { background: rgba(245,158,11,.12); color: var(--warning); }
.pill-info    { background: rgba(56,189,248,.12); color: var(--info); }

/* ── Section Header ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.btn-filter {
  padding: 6px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 600;
  transition: var(--trans);
}
.btn-filter:hover { border-color: var(--border2); color: var(--text); }
.btn-filter.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Task Cards ────────────────────────────────────────────── */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.task-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--trans);
  position: relative;
}
.task-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.task-card.vencida { border-color: rgba(244,63,94,.3); }
.task-card.vencida::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--danger);
  border-radius: var(--radius) var(--radius) 0 0;
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.task-card-header h4 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.task-desc {
  font-size: .83rem;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--text3);
  margin-bottom: 10px;
}
.vencida-tag {
  background: rgba(244,63,94,.2);
  color: var(--danger);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
}
.task-actions .estado-select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: .83rem;
}
.task-actions .estado-select:focus {
  border-color: var(--accent);
  outline: none;
}

/* ── Data Table ────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
.data-table td strong { color: var(--text); }
.data-table td small { font-size: .75rem; color: var(--text3); }
.data-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.data-table tbody tr:last-child td { border-bottom: none; }
.row-highlight td { background: rgba(249,115,22,.04) !important; }
.you-tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  margin-left: 4px;
}
.empty-cell {
  text-align: center;
  color: var(--text3);
  padding: 32px !important;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row  { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 13px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  transition: var(--trans);
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group input[readonly] { opacity: .6; cursor: not-allowed; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  transition: var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover { border-color: var(--border); color: var(--text); }

.btn-icon {
  background: transparent;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: var(--trans);
}
.btn-edit:hover  { background: rgba(56,189,248,.1); }
.btn-danger:hover { background: rgba(244,63,94,.1); }

/* ── Ranking Items ─────────────────────────────────────────── */
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-pos { font-size: 1.4rem; }

/* ── Comments ──────────────────────────────────────────────── */
.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.comment-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-header strong { display: block; font-size: .88rem; }
.comment-header small { font-size: .75rem; color: var(--text3); }
.comment-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 6px;
}
.comment-card p { font-size: .83rem; color: var(--text2); line-height: 1.6; }

/* ── Empty States ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  max-width: 420px;
  margin: 24px auto;
  color: var(--text3);
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  transition: border-color var(--duration-fast, 0.2s) var(--ease-out, ease), box-shadow var(--duration-fast, 0.2s) ease;
}
.empty-state span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 14px;
  filter: grayscale(0.15);
}
.empty-state p {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text2);
}

/* ── Loading Spinner ───────────────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .88rem; }
.alert-danger { background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3); color: var(--danger); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: .88rem;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: all .3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-248px); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 248px; }
  .main-wrapper { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .cards-row { flex-direction: column; }
  .tasks-grid { grid-template-columns: 1fr; }
  #main-content { padding: 16px; }
}

/* ══════════════════════════════════════════════════════════
   KPI STYLES
══════════════════════════════════════════════════════════ */
.kpi-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: .9rem;
  color: var(--text2);
  animation: fadeIn .3s ease;
}
.score-preview strong {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.observacion-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
}
.observacion-box strong {
  display: block;
  font-size: .82rem;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.observacion-box p {
  font-size: .88rem;
  color: var(--text2);
  line-height: 1.6;
}

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

/* ══════════════════════════════════════════════════════════
   CALENDARIO DE ASISTENCIA
══════════════════════════════════════════════════════════ */
.asist-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.asist-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  font-size: .85rem;
}

.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.cal-header {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 0;
}
.cal-empty { background: transparent; }

.cal-dia {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: var(--trans);
}
.cal-dia:hover { border-color: var(--border2); }
.cal-finde { background: rgba(255,255,255,.02); opacity: .6; }
.cal-hoy   { border-color: var(--accent) !important; background: var(--accent-dim); }
.cal-num {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text2);
  align-self: flex-start;
  padding-left: 2px;
}
.cal-select {
  width: 100%;
  font-size: .68rem;
  padding: 3px 4px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.cal-select:focus { border-color: var(--accent); outline: none; }
.cal-vacio { opacity: .5; }
.cal-obs {
  font-size: .75rem;
  cursor: help;
  align-self: flex-end;
}
.cal-estado-icon {
  font-size: 1.1rem;
  margin-top: 2px;
}
.cal-obs-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: .65rem;
  cursor: help;
}
.cal-vacio-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border2);
  margin-top: 4px;
}
.cal-readonly { cursor: default; }
.cal-readonly:hover { transform: none; }

@media (max-width: 768px) {
  .calendario-grid { gap: 2px; }
  .cal-dia { min-height: 52px; padding: 4px 2px; }
  .cal-select { font-size: .6rem; }
}

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(7,11,20,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 99998;
  opacity: 0; transition: opacity .25s ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { opacity: 1; }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  transform: translateY(-20px);
  transition: transform .25s ease;
}
.modal-overlay.show .modal-box { transform: translateY(0); }

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.modal-title.modal-danger { color: var(--danger); }

.modal-msg {
  color: var(--text2);
  font-size: .92rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-box .btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  transition: var(--trans);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

.btn-danger-solid {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  transition: var(--trans);
}
.btn-danger-solid:hover { background: #e11d48; }

/* ══════════════════════════════════════════════════════════
   NOTIFICACIONES
══════════════════════════════════════════════════════════ */
.notif-wrap {
  position: relative;
  margin-right: 8px;
}

.btn-notif {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  position: relative;
  transition: var(--trans);
  cursor: pointer;
}
.btn-notif:hover { background: var(--border2); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg2);
}

.notif-panel {
  position: absolute;
  top: 48px; right: 0;
  width: 320px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 9999;
  display: none;
  overflow: hidden;
}
.notif-panel.open { display: block; animation: fadeIn .15s ease; }

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
}
.btn-text:hover { text-decoration: underline; }

.notif-list { max-height: 340px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--trans);
}
.notif-item:hover { background: var(--bg3); }
.notif-item:last-child { border-bottom: none; }

.notif-icon { font-size: 1.2rem; flex-shrink: 0; padding-top: 2px; }

.notif-titulo {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.notif-msg   { font-size: .8rem; color: var(--text2); margin-bottom: 4px; }
.notif-time  { font-size: .72rem; color: var(--text3); }

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: .88rem;
}

/* ══════════════════════════════════════════════════════════
   BÚSQUEDA / SEARCH INPUT
══════════════════════════════════════════════════════════ */
.search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 8px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .88rem;
  transition: var(--trans);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-input::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════════════════════
   FORTALEZA CONTRASEÑA
══════════════════════════════════════════════════════════ */
#pass-strength {
  font-size: .78rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 18px;
}

/* ── Badge modo edición / solo lectura ──────────────────── */
.at-modo-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.at-modo-edit {
  background: rgba(249,115,22,.15);
  color: var(--accent);
  border: 1px solid rgba(249,115,22,.3);
}
.at-modo-view {
  background: rgba(56,189,248,.12);
  color: var(--info);
  border: 1px solid rgba(56,189,248,.25);
}

/* ── Celda readonly: sin cursor pointer, sin hover interactivo ─ */
.at-cell-readonly {
  cursor: default !important;
}
.at-cell-readonly:hover {
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Celda editable: feedback visual ───────────────────── */
.at-cell-editable {
  cursor: pointer;
}

/* ── Botón Excel ─────────────────────────────────────────── */
.btn-success-outline {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.4);
  color: #22c55e;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-success-outline:hover {
  background: rgba(34,197,94,.22);
  border-color: rgba(34,197,94,.7);
  box-shadow: 0 0 12px rgba(34,197,94,.2);
}

/* ══════════════════════════════════════════════════════════
   TABLA DE ASISTENCIA MENSUAL — MATRIZ INVERTIDA
   Filas = Asesores  |  Columnas = Días
══════════════════════════════════════════════════════════ */

/* ── Toolbar + leyenda (tabla asistencia) ─────────────────── */
.at-toolbar-wrap {
  margin-bottom: 12px;
}
.at-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 0;
}
.at-toolbar-left  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.at-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }

.at-leyenda-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.at-leyenda-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  width: max-content;
  min-width: 100%;
}

.at-select {
  padding: 8px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: var(--trans);
}
.at-select:focus { outline: none; border-color: var(--accent); }

.at-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.at-leg-item {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.2;
}

/* ── Scroll container ────────────────────────────────────── */
.at-scroll-hint {
  font-size: .75rem;
  color: var(--text3);
  margin-bottom: 6px;
  display: none;
}
@media (max-width: 900px) { .at-scroll-hint { display: block; } }

.at-table-wrapper { position: relative; }

.at-table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 72vh;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}

/* ── Tabla ───────────────────────────────────────────────── */
.at-matrix,
.at-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .8rem;
  min-width: max-content;
  width: max-content;
  table-layout: fixed;
}

/* ── Sticky: nombre y área fijos a la izquierda ──────────── */
.at-sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg2);
  box-sizing: border-box;
}
.at-sticky-col2 {
  position: sticky;
  left: 160px; /* ancho columna Asesor */
  z-index: 3;
  background: var(--bg2);
  border-right: 2px solid var(--border2);
  box-sizing: border-box;
}

/* ── Cabecera (días en columnas) ─────────────────────────── */
.at-head-row th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg3);
  border-bottom: 2px solid var(--border2);
}
.at-head-row .at-sticky-col,
.at-head-row .at-sticky-col2 { z-index: 5; }

.at-th-nombre {
  min-width: 160px;
  width: 160px;
  max-width: 260px;
  padding: 8px 10px;
  text-align: left;
  font-size: .78rem;
  color: var(--text2);
  font-weight: 700;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: middle;
}
.at-th-area {
  min-width: 120px;
  width: 120px;
  padding: 8px 8px;
  text-align: left;
  font-size: .74rem;
  color: var(--text2);
  font-weight: 600;
  vertical-align: middle;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
}

/* Columna de cada día — 26px, tipografía compacta */
.at-th-dia-col {
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  padding: 5px 2px;
  text-align: center;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  vertical-align: middle;
  cursor: default;
  box-sizing: border-box;
}
.at-th-dia-col.at-week-start,
.at-cell.at-week-start {
  border-left: 2px solid rgba(249, 115, 22, 0.4);
}
.at-th-finde {
  background: rgba(148, 163, 184, 0.1) !important;
  color: var(--text3) !important;
}
.at-th-hoy {
  background: rgba(249, 115, 22, 0.2) !important;
  color: var(--accent) !important;
}
.at-dia-num {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  display: block;
}
.at-dia-dow {
  font-size: 9px;
  color: var(--text3);
  margin-top: 2px;
  text-align: center;
  letter-spacing: 0.03em;
  font-weight: 600;
  display: block;
}
.at-th-finde .at-dia-dow {
  color: rgba(148, 163, 184, 0.95);
}
.at-th-hoy .at-dia-dow { color: var(--accent); opacity: .9; }

/* Totales — 36px */
.at-th-tot {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 6px 2px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  border-left: 1px solid rgba(148, 163, 184, 0.25);
  vertical-align: middle;
  box-sizing: border-box;
}
.at-th-pct {
  width: 36px;
  min-width: 36px;
  max-width: 38px;
  color: var(--accent);
  border-left: 2px solid var(--border2);
}

/* ── Filas (una por asesor) ──────────────────────────────── */
.at-row {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  transition: background .15s ease;
}
tbody tr.at-row:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}
tbody tr.at-row:nth-child(even) td.at-sticky-col,
tbody tr.at-row:nth-child(even) td.at-sticky-col2 {
  background: rgba(15, 23, 42, 0.98);
}
tbody tr.at-row:hover td {
  background: rgba(249, 115, 22, 0.06);
}
tbody tr.at-row:hover .at-sticky-col,
tbody tr.at-row:hover .at-sticky-col2 {
  background: rgba(18, 26, 44, 0.99) !important;
}

.at-td-nombre {
  min-width: 160px;
  width: 160px;
  max-width: 260px;
  padding: 7px 10px;
  min-height: 38px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  /* Una sola línea (ADP / nombre corto); elipsis si no cabe */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
  box-sizing: border-box;
}
.at-td-area {
  min-width: 120px;
  width: 120px;
  padding: 6px 8px;
  font-size: .72rem;
  color: var(--text3);
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
  box-sizing: border-box;
}

/* ── Celda de estado (día) ───────────────────────────────── */
.at-cell {
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 36px;
  text-align: center;
  vertical-align: middle;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 1px;
  position: relative;
  transition: filter .12s ease, transform .1s ease;
  box-sizing: border-box;
}
.at-cell-editable  { cursor: pointer; }
.at-cell-readonly  { cursor: default; }
.at-cell-finde {
  background: rgba(148, 163, 184, 0.08) !important;
}
tbody tr.at-row:nth-child(even) td.at-cell-finde {
  background: rgba(148, 163, 184, 0.11) !important;
}
tbody tr.at-row:hover td.at-cell-finde {
  background: rgba(249, 115, 22, 0.08) !important;
}
/* fines de semana SÍ son editables, solo visualmente distintos */
.at-cell-editable:hover {
  filter: brightness(1.3);
  transform: scale(1.12);
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.at-cell-hoy {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.at-sigla {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: block;
  line-height: 34px;
}

/* ── Celdas totales al final de cada fila ────────────────── */
.at-tot-cell {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  padding: 2px;
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 700;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(30, 41, 59, 0.45);
  box-sizing: border-box;
}
.at-tot-pct {
  width: 36px;
  min-width: 36px;
  border-left: 2px solid var(--border2);
  background: rgba(249, 115, 22, 0.07);
}
tbody tr.at-row:nth-child(even) .at-tot-cell {
  background: rgba(24, 33, 52, 0.75);
}
tbody tr.at-row:hover .at-tot-cell {
  background: rgba(249, 115, 22, 0.07);
}

/* ── Responsive: menos columnas en móvil ────────────────── */
@media (max-width: 640px) {
  .at-col-area {
    display: none !important;
  }
  .at-sticky-col2 {
    display: none !important;
  }
}
@media (max-width: 480px) {
  .at-tot-hide-sm {
    display: none !important;
  }
}

/* ── Popup selector ──────────────────────────────────────── */
.at-popup {
  position: absolute;
  z-index: 9999;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  padding: 14px;
  min-width: 260px;
}
.at-popup-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.at-popup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.at-popup-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--trans);
  gap: 2px;
}
.at-popup-btn strong { font-size: .9rem; }
.at-popup-btn span   { font-size: .62rem; opacity: .85; }
.at-popup-btn:hover  { filter: brightness(1.2); transform: translateY(-2px); }
.at-popup-clear {
  background: rgba(255,255,255,.05) !important;
  color: var(--text3) !important;
  border: 1px solid var(--border) !important;
  grid-column: span 4;
}

/* ── Badge modo ──────────────────────────────────────────── */
.at-modo-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.at-modo-edit {
  background: rgba(249,115,22,.15);
  color: var(--accent);
  border: 1px solid rgba(249,115,22,.3);
}
.at-modo-view {
  background: rgba(56,189,248,.12);
  color: var(--info);
  border: 1px solid rgba(56,189,248,.25);
}

/* ── Celda readonly sin interacción ──────────────────────── */
.at-cell-readonly:hover {
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Botón Excel ─────────────────────────────────────────── */
.btn-success-outline {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.4);
  color: #22c55e;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-success-outline:hover {
  background: rgba(34,197,94,.22);
  border-color: rgba(34,197,94,.7);
  box-shadow: 0 0 12px rgba(34,197,94,.2);
}

/* ── Sección interna del formulario de usuario ───────────── */
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════
   UI 2025 — tema claro, a11y, skeleton, focus
   ═══════════════════════════════════════════════════════════ */

:root {
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.28s;
  --font-display: "Syne", system-ui, sans-serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px var(--accent-dim);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --bg3: #ffffff;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --text: #0f172a;
  --text2: #475569;
  --text3: #64748b;
  --accent-dim: rgba(249, 115, 22, 0.12);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .sidebar {
  box-shadow: 2px 0 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .toast {
  box-shadow: var(--shadow-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100000;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus {
  left: 12px;
  outline: none;
  box-shadow: var(--ring);
}

.header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.btn-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), border-color 0.2s, transform 0.15s;
}
.btn-menu-toggle:hover {
  background: var(--bg);
  border-color: var(--border2);
  color: var(--text);
}
.btn-menu-toggle:active {
  transform: scale(0.96);
}

.btn-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-theme-toggle:hover {
  background: var(--bg);
  border-color: var(--border2);
  transform: rotate(-8deg) scale(1.05);
}
.btn-theme-toggle:active {
  transform: scale(0.95);
}

[data-theme="dark"] .theme-ico-light,
[data-theme="light"] .theme-ico-dark {
  display: none;
}
[data-theme="light"] .theme-ico-light,
[data-theme="dark"] .theme-ico-dark {
  display: inline;
}

.login-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

.login-theme-only {
  width: 44px;
  height: 44px;
}

.login-page {
  position: relative;
}

/* Focus visible — accesibilidad teclado (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.btn-notif:focus-visible,
.btn-theme-toggle:focus-visible,
.btn-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

/* Skeleton loading */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-panel {
  padding: 8px 0 24px;
  max-width: 720px;
}

.skeleton-block {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    var(--bg3) 0%,
    var(--border2) 50%,
    var(--bg3) 100%
  );
  background-size: 200% 100%;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: shimmer 1.2s ease-in-out infinite;
}

[data-theme="light"] .skeleton-shimmer::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.7),
    transparent
  );
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg3);
  margin-bottom: 12px;
  max-width: 100%;
}
.skeleton-line.short {
  width: 40%;
}

/* Cards — micro-interacción */
.card {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.nav-link {
  transition: background 0.2s var(--ease-out), color 0.2s, transform 0.15s;
}
.nav-link:active {
  transform: scale(0.98);
}

#user-info {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Toast — legible en ambos temas */
.toast {
  max-width: min(420px, calc(100vw - 32px));
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton-shimmer::after {
    animation: none;
  }
}
