/* =================================================================
   admin.css — Sistema de diseño unificado RapiClean Puebla
   ─────────────────────────────────────────────────────────────────
   Cubre:
     • Admin panel (app-shell, sidebar, topbar, content)
     • Nueva venta (POS móvil con steps, panels, cart)
     • Mantenimiento ventas (datatable, semáforo, ticket)
     • Inventario (KPIs, inv-cards, charts, modales)
     • Perfil cliente (user-card, orders-card)
     • Semáforo / Kanban
     • Sitio web público (navbar, hero, services, footer)
     • Pedido / Checkout / Login / Registro / Privacidad / Gracias
     • 404
   Mobile-first · responsive · sin tocar HTML existente
   ================================================================= */

/* ─── 1. TOKENS ─────────────────────────────────────────────────── */
:root {
    /* Sistema principal admin */
    --primary: #00aeef;
    --primary-dark: #0090c8;
    --primary-light: #e6f6fd;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-soft: #4a4a4a;
    --text-faded: #8a8a8a;
    --border: #e0e6ed;
    --border-soft: #f0f4f8;

    --success: #28a745;
    --success-light: #d4edda;
    --warning: #ffa500;
    --warning-light: #fff3cd;
    --error: #dc3545;
    --error-light: #f8d7da;
    --info: #17a2b8;
    --info-light: #cce5ff;

    --sidebar-w: 260px;
    --topbar-h: 60px;

    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --transition: .25s var(--ease);

    /* ── Aliases legacy (vistas boutique) ── */
    --sky: var(--primary);
    --sky-mid: var(--primary-dark);
    --sky-pale: var(--primary-light);
    --cream: var(--bg);
    --white: var(--surface);
    --ink: var(--text);
    --ink-soft: var(--text-soft);
    --ink-faded: var(--text-faded);
    --green: var(--success);
    --green-pale: var(--success-light);
    --red: var(--error);

    /* Inventario - semáforo de stock */
    --ok: #22c55e;
    --ok-bg: rgba(34, 197, 94, .10);
    --ok-txt: #15803d;
    --warn: #eab308;
    --warn-bg: rgba(234, 179, 8, .10);
    --warn-txt: #854d0e;
    --low: #f97316;
    --low-bg: rgba(249, 115, 22, .10);
    --low-txt: #c2410c;
    --danger: var(--error);
    --danger-bg: var(--error-light);
    --danger-txt: #721c24;

    /* Privacidad / sitio público */
    --cream-dark: #F5EDE3;
    --sky-light: #D6EBF5;
    --sky-dark: #7ABED4;
    --text-dark: var(--text);
    --text-body: var(--text-soft);
    --text-muted: var(--text-faded);
    --font-heading: var(--serif);
    --font-body: var(--sans);
}

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

body {
    font-family: var(--sans);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
}

ul {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faded);
}

/* Container compartido (sitio público + admin) */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
}

