@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --bg: #f4f6f9;
    --sidebar: #1a2332;
    --sidebar-hover: #243044;
    --primary: #e85d04;
    --primary-dark: #dc2f02;
    --accent: #06adbf;
    --accent-dark: #035c67;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; overflow-x: hidden; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
body.swal2-shown { padding-right: 0 !important; overflow: hidden !important; }
body.swal2-shown #sidebar,
body.swal2-shown #content { padding-right: 0 !important; }

/* Sidebar */
#sidebar {
    position: fixed; left: 0; top: 0; width: 260px; height: 100vh;
    background: var(--sidebar); color: #cbd5e1; z-index: 1000;
    transition: width .3s ease, transform .3s ease;
    overflow-x: hidden; overflow-y: auto;
}
#sidebar.hide { width: 64px; }
#sidebar.hide:hover { width: 260px; }
#sidebar .brand {
    display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.5rem;
    color: var(--white); font-size: 1.25rem; font-weight: 700; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap; min-height: 64px;
}
#sidebar.hide .brand { padding: 1.25rem .75rem; justify-content: center; }
#sidebar.hide:hover .brand { padding: 1.25rem 1.5rem; justify-content: flex-start; }
#sidebar .brand i { font-size: 1.75rem; color: var(--primary); flex-shrink: 0; }
#sidebar .brand span {
    overflow: hidden; transition: opacity .2s ease, max-width .3s ease;
    max-width: 180px; opacity: 1;
}
#sidebar.hide .brand span { max-width: 0; opacity: 0; }
#sidebar.hide:hover .brand span { max-width: 180px; opacity: 1; }
.side-menu { list-style: none; padding: 1rem 0; }
.side-menu li.divider {
    padding: .75rem 1.5rem .35rem; font-size: .7rem; text-transform: uppercase;
    letter-spacing: .08em; color: #64748b; font-weight: 600;
    white-space: nowrap; overflow: hidden; transition: all .2s ease;
}
#sidebar.hide .side-menu li.divider { padding: .75rem .5rem .35rem; text-align: center; }
#sidebar.hide:hover .side-menu li.divider { padding: .75rem 1.5rem .35rem; text-align: left; }
.side-menu a {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem;
    color: #94a3b8; text-decoration: none; transition: all .2s; font-size: .925rem;
    white-space: nowrap;
}
#sidebar.hide .side-menu a { justify-content: center; padding: .75rem; gap: 0; }
#sidebar.hide:hover .side-menu a { justify-content: flex-start; padding: .75rem 1.5rem; gap: .75rem; }
.side-menu a span {
    overflow: hidden; transition: opacity .2s ease, max-width .3s ease;
    max-width: 200px; opacity: 1;
}
#sidebar.hide .side-menu a span { max-width: 0; opacity: 0; }
#sidebar.hide:hover .side-menu a span { max-width: 200px; opacity: 1; }
.side-menu a:hover, .side-menu a.active {
    background: var(--sidebar-hover); color: var(--white);
}
.side-menu a.active { border-left: 3px solid var(--primary); }
#sidebar.hide .side-menu a.active { border-left: none; }
#sidebar.hide:hover .side-menu a.active { border-left: 3px solid var(--primary); }
.side-menu .icon { font-size: 1.25rem; min-width: 1.25rem; flex-shrink: 0; }

/* Content */
#content { margin-left: 260px; min-height: 100vh; transition: margin-left .3s ease; }
#sidebar.hide + #content { margin-left: 64px; }
.topbar {
    display: flex; align-items: center; gap: 1rem; padding: .85rem 1.5rem;
    background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.toggle-sidebar { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }
.topbar-actions { margin-left: auto; }
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: .5rem; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .85rem; cursor: pointer;
}
.user-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + .5rem);
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 200px; overflow: hidden;
}
.user-menu.open .user-dropdown { display: block; }
.user-info { padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.user-info small { color: var(--text-muted); }
.user-dropdown a {
    display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem;
    color: var(--text); text-decoration: none;
}
.user-dropdown a:hover { background: var(--bg); }

main { padding: 1.5rem; }

/* Page */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); margin-top: .25rem; }

