/* ============================================================
   VettaCRM · Design system
   Paleta tomada del isotipo: azul #2F86D6 → turquesa #2EC4B6
   ============================================================ */

:root {
    --brand-50: #eff7ff;
    --brand-100: #dbeeff;
    --brand-200: #b9defe;
    --brand-300: #86c8fb;
    --brand-400: #4ba9ee;
    --brand-500: #2f86d6;
    --brand-600: #216bb4;
    --brand-700: #1b568f;
    --teal-400: #49d6c9;
    --teal-500: #2ec4b6;
    --teal-600: #1ba89b;
    --ink: #0b1526;
    --ink-800: #0f1d31;
    --ink-700: #16283f;
    --text: #1b2a3f;
    --muted: #6b7c91;
    --soft: #93a2b5;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --line: #e4ebf4;
    --line-strong: #d4dfec;
    --success: #179c6a;
    --success-bg: #e9f9f1;
    --warning: #b7791f;
    --warning-bg: #fff7e6;
    --danger: #d64545;
    --danger-bg: #fdeeee;
    --violet: #6d5bd0;
    --violet-bg: #f0edff;
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 29, 49, 0.05);
    --shadow-sm: 0 1px 2px rgba(15, 29, 49, 0.04), 0 4px 12px rgba(15, 29, 49, 0.04);
    --shadow: 0 2px 4px rgba(15, 29, 49, 0.04), 0 12px 32px rgba(15, 29, 49, 0.07);
    --shadow-lg: 0 24px 60px rgba(15, 29, 49, 0.14);
    --sidebar-width: 272px;
    --topbar-height: 76px;
    --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Shell ---------- */
