        :root {
            --gold:        #C9A84C;
            --gold-light:  #E8C97A;
            --gold-dark:   #9B7A2E;
            --gold-subtle: rgba(201,168,76,0.12);
            --gold-glow:   rgba(201,168,76,0.20);
            --bg:          #141210;
            --surface:     #1D1A16;
            --surface2:    #252118;
            --surface3:    #2E2920;
            --text:        #F0E8D5;
            --text-muted:  #9A8870;
            --text-dim:    #5C5044;
            --border:      rgba(201,168,76,0.18);
            --border-soft: rgba(201,168,76,0.10);
            --danger:      #B84040;
            --danger-bg:   rgba(184,64,64,0.12);
            --header-bg:   linear-gradient(170deg, #201C14 0%, #1A160F 100%);
            --summary-bg:  linear-gradient(135deg, #1A160F 0%, #161210 100%);
            --modal-bg:    linear-gradient(160deg, #1D1A16 0%, #141210 100%);
        }

        body.light-mode {
    --bg:          #141210;
    --surface:     #E8DCC8;
    --surface2:    #DCCBB0;
    --surface3:    #CDB894;

    --text:        #241D15;
    --text-muted:  #4F402E;
    --text-dim:    #6F5A40;

    --border:      rgba(120,80,25,0.42);
    --border-soft: rgba(120,80,25,0.28);

    --danger-bg:   rgba(184,64,64,0.12);

    --header-bg:   linear-gradient(170deg, #E6D8C1 0%, #D4BE9D 100%);
    --summary-bg:  linear-gradient(135deg, #EADCC5 0%, #D8C19E 100%);
    --modal-bg:    linear-gradient(160deg, #E7D9C3 0%, #D2BC9A 100%);
}
body.light-mode .toast {
    background: #F4E8D3;
    color: #5C4315;
    border-color: rgba(120,80,25,0.45);
}

body.light-mode .login-error {
    color: #9E2F2F;
}

body.light-mode .confirm-message,
body.light-mode .history-sub,
body.light-mode .dashboard-item-meta {
    color: #5F503E;
}

body.light-mode input::placeholder {
    color: #7A6852;
}
body.light-mode .section-label,
body.light-mode .s-label,
body.light-mode .total-label,
body.light-mode .range-field label,
body.light-mode .dashboard-section-title {
    color: #8A651F;
    font-weight: 600;
}
body.light-mode .btn-theme,
body.light-mode .btn-logout {
    color: #5A4218;
    border-color: rgba(120,80,25,0.55);
    background: rgba(255,255,255,0.35);
    font-weight: 600;
}

body.light-mode .btn-theme:hover,
body.light-mode .btn-logout:hover {
    color: #241D15;
    border-color: #9B7A2E;
    background: rgba(201,168,76,0.22);
}
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Jost', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 3rem 1.5rem 4rem;
            transition: background 0.25s, color 0.25s;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                repeating-linear-gradient(
                    90deg,
                    transparent,
                    transparent 79px,
                    rgba(201,168,76,0.03) 79px,
                    rgba(201,168,76,0.03) 80px
                );
            pointer-events: none;
            z-index: 0;
        }

        .card {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 680px;
            background: var(--surface);
            border-radius: 24px;
            border: 1px solid var(--border);
            overflow: hidden;
        }

        .header {
            padding: 2.75rem 2.5rem 2.25rem;
            text-align: center;
            background: var(--header-bg);
            border-bottom: 1px solid var(--border);
            position: relative;
        }

        .header::after {
            content: '';
            position: absolute;
            bottom: 0; left: 50%; transform: translateX(-50%);
            width: 60px; height: 2px;
            background: linear-gradient(90deg, transparent, var(--gold), transparent);
        }

        .logo-img-wrap {
            margin: 0 auto 0.5rem;
            width: 160px; height: 160px;
            border-radius: 50%;
            overflow: hidden;
            border: 1.5px solid var(--border);
            background: #F5EDD8;
        }

        .logo-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

        .brand-sub {
            font-size: 10px;
            letter-spacing: 4px;
            text-transform: uppercase;
            color: var(--text-muted);
            margin-top: 6px;
            font-weight: 300;
        }

        .body { padding: 2.25rem 2.5rem; }

        .section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
        .section-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 500; }
        .section-line { flex: 1; height: 1px; background: var(--border-soft); }

        .select-wrap { position: relative; margin-bottom: 1.5rem; }

        select, input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"] {
            width: 100%;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 14px 18px;
            color: var(--text);
            font-family: 'Jost', sans-serif;
            font-size: 15px;
            font-weight: 400;
            outline: none;
            appearance: none;
            transition: border-color 0.2s, background 0.2s;
        }

        select:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="date"]:focus {
            border-color: var(--gold);
            background: var(--surface3);
        }

        select option { background: var(--surface2); }
        input::placeholder { color: var(--text-dim); }

        .new-client-input { display: none; margin-top: 8px; animation: slideDown 0.2s ease; }
        .new-client-input.visible { display: block; }

        @keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

        .divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 1.5rem 0; }

        #listaProds { margin-bottom: 10px; }
        .product-row { display: grid; grid-template-columns: 1fr 70px 120px 42px; gap: 10px; margin-bottom: 10px; animation: rowIn 0.25s ease; }
        @keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
        .p-qty { text-align: center; }
        .p-price { text-align: right; }
        input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { opacity: 0; }

        .btn-del {
            width: 38px; height: 38px;
            border-radius: 8px;
            background: var(--danger-bg);
            border: 1px solid rgba(184,64,64,0.25);
            color: #D06060;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.2s, border-color 0.2s;
            flex-shrink: 0;
            align-self: center;
        }
        .btn-del:hover { background: rgba(184,64,64,0.25); border-color: var(--danger); }
        @media (min-width: 601px) {
    .product-row:first-child {
        grid-template-columns: 1fr 70px 120px;
    }

    .product-row:first-child .btn-del {
        display: none;
    }
}
        .trash-icon { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; }

        .btn-add {
    width: 100%;
    background: var(--gold-subtle);
    border: 1.5px dashed rgba(201,168,76,0.55);
    border-radius: 10px;
    padding: 13px;
    color: var(--gold);
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
body.light-mode .btn-add {
    color: #7A5818;
    border-color: rgba(120,80,25,0.60);
    background: rgba(255,255,255,0.28);
    font-weight: 600;
}
        .btn-add:hover { background: var(--gold-subtle); border-color: var(--gold); }

        .summary {
            background: var(--summary-bg);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 1.5rem 1.75rem;
            margin: 1.5rem 0;
        }
        .summary-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
        .s-label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); font-weight: 400; }
        .s-value { color: var(--text); font-family: 'Cormorant Garamond', serif; font-size: 18px; }
        .summary-divider { height: 1px; background: var(--border); margin: 10px 0; }
        .total-row { display: flex; justify-content: space-between; align-items: baseline; }
        .total-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 500; }
        .total-value { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 400; color: var(--gold); letter-spacing: 1px; }

        .btn-main {
            width: 100%;
            min-height: 56px;
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
            border: none;
            border-radius: 12px;
            padding: 17px;
            color: #12100C;
            font-family: 'Jost', sans-serif;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 3px;
            text-transform: uppercase;
            cursor: pointer;
            transition: opacity 0.2s, transform 0.15s;
            position: relative;
            overflow: hidden;
        }
        .btn-main::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%); pointer-events: none; }
        .btn-main:hover { opacity: 0.92; }
        .btn-main:active { transform: scale(0.99); opacity: 0.88; }
        .btn-main:disabled { opacity: 0.55; cursor: not-allowed; }

        .footer-ornament { text-align: center; margin-top: 1.5rem; font-size: 10px; letter-spacing: 3px; color: var(--text-dim); text-transform: uppercase; }

        .toast {
            position: fixed;
            left: 50%;
            bottom: calc(24px + env(safe-area-inset-bottom));
            transform: translateX(-50%) translateY(20px);
            background: var(--surface3);
            border: 1px solid var(--gold);
            border-radius: 12px;
            padding: 13px 22px;
            color: var(--gold);
            font-size: 12px;
            letter-spacing: 1px;
            opacity: 0;
            transition: opacity 0.3s, transform 0.3s;
            pointer-events: none;
            z-index: 9999;
            max-width: 92vw;
            white-space: normal;
            text-align: center;
            line-height: 1.4;
            box-shadow: 0 16px 40px rgba(0,0,0,0.35);
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

       #loginScreen {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;

    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}