/* Cards & Stats */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.card-desc { color: var(--text-muted); font-size: .875rem; margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--white); border-radius: var(--radius); padding: 1.25rem;
    display: flex; gap: 1rem; box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.orange { background: #ffedd5; color: var(--primary); }
.stat-icon.teal { background: #cffafe; color: var(--accent); }
.stat-label { font-size: .8rem; color: var(--text-muted); }
.stat-value { font-size: 1.35rem; font-weight: 700; display: block; }
.stat-body small { color: var(--text-muted); font-size: .8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem;
    border: none; border-radius: var(--radius); font-family: inherit; font-size: .9rem;
    font-weight: 600; cursor: pointer; text-decoration: none; transition: all .2s;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: .85rem; font-size: 1rem; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); padding: .25rem; }
.btn-icon:hover { color: var(--primary); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: .9rem;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,173,191,.15); }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; margin: .5rem 0; cursor: pointer; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.row-warning { background: #fffbeb; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); font-weight: 600; }
.text-right { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 20px; font-size: .75rem; font-weight: 600; background: var(--bg); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }

/* Alerts */
.alert { padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; }
.modal.open { display: flex; }
.modal-dialog { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 1.25rem; }
.modal-dialog.modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Auth */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a2332 0%, #2d3748 50%, #1a2332 100%); }
.auth-wrapper { width: 100%; max-width: 420px; padding: 1.5rem; }
.auth-card { background: var(--white); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow-lg); }
.auth-brand { text-align: center; margin-bottom: 1.75rem; }
.auth-brand i { font-size: 3rem; color: var(--primary); }
.auth-brand h1 { font-size: 1.5rem; margin-top: .5rem; }
.auth-brand p { color: var(--text-muted); font-size: .875rem; }
.auth-form .form-group { margin-bottom: 1rem; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon input { width: 100%; padding: .7rem .85rem .7rem 2.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.auth-footer { text-align: center; color: rgba(255,255,255,.5); font-size: .8rem; margin-top: 1.5rem; }
.auth-demo { text-align: center; font-size: .8rem; color: var(--text-muted); margin-top: 1rem; }
.auth-demo code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; }

/* POS */
.pos-page { margin: -.25rem 0 0; }
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 1.25rem;
    align-items: start;
}

/* Panel menú */
.pos-products {
    background: var(--white);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.pos-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--white) 100%);
    flex-wrap: wrap;
}
.pos-heading { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.pos-subheading { color: var(--text-muted); font-size: .82rem; margin-top: .15rem; }
.pos-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}
.pos-search-wrap i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
    pointer-events: none;
}
.pos-search {
    width: 100%;
    padding: .7rem 1rem .7rem 2.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .9rem;
    font-family: inherit;
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}
.pos-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(6, 173, 191, .12);
}

.pos-categories {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}
.cat-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .95rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    transition: all .2s ease;
}
.cat-btn i { font-size: 1rem; }
.cat-btn:hover {
    border-color: #cbd5e1;
    color: var(--text);
    transform: translateY(-1px);
}
.cat-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(232, 93, 4, .25);
}
.cat-btn.active[data-cat]:not([data-cat=""]) {
    background: var(--cat-color, var(--primary));
    border-color: var(--cat-color, var(--primary));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--cat-color, var(--primary)) 35%, transparent);
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: .85rem;
    padding: 1.25rem 1.35rem 1.35rem;
    align-content: start;
    grid-auto-rows: min-content;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.pos-grid::-webkit-scrollbar { width: 6px; }
.pos-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.pos-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    height: auto;
    align-self: start;
}
.pos-item:hover {
    border-color: color-mix(in srgb, var(--item-accent, var(--primary)) 45%, white);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}