/* ─── 3. LAYOUT ADMIN — Topbar + Sidebar + Content ──────────────── */
.app-shell {
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

/* Topbar admin */
.topbar {
    grid-row: 1;
    grid-column: 1;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-toggle {
    padding: 8px;
    font-size: 1.4rem;
}

.topbar-logo {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.topbar-user:hover {
    background: var(--bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: .85rem;
}

.user-name {
    font-size: .9rem;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    grid-row: 2;
    grid-column: 1;
    background: white;
    width: var(--sidebar-w);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 40;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 39;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Menu */
.menu {
    padding: 12px 0;
}

.menu-section {
    padding: 8px 20px 4px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faded);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-soft);
    transition: var(--transition);
    position: relative;
    font-size: .95rem;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.menu-icon {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.menu-label {
    flex: 1;
}

.menu-badge {
    background: var(--primary);
    color: white;
    font-size: .7rem;
    padding: 2px 7px;
    border-radius: 10px;
}

.menu-item.has-children .menu-arrow {
    transition: transform var(--transition);
}

.menu-item.expanded .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    padding-left: 32px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
}

.submenu.open {
    max-height: 400px;
}

.submenu .menu-item {
    padding-left: 20px;
    font-size: .9rem;
}

/* Content */
.content {
    grid-row: 2;
    grid-column: 1;
    padding: 16px;
    min-width: 0;
}

/* Tablet+ : sidebar fijo */
@media (min-width: 992px) {
    .app-shell {
        grid-template-columns: var(--sidebar-w) 1fr;
        grid-template-rows: var(--topbar-h) 1fr;
    }

    .topbar {
        grid-column: 1 / -1;
    }

    .sidebar {
        position: relative;
        transform: none;
        top: 0;
        grid-row: 2;
        grid-column: 1;
    }

    .sidebar-overlay {
        display: none;
    }

    .topbar-toggle {
        display: none;
    }

    .content {
        grid-row: 2;
        grid-column: 2;
        padding: 24px 32px;
    }
}

/* ─── 4. PAGE HEADER ────────────────────────────────────────────── */
.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 500;
}

.page-subtitle {
    font-size: .9rem;
    color: var(--text-faded);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Page hero (oscuro, usado en inventario, perfil, sitio web admin) */
.page-hero {
    background: var(--text);
    padding: 48px 0 40px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(0, 174, 239, .12) 0%, transparent 65%);
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
}

.section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(0, 174, 239, .85);
    display: block;
    margin-bottom: 10px;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 300;
    color: #fff;
    line-height: 1.1;
}

.hero-title em {
    font-style: italic;
    color: var(--primary);
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .page-hero {
        padding: 32px 0 28px;
    }
}

/* ─── 5. CARDS / SECCIONES ─────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    margin: -20px -20px 16px;
}

.card-header h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 300;
}

.card-header h3 em {
    font-style: italic;
    color: var(--primary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 0;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.kpi-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease);
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.kpi-icon.blue {
    background: rgba(0, 174, 239, .12);
    color: var(--primary);
}

.kpi-icon.green {
    background: var(--ok-bg);
    color: var(--ok-txt);
}

.kpi-icon.orange {
    background: var(--low-bg);
    color: var(--low-txt);
}

.kpi-icon.red {
    background: var(--danger-bg);
    color: var(--danger-txt);
}

.kpi-icon.purple {
    background: rgba(168, 85, 247, .12);
    color: #7c3aed;
}

.kpi-icon.teal {
    background: rgba(20, 184, 166, .12);
    color: #0d9488;
}

.kpi-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faded);
    margin-bottom: 4px;
    font-weight: 500;
    display: block;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 600;
}

.kpi-num {
    font-family: var(--serif);
    font-size: 1.9rem;
    font-weight: 300;
    line-height: 1;
    display: block;
}

.kpi-sub {
    font-size: .75rem;
    color: var(--text-faded);
}

.kpi-up {
    color: var(--success);
}

.kpi-down {
    color: var(--error);
}

@media (min-width: 768px) {
    .kpi-value {
        font-size: 1.7rem;
    }
}

/* ─── 6. BOTONES ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .9rem;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 40px;
    font-family: var(--sans);
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(.98);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-secondary {
    background: var(--text-faded);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

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

.btn-ghost {
    background: transparent;
    color: var(--primary);
}

.btn-ghost:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: .8rem;
    min-height: 32px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: .75rem;
    min-height: 26px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px;
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── 7. FORMULARIOS ────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-soft);
}

.form-control,
input.form-control,
textarea.form-control,
select.form-control,
.form-group input,
.form-group textarea,
.form-group select,
.input,
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: .95rem;
    font-family: var(--sans);
    color: var(--text);
    transition: var(--transition);
    min-height: 42px;
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, .12);
}

.form-control[aria-invalid="true"] {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: .8rem;
    margin-top: 4px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-faded);
    margin-top: 3px;
}

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

@media (min-width: 600px) {
    .form-row.cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .form-row.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.input-group {
    margin-bottom: 12px;
}

.input-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-soft);
    display: block;
    margin-bottom: 6px;
}

select.input {
    cursor: pointer;
}

textarea.input,
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Search box (POS / inventario) */
.search-box {
    position: relative;
}

.search-box .input,
.search-box .form-input,
.search-box input {
    padding-left: 38px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faded);
    font-size: 14px;
}

/* ─── 8. TABLAS ─────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table,
.rep-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-size: .9rem;
}

table.data-table {
    min-width: 600px;
}

table.data-table thead th,
.rep-table thead th {
    background: var(--bg);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .78rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

table.data-table tbody td,
.rep-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    font-size: .9rem;
}

table.data-table tbody tr:last-child td,
.rep-table tbody tr:last-child td {
    border-bottom: none;
}

table.data-table tbody tr:hover td,
.rep-table tbody tr:hover td {
    background: var(--primary-light);
}

/* DataTables overrides */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    background: var(--bg);
    padding: 12px 14px !important;
    font-weight: 600;
    font-size: .78rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--border) !important;
}

table.dataTable tbody td {
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--border-soft) !important;
    font-size: .9rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
    font-size: .85rem;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_length select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 12px;
    font-size: .85rem;
    color: var(--text-soft);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px;
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-soft) !important;
    background: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Tarjetas en lugar de tablas en móvil */
