/* =========================================================
   Webprodesk — Panel de clientes
   Regla 60/30/10:
   60% dominante  → lienzo claro neutro (--canvas, --surface)
   30% secundario → azul marino estructural (--navy*): navegación, tipografía, tarjetas
   10% acento     → naranja (--accent): CTAs, micro-interacciones, detalles clave
   ========================================================= */
:root {
    --canvas: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --line: #e3e8f0;

    --navy-900: #0a1f3c;
    --navy-800: #102a4c;
    --navy-700: #1b3a63;
    --navy-500: #4a6283;
    --navy-300: #8a9bb4;
    --navy-100: #e6ecf5;

    --accent: #ff6b2c;
    --accent-600: #f0561a;
    --accent-50: #fff1ea;

    --ok: #16a34a;   --ok-bg: #e9f8ef;
    --warn: #c27c0e; --warn-bg: #fff5e0;
    --bad: #dc2626;  --bad-bg: #fdecec;
    --off: #6b7a90;  --off-bg: #eef1f5;

    --r-sm: 8px; --r: 14px; --r-lg: 20px;
    --sh-1: 0 1px 2px rgba(10, 31, 60, .06), 0 1px 3px rgba(10, 31, 60, .05);
    --sh-2: 0 4px 12px rgba(10, 31, 60, .07), 0 2px 4px rgba(10, 31, 60, .04);
    --sh-3: 0 18px 40px rgba(10, 31, 60, .14), 0 6px 14px rgba(10, 31, 60, .06);
    --sh-accent: 0 8px 20px rgba(255, 107, 44, .28);
    --ease: cubic-bezier(.22, .8, .3, 1);
    --sidebar: 264px;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--navy-800); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--navy-900); letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--navy-500); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.link { color: var(--navy-700); font-weight: 600; border-bottom: 1px dashed transparent; transition: color .2s, border-color .2s; }
.link:hover { color: var(--accent-600); border-color: currentColor; }
.warn-txt { color: var(--warn); }
[hidden] { display: none !important; }