.pos-item:active { transform: translateY(0); }
.pos-item-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--item-accent, #64748b) 18%, white),
        color-mix(in srgb, var(--item-accent, #64748b) 8%, white));
    border-bottom: 1px solid color-mix(in srgb, var(--item-accent, #64748b) 12%, white);
}
.pos-item-visual i {
    font-size: 1.85rem;
    color: var(--item-accent, #64748b);
    opacity: .9;
}
.pos-item-body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem .8rem .85rem;
    flex: 0 0 auto;
}
.pos-item-cat {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--item-accent, var(--text-muted));
}
.pos-item-name {
    font-weight: 600;
    font-size: .84rem;
    line-height: 1.35;
    color: var(--text);
    min-height: 2.3em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.pos-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
    margin-top: .35rem;
    padding-top: .55rem;
    border-top: 1px dashed #e2e8f0;
}
.pos-item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: .92rem;
    white-space: nowrap;
}
.pos-item-stock {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.pos-item--low .stock-dot { background: var(--warning); }
.pos-item--out { opacity: .72; }
.pos-item--out .stock-dot { background: var(--danger); }
.pos-item--out .pos-item-visual { filter: grayscale(.35); }

/* Panel orden */
.pos-cart {
    background: var(--white);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 100px);
    position: sticky;
    top: .85rem;
}
.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    background: var(--sidebar);
    color: var(--white);
}
.pos-cart-title { display: flex; align-items: center; gap: .75rem; }
.pos-cart-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
}
.pos-cart-header h2 { font-size: 1rem; font-weight: 700; }
.pos-cart-header small { color: rgba(255, 255, 255, .65); font-size: .75rem; }
.btn-clear-cart {
    color: rgba(255, 255, 255, .7);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-clear-cart:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: .85rem 1rem;
    min-height: 160px;
    max-height: 280px;
    background: #fafbfc;
}
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.cart-empty i { font-size: 2.75rem; color: #cbd5e1; margin-bottom: .65rem; }
.cart-empty p { font-weight: 600; color: var(--text); font-size: .9rem; }
.cart-empty small { font-size: .78rem; margin-top: .2rem; }

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .65rem;
    padding: .7rem .75rem;
    margin-bottom: .5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .85rem;
}
.cart-line-info { min-width: 0; }
.cart-line-name { font-weight: 600; display: block; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line-price { color: var(--text-muted); font-size: .72rem; }
.cart-line-total { font-weight: 700; color: var(--text); font-size: .88rem; white-space: nowrap; }
.cart-qty {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    background: var(--bg);
    border-radius: 8px;
    padding: .15rem;
}
.cart-qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--text);
    transition: background .15s;
}
.cart-qty button:hover { background: #e2e8f0; }
.cart-qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: .85rem; }

.pos-cart-options {
    padding: .9rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--white);
    font-size: .85rem;
}
.pos-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-bottom: .65rem;
}
.pos-cart-options .form-group { margin-bottom: 0; }
.pos-cart-options label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: .3rem;
    display: block;
}
.label-opt { text-transform: none; font-weight: 500; letter-spacing: 0; }
.pos-cart-options select,
.pos-cart-options input {
    width: 100%;
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .84rem;
    font-family: inherit;
    background: var(--white);
}
.pos-cart-options select:focus,
.pos-cart-options input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(6, 173, 191, .1);
}
.pos-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 600;
    margin: .75rem 0;
    user-select: none;
}
.pos-check input { position: absolute; opacity: 0; pointer-events: none; }
.pos-check-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    flex-shrink: 0;
    position: relative;
    transition: all .15s;
}
.pos-check input:checked + .pos-check-box {
    background: var(--primary);
    border-color: var(--primary);
}
.pos-check input:checked + .pos-check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.pos-factura-fields {
    display: grid;
    gap: .55rem;
    padding: .75rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed var(--border);
}

.pos-totals {
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid var(--border);
}
.total-row {
    display: flex;
    justify-content: space-between;
    padding: .28rem 0;
    font-size: .84rem;
    color: var(--text-muted);
}
.total-row span:last-child { color: var(--text); font-weight: 600; }
.total-final {
    font-size: 1.15rem;
    font-weight: 700;
    padding-top: .65rem;
    margin-top: .45rem;
    border-top: 2px solid var(--border);
    color: var(--text) !important;
}
.total-final span:first-child { color: var(--text); font-weight: 700; }
.total-final span:last-child { color: var(--primary); font-size: 1.2rem; }

.btn-pos-cobrar {
    margin: 0;
    border-radius: 0;
    padding: 1rem 1.15rem;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
    gap: .5rem;
}
.btn-pos-cobrar:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-pos-cobrar:not(:disabled):hover {
    filter: brightness(1.05);
}

/* Factura print */
.factura-header { display: flex; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--text); }
.factura-meta { text-align: right; }
.factura-cliente { margin-bottom: 1.5rem; }
.factura-table tfoot td { border-top: 2px solid var(--border); }
.factura-footer { margin-top: 2rem; font-size: .85rem; color: var(--text-muted); }

.link-sm { font-size: .8rem; color: var(--accent); text-decoration: none; }

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input { border: 1px solid var(--border); border-radius: 8px; padding: .4rem .65rem; }
.dataTables_wrapper .dataTables_length select { border: 1px solid var(--border); border-radius: 8px; padding: .3rem; }

@media (max-width: 992px) {
    #sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }
    #sidebar.open { transform: translateX(0); }
    #sidebar.hide + #content,
    #content { margin-left: 0 !important; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-field-row { grid-template-columns: 1fr; }
    .pos-products-header { flex-direction: column; align-items: stretch; }
    .pos-search-wrap { max-width: none; }
    .pos-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .pos-cart { position: static; max-height: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.span-2, .form-group.span-3 { grid-column: span 1; }
}