@media (max-width: 600px) {
    .table-cards .data-table {
        display: none;
    }

    .table-cards .row-card {
        background: white;
        border-radius: var(--radius-lg);
        padding: 14px;
        margin-bottom: 10px;
        box-shadow: var(--shadow-sm);
    }

    .table-cards .row-card .row-line {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        font-size: .9rem;
    }

    .table-cards .row-card .row-label {
        color: var(--text-faded);
    }

    .table-cards .row-card .row-value {
        font-weight: 500;
    }
}

/* ─── 9. BADGES / ESTADOS ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.badge-success {
    background: var(--success-light);
    color: #155724;
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
}

.badge-error {
    background: var(--error-light);
    color: #721c24;
}

.badge-info {
    background: var(--info-light);
    color: #004085;
}

.badge-gray {
    background: #e2e3e5;
    color: #383d41;
}

/* Status pills (perfil de cliente) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.status-Registrado,
.status-pill.status-Registrado {
    background: var(--info-light);
    color: #004085;
}

.status-EnProceso,
.status-pill.status-EnProceso {
    background: var(--warning-light);
    color: #856404;
}

.status-Listo,
.status-pill.status-Listo {
    background: rgba(32, 201, 151, .15);
    color: #0d8a6a;
}

.status-Entregado,
.status-pill.status-Entregado {
    background: var(--success-light);
    color: #155724;
}

.status-Cancelado,
.status-pill.status-Cancelado {
    background: var(--error-light);
    color: #721c24;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-Registrado .status-dot {
    background: var(--info);
}

.status-EnProceso .status-dot {
    background: var(--warning);
}

.status-Listo .status-dot {
    background: #20c997;
}

.status-Entregado .status-dot {
    background: var(--success);
}

.status-Cancelado .status-dot {
    background: var(--error);
}

/* Stock badges (inventario) */
.stock-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    white-space: nowrap;
}

.b-ok {
    background: var(--ok-bg);
    color: var(--ok-txt);
}

.b-warn {
    background: var(--warn-bg);
    color: var(--warn-txt);
}

.b-low {
    background: var(--low-bg);
    color: var(--low-txt);
}

.b-danger {
    background: var(--danger-bg);
    color: var(--danger-txt);
}

/* ─── 10. TABS ──────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 16px;
    background: transparent;
    color: var(--text-soft);
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    cursor: pointer;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ─── 11. MODALES ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal-overlay.show,
.modal-overlay.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal,
.modal-box {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: fadeUp .3s var(--ease);
}

.modal-box.sm {
    max-width: 360px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 300;
}

.modal-header h3 em {
    font-style: italic;
    color: var(--primary);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    padding: 4px 8px;
    font-size: 1.4rem;
    color: var(--text-faded);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
}

.modal-close:hover {
    background: var(--border-soft);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
}

/* Modal sheet (móvil bottom) */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.overlay.open {
    display: flex;
}

.modal-sheet {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp .3s var(--ease);
    position: relative;
}

.modal-sheet h3 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.modal-sheet h3 em {
    color: var(--primary);
    font-style: italic;
}

.modal-sheet .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: none;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ─── 12. ALERTAS ───────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 16px;
}

.alert-success {
    background: var(--success-light);
    color: #155724;
}

.alert-error {
    background: var(--error-light);
    color: #721c24;
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
}

.alert-info {
    background: var(--info-light);
    color: #004085;
}

/* ─── 13. LOADING ───────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 174, 239, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.loading-row td {
    text-align: center;
    color: var(--text-faded);
    padding: 32px !important;
}

.saving {
    opacity: .5;
    pointer-events: none;
}

/* ─── 14. SEMÁFORO / KANBAN ─────────────────────────────────────── */
.kanban,
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    min-height: 300px;
}