.app-body { min-height: 100vh; background: radial-gradient(1200px 600px at 78% -10%, #eaf4ff 0%, transparent 55%), var(--bg); }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 60;
    display: flex;
    flex-direction: column;
    color: #b9c8da;
    background:
        radial-gradient(420px 280px at 0% 0%, rgba(47, 134, 214, 0.22), transparent 65%),
        radial-gradient(360px 300px at 110% 80%, rgba(46, 196, 182, 0.14), transparent 65%),
        linear-gradient(180deg, #091323 0%, #0c1a2d 48%, #0a1d30 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 22px 20px;
    flex: none;
}
.brand-link { display: inline-flex; align-items: center; }
.brand-logo { width: 158px; height: auto; }
.sidebar-close { display: none; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #dbe6f3; border-radius: 8px; width: 34px; height: 34px; align-items: center; justify-content: center; }

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

.nav-section {
    padding: 18px 12px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(210, 226, 243, 0.36);
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: #a9b9cc;
    transition: background .16s ease, color .16s ease;
}
.nav-link .icon { color: #7f95ae; transition: color .16s ease; }
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #f3f8ff; }
.nav-link:hover .icon { color: #d9e8f8; }
.nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(47, 134, 214, 0.26), rgba(46, 196, 182, 0.07));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--brand-400), var(--teal-500));
}
.nav-link.active .icon { color: var(--teal-400); }
.nav-tag {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 999px;
    color: #062a2a;
    background: linear-gradient(135deg, #6fe3d8, #2ec4b6);
}

.sidebar-footer { flex: none; padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; color: #e8f1fa; }
.sidebar-user:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-info strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { font-size: 10.5px; color: #8095ad; }
.sidebar-user > .icon { color: #607891; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-500), var(--teal-500));
    box-shadow: 0 4px 10px rgba(47, 134, 214, .28);
}
.avatar-inverse { box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.avatar-sm { width: 30px; height: 30px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 17px; border-radius: 16px; }
.avatar-soft { background: var(--brand-50); color: var(--brand-700); box-shadow: none; }

.logout-form { margin-top: 4px; }
.sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7f95ad;
    font-size: 12px;
    transition: .16s ease;
}
.sidebar-logout:hover { background: rgba(214, 69, 69, .12); color: #ff9e9e; }
.sidebar-version { margin-top: 8px; padding: 0 10px; font-size: 9.5px; letter-spacing: .04em; color: #50657d; display: flex; justify-content: space-between; }
.sidebar-version span { color: #6f849c; }

/* ---------- Main / topbar ---------- */
.app-main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-height);
    padding: 0 30px;
    background: rgba(244, 247, 251, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(212, 223, 236, 0.7);
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-500); }
.topbar-title h1 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 236px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.72);
    color: var(--soft);
    font-size: 12.5px;
}
.topbar-search:hover { border-color: var(--line-strong); color: var(--muted); background: #fff; }
.topbar-search span { flex: 1; text-align: left; }
.topbar-search kbd { font-size: 10px; font-family: var(--font); color: var(--soft); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-500), var(--teal-500));
    box-shadow: 0 4px 12px rgba(47, 134, 214, .25);
}
.sidebar-toggle { display: none; }
.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

.app-content { flex: 1; width: 100%; max-width: 1460px; margin: 0 auto; padding: 28px 30px 44px; }

.app-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 30px 22px;
    max-width: 1460px;
    margin: 0 auto;
    width: 100%;
    font-size: 11px;
    color: var(--soft);
}
.app-footer .footer-spacer { flex: 1; }
.dot-sep { color: var(--line-strong); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: #51725f; background: #edf8f2; border: 1px solid #d7efe1; border-radius: 999px; padding: 3px 9px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #24b47e; box-shadow: 0 0 0 3px rgba(36,180,126,.12); }

.sidebar-overlay { display: none; }

/* ---------- Typography & helpers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; color: var(--ink-800); }
.page-head p { margin-top: 5px; font-size: 13px; color: var(--muted); max-width: 680px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-500); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.strong { font-weight: 650; color: var(--ink-800); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; }
.w-full { width: 100%; }
.mono { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.tiny { font-size: 10.5px; }
.hidden { display: none !important; }
.desktop-only { display: initial; }
.mobile-only { display: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.card-header.flush { border-bottom: 0; padding-bottom: 0; }
.card-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--ink-800); letter-spacing: -0.01em; }
.card-title .icon { color: var(--brand-500); }
.card-subtitle { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfdff; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { position: relative; padding: 19px 18px 17px; overflow: hidden; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon.brand { color: var(--brand-600); background: var(--brand-50); }
.stat-icon.teal { color: var(--teal-600); background: #e9faf7; }
.stat-icon.amber { color: var(--warning); background: var(--warning-bg); }
.stat-icon.violet { color: var(--violet); background: var(--violet-bg); }
.stat-icon.rose { color: var(--danger); background: var(--danger-bg); }
.stat-icon.slate { color: #4c6a86; background: #eef3f8; }
.stat-value { margin-top: 12px; font-size: 27px; line-height: 1.1; font-weight: 700; letter-spacing: -0.035em; color: var(--ink-800); font-variant-numeric: tabular-nums; }
.stat-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 10.5px; padding: 2px 6px; border-radius: 999px; }
.trend.up { color: var(--success); background: var(--success-bg); }
.trend.down { color: var(--danger); background: var(--danger-bg); }
.trend.flat { color: var(--muted); background: #f2f5f9; }

/* ---------- Layout grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--ink-800); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2f86d6 0%, #288fc9 55%, #23a7a8 100%);
    box-shadow: 0 6px 16px rgba(47, 134, 214, .24);
}
.btn-primary:hover { color: #fff; box-shadow: 0 9px 22px rgba(47, 134, 214, .32); transform: translateY(-1px); }
.btn-secondary { color: var(--ink-700); background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { color: var(--ink); border-color: #bdcddd; background: #fbfdff; }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: rgba(15, 29, 49, .05); }
.btn-danger { color: #fff; background: linear-gradient(135deg, #dc5757, #c93b3b); box-shadow: 0 6px 16px rgba(214, 69, 69, .18); }
.btn-danger:hover { color: #fff; box-shadow: 0 9px 22px rgba(214, 69, 69, .28); }
.btn-outline-danger { color: var(--danger); background: #fff; border-color: #f2caca; }
.btn-outline-danger:hover { color: #b93434; background: var(--danger-bg); }
.btn-success { color: #fff; background: linear-gradient(135deg, #1fae78, #179c6a); box-shadow: 0 6px 16px rgba(23, 156, 106, .18); }
.btn-success:hover { color: #fff; }
.btn-dark { color: #fff; background: #14263c; }
.btn-dark:hover { color: #fff; background: #0b1526; }
.btn-sm { height: 33px; padding: 0 11px; border-radius: 8px; font-size: 11.5px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 13.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .015em; white-space: nowrap; border: 1px solid transparent; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-brand { color: var(--brand-700); background: var(--brand-50); border-color: #d8ecff; }
.badge-success { color: #157a54; background: var(--success-bg); border-color: #d2f1e2; }
.badge-warning { color: #96620f; background: var(--warning-bg); border-color: #f8e8c5; }
.badge-danger { color: #b23232; background: var(--danger-bg); border-color: #f6dada; }
.badge-info { color: #1b6f88; background: #eaf8fc; border-color: #d3eef6; }
.badge-violet { color: #5747b0; background: var(--violet-bg); border-color: #e3ddff; }
.badge-neutral { color: #586b80; background: #f1f5f9; border-color: #e4ebf2; }
.badge-dark { color: #dce9f7; background: #1a3049; border-color: #28445f; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
    padding: 10px 18px;
    text-align: left;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--soft);
    background: #f8fafd;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid #edf2f8; vertical-align: middle; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table.compact td { padding: 10px 14px; }
.data-table.compact th { padding: 8px 14px; }
.table-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-main .cell-text { min-width: 0; }
.cell-main strong { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.cell-main small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.cell-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-50); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cell-icon.teal { background: #e9faf7; color: var(--teal-600); }
.cell-icon.amber { background: var(--warning-bg); color: var(--warning); }
.cell-icon.violet { background: var(--violet-bg); color: var(--violet); }
.cell-icon.rose { background: var(--danger-bg); color: var(--danger); }
.row-title { font-weight: 650; color: var(--ink-800); }
.row-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 11.5px; font-weight: 650; color: #3c4c61; display: flex; align-items: center; gap: 5px; }
.req { color: var(--danger); }
.input, .select, .textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--ink-800);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: #a8b6c6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(47, 134, 214, .12); }
.input:disabled, .select:disabled { background: #f5f8fb; color: var(--muted); cursor: not-allowed; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7c91' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field-help { font-size: 10.5px; color: var(--soft); line-height: 1.4; }
.field-error, .validation-message { font-size: 10.5px; color: var(--danger); }
.input.input-error, .select.input-error, .textarea.input-error { border-color: #e8a6a6; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 12px; color: var(--soft); width: 16px; height: 16px; }
.input-group .input { padding-left: 36px; }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--soft); }
.money-input .input { padding-left: 25px; font-variant-numeric: tabular-nums; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); }
.form-actions.split { justify-content: space-between; }
.form-actions .left { display: flex; gap: 8px; }
.validation-summary { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); border: 1px solid #f3cfcf; color: #9c2b2b; font-size: 12px; }
.validation-summary ul { margin: 5px 0 0; padding-left: 18px; list-style: disc; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #405168; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand-500); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; font-size: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 21px; border-radius: 999px; background: #d8e2ec; transition: .18s; position: relative; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s; }
.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--brand-500), var(--teal-500)); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--ink-800); margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.form-section-title .icon { color: var(--brand-500); width: 16px; height: 16px; }
.form-section-title small { font-weight: 400; color: var(--soft); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); margin-bottom: 16px; }
.toolbar .search-field { flex: 1; min-width: 210px; position: relative; }
.toolbar .search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--soft); width: 16px; height: 16px; }
.toolbar .search-field .input { padding-left: 36px; height: 38px; min-height: 38px; }
.toolbar .select { height: 38px; min-height: 38px; width: auto; min-width: 130px; }
.toolbar-sep { width: 1px; height: 24px; background: var(--line); }
.toolbar-count { margin-left: auto; font-size: 11px; color: var(--soft); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active { color: var(--brand-700); background: var(--brand-50); border-color: #cfe6fb; }
.chip .count { font-size: 9.5px; background: rgba(15,29,49,.06); border-radius: 999px; padding: 1px 5px; }

/* ---------- Alerts / notices ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; font-size: 12px; line-height: 1.5; border: 1px solid transparent; }
.alert .icon { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.alert strong { font-weight: 700; }
.alert-info { color: #1c647c; background: #eef9fd; border-color: #d4eef7; }
.alert-success { color: #146c4b; background: var(--success-bg); border-color: #cff0e1; }
.alert-warning { color: #8d5b0e; background: var(--warning-bg); border-color: #f5e3bd; }
.alert-danger { color: #9c2b2b; background: var(--danger-bg); border-color: #f2cccc; }
.notice { padding: 11px 13px; border-radius: 10px; background: #f7fafd; border: 1px dashed var(--line-strong); font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* ---------- Empty state ---------- */
.empty-state { padding: 46px 24px; text-align: center; }
.empty-illustration { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--brand-50), #e9faf7); color: var(--brand-500); }
.empty-illustration .icon { width: 25px; height: 25px; }
.empty-state h3 { font-size: 14px; font-weight: 700; color: var(--ink-800); }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 380px; margin: 6px auto 16px; }

/* ---------- Dashboard ---------- */
.welcome {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    color: #eaf4ff;
    background:
        radial-gradient(500px 260px at 90% 0%, rgba(46, 196, 182, 0.24), transparent 65%),
        radial-gradient(420px 280px at 0% 100%, rgba(47, 134, 214, 0.28), transparent 70%),
        linear-gradient(120deg, #0b1a2d, #102943 60%, #0e3344);
    box-shadow: 0 18px 40px rgba(11, 21, 38, .16);
}
.welcome::after { content: ""; position: absolute; right: -40px; top: -80px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.welcome::before { content: ""; position: absolute; right: 20px; top: -30px; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; }
.welcome-content { position: relative; z-index: 1; }
.welcome .eyebrow { color: #6fe3d8; }
.welcome h2 { margin-top: 5px; font-size: 23px; letter-spacing: -0.03em; color: #fff; }
.welcome p { margin-top: 5px; font-size: 12.5px; color: #a9c1d8; max-width: 520px; }
.welcome-actions { display: flex; gap: 9px; margin-top: 15px; flex-wrap: wrap; }
.welcome .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #e8f3ff; box-shadow: none; }
.welcome .btn-secondary:hover { background: rgba(255,255,255,.14); color: #fff; }
.welcome-side { position: relative; z-index: 1; display: flex; gap: 16px; flex: none; }
.welcome-mini { min-width: 126px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px); }
.welcome-mini small { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: #8fb1cc; }
.welcome-mini strong { display: block; margin-top: 4px; font-size: 19px; color: #fff; letter-spacing: -0.02em; }
.welcome-mini span { font-size: 10px; color: #7fd8ce; }

.chart-card { min-height: 320px; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 12px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; min-width: 0; }
.bar-track { width: 100%; max-width: 38px; flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; min-height: 4px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #4ba9ee, #2f86d6 55%, #2ec4b6); opacity: .9; transition: opacity .15s; }
.bar-col:hover .bar { opacity: 1; }
.bar-col.current .bar { background: linear-gradient(180deg, #45d8cb, #2ec4b6 55%, #1aa89c); }
.bar-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.bar-value { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--brand-500); }
.legend-dot.teal { background: var(--teal-500); }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid #eef3f8; }
.activity-item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-item:first-child { padding-top: 0; }
.activity-icon { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.activity-icon .icon { width: 15px; height: 15px; }
.activity-icon.teal { background: #e9faf7; color: var(--teal-600); }
.activity-icon.amber { background: var(--warning-bg); color: var(--warning); }
.activity-icon.violet { background: var(--violet-bg); color: var(--violet); }
.activity-body { min-width: 0; flex: 1; }
.activity-body strong { display: block; font-size: 11.5px; font-weight: 650; color: var(--ink-800); }
.activity-body p { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-body time { display: block; margin-top: 3px; font-size: 9.5px; color: var(--soft); }
.activity-amount { font-size: 11.5px; font-weight: 700; color: var(--ink-800); white-space: nowrap; font-variant-numeric: tabular-nums; }

.renewal-list { display: flex; flex-direction: column; gap: 0; }
.renewal-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #eef3f8; }
.renewal-item:last-child { border-bottom: 0; padding-bottom: 0; }
.renewal-date { width: 40px; height: 42px; border-radius: 9px; flex: none; background: #f2f7fc; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.renewal-date strong { font-size: 14px; line-height: 1; color: var(--ink-800); }
.renewal-date span { font-size: 8.5px; text-transform: uppercase; color: var(--soft); margin-top: 2px; }
.renewal-body { flex: 1; min-width: 0; }
.renewal-body strong { display: block; font-size: 11.5px; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.renewal-body small { font-size: 10px; color: var(--muted); }
.renewal-amount { font-size: 11px; font-weight: 700; color: var(--ink-700); }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; align-items: start; }
.pos-main { min-width: 0; }
.pos-summary { position: sticky; top: calc(var(--topbar-height) + 18px); }
.items-editor { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 118px 92px 105px 34px; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdff; }
.item-row .field > label { display: none; }
.item-row .money-input .input { text-align: right; }
.item-row .item-total { height: 42px; display: flex; align-items: center; justify-content: flex-end; font-size: 12.5px; font-weight: 700; color: var(--ink-800); font-variant-numeric: tabular-nums; }
.item-remove { width: 34px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--soft); }
.item-remove:hover { color: var(--danger); border-color: #f0c6c6; background: var(--danger-bg); }
.items-head { display: grid; grid-template-columns: minmax(0, 1fr) 72px 118px 92px 105px 34px; gap: 8px; padding: 0 12px 4px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); font-weight: 700; }
.items-head span:nth-child(2), .items-head span:nth-child(3) { text-align: right; }
.add-item { margin-top: 11px; }
.totals { display: flex; flex-direction: column; gap: 9px; }
.total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.total-row strong { color: var(--ink-700); font-variant-numeric: tabular-nums; }
.total-row.grand { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-800); font-weight: 650; }
.total-row.grand strong { font-size: 25px; letter-spacing: -0.03em; color: var(--ink-800); }
.pay-methods { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.pay-chip { position: relative; }
.pay-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pay-chip span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 10.5px; font-weight: 600; color: var(--muted); transition: .15s; text-align: center; }
.pay-chip input:checked + span { color: var(--brand-700); border-color: var(--brand-300); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-300); }
.pay-chip span:hover { border-color: var(--brand-300); }
.segmented { display: flex; padding: 3px; border-radius: 9px; background: #f1f5f9; border: 1px solid var(--line); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; border-radius: 7px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.segmented input:checked + span { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-xs); }
.client-picker { position: relative; }
.client-summary { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.client-summary .cell-text { flex: 1; min-width: 0; }
.client-summary strong { display: block; font-size: 12px; }
.client-summary small { display: block; font-size: 10px; color: var(--muted); }
.pos-note { margin-top: 12px; }

/* ---------- Detail pages ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px; }
.detail-identity { display: flex; gap: 15px; align-items: flex-start; }
.detail-identity h2 { font-size: 22px; letter-spacing: -0.03em; color: var(--ink-800); line-height: 1.2; }
.detail-identity p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.meta-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.meta-item small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--soft); margin-bottom: 3px; }
.meta-item span, .meta-item a { font-size: 12.5px; color: var(--ink-700); }
.meta-item .icon { width: 13px; height: 13px; color: var(--soft); margin-right: 4px; vertical-align: -2px; }
.summary-list { display: flex; flex-direction: column; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eaf0f6; font-size: 12px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); }
.summary-row strong { color: var(--ink-800); font-variant-numeric: tabular-nums; }
.summary-row.total { margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--line); border-bottom: 0; }
.summary-row.total strong { font-size: 20px; letter-spacing: -0.03em; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-700); }
.contact-item .icon { width: 15px; height: 15px; color: var(--soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tab { padding: 13px 12px 11px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-500); }
.tab .count { font-size: 9.5px; color: var(--soft); margin-left: 4px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 15px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-300); }
.timeline-item.success::before { border-color: #6fd3a9; }
.timeline-item.warning::before { border-color: #e8bd6a; }
.timeline-item.danger::before { border-color: #e79a9a; }
.timeline-body { font-size: 11.5px; color: var(--muted); }
.timeline-body strong { color: var(--ink-800); font-weight: 650; }
.timeline-time { font-size: 9.5px; color: var(--soft); margin-top: 2px; }

/* ---------- Toggle / state rows ---------- */
.state-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #eef3f8; }
.state-row:last-child { border-bottom: 0; }
.state-row strong { display: block; font-size: 12px; color: var(--ink-800); }
.state-row small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Receipt ---------- */
.receipt-page { display: flex; flex-direction: column; align-items: center; padding: 8px 0 30px; }
.receipt-toolbar { display: flex; gap: 8px; margin-bottom: 18px; }
.receipt {
    width: 80mm;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 9mm 7mm;
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 9.5px;
    line-height: 1.45;
    color: #111;
}
.receipt-header { text-align: center; padding-bottom: 8px; border-bottom: 1px dashed #999; }
.receipt-header .receipt-logo { width: 118px; margin: 0 auto 6px; filter: invert(1) grayscale(1) brightness(.2); opacity: .85; }
.receipt-header h3 { font-size: 11px; margin: 2px 0; text-transform: uppercase; letter-spacing: .05em; }
.receipt-header p { font-size: 8.5px; color: #444; }
.receipt-type { margin: 9px 0 6px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.receipt-type small { display: block; font-size: 8px; font-weight: 400; letter-spacing: .02em; margin-top: 2px; color: #555; }
.receipt-banner { margin: 8px 0; padding: 6px; text-align: center; font-size: 8.5px; border: 1px dashed #777; background: #f4f4f4; }
.receipt-banner.invalid { border: 1px solid #111; background: #eee; font-weight: 700; }
.receipt-meta { display: flex; flex-direction: column; gap: 1px; margin: 7px 0; font-size: 8.5px; }
.receipt-meta div { display: flex; justify-content: space-between; gap: 8px; }
.receipt-meta span { color: #444; }
.receipt-section { margin-top: 8px; padding-top: 7px; border-top: 1px dashed #999; }
.receipt-section h4 { font-size: 8px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; color: #444; }
.receipt-item { padding: 5px 0; border-bottom: 1px dotted #d6d6d6; }
.receipt-item:last-child { border-bottom: 0; }
.receipt-item-desc { font-size: 8.5px; line-height: 1.4; color: #111; }
.receipt-item-calc { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 1px; font-size: 8px; color: #444; font-variant-numeric: tabular-nums; }
.receipt-item-calc strong { font-size: 8.5px; color: #111; white-space: nowrap; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.receipt-table th { text-align: left; font-size: 7.5px; text-transform: uppercase; border-bottom: 1px solid #bbb; padding: 3px 0; color: #444; }
.receipt-table td { padding: 3px 0; vertical-align: top; }
.receipt-table .r { text-align: right; }
.receipt-totals { margin-top: 7px; border-top: 1px solid #bbb; padding-top: 5px; }
.receipt-total-row { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; font-size: 8.5px; }
.receipt-total-row.grand { margin-top: 4px; padding-top: 4px; border-top: 1px solid #111; font-size: 12px; font-weight: 700; }
.receipt-qr { margin: 9px auto 4px; width: 104px; height: 104px; }
.receipt-qr img, .receipt-qr svg { width: 100%; height: 100%; }
.receipt-auth { text-align: center; font-size: 8.5px; margin-top: 6px; }
.receipt-auth strong { font-size: 10px; }
.receipt-footer { margin-top: 9px; padding-top: 7px; border-top: 1px dashed #999; text-align: center; font-size: 8px; color: #444; }
.receipt-leyenda { font-size: 8px; color: #555; margin-top: 3px; }
.receipt-provisorio { border: 2px solid #111; padding: 7px; margin: 9px 0; text-align: center; font-size: 8.5px; font-weight: 700; }

@media print {
    body { background: #fff !important; }
    .app-sidebar, .topbar, .app-footer, .receipt-toolbar, .toast-stack, .sidebar-overlay { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; max-width: none !important; }
    .receipt-page { padding: 0 !important; }
    .receipt { box-shadow: none !important; border: 0 !important; width: 80mm !important; padding: 4mm 5mm !important; margin: 0 auto; }
    .receipt-page > *:not(.receipt) { display: none !important; }
}

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; background: #0b1526; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr); min-height: 100vh; }
.auth-visual {
    position: relative;
    overflow: hidden;
    padding: 54px 60px;
    display: flex;
    flex-direction: column;
    color: #eaf4ff;
    background:
        radial-gradient(620px 440px at 88% 12%, rgba(46, 196, 182, .2), transparent 62%),
        radial-gradient(720px 560px at 0% 90%, rgba(47, 134, 214, .26), transparent 66%),
        linear-gradient(145deg, #081221 0%, #0d2036 58%, #0b2c39 100%);
}
.auth-visual::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(255,255,255,.06); right: -180px; bottom: -220px; }
.auth-visual::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; border: 1px solid rgba(255,255,255,.05); right: -40px; bottom: -100px; }
.auth-brand img { width: 208px; }
.auth-copy { position: relative; z-index: 1; margin: auto 0; max-width: 520px; }
.auth-copy .eyebrow { color: #6fe3d8; }
.auth-copy h1 { margin-top: 12px; font-size: clamp(32px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -0.04em; color: #fff; font-weight: 700; }
.auth-copy h1 em { font-style: normal; background: linear-gradient(100deg, #74d6ff, #58e2d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { margin-top: 15px; font-size: 14px; line-height: 1.65; color: #9fb8cf; max-width: 440px; }
.auth-features { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-feature { display: flex; align-items: center; gap: 11px; font-size: 12.5px; color: #c4d8e9; }
.auth-feature-icon { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; color: #6fe3d8; flex: none; }
.auth-feature-icon .icon { width: 15px; height: 15px; }
.auth-visual-footer { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: #6785a0; }
.auth-visual-footer .status-dot { background: #48d6a5; }
.auth-watermark { position: absolute; right: -30px; bottom: 90px; width: 360px; opacity: .055; pointer-events: none; filter: grayscale(1) brightness(2); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: radial-gradient(700px 400px at 100% 0%, #f2f8ff, #fbfdff 55%, #f4f8fc); }
.auth-card { width: 100%; max-width: 392px; }
.auth-mobile-brand { display: none; margin-bottom: 26px; }
.auth-mobile-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg, #2f86d6, #2ec4b6); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 8px 20px rgba(47,134,214,.25); }
.auth-card h2 { font-size: 26px; letter-spacing: -0.035em; color: var(--ink-800); }
.auth-card > p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 15px; }
.auth-form .field > label { font-size: 12px; }
.auth-form .input { height: 46px; min-height: 46px; border-radius: 10px; }
.auth-form .btn { height: 46px; border-radius: 10px; margin-top: 4px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; }
.auth-row a { font-weight: 600; }
.auth-demo { margin-top: 22px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #f8fbfe; font-size: 11px; color: var(--muted); line-height: 1.55; }
.auth-demo strong { color: var(--ink-700); }
.auth-demo code { font-family: "Cascadia Mono", Consolas, monospace; background: #eef4fa; padding: 1px 5px; border-radius: 4px; font-size: 10.5px; color: var(--brand-700); }
.auth-footer { margin-top: 28px; font-size: 10.5px; color: var(--soft); display: flex; justify-content: space-between; gap: 12px; }
.auth-error { padding: 10px 12px; border-radius: 9px; background: var(--danger-bg); border: 1px solid #f2cccc; color: #9c2b2b; font-size: 11.5px; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12px; color: var(--ink-700); animation: toast-in .25s ease; }
.toast .icon { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.toast-success .icon { color: var(--success); }
.toast-danger .icon { color: var(--danger); }
.toast-warning .icon { color: var(--warning); }
.toast span { flex: 1; line-height: 1.45; }
.toast-close { border: 0; background: transparent; color: var(--soft); font-size: 18px; line-height: 1; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12px; }
.kv span { color: var(--muted); }
.kv strong { color: var(--ink-800); }
.progress { height: 6px; border-radius: 99px; background: #eef3f8; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-500), var(--teal-500)); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.pagination .pages { display: flex; gap: 4px; }
.page-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.page-btn.active { color: #fff; border-color: var(--brand-500); background: var(--brand-500); }
.page-btn:hover { border-color: var(--brand-300); color: var(--brand-700); }

.hero-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
    .topbar-search { display: none; }
    .welcome-side { display: none; }
}

@media (max-width: 1120px) {
    .layout-main, .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .pos-layout { grid-template-columns: minmax(0, 1fr); }
    .pos-summary { position: static; }
}

@media (max-width: 1024px) {
    :root { --sidebar-width: 264px; }
    .app-sidebar { transform: translateX(-104%); transition: transform .24s cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-lg); }
    body.sidebar-open .app-sidebar { transform: none; }
    .app-main { margin-left: 0; }
    .sidebar-close { display: inline-flex; }
    .sidebar-toggle { display: inline-flex; }
    .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(7, 15, 27, .5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .topbar { padding: 0 20px; }
    .app-content { padding: 22px 20px 36px; }
    .app-footer { padding: 14px 20px 20px; }
}

@media (max-width: 768px) {
    .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-head h2 { font-size: 21px; }
    .grid-2, .grid-3, .hero-split { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
    .span-2, .span-3 { grid-column: span 1; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 15px 14px; }
    .stat-value { font-size: 22px; }
    .topbar-title h1 { font-size: 17px; }
    .topbar-eyebrow { font-size: 9px; }
    .topbar-cta span { display: none; }
    .topbar-cta { width: 38px; padding: 0; }
    .topbar-actions { gap: 7px; }
    .welcome { padding: 20px; }
    .welcome h2 { font-size: 20px; }
    .welcome-actions .btn { flex: 1; }
    .data-table.responsive thead { display: none; }
    .data-table.responsive, .data-table.responsive tbody, .data-table.responsive tr, .data-table.responsive td { display: block; width: 100%; }
    .data-table.responsive tbody tr { border: 1px solid var(--line); border-radius: 11px; margin: 0 0 10px; padding: 6px 2px; background: #fff; }
    .data-table.responsive tbody tr:hover { background: #fff; }
    .data-table.responsive td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 13px; border: 0; text-align: right; }
    .data-table.responsive td::before { content: attr(data-label); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); text-align: left; flex: none; }
    .data-table.responsive td:first-child { display: block; padding-top: 10px; padding-bottom: 9px; border-bottom: 1px dashed #eef3f8; margin-bottom: 3px; }
    .data-table.responsive td:first-child::before { display: block; margin-bottom: 4px; }
    .data-table.responsive td:first-child .cell-main { justify-content: flex-start; text-align: left; }
    .data-table.responsive td:first-child .cell-main strong { max-width: none; }
    .data-table.responsive td:last-child { padding-bottom: 9px; }
    .data-table.responsive td[data-label=""]::before { display: none; }
    .data-table.responsive .cell-main { justify-content: flex-end; text-align: right; }
    .data-table.responsive .cell-main strong { max-width: 190px; }
    .data-table.responsive .actions { justify-content: flex-end; }
    .table-wrap { overflow: visible; }
    .card-header { padding: 14px 16px; }
    .card-body { padding: 16px; }
    .tabs { padding: 0 10px; }
    .meta-grid, .meta-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .detail-hero { flex-direction: column; padding: 18px; }
    .detail-actions { width: 100%; justify-content: flex-start; }
    .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; }
    .item-row .field:nth-child(1) { grid-column: 1 / 3; }
    .item-row .field:nth-child(2) { grid-column: 1; }
    .item-row .field:nth-child(3) { grid-column: 2; }
    .item-row .field:nth-child(4) { grid-column: 1; }
    .item-row .item-total { grid-column: 2; justify-content: flex-end; height: 42px; padding: 0; font-size: 12.5px; color: var(--ink-800); font-weight: 700; }
    .item-row .item-total::before { content: "Total "; margin-right: 4px; font-weight: 400; color: var(--muted); }
    .item-remove { grid-column: 3; grid-row: 1; }
    .items-head { display: none; }
    .item-row { padding: 11px; }
    .pay-methods { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { min-height: 100vh; padding: 30px 20px; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 11px; }
    .auth-mobile-brand strong { display: block; font-size: 15px; color: var(--ink-800); letter-spacing: -0.02em; }
    .auth-mobile-brand small { display: block; font-size: 10px; color: var(--muted); }
    .auth-card { max-width: 420px; }
    .toast-stack { left: 12px; right: 12px; bottom: 12px; max-width: none; }
    .app-footer .status-pill { display: none; }
    .app-footer { padding: 12px 16px 18px; font-size: 10px; }
}

@media (max-width: 560px) {
    .topbar { height: 66px; padding: 0 14px; gap: 10px; }
    .topbar-avatar { display: none; }
    .app-content { padding: 18px 14px 30px; }
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card { display: flex; align-items: center; gap: 13px; padding: 14px; }
    .stat-top { order: 2; margin-left: auto; }
    .stat-icon { width: 40px; height: 40px; }
    .stat-value { margin-top: 0; font-size: 23px; }
    .stat-meta { display: none; }
    .stat-label { font-size: 11px; }
    .page-head h2 { font-size: 19px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .meta-grid, .meta-grid.three { grid-template-columns: 1fr; }
    .meta-grid .meta-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #eef3f8; padding-bottom: 7px; }
    .meta-grid .meta-item small { margin-bottom: 0; }
    .meta-grid .meta-item span { text-align: right; }
    .pay-methods { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .toolbar { padding: 10px; }
    .toolbar .toolbar-count { display: none; }
    .toolbar .select { flex: 1; }
    .card-body { padding: 14px; }
    .welcome-actions { flex-direction: column; }
    .welcome-actions .btn { width: 100%; }
    .bar-chart { gap: 7px; }
    .bar-value { display: none; }
    .renewal-amount { display: none; }
    .detail-identity { gap: 12px; }
    .detail-identity h2 { font-size: 19px; }
    .receipt { width: 100%; padding: 20px 15px; }
}

/* ---------- Utilidades puntuales ---------- */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.badge-teal { color: #126f67; background: #e7faf7; border-color: #c9f0eb; }

/* ---------- Recibo: marca y ajustes ---------- */
.receipt-logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .28em;
    color: #111;
    text-align: center;
    margin-bottom: 5px;
}

/* ---------- Presupuesto imprimible ---------- */
.print-body { background: #e9eef5; min-height: 100vh; padding: 1px 0 30px; }
.print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: min(210mm, calc(100% - 32px));
    margin: 20px auto;
}
.quote {
    width: 210mm;
    max-width: calc(100% - 32px);
    min-height: 270mm;
    margin: 0 auto 30px;
    padding: 15mm 15mm 13mm;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(15, 29, 49, .12);
    color: #1b2a3f;
}
.quote-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; padding-bottom: 9mm; border-bottom: 1px solid var(--line); }
.quote-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 18px;
    border-radius: 14px;
    color: #eaf4ff;
    background:
        radial-gradient(240px 140px at 100% 0%, rgba(46, 196, 182, .28), transparent 70%),
        linear-gradient(130deg, #0b1a2d, #123249);
    min-width: 265px;
}
.quote-brand img { width: 142px; height: auto; }
.quote-brand strong { font-size: 11px; font-weight: 600; letter-spacing: .01em; color: #fff; }
.quote-brand span { font-size: 8.5px; color: #9bb8cf; }
.quote-title { text-align: right; }
.quote-title > span { font-size: 8.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-500); }
.quote-title h1 { font-size: 24px; letter-spacing: -.03em; color: var(--ink-800); margin: 4px 0 2px; }
.quote-title strong { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.quote-meta { display: grid; grid-template-columns: 1.15fr 1.15fr .8fr; gap: 20px; margin-top: 8mm; }
.quote-meta h3 { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--soft); margin-bottom: 5px; }
.quote-meta strong { display: block; font-size: 10.5px; color: var(--ink-800); }
.quote-meta p { font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.quote-dates p { display: flex; justify-content: space-between; gap: 10px; font-size: 9.5px; margin-top: 3px; }
.quote-dates p span { color: var(--soft); }
.quote-dates p strong { font-size: 9.5px; }
.quote-table { width: 100%; border-collapse: collapse; margin-top: 8mm; font-size: 10px; }
.quote-table th { padding: 8px 9px; text-align: left; background: #f5f8fc; border-bottom: 1px solid var(--line); font-size: 7.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.quote-table td { padding: 9px; border-bottom: 1px solid #edf2f8; vertical-align: top; }
.quote-table td small { display: block; font-size: 8px; color: var(--brand-500); }
.quote-table .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-bottom { display: grid; grid-template-columns: 1.35fr .75fr; gap: 24px; margin-top: 7mm; align-items: start; }
.quote-notes h3 { font-size: 8px; text-transform: uppercase; letter-spacing: .1em; color: var(--soft); margin: 0 0 4px; }
.quote-notes p { font-size: 9px; color: var(--muted); line-height: 1.55; margin: 0 0 10px; white-space: pre-line; }
.quote-totals { background: #f8fbfe; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.quote-totals > div { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; font-size: 10px; color: var(--muted); }
.quote-totals strong { color: var(--ink-800); font-variant-numeric: tabular-nums; }
.quote-totals .total { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-strong); font-size: 12px; }
.quote-totals .total strong { font-size: 18px; letter-spacing: -.03em; }
.quote-footer { margin-top: 12mm; padding-top: 5mm; border-top: 1px solid var(--line); text-align: center; color: var(--soft); font-size: 8.5px; line-height: 1.6; }
.quote-footer p:first-child { color: var(--ink-700); font-weight: 600; }
.quote-footer .tiny { font-size: 7.5px; }

@media (max-width: 768px) {
    .quote { padding: 22px 18px; min-height: 0; }
    .quote-header { flex-direction: column; gap: 16px; }
    .quote-brand { width: 100%; min-width: 0; }
    .quote-title { text-align: left; }
    .quote-meta { grid-template-columns: 1fr; gap: 14px; }
    .quote-bottom { grid-template-columns: 1fr; }
    .quote-table { font-size: 9px; }
    .quote-table th, .quote-table td { padding: 6px 4px; }
}

@media print {
    .print-body { background: #fff !important; padding: 0 !important; }
    .print-toolbar, .receipt-toolbar { display: none !important; }
    .quote { width: auto !important; max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 10mm !important; border: 0 !important; box-shadow: none !important; }
}