#loginScreen.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

#loginScreen.hidden {
    display: none;
}

#loginScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(20,18,16,0.55), rgba(20,18,16,0.55)),
        url("/assets/login-bg-web.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

#loginScreen {
    display: flex;
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    background: rgba(29, 26, 22, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
}
        .login-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
        .login-brand-main { font-family: 'Cormorant Garamond', serif; font-size: 68px; line-height: 1; color: var(--gold); letter-spacing: 4px; text-shadow: 0 0 18px rgba(201,168,76,0.15); }
        .login-brand-sub { margin-top: 4px; font-size: 12px; letter-spacing: 8px; color: var(--text-muted); text-transform: uppercase; }
        .login-header { padding: 3rem 2.25rem 2.35rem; text-align: center; background: var(--header-bg); border-bottom: 1px solid var(--border); }
        .login-body { padding: 2.35rem 2.2rem 2.5rem; display: flex; flex-direction: column; gap: 15px; }
        .login-title { font-family: 'Cormorant Garamond', serif; font-size: 25px; font-weight: 500; color: var(--gold-dark); text-align: center; margin-bottom: 8px;
}
        .login-input-wrap { position: relative; }
        .login-input-wrap input { width: 100%; padding-right: 48px; }
        .login-eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; font-size: 16px; user-select: none; transition: color 0.2s; z-index: 2; }
        .login-eye:hover { color: var(--gold); }
        .login-error { font-size: 12px; color: var(--danger); text-align: center; min-height: 18px; letter-spacing: 0.5px; opacity: 0; transition: opacity 0.3s; }
        .login-error.show { opacity: 1; }

        .btn-row { display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: stretch; width: 100%; }
        .btn-row-actions { grid-template-columns: 1fr 110px 120px 130px; }
        .btn-wa { min-height: 56px; height: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; background: #25D366; border: none; border-radius: 12px; padding: 17px 18px; color: #fff; font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: opacity 0.2s, transform 0.15s; white-space: nowrap; }
        .btn-wa:hover { opacity: 0.88; }
        .btn-wa:active { transform: scale(0.98); }
        .wa-icon { width: 18px; height: 18px; flex-shrink: 0; }

        .btn-logout, .btn-theme {
            position: absolute;
            top: 18px;
            width: auto;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid rgba(201,168,76,0.25);
            background: transparent;
            color: var(--text-muted);
            font-family: 'Jost', sans-serif;
            font-size: 10px;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            cursor: pointer;
            transition: color 0.2s, border-color 0.2s, background 0.2s;
        }
        .btn-logout { right: 18px; }
        .btn-theme { left: 18px; min-width: 38px; }
        .btn-logout:hover, .btn-theme:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-subtle); }

        .summary-payment-row { align-items: flex-start; gap: 16px; margin-top: 12px; }
        .payment-fields { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
        .money-field { display: flex; align-items: center; gap: 6px; }
        .money-field span { font-size: 14px; color: var(--text-muted); }
        .money-field input { width: 110px; padding: 8px 10px; font-size: 15px; text-align: right; border-color: rgba(201,168,76,0.35); }
        .date-field-wrap { display: flex; align-items: center; gap: 10px; }
        .date-dark { width: 170px; padding: 10px 12px; font-size: 14px; text-align: center; background: var(--surface2); color: var(--text); border: 1px solid rgba(201,168,76,0.35); border-radius: 12px; font-family: 'Jost', sans-serif; outline: none; }
        .date-dark:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,168,76,0.15); }
        .date-dark::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; cursor: pointer; }
        body.light-mode .date-dark::-webkit-calendar-picker-indicator { filter: none; }
        .summary-input-row { gap: 16px; }
        .summary-money-input input { width: 130px; padding: 8px 10px; font-size: 15px; text-align: right; border-color: rgba(201,168,76,0.35); }

        .edit-badge { margin-bottom: 12px; border: 1px solid rgba(201,168,76,0.35); background: var(--gold-subtle); color: var(--gold); border-radius: 10px; padding: 10px 14px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; text-align: center; }

        .history-overlay, .confirm-overlay, .dashboard-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.72);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
        }
        .history-overlay { z-index: 2100; }
        .confirm-overlay { z-index: 2200; }
        .dashboard-overlay { z-index: 2150; }
        .history-overlay.show, .confirm-overlay.show, .dashboard-overlay.show { display: flex; }

        .history-box, .dashboard-box, .confirm-box {
            width: 100%;
            background: var(--modal-bg);
            border: 1px solid rgba(201,168,76,0.35);
            border-radius: 22px;
            padding: 1.5rem;
            box-shadow: 0 20px 60px rgba(0,0,0,0.45);
        }
        .history-box { max-width: 560px; max-height: 82vh; overflow: hidden; }
        .dashboard-box { max-width: 680px; max-height: 88vh; overflow-y: auto; }
        .confirm-box { max-width: 380px; border-radius: 20px; text-align: center; animation: modalIn 0.18s ease; }
        @keyframes modalIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

        .history-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
        .history-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; color: var(--gold); }
        .history-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
        .history-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(201,168,76,0.25); background: transparent; color: var(--gold); font-size: 24px; cursor: pointer; line-height: 1; }
        .history-list { margin-top: 14px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
        .range-filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; }
        .range-field { display: flex; flex-direction: column; gap: 6px; }
        .range-field label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
        .range-field input { padding: 10px 12px; font-size: 13px; border-radius: 12px; border-color: rgba(201,168,76,0.35); }
        .btn-range { min-height: 42px; border-radius: 12px; border: 1px solid rgba(201,168,76,0.35); background: var(--gold-subtle); color: var(--gold); font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; padding: 0 14px; }
        .btn-range:hover { border-color: var(--gold); background: rgba(201,168,76,0.18); }
        .btn-more { width: 100%; margin-top: 6px; border: 1px dashed rgba(201,168,76,0.30); background: transparent; color: var(--gold); border-radius: 10px; padding: 12px; font-family: 'Jost', sans-serif; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; }
        .btn-more:hover { background: var(--gold-subtle); border-color: var(--gold); }
        .history-btn-danger { border-color: rgba(184,64,64,0.35); color: #D06060; }
        .history-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: #D06060; }
        .history-item { border: 1px solid var(--border); background: var(--surface2); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
        .history-item-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
        .history-client { color: var(--text); font-size: 15px; font-weight: 500; }
        .history-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
        .history-total { color: var(--gold); font-family: 'Cormorant Garamond', serif; font-size: 22px; white-space: nowrap; }
        .history-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
        .history-btn { border: 1px solid rgba(201,168,76,0.25); background: transparent; color: var(--gold); border-radius: 10px; padding: 10px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
        .history-btn:hover { background: var(--gold-subtle); border-color: var(--gold); }

        .confirm-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 400; color: var(--gold); margin-bottom: 10px; }
        .confirm-message { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
        .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .btn-cancel, .btn-confirm { min-height: 48px; border-radius: 12px; font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; }
        .btn-cancel { background: transparent; border: 1px solid rgba(201,168,76,0.25); color: var(--text-muted); }
        .btn-confirm { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); border: none; color: #12100C; }

        .dashboard-head-left { flex: 1; min-width: 0; }
        .dashboard-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 320px; margin-top: 14px; }
        .dash-filter { border: 1px solid rgba(201,168,76,0.25); background: transparent; color: var(--text-muted); border-radius: 10px; padding: 8px 14px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: all 0.2s; }
        .dash-filter.active { background: var(--gold-subtle); border-color: var(--gold); color: var(--gold); }
        .dashboard-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
        .dashboard-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
        .dashboard-card span { display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
        .dashboard-card strong { font-family: 'Cormorant Garamond', serif; font-size: 25px; font-weight: 400; color: var(--gold); }
        .dashboard-section-title { margin: 20px 0 10px; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
        .dashboard-list { display: flex; flex-direction: column; gap: 8px; }
        .dashboard-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; width: 100%; background: var(--surface2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; }
        .dashboard-item-name { color: var(--text); font-size: 14px; }
        .dashboard-item-meta { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
        .dashboard-item-value { color: var(--gold); font-family: 'Cormorant Garamond', serif; font-size: 21px; white-space: nowrap; }
        .dashboard-empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }

        input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px var(--surface2) inset; caret-color: var(--text); transition: background-color 9999s ease-in-out 0s; }

        @media (max-width: 600px) {
            body { padding: 1rem 0.75rem 2rem; align-items: stretch; }
            .card { max-width: none; border-radius: 18px; }
            .header { padding: 2.2rem 1.25rem 1.6rem; }
            .btn-logout, .btn-theme { top: 12px; padding: 7px 10px; font-size: 9px; letter-spacing: 1px; }
            .btn-logout { right: 12px; }
            .btn-theme { left: 12px; }
            .logo-img-wrap { width: 138px; height: 138px; }
            .body { padding: 1.6rem 1.25rem; }
            .section-label { font-size: 9px; letter-spacing: 2.2px; white-space: nowrap; }
            select, input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"] { font-size: 14px; padding: 12px 12px; }
            .product-row { grid-template-columns: minmax(0, 1fr) 58px 102px 36px; gap: 7px; align-items: center; }
            .product-row:first-child { grid-template-columns: minmax(0, 1fr) 58px 102px; }
            .product-row:first-child .btn-del { display: none; }
            .p-name, .p-price, .p-qty { min-width: 0; height: 48px; font-size: 13px; padding: 11px 10px; }
            .p-price { text-align: right; }
            .btn-del { width: 36px; height: 36px; }
            .summary { padding: 1.25rem 1.1rem; }
            .summary-row { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 10px; align-items: center; }
            .s-label, .total-label { line-height: 1.35; }
            .s-value { text-align: right; font-size: 18px; }
            .summary-input-row, .summary-payment-row { display: grid; grid-template-columns: 138px minmax(0, 1fr); align-items: center; gap: 10px; }
            .payment-fields { display: contents; }
            .money-field { width: 100%; display: grid; grid-template-columns: 16px 132px; align-items: center; justify-content: end; gap: 7px; }
            .money-field span { width: 16px; text-align: left; flex-shrink: 0; font-size: 13px; }
            .money-field input, .summary-money-input input { width: 132px; max-width: 132px; height: 44px; padding: 8px 10px; font-size: 13px; text-align: right; }
            .date-field-wrap { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: 138px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 4px; }
            .date-dark { width: 155px; max-width: 155px; height: 44px; padding: 8px 10px; font-size: 13px; text-align: center; }
            .total-row { align-items: center; gap: 12px; }
            .total-value { font-size: 28px; white-space: nowrap; }
            .btn-row, .btn-row-actions { grid-template-columns: 1fr; gap: 10px; }
            .btn-main { min-height: 52px; padding: 14px 10px; font-size: 11px; letter-spacing: 2px; }
            .footer-ornament { line-height: 1.8; }
            .toast { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translateY(20px); width: auto; max-width: none; padding: 14px 16px; font-size: 12px; z-index: 9999; }
            .toast.show { transform: translateY(0); }
            #loginScreen { align-items: center; padding: 1rem; }
            .login-card { max-width: 430px; border-radius: 24px; }
            .login-brand-main { font-size: 60px; }
            .login-brand-sub { font-size: 11px; letter-spacing: 7px; }
            .login-header { padding: 2.5rem 1.75rem 2rem; }
            .login-body { padding: 2rem 1.75rem 2.25rem; }
            .login-title { font-size: 24px; }
            .history-overlay, .dashboard-overlay { align-items: flex-start; justify-content: center; padding: 12px; overflow-y: auto; }
            .history-box, .dashboard-box { width: 100%; max-width: 100%; max-height: none; overflow-x: hidden; overflow-y: visible; padding: 1.15rem; border-radius: 18px; }
            .history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
            .history-title { font-size: 27px; }
            .history-sub { max-width: 190px; line-height: 1.4; }
            .dashboard-filters { max-width: none; margin-top: 12px; }
            .range-filters { grid-template-columns: 1fr; gap: 9px; }
            .btn-range { width: 100%; }
            .dash-filter { width: 100%; padding: 9px 6px; font-size: 10px; letter-spacing: 1.2px; }
            .dashboard-cards { grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
            .dashboard-card, .dashboard-list { width: 100%; }
            .dashboard-item { grid-template-columns: 1fr; width: 100%; }
            .dashboard-item-value { margin-top: 6px; }
            .history-item-top { flex-direction: column; gap: 4px; }
            .history-date { white-space: normal; }
        }

        @media (max-width: 360px) {
            .body { padding: 1.4rem 1rem; }
            .product-row { grid-template-columns: minmax(0, 1fr) 52px 90px 34px; gap: 6px; }
            .product-row:first-child { grid-template-columns: minmax(0, 1fr) 52px 90px; }
            .btn-del { width: 34px; height: 34px; }
            .login-brand-main { font-size: 54px; }
            .login-body { padding: 1.85rem 1.35rem 2rem; }
        }
        @media (max-width: 600px) {
    #loginScreen::before {
        background-image:
            linear-gradient(rgba(20,18,16,0.60), rgba(20,18,16,0.60)),
            url("/assets/login-bg-mobile.png");
    }
}