.kanban-col {
    background: var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-width: 260px;
    max-width: 280px;
    flex-shrink: 0;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-soft);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.kanban-badge {
    background: var(--primary);
    color: white;
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
    border-left: 3px solid var(--primary);
    transition: box-shadow .2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.kanban-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.kanban-card-title {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: .9rem;
}

.kanban-card-id {
    font-weight: 600;
    font-size: .85rem;
    color: var(--primary);
}

.kanban-card-cliente {
    font-size: .78rem;
    color: var(--text-soft);
    font-weight: 500;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-meta {
    font-size: .75rem;
    color: var(--text-faded);
    margin-bottom: 6px;
}

.kanban-card-comment {
    font-size: .73rem;
    color: var(--text-faded);
    font-style: italic;
    margin-bottom: 8px;
    padding: 4px 6px;
    background: var(--border-soft);
    border-radius: 4px;
}

.kanban-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.kanban-select {
    flex: 1;
    font-size: .75rem;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-height: 30px;
}

.kanban-select:focus {
    outline: none;
    border-color: var(--primary);
}

.kanban-select:disabled {
    opacity: .5;
    cursor: wait;
}

.kanban-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    font-size: .9rem;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.kanban-wa-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(37, 211, 102, .4);
}

.kanban-wa-btn.disabled {
    background: var(--border);
    color: var(--text-faded);
    cursor: not-allowed;
    font-size: .75rem;
}

.kanban-wa-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.kanban-empty {
    text-align: center;
    font-size: .8rem;
    color: var(--text-faded);
    padding: 20px 0;
}

/* ─── 15. POS / NUEVA VENTA ─────────────────────────────────────── */
/* Header tipo POS (sticky) */
.pos-header {
    background: var(--primary);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pos-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-header-title {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-header-title img {
    height: 28px;
}

.pos-header a {
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    text-decoration: none;
}

/* Steps indicator */
.steps {
    display: flex;
    gap: 0;
    padding: 16px 0 8px;
    position: relative;
}

.step-dot {
    flex: 1;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.step-dot::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin: 0 auto 6px;
    background: var(--border);
    transition: all .3s var(--ease);
    font-size: 12px;
    line-height: 28px;
    color: var(--text-soft);
}

.step-dot.active::before {
    background: var(--primary);
    color: #fff;
}

.step-dot.done::before {
    background: var(--success);
    color: #fff;
}

.step-dot span {
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 500;
}

.step-dot.active span {
    color: var(--primary);
}

.step-dot.done span {
    color: var(--success);
}

.step-dot:nth-child(1)::before {
    content: '1';
}

.step-dot:nth-child(2)::before {
    content: '2';
}

.step-dot:nth-child(3)::before {
    content: '3';
}

.step-dot:nth-child(4)::before {
    content: '4';
}

.step-line {
    position: absolute;
    top: 30px;
    left: 14%;
    right: 14%;
    height: 2px;
    background: var(--border);
    z-index: -1;
}

/* Panels POS */
.panel {
    display: none;
    padding: 8px 0 100px;
    animation: fadeIn .25s var(--ease);
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Client list (POS) */
.client-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}

.client-item:last-child {
    border-bottom: none;
}

.client-item:hover,
.client-item:active {
    background: var(--primary-light);
}

.client-item.selected {
    background: var(--success-light);
    border-left: 3px solid var(--success);
}

.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    flex-shrink: 0;
}

.client-name {
    font-size: 14px;
    font-weight: 500;
}

.client-detail {
    font-size: 12px;
    color: var(--text-soft);
}

.client-check {
    margin-left: auto;
    color: var(--success);
    font-size: 16px;
    display: none;
}

.client-item.selected .client-check {
    display: block;
}

/* Service catalog (POS) */
.service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 480px) {
    .service-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.service-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}

.service-card:active {
    transform: scale(.98);
}

.service-card.in-cart {
    border-color: var(--success);
    background: var(--success-light);
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-price {
    font-size: 13px;
    color: var(--primary-dark);
    font-weight: 500;
}

.service-qty {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all .15s;
}

.qty-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.qty-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.qty-btn:active {
    background: var(--primary-light);
}

.qty-val {
    width: 36px;
    height: 34px;
    border-top: 1.5px solid var(--border);
    border-bottom: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    background: white;
}

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--text-soft);
}

.cart-item-total {
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
    white-space: nowrap;
}

.cart-item-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(220, 53, 69, .1);
    color: var(--error);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 500;
    border-top: 2px solid var(--text);
    padding-top: 12px;
    margin-top: 4px;
}

.summary-row.total span:last-child {
    color: var(--success);
}

.cart-badge {
    position: relative;
}

.cart-badge .count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom bar (POS) */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    z-index: 100;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .05);
}

.bottom-bar .btn {
    flex: 1;
}

.bottom-total {
    text-align: center;
    flex: 1;
}

.bottom-total-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-soft);
}

.bottom-total-amount {
    font-size: 18px;
    font-weight: 500;
    color: var(--success);
}

/* Empty state */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-soft);
}

.empty i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 12px;
    display: block;
}

.empty p {
    font-size: 14px;
}

/* ─── 16. TICKET (impresión + preview) ──────────────────────────── */
.ticket {
    background: white;
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 24px 20px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.ticket-center {
    text-align: center;
}

.ticket hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 12px 0;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
}

.ticket-logo {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 4px;
}

.ticket-logo em {
    color: var(--primary);
    font-style: italic;
}