/* ---------- Sidebar (secundario 30%) ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: #c9d5e6; display: flex; flex-direction: column; padding: 22px 16px;
    box-shadow: 4px 0 24px rgba(10, 31, 60, .18);
    transition: transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), #ff9a5c); color: #fff; box-shadow: var(--sh-accent);
}
.brand-mark .ic { width: 22px; height: 22px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt strong { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand-txt small { color: var(--navy-300); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6f84a3; padding: 16px 12px 6px; font-weight: 700; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
    font-weight: 600; color: #c9d5e6; transition: background .25s var(--ease), color .25s, transform .25s var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(3px); }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active::before {
    content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-item.active .ic { color: var(--accent); }
.sidebar-foot { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.since { display: flex; flex-direction: column; }
.since strong { color: #fff; font-size: 20px; font-weight: 800; }
.since span { font-size: 12.5px; color: var(--navy-300); }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
    background: rgba(243, 245, 249, .82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface); box-shadow: var(--sh-1); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 13px; color: var(--navy-900); }
.user-meta small { font-size: 11.5px; color: var(--navy-500); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--navy-800); color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
}
.avatar.sm { width: 34px; height: 34px; background: var(--navy-100); color: var(--navy-800); }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; margin: 0 auto 12px; box-shadow: var(--sh-2); }
.content { flex: 1; padding: 28px 32px 40px; max-width: 1400px; width: 100%; }
.foot { padding: 18px 32px; color: var(--navy-300); font-size: 12.5px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px;
    font: inherit; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--sh-accent); }
.btn-accent:hover { background: var(--accent-600); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 107, 44, .35); }
.btn-ghost { background: var(--surface); color: var(--navy-800); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { border-color: var(--navy-300); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-light:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.icon-btn {
    width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--navy-700); cursor: pointer; transition: all .2s var(--ease);
}
.icon-btn .ic { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--accent-600); border-color: #ffc6ad; background: var(--accent-50); transform: translateY(-1px); }
.icon-btn.danger:hover { color: var(--bad); border-color: #f6b9b9; background: var(--bad-bg); }
.icon-btn.ok:hover { color: var(--ok); border-color: #a9e2bf; background: var(--ok-bg); }
.only-mobile { display: none; }

/* ---------- Cabeceras ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; }
.page-head p { margin-top: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; color: var(--navy-500); font-weight: 600; margin-bottom: 6px; transition: color .2s, transform .2s; }
.back:hover { color: var(--accent-600); transform: translateX(-3px); }
.eyebrow { font-size: 12.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }

.hero-card {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: 28px 32px; border-radius: var(--r-lg); margin-bottom: 22px; color: #c9d5e6;
    background: radial-gradient(120% 140% at 100% 0%, var(--navy-700) 0%, var(--navy-900) 60%);
    box-shadow: var(--sh-3);
}
.hero-card::after {
    content: ''; position: absolute; width: 280px; height: 280px; right: -80px; top: -120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 44, .35), transparent 70%); animation: float 9s ease-in-out infinite;
}
.hero-card h2 { color: #fff; font-size: 26px; font-weight: 800; margin: 4px 0 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-2); border: 1px solid rgba(227, 232, 240, .7); padding: 22px; margin-bottom: 22px; transition: box-shadow .3s var(--ease); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-h h3 { font-size: 16px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-2 > .card { margin-bottom: 22px; }
.grid-cat { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi {
    display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border-radius: var(--r);
    box-shadow: var(--sh-2); border: 1px solid rgba(227, 232, 240, .7);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.kpi:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.kpi small { display: block; color: var(--navy-500); font-weight: 600; font-size: 12.5px; }
.kpi strong { display: block; font-size: 21px; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); flex: none; }
.kpi-ic.big { width: 64px; height: 64px; margin: 0 auto 14px; }
.kpi-alert .kpi-ic { background: var(--accent-50); color: var(--accent-600); }
.kpi-alert strong { color: var(--accent-600); }

/* Catálogo */
.catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 22px; }
.cat-card {
    position: relative; padding: 20px; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-2);
    border: 1px solid rgba(227, 232, 240, .7); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.cat-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--navy-800); transition: background .3s; }
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--sh-3); }
.cat-card:hover::before { background: var(--accent); }
.cat-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); margin-bottom: 12px; }
.cat-card h4 { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.cat-price { font-size: 22px; font-weight: 800; color: var(--navy-900); margin: 12px 0 8px; letter-spacing: -.02em; }
.cat-price small { font-size: 13px; font-weight: 600; color: var(--navy-500); margin-left: 2px; }

/* ---------- Filtros / formularios ---------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters-total { margin-left: auto; color: var(--navy-500); }
.filters-total strong { color: var(--navy-900); }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=date], select {
    width: 100%; font: inherit; color: var(--navy-900); background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 11px; padding: 10px 13px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
select { cursor: pointer; padding-right: 32px; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a6283' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.filters select { width: auto; min-width: 180px; }
input:focus, select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(255, 107, 44, .14); }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic, .input-ic > .prefix { position: absolute; left: 12px; color: var(--navy-300); pointer-events: none; width: 18px; height: 18px; font-weight: 700; }
.input-ic > .prefix { line-height: 18px; }
.input-ic input { padding-left: 38px; }
.peek { position: absolute; right: 6px; border: 0; background: none; color: var(--navy-300); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.peek:hover { color: var(--accent); }
.form { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.form > .field { margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--navy-700); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: var(--accent-50); color: var(--navy-800); cursor: pointer; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pay-only { transition: opacity .3s var(--ease); }
.pay-only.dim { opacity: .45; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: -6px; padding: 6px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-500);
    font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.row-off td { opacity: .55; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main small { display: block; }
td.actions { text-align: right; white-space: nowrap; width: 1%; }
.actions > * { vertical-align: middle; }
.actions > * + * { margin-left: 6px; }
.actions form { margin: 0; display: inline-block; }
.dim { opacity: .45; transition: opacity .3s var(--ease); }

.badge, .pill, .role {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-off { background: var(--off-bg); color: var(--off); }
.pill { background: var(--navy-100); color: var(--navy-700); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.role-admin { background: var(--navy-800); color: #fff; }
.role-normal { background: var(--navy-100); color: var(--navy-700); }

/* ---------- Listas del dashboard ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); flex: none; }
.list-ic .ic { width: 18px; height: 18px; }
.list-ic.ok { background: var(--ok-bg); color: var(--ok); }
.list-ic.warn { background: var(--warn-bg); color: var(--warn); }
.list-ic.bad { background: var(--bad-bg); color: var(--bad); }
.list-main { flex: 1; min-width: 0; }
.list-main strong, .list-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--navy-500); font-size: 12.5px; }
.list-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 210px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar-col span { font-size: 11.5px; color: var(--navy-500); font-weight: 600; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar { width: 100%; height: 0; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); transition: height 1s var(--ease); }
.bar-col.current .bar { background: linear-gradient(180deg, #ff9a5c, var(--accent)); }
.bar-col.current span { color: var(--accent-600); }
.mix { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mix-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13.5px; }
.mix-top em { font-style: normal; font-size: 12px; }
.meter { height: 8px; border-radius: 99px; background: var(--navy-100); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--navy-700); transition: width 1.1s var(--ease); }
.mix li:first-child .meter span { background: var(--accent); }

.empty { text-align: center; padding: 40px 20px; color: var(--navy-500); }
.empty .ic { width: 40px; height: 40px; color: var(--navy-300); margin-bottom: 10px; }
.empty p { margin-bottom: 14px; }
.empty.small { padding: 24px 10px; }
.empty-page { text-align: center; max-width: 520px; margin: 40px auto; padding: 40px; }
.empty-page h2 { margin-bottom: 6px; }
.empty-page p { margin-bottom: 20px; }
.profile { text-align: center; }
.profile h3 { font-size: 19px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; text-align: left; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.dl dt { color: var(--navy-500); font-weight: 600; font-size: 13px; }
.dl dd { margin: 0; }

/* ---------- Toasts / alertas / modal ---------- */
.toasts { position: fixed; top: 80px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 12px; background: var(--surface);
    box-shadow: var(--sh-3); border-left: 4px solid var(--navy-700); animation: toastIn .45s var(--ease) both;
}
.toast span { flex: 1; }
.toast-ok { border-color: var(--ok); } .toast-ok > .ic { color: var(--ok); }
.toast-error { border-color: var(--bad); } .toast-error > .ic { color: var(--bad); }
.toast-info > .ic { color: var(--navy-700); }
.toast-x { border: 0; background: none; color: var(--navy-300); cursor: pointer; padding: 0; display: grid; }
.toast-x .ic { width: 16px; height: 16px; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; margin-bottom: 16px; font-weight: 600; font-size: 13.5px; animation: shake .45s var(--ease); }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-ok, .alert-info { background: var(--ok-bg); color: var(--ok); animation: none; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(10, 31, 60, .45); backdrop-filter: blur(4px); animation: fadeIn .25s ease both; }
.modal-box { width: min(420px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 28px; text-align: center; box-shadow: var(--sh-3); animation: popIn .35s var(--ease) both; }
.modal-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--accent-50); color: var(--accent-600); }
.modal-ic .ic { width: 26px; height: 26px; }
.modal-box h3 { margin-bottom: 8px; }
.modal-box p { color: var(--navy-500); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.backdrop { display: none; }

/* ---------- Animaciones ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 24px); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- Login ---------- */
.login-page { background: var(--canvas); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
    position: relative; overflow: hidden; color: #c9d5e6; display: flex; align-items: center; padding: 56px;
    background: radial-gradient(120% 120% at 0% 100%, var(--navy-700) 0%, var(--navy-900) 55%);
}
.hero-inner { position: relative; z-index: 1; max-width: 520px; }
.brand-lg .brand-mark { width: 52px; height: 52px; border-radius: 15px; }
.brand-lg .brand-txt strong { font-size: 24px; }
.login-hero h2 { color: #fff; font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; margin: 36px 0 16px; }
.login-hero p { font-size: 16px; color: #aebdd2; }
.login-hero p strong { color: #fff; }
.hero-list { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 14px; }
.hero-list li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: #dfe7f2; }
.hero-list .ic { color: var(--accent); }
.hero-badge { display: inline-flex; align-items: center; gap: 12px; margin-top: 40px; padding: 12px 18px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.hero-badge span { font-size: 32px; font-weight: 800; color: var(--accent); line-height: 1; }
.hero-badge small { font-size: 12.5px; line-height: 1.25; color: #aebdd2; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); animation: float 12s ease-in-out infinite; }
.orb-1 { width: 380px; height: 380px; right: -120px; top: -100px; background: radial-gradient(circle, rgba(255, 107, 44, .32), transparent 70%); }
.orb-2 { width: 300px; height: 300px; left: -80px; bottom: -90px; background: radial-gradient(circle, rgba(74, 98, 131, .55), transparent 70%); animation-delay: -4s; }
.orb-3 { width: 160px; height: 160px; right: 18%; bottom: 14%; background: radial-gradient(circle, rgba(255, 255, 255, .09), transparent 70%); animation-delay: -8s; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); padding: 36px 32px; border-radius: var(--r-lg); box-shadow: var(--sh-3); animation: popIn .6s var(--ease) both; }
.login-card h1 { font-size: 26px; font-weight: 800; }
.login-card > .muted { margin: 4px 0 24px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { margin-top: 8px; }
.login-foot { text-align: center; color: var(--navy-300); font-size: 12px; margin-top: 22px; }
.brand-mobile { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-2, .grid-cat { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 31, 60, .4); animation: fadeIn .25s; }
    .main { margin-left: 0; }
    .only-mobile { display: inline-grid; }
    .topbar { padding: 12px 16px; }
    .content { padding: 20px 16px 32px; }
    .foot { padding: 16px; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .brand-mobile { display: flex; padding: 0 0 22px; }
    .brand-mobile .brand-txt strong { color: var(--navy-900); }
    .brand-mobile .brand-txt small { color: var(--navy-500); }
}
@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .hero-card { padding: 22px; }
    .hero-card h2 { font-size: 21px; }
    .page-head h2 { font-size: 21px; }
    .filters select { flex: 1; min-width: 0; }
    .filters-total { margin-left: 0; width: 100%; }
    .bars { gap: 4px; height: 170px; }
    .bar-col span { font-size: 10px; }
    /* tablas → tarjetas */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .table tbody tr:last-child { border-bottom: 0; }
    .table td { border: 0; padding: 5px 4px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .table td[data-l]::before { content: attr(data-l); color: var(--navy-500); font-size: 12px; font-weight: 600; text-align: left; }
    .table td:first-child { display: block; text-align: left; }
    .table td:first-child::before { display: none; }
    .table td.actions { justify-content: flex-end; padding-top: 8px; }
    .num { white-space: normal; }
    .login-card { padding: 28px 22px; }
}