/* ─── 17. INVENTARIO — Cards ────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.toolbar h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 300;
}

.toolbar h2 em {
    font-style: italic;
    color: var(--primary);
}

.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-soft);
}

.filter-tab.active,
.filter-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.inv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 600px) {
    .inv-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.inv-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 20px 20px 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all .25s var(--ease);
    animation: fadeUp .4s var(--ease) both;
}

.inv-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.inv-stripe {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.s-ok {
    background: var(--ok);
}

.s-warn {
    background: var(--warn);
}

.s-low {
    background: var(--low);
}

.s-danger {
    background: var(--danger);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.card-cat {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faded);
    margin-bottom: 10px;
}

.desc {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 12px;
    line-height: 1.5;
}

.inv-bar-wrap {
    margin-bottom: 12px;
}

.inv-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.inv-bar-labels strong {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.inv-bar {
    height: 6px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.inv-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s var(--ease);
}

.f-ok {
    background: var(--ok);
}

.f-warn {
    background: var(--warn);
}

.f-low {
    background: var(--low);
}

.f-danger {
    background: var(--danger);
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 12px;
}

.meta-item {
    background: var(--bg);
    border-radius: 6px;
    padding: 8px 10px;
}

.meta-lbl {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-faded);
    display: block;
    margin-bottom: 1px;
}

.meta-val {
    font-size: 13px;
    font-weight: 500;
}

.meta-val.g {
    color: var(--ok-txt);
}

.meta-val.r {
    color: var(--danger-txt);
}

.meta-val.o {
    color: var(--low-txt);
}

.servicio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.stag {
    background: rgba(0, 174, 239, .08);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 174, 239, .2);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 500;
}

.stag.none {
    background: var(--bg);
    color: var(--text-faded);
    border-color: var(--border);
}

.card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Charts row inventario */
.chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .chart-row {
        grid-template-columns: 1fr 1fr;
    }
}

.chart-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.chart-card h3 em {
    font-style: italic;
    color: var(--primary);
}

.sec-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.sec-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sec-head h2 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 300;
}

.sec-head h2 em {
    font-style: italic;
    color: var(--primary);
}

.sec-body {
    padding: 16px 20px;
    overflow-x: auto;
}

/* Ajuste tabs (inventario) */
.ajuste-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 14px;
}

.ajuste-tab {
    padding: 9px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.ajuste-tab.sel-in {
    border-color: var(--ok);
    background: var(--ok-bg);
    color: var(--ok-txt);
}

.ajuste-tab.sel-out {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger-txt);
}

.ajuste-tab.sel-merma {
    border-color: var(--warn);
    background: var(--warn-bg);
    color: var(--warn-txt);
}

/* Movimientos */
.mov-Venta {
    background: var(--danger-bg);
    color: var(--danger-txt);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.mov-Compra {
    background: var(--ok-bg);
    color: var(--ok-txt);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.mov-Ajuste_Entrada {
    background: rgba(0, 174, 239, .1);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.mov-Ajuste_Salida {
    background: var(--warn-bg);
    color: var(--warn-txt);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.mov-Merma {
    background: rgba(168, 85, 247, .1);
    color: #7c3aed;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ─── 18. PERFIL CLIENTE ────────────────────────────────────────── */
.profile-section {
    padding: 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 900px) {
    .profile-grid {
        grid-template-columns: 320px 1fr;
    }
}

.user-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    height: fit-content;
}

.user-card-header .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
}

.user-card-header .user-name {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 6px;
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--success-light);
    color: #155724;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 999px;
}

.user-details {
    margin: 20px 0;
    text-align: left;
}

.detail-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.detail-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detail-label {
    font-size: .7rem;
    color: var(--text-faded);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-value {
    font-size: .9rem;
    font-weight: 500;
    word-break: break-word;
}

.points-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.points-num {
    display: block;
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
}

.points-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .9;
}

.orders-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.orders-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
    gap: 10px;
}

.orders-card-header h2 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 300;
}

.orders-card-header h2 em {
    font-style: italic;
    color: var(--primary);
}

.orders-body {
    padding: 16px 20px;
    overflow-x: auto;
}

.no-session {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}

.no-session i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 16px;
    display: block;
}

/* ─── 19. SITIO WEB PÚBLICO (navbar + hero + footer) ────────────── */
/* Navbar pública */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.site-logo img {
    height: 38px;
}

.site-logo span {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text);
}

.site-nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

.site-nav a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: none;
    transition: color .2s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--primary);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }
}

/* Navbar legacy (perfil.html, etc.) */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .3s;
}

.navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar .logo img {
    height: 44px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    font-size: 13.5px;
    color: var(--text-soft);
    text-decoration: none;
    transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-cta {
    display: flex;
    gap: 10px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all .3s;
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    background: white;
    z-index: 99;
    padding: 100px 40px 40px;
    flex-direction: column;
    gap: 28px;
}

.mobile-drawer.open {
    display: flex;
}

.mobile-drawer a {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text);
    text-decoration: none;
}

.mobile-drawer a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {

    .nav-links,
    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

/* Hero homepage (sitioweb.html) */
.hero {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, white 0%, var(--bg) 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.1fr 1fr;
        gap: 48px;
    }
}

.hero h1,
#siteSlogan {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    margin: 12px 0 18px;
    color: var(--text);
}

.hero p {
    font-size: 1rem;
    color: var(--text-soft);
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-img img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Section general (sitio público) */
.section {
    padding: 64px 0;
}

.section h2 {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 400;
    margin-top: 6px;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* Footer público */
.site-footer {
    background: var(--text);
    color: rgba(255, 255, 255, .8);
    padding: 48px 0 24px;
    margin-top: auto;
}

.site-footer h4 {
    color: white;
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.site-footer a {
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    transition: color .2s;
}

.site-footer a:hover {
    color: var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

@media (min-width: 600px) {
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col li {
    font-size: .9rem;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    text-align: center;
    font-size: .8rem;
    color: rgba(255, 255, 255, .5);
}

/* Footer legacy (inventario) */
footer {
    background: var(--text);
    padding: 44px 0 28px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.footer-logo img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .45);
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}

.footer-social a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.footer-copy {
    padding-top: 18px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, .35);
}

/* Floating buttons */
.float-btns {
    position: fixed;
    bottom: 28px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

.float-btn,
.whatsapp-float {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    transition: transform .3s;
    color: white;
}

.float-btn:hover,
.whatsapp-float:hover {
    transform: translateY(-3px);
}

.float-btn.whatsapp,
.whatsapp-float {
    background: #25d366;
    color: #fff;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
}

.float-btn.top {
    background: var(--text);
    color: #fff;
    font-size: 13px;
}

/* ─── 20. AUTH / CHECKOUT / GRACIAS ─────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--primary-light), var(--bg));
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 6px;
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-faded);
    margin-bottom: 24px;
    font-size: .9rem;
}

.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: .85rem;
    color: var(--text-soft);
    line-height: 1.8;
}

.auth-links a {
    color: var(--primary);
    font-weight: 500;
}

/* Gracias / success */
.success-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-light), var(--bg));
}

.success-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(40, 167, 69, .25);
    animation: fadeUp .5s var(--ease);
}

.success-page h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 400;
    color: var(--text);
}

.success-page p {
    color: var(--text-soft);
    line-height: 1.6;
}

/* Privacidad / páginas legales */
.privacy-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 0;
}

.privacy-content h1,
.privacy-content h2 {
    font-family: var(--serif);
    font-weight: 400;
    margin: 24px 0 12px;
    color: var(--text);
}

.privacy-content h1 {
    font-size: 2rem;
    margin-top: 0;
}

.privacy-content h2 {
    font-size: 1.4rem;
}

.privacy-content p,
.privacy-content li {
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 12px;
}

.privacy-content ul {
    list-style: disc;
    padding-left: 22px;
    margin-bottom: 12px;
}

/* Top bar (privacidad legacy) */
.top-bar {
    background: var(--text);
    color: white;
    font-size: 12px;
    padding: 8px 0;
    text-align: center;
    letter-spacing: .3px;
}

.top-bar a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.top-bar span {
    opacity: .5;
    margin: 0 8px;
}

/* ─── 21. TOASTS ────────────────────────────────────────────────── */
.toast-container,
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 32px);
}

.toast {
    font-family: var(--sans);
    font-size: 13px;
    padding: 12px 18px;
    border-radius: var(--radius);
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn .3s var(--ease), toastOut .3s var(--ease) 2.7s forwards;
}

.toast-success {
    background: #15803d;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: var(--primary-dark);
}

.toast-warning {
    background: #d97706;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@media (max-width: 600px) {

    .toast-container,
    #toastContainer {
        bottom: 16px;
        right: 16px;
        left: 16px;
        align-items: stretch;
    }

    .toast {
        white-space: normal;
    }
}

/* ─── 22. UTILIDADES ────────────────────────────────────────────── */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-faded);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-primary {
    color: var(--primary);
}

.text-bold {
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.flex-gap-2 {
    gap: 8px;
}

.flex-gap-3 {
    gap: 12px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.pt-3 {
    padding-top: 24px;
}

.pt-4 {
    padding-top: 32px;
}

/* ─── 23. RESPONSIVE FINE-TUNING ────────────────────────────────── */
@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions,
    .hero-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn,
    .page-actions .btn {
        width: 100%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .content {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── 24. MANTENIMIENTO-VENTAS — Reporte mensual ───────────────── */
.reporte-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.reporte-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.reporte-card-header h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 300;
}

.reporte-card-header h3 em {
    font-style: italic;
    color: var(--primary);
}

.reporte-body {
    padding: 16px 20px;
}

.reporte-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.reporte-chart-wrap {
    min-height: 220px;
    padding-top: 8px;
}

.reporte-year-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.year-tab {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-soft);
}

.year-tab.active,
.year-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* IVA / chip resumen */
.iva-note {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    font-size: 12.5px;
    color: var(--text-soft);
    line-height: 1.5;
}

.resumen-iva {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.iva-chip {
    flex: 1;
    min-width: 140px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.iva-chip.success {
    border-top: 3px solid var(--success);
}

.iva-chip.warning {
    border-top: 3px solid var(--warning);
}

.iva-chip.danger {
    border-top: 3px solid var(--error);
}

.iva-chip.info {
    border-top: 3px solid var(--primary);
}

.chip-num {
    display: block;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text);
}

.chip-label {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faded);
    margin-top: 2px;
}

/* KPI dot (mantenimiento-ventas) */
.kpi-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Field select / monto (data-table editable) */
.field-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: 12.5px;
    font-family: var(--sans);
    cursor: pointer;
    min-height: 30px;
    color: var(--text);
}

.field-select:focus {
    outline: none;
    border-color: var(--primary);
}

.field-select.saving {
    opacity: .5;
    pointer-events: none;
}

td.monto,
.monto {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    text-align: right;
}

/* Botones acción ventas */
.btn-encuesta,
.btn-ticket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.btn-encuesta {
    background: #25d366;
    color: white;
}

.btn-encuesta:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(37, 211, 102, .4);
}

.btn-encuesta.disabled {
    background: var(--border);
    color: var(--text-faded);
    cursor: not-allowed;
}

.btn-encuesta.disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-ticket {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-ticket:hover {
    background: var(--primary);
    color: white;
}

/* ─── 25. SITIO-WEB ADMIN — CMS ─────────────────────────────────── */
.main-section {
    padding: 24px 0 60px;
    flex: 1;
}

/* Tab nav */
.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-nav .tab-btn {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    padding: 11px 18px;
    border: none;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 7px;
}

.tab-nav .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-nav .tab-btn:hover:not(.active) {
    color: var(--text);
    background: rgba(0, 174, 239, .04);
}

/* Form grid (CMS) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid.cols3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-grid.full {
    grid-template-columns: 1fr;
}

.form-group.span2 {
    grid-column: 1 / -1;
}

.form-select {
    width: 100%;
    font-family: var(--sans);
    font-size: .95rem;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color .2s;
    min-height: 42px;
    cursor: pointer;
}

.form-textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.55;
}

.form-textarea.tall {
    min-height: 180px;
}

.form-textarea.editor {
    min-height: 320px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12.5px;
}

.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, .12);
}

.char-count {
    font-size: 10.5px;
    color: var(--text-faded);
    text-align: right;
    margin-top: 4px;
}

.char-count.over {
    color: var(--error);
    font-weight: 600;
}

/* KPI row (sitio-web CMS) */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.kpi-icon.amber {
    background: var(--warn-bg);
    color: var(--warn-txt);
}

/* Badge on/off/draft */
.badge-on {
    background: var(--ok-bg);
    color: var(--ok-txt);
}

.badge-off {
    background: var(--danger-bg);
    color: var(--danger-txt);
}

.badge-draft {
    background: var(--warn-bg);
    color: var(--warn-txt);
}

/* Componente cards */
.comp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 600px) {
    .comp-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.comp-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease);
    position: relative;
}

.comp-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.comp-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.comp-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.2;
}

.comp-meta {
    font-size: 10.5px;
    color: var(--text-faded);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.comp-desc {
    font-size: 12.5px;
    color: var(--text-soft);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comp-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.comp-btn-tag {
    background: rgba(0, 174, 239, .08);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 174, 239, .2);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10.5px;
    font-weight: 500;
}

/* Blog cards */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.blog-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.blog-card-body {
    padding: 18px;
}

.blog-card-estado {
    margin-bottom: 8px;
}

.blog-card-titulo {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.3;
}

.blog-card-subtitulo {
    font-size: 12.5px;
    color: var(--text-soft);
    margin-bottom: 10px;
    line-height: 1.5;
}

.blog-card-meta {
    font-size: 11px;
    color: var(--text-faded);
    margin-bottom: 12px;
}

.blog-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blog-slug {
    font-size: 10.5px;
    color: var(--text-faded);
    background: var(--bg);
    border-radius: 3px;
    padding: 2px 7px;
    font-family: monospace;
    word-break: break-all;
}

/* SEO meter */
.seo-bar-wrap {
    margin-top: 6px;
}

.seo-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.seo-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .4s var(--ease);
}

.seo-fill.ok {
    background: var(--ok);
}

.seo-fill.warn {
    background: var(--warn);
}

.seo-fill.bad {
    background: var(--danger);
}

.seo-hint {
    font-size: 10px;
    margin-top: 2px;
}

.seo-hint.ok {
    color: var(--ok-txt);
}

.seo-hint.warn {
    color: var(--warn-txt);
}

.seo-hint.bad {
    color: var(--danger-txt);
}

/* Preview iframe */
.preview-frame {
    width: 100%;
    height: 460px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

/* Modal box variants */
.modal-box.lg {
    max-width: 900px;
}

@media (max-width: 768px) {

    .form-grid,
    .form-grid.cols3 {
        grid-template-columns: 1fr;
    }

    .comp-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .form-group.span2 {
        grid-column: 1;
    }
}

/* ─── 26. PRIVACIDAD / NAVBAR PUBLIC LEGACY ─────────────────────── */
.navbar-logo img {
    height: 38px;
}

.navbar-links {
    display: flex;
    gap: 28px;
    list-style: none;
    align-items: center;
}

.navbar-links a {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    letter-spacing: .2px;
    transition: color .2s;
}

.navbar-links a:hover {
    color: var(--primary-dark);
}

.btn-nav {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .3px;
}

.btn-nav:hover {
    background: var(--primary-dark);
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: all .3s;
}

@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .navbar-links.open {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
}

/* Hero label (privacidad) */
.hero-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* Policy content */
.policy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.policy-section {
    margin-bottom: 32px;
}

.policy-section h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 14px;
}

.policy-section h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text);
    margin: 18px 0 10px;
}

.policy-section p {
    color: var(--text-soft);
    line-height: 1.75;
    margin-bottom: 12px;
}

.policy-section ul,
.policy-section ol {
    padding-left: 22px;
    margin-bottom: 12px;
    list-style: disc;
}

.policy-section ol {
    list-style: decimal;
}

.policy-section li {
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 6px;
}

.policy-section strong {
    color: var(--text);
    font-weight: 600;
}

.policy-section a {
    color: var(--primary);
    text-decoration: underline;
}

.policy-section a:hover {
    color: var(--primary-dark);
}

.info-card {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
}

.info-card p {
    margin-bottom: 6px;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.updated-badge {
    display: inline-block;
    background: var(--bg);
    color: var(--text-soft);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
}

.footer-brand img {
    height: 38px;
    margin-bottom: 10px;
}

.footer-brand p {
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    line-height: 1.6;
}

/* ─── 28. TABLE CARD (mantenimiento-ventas listado) ─────────────── */
.table-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.table-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-card-header h2,
.table-card-header h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 300;
}

.table-card-header h2 em,
.table-card-header h3 em {
    font-style: italic;
    color: var(--primary);
}

.table-body {
    padding: 16px 20px;
    overflow-x: auto;
}

/* Columnas del reporte mensual */
.rep-mes {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.rep-ventas {
    text-align: center;
    color: var(--text-soft);
    font-weight: 500;
}

.rep-total {
    text-align: right;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.rep-pagado {
    text-align: right;
    font-weight: 600;
    color: var(--ok-txt);
    white-space: nowrap;
}

.rep-iva {
    text-align: right;
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* ─── 29. PRINT (ticket) ────────────────────────────────────────── */
@media print {
    body {
        background: white;
        padding: 12px;
        font-size: 13px;
        line-height: 1.6;
        max-width: 300px;
        margin: 0 auto;
    }

    .topbar,
    .sidebar,
    .sidebar-overlay,
    .site-header,
    .site-footer,
    .navbar,
    .bottom-bar,
    .float-btns,
    .whatsapp-float,
    .modal-footer,
    .modal-close,
    #toastContainer,
    .toast-container {
        display: none !important;
    }

    .modal-overlay {
        position: static;
        background: none;
        padding: 0;
    }

    .modal-box,
    .modal {
        box-shadow: none;
        max-height: none;
        animation: none;
    }

    .ticket {
        border: none;
        padding: 0;
        max-width: 100%;
    }

}
/* fin @media print */

/* =================================================================
   COLAPSO DEL SIDEBAR — funciona en cualquier ancho de pantalla
   Pegar al final de admin.css, FUERA de @media print.
   ================================================================= */

/* Botón #sidebarCollapse siempre visible —
   la regla @media (min-width:992px) original oculta TODOS los
   .topbar-toggle; aquí lo rescatamos solo para este botón. */
#sidebarCollapse {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 1.4rem;
}

/* Estado colapsado: ocultar sidebar sin importar tamaño de pantalla */
.app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
    overflow: hidden;
    border-right: none;
}

.app-shell.sidebar-collapsed .sidebar-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* En desktop: colapsar la columna del grid para que el content
   ocupe toda la pantalla */
@media (min-width: 992px) {
    .app-shell.sidebar-collapsed {
        grid-template-columns: 0 1fr;
    }
}