:root {
    --bg: #0b1220;
    --bg-soft: #101827;
    --panel: #141c2d;
    --panel-2: #1a2438;
    --line: rgba(232, 238, 247, .1);
    --text: #e8eef7;
    --muted: #93a0b5;
    --ice: #38bdf8;
    --ice-2: #7dd3fc;
    --gold: #f5c16c;
    --success: #34d399;
    --success-2: #059669;
    --danger: #fb7185;
    --warning: #f5c16c;
    --orange: #fb923c;
    --teal: #2dd4bf;
    --purple: #a78bfa;
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --dark: #16324f;
    --darker: #0b1220;
    --light: #f4f7fb;
    --ink: #122033;
    --shadow: 0 10px 30px rgba(0, 0, 0, .28);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, .35);
    --radius: 16px;
    --header-h: 64px;
    --sidebar-w: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(1200px 520px at -10% -20%, rgba(56,189,248,.14), transparent 50%),
        radial-gradient(900px 480px at 110% 0%, rgba(245,193,108,.08), transparent 42%),
        var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    min-height: 100vh;
}

button, input, select { font-family: inherit; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.header {
    height: var(--header-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(11, 18, 32, .82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.header-left, .header-right { display: flex; align-items: center; gap: 10px; }
.header-right { flex-wrap: wrap; }

.menu-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.menu-btn:hover { background: rgba(255,255,255,.08); }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 34px; height: 34px; border-radius: 10px; }
.logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.04em;
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.logo-text small {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--muted);
    text-transform: none;
}

.header-btn, .btn, .filter-btn, .period-btn, .add-person-btn, .day-btn, .action-btn, .product-tab, .icon-btn {
    transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.header-btn {
    height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255,255,255,.05);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.header-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); }
.btn-new { background: #34d399; border-color: transparent; color: #053325; }
.btn-home { background: var(--ice); border-color: transparent; color: #062033; }
.header-date, .user-chip {
    height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 650;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line);
    color: var(--text);
}
.user-chip span {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(56,189,248,.2);
    color: var(--ice-2);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.main-container { display: flex; margin-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }

.sidebar {
    width: var(--sidebar-w);
    background: rgba(16, 24, 39, .92);
    border-right: 1px solid var(--line);
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: transform .25s ease;
}
.sidebar.hidden { transform: translateX(-100%); }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }

.debt-box {
    margin: 16px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(251,113,133,.18), rgba(251,113,133,.08));
    border: 1px solid rgba(251,113,133,.22);
}
.debt-box h4 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fecdd3;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.debt-box .amount { font-size: 26px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.sidebar-title {
    padding: 4px 18px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--muted);
    text-transform: uppercase;
}
.empty-sidebar { padding: 20px 18px; color: var(--muted); font-size: 13px; }

.customer-item {
    margin: 0 10px 6px;
    padding: 11px 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    background: rgba(255,255,255,.03);
    border: 1px solid transparent;
}
.customer-item:hover { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.2); }
.customer-item .name { font-size: 13px; font-weight: 650; }
.customer-item .bal { color: var(--gold); font-weight: 750; font-variant-numeric: tabular-nums; }

.sidebar-logout { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }

.content { flex: 1; margin-left: var(--sidebar-w); padding: 18px; transition: margin .25s ease; }
.sidebar.hidden + .content { margin-left: 0; }

.sale-view {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 268px 92px;
    gap: 14px;
    height: calc(100vh - var(--header-h) - 36px);
    animation: fadeIn .35s ease;
}

.summary-panel, .product-panel, .welcome-panel, .numpad-panel, .stats-section, .detail-summary, .detail-persons, .detail-payments {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.summary-panel {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 750;
}
.summary-header span { display: flex; align-items: center; gap: 7px; }
.summary-stats { display: flex; gap: 14px; }
.summary-stats .stat { text-align: right; }
.summary-stats .stat small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.summary-stats .stat strong { font-size: 15px; color: var(--success); font-variant-numeric: tabular-nums; }

.day-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.day-btn {
    height: 38px;
    border: 0;
    border-radius: 11px;
    font-weight: 750;
    cursor: pointer;
    font-size: 12px;
}
.day-btn.plus { background: rgba(52,211,153,.16); color: #6ee7b7; }
.day-btn.minus { background: rgba(251,113,133,.16); color: #fda4af; }
.day-btn:hover { filter: brightness(1.08); }

.persons-section { margin-bottom: 12px; }
.persons-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.persons-header span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.add-person-btn {
    background: rgba(56,189,248,.16);
    color: var(--ice-2);
    border: 0;
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.persons-list { display: flex; flex-direction: column; gap: 6px; max-height: 128px; overflow-y: auto; }
.person-item {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    background: rgba(255,255,255,.04);
    border-radius: 11px;
    cursor: pointer;
    border: 1px solid transparent;
}
.person-item.active { border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.12); }
.person-name { flex: 1; font-weight: 700; font-size: 12px; }
.person-stats { font-size: 11px; color: var(--muted); margin-right: 8px; }
.person-remove {
    background: rgba(251,113,133,.18);
    color: #fecdd3;
    border: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.empty-persons, .empty-cart, .empty, .empty-row { text-align: center; padding: 22px 10px; color: var(--muted); font-size: 13px; }

.current-box {
    background: rgba(56,189,248,.08);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(56,189,248,.18);
}
.current-box .label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.current-box .name { font-size: 15px; font-weight: 800; color: var(--ice-2); margin: 4px 0; }
.current-box .total { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--success); font-variant-numeric: tabular-nums; }
.current-box .discount-tag { color: var(--gold); font-size: 12px; font-weight: 700; margin-top: 4px; }
.current-box .info { font-size: 12px; color: var(--muted); margin-top: 4px; }

.cart-list { flex: 1; overflow-y: auto; min-height: 0; }
.cart-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(255,255,255,.04);
    border-radius: 12px;
    margin-bottom: 7px;
    font-size: 12px;
}
.cart-item-top { display: flex; align-items: center; gap: 8px; }
.cart-item-top .num, .cart-item .num { color: var(--muted); font-weight: 750; min-width: 16px; }
.cart-item-top .name { flex: 1; font-weight: 700; line-height: 1.3; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; padding-left: 24px; }
.cart-item .days { text-align: center; font-weight: 750; font-size: 11px; min-width: 28px; color: var(--gold); }
.cart-item .price { color: var(--success); text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-item .qty { text-align: center; font-weight: 750; min-width: 20px; }
.qty-btns { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.days-ctrl { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,.18); border-radius: 8px; padding: 2px; }
.cart-btn {
    width: 22px; height: 22px;
    border-radius: 7px;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
}
.cart-btn.minus { background: #e11d48; }
.cart-btn.plus { background: #059669; }
.cart-btn.day-minus, .cart-btn.day-plus { background: #0284c7; width: 20px; height: 20px; font-size: 12px; }

.cart-item-middle { display: flex; align-items: center; justify-content: space-between; padding-left: 24px; }
.start-date-ctrl { display: flex; gap: 4px; }
.date-btn {
    padding: 3px 8px;
    border: 0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
    background: rgba(255,255,255,.08);
    color: var(--muted);
}
.date-btn.active { background: var(--gold); color: #3b2a0a; }
.end-info { font-size: 11px; color: var(--gold); font-weight: 650; }

.product-panel, .welcome-panel {
    background: var(--light);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    overflow: hidden;
}
.welcome-panel { align-items: center; justify-content: center; text-align: center; }
.welcome-content { max-width: 360px; }
.welcome-mark {
    width: 72px; height: 72px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: #e8f4ff;
    color: #0284c7;
}
.welcome-content h2 { font-size: 24px; letter-spacing: -.03em; margin-bottom: 8px; }
.welcome-content p { font-size: 14px; color: #5b6b80; margin-bottom: 22px; }

.product-header { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.date-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
}
.date-box input { border: 0; background: transparent; font-size: 13px; width: 124px; font-weight: 650; color: var(--ink); }
.date-box .price {
    background: #122033;
    color: #6ee7b7;
    padding: 8px 12px;
    border-radius: 9px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.product-tabs { display: flex; gap: 8px; }
.product-tab {
    padding: 10px 16px;
    border: 1px solid #dbe3ee;
    background: #fff;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    font-size: 12px;
    color: #5b6b80;
}
.product-tab:hover { background: #eef3f8; }
.product-tab.active { background: #122033; border-color: #122033; color: #fff; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
}
.product-grid::-webkit-scrollbar { width: 6px; }
.product-grid::-webkit-scrollbar-thumb { background: #c5d0de; border-radius: 99px; }

.product-card {
    background: #fff;
    border: 1px solid #dce4ef;
    border-radius: 14px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
}
.product-card:hover { border-color: #7dd3fc; transform: translateY(-2px); box-shadow: 0 12px 24px rgba(15, 23, 42, .08); }
.product-card .product-emoji {
    width: 42px; height: 42px;
    margin: 0 auto 8px;
    border-radius: 12px;
    background: #eef6ff;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
}
.product-card .name {
    font-weight: 750;
    font-size: 12px;
    line-height: 1.3;
    color: var(--ink);
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .price { color: #059669; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

.numpad-panel {
    background: var(--light);
    border-radius: var(--radius);
    padding: 14px;
    color: var(--ink);
    overflow: hidden;
}
.numpad-display {
    background: #fff;
    padding: 14px;
    text-align: right;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.04em;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #dbe3ee;
    font-variant-numeric: tabular-nums;
}
.numpad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.num-btn {
    padding: 13px 6px;
    border: 0;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.num-btn.number { background: #fff; color: var(--ink); border: 1px solid #dbe3ee; }
.num-btn.quick { background: #d1fae5; color: #065f46; }
.num-btn.action { background: #334155; color: #fff; }
.num-btn.discount { background: #fde68a; color: #78350f; font-size: 11px; }

.action-panel { display: flex; flex-direction: column; gap: 7px; }
.action-btn {
    padding: 11px 6px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .02em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #fff;
}
.action-btn .icon { display: flex; }
.action-btn.orange { background: #ea580c; }
.action-btn.green { background: #059669; }
.action-btn.blue { background: #0284c7; }
.action-btn.teal { background: #0f766e; }
.action-btn.red { background: #e11d48; }
.action-btn.gray { background: #475569; }

.list-view, .stats-view, .products-view, .detail-view { animation: fadeIn .3s ease; }
.list-header, .stats-header, .products-header { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

.filter-btn, .period-btn {
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    font-size: 12px;
    color: var(--text);
}
.filter-btn.active, .period-btn.active { background: #fff; color: #122033; border-color: #fff; }
.filter-btn.debt.active { background: #34d399; color: #053325; border-color: #34d399; }
.filter-btn.returned.active { background: #2dd4bf; color: #042f2e; border-color: #2dd4bf; }
.filter-btn.refund.active { background: #fb7185; color: #4c0519; border-color: #fb7185; }

.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    border-radius: 11px;
    font-size: 13px;
    color: #fff;
}
.search-box::before {
    content: "";
    position: absolute;
    left: 13px; top: 11px;
    width: 14px; height: 14px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    box-shadow: 6px 6px 0 -5px var(--muted);
}
.search-box input::placeholder { color: #7d8aa0; }
.search-box input:focus { outline: 0; border-color: rgba(56,189,248,.6); }

.icon-btn {
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    border-radius: 11px;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--text);
}
.refresh-btn:hover { animation: spin .5s; }

.date-range { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.date-range input {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    border-radius: 11px;
    color: #fff;
    font-size: 12px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink); }
.data-table th {
    background: #122033;
    color: #dbe7f5;
    padding: 13px 10px;
    text-align: left;
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.data-table td { padding: 12px 10px; border-bottom: 1px solid #edf2f7; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f4f9ff; }
.data-table tr.has-debt { background: #fff7e6; }
.data-table tr.is-returned { background: #ecfdf5; }
.data-table tr.is-refunded { background: #fff1f2; }
.data-table tr.is-refunded td { color: #9f1239; }
.empty-row { text-align: center; padding: 48px !important; color: #7b8aa0; }
.bal-red { color: #e11d48; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal-green { color: #059669; font-weight: 800; font-variant-numeric: tabular-nums; }

.type-badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}
.type-badge.hotel { background: #e0f2fe; color: #075985; }
.type-badge.daily { background: #ffedd5; color: #9a3412; }

.edit-btn, .print-btn, .refund-btn, .pay-btn {
    border: 0;
    width: 30px; height: 30px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.edit-btn { background: #0284c7; }
.print-btn { background: #0f766e; }
.refund-btn { background: #ea580c; }
.pay-btn { background: #059669; margin-right: 6px; font-weight: 800; }
.refund-badge {
    background: #ffe4e6;
    color: #9f1239;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    transition: .2s;
    border-radius: 99px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: #059669; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
}
.stat-card.blue { box-shadow: inset 3px 0 0 var(--ice); }
.stat-card.green { box-shadow: inset 3px 0 0 var(--success); }
.stat-card.teal { box-shadow: inset 3px 0 0 var(--teal); }
.stat-card.purple { box-shadow: inset 3px 0 0 var(--purple); }
.stat-card.orange { box-shadow: inset 3px 0 0 var(--orange); }
.stat-card.red { box-shadow: inset 3px 0 0 var(--danger); }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.05);
    color: var(--ice-2);
}
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 650; }

.stats-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stats-section { background: var(--panel); border-radius: 16px; padding: 16px; }
.stats-section h3 { font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.top-item, .daily-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.top-item .rank {
    background: rgba(56,189,248,.16);
    color: var(--ice-2);
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}
.top-item .name, .daily-item .date { flex: 1; }
.top-item .qty, .daily-item .cnt { color: var(--muted); }
.top-item .rev, .daily-item .rev { color: var(--success); font-weight: 750; font-variant-numeric: tabular-nums; }

.products-header h2 { flex: 1; font-size: 20px; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.products-list { display: flex; flex-direction: column; gap: 8px; }
.product-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--panel);
    border-radius: 14px;
    border: 1px solid var(--line);
}
.product-item.inactive { opacity: .45; }
.product-info { flex: 1; }
.product-info strong { display: block; font-size: 14px; }
.product-info .category { font-size: 12px; color: var(--muted); }
.product-prices { margin-right: 16px; text-align: right; }
.product-prices span { display: block; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.product-prices .vip { font-size: 12px; color: var(--gold); }
.product-actions { display: flex; gap: 6px; }

.detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-header h2 { flex: 1; font-size: 20px; letter-spacing: -.03em; }
.back-btn {
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line);
    color: var(--text);
    height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-content { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 12px; }
.detail-summary, .detail-persons, .detail-payments {
    background: var(--panel);
    border-radius: 16px;
    padding: 16px;
    max-height: min(62vh, 560px);
    overflow-y: auto;
}
.summary-grid { display: flex; flex-direction: column; gap: 4px; }
.summary-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-item:last-child { border-bottom: 0; }
.summary-item label { font-size: 12px; color: var(--muted); }
.summary-item span { font-size: 13px; font-weight: 750; }
.summary-item.highlight { background: rgba(255,255,255,.04); padding: 10px 12px; border-radius: 10px; margin-top: 8px; }
.summary-item.highlight span { font-size: 16px; }
.summary-item span.red { color: var(--danger); }
.summary-item span.green { color: var(--success); }
.highlight-date { color: var(--gold); }

.detail-persons h3, .detail-payments h3 {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.person-detail { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.person-detail:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.person-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.person-header strong { font-size: 14px; }
.person-header span { color: var(--muted); font-size: 12px; }
.person-items { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: rgba(255,255,255,.04); border-radius: 10px; font-size: 12px; }
.item-row.returned { opacity: .5; text-decoration: line-through; }
.item-row .item-name { flex: 1; }
.item-row .item-qty { color: var(--muted); }
.item-row .item-price { font-weight: 750; color: var(--success); font-variant-numeric: tabular-nums; }

.payment-row-detail { display: flex; gap: 12px; padding: 10px; border-bottom: 1px solid var(--line); font-size: 12px; cursor: pointer; border-radius: 10px; }
.payment-row-detail:hover { background: rgba(255,255,255,.04); }
.payment-row-detail .pay-date { flex: 1; color: var(--muted); }
.payment-row-detail .pay-amount { font-weight: 750; color: var(--success); }
.payment-row-detail .pay-edit { color: var(--ice-2); font-weight: 750; font-size: 11px; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, .62);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: .2s;
    padding: 18px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--ink);
    animation: fadeIn .25s ease;
    box-shadow: var(--shadow-lg);
}
.modal.modal-sm { max-width: 360px; }
.modal.modal-lg { max-width: 620px; }
.modal-header {
    padding: 16px 20px;
    background: #122033;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.modal-close {
    background: rgba(255,255,255,.08);
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 9px;
}
.modal-body { padding: 20px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 750; font-size: 12px; color: #4b5b70; }
.form-group input, .form-group select, #addItemPersonSelect, #listPayDiscount, #listPayDiscountType {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
}
.form-group input:focus, .form-group select:focus { outline: 0; border-color: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,.14); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.customer-type-btns { display: flex; gap: 8px; }
.customer-type-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #d7e0eb;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #334155;
}
.customer-type-btn.active { border-color: #122033; background: #122033; color: #fff; }

.payment-info { background: #f4f7fb; padding: 14px; border-radius: 14px; margin-bottom: 16px; }
.payment-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e4ebf3; font-size: 13px; }
.payment-row:last-child { border-bottom: 0; font-weight: 800; font-size: 15px; padding-top: 12px; margin-top: 6px; border-top: 1px solid #d7e0eb; }
.payment-row.debt, .payment-row.highlight { color: #e11d48; }

.multi-payment, .payment-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.payment-input-row { display: flex; align-items: center; gap: 12px; }
.payment-input-row label { min-width: 72px; font-size: 12px; font-weight: 750; color: #4b5b70; }
.payment-type-icon {
    width: 128px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}
.payment-type-icon.nakit { background: #d1fae5; color: #065f46; }
.payment-type-icon.kredi { background: #e0f2fe; color: #075985; }
.payment-type-icon.havale { background: #ffedd5; color: #9a3412; }
.payment-input-row input {
    flex: 1;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 750;
}

.payment-types { display: flex; gap: 8px; margin-bottom: 14px; }
.payment-type-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #d7e0eb;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}
.payment-type-btn.active { border-color: #122033; background: #122033; color: #fff; }

.confirm-btns, .btn-row { display: flex; gap: 10px; margin-top: 16px; }
.confirm-btns .btn, .btn-row .btn { flex: 1; }
.warning-text { color: #e11d48; font-size: 12px; font-weight: 700; margin-top: 8px; }

.btn {
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font-weight: 750;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
}
.btn-success { background: #059669; }
.btn-teal { background: #0f766e; }
.btn-blue, .btn-primary { background: #0284c7; }
.btn-orange { background: #ea580c; }
.btn-red { background: #e11d48; }
.btn-gray { background: #475569; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 14px; }
.btn-sm {
    padding: 5px 8px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}
.btn-edit { background: #0284c7; color: #fff; }
.btn-delete, .btn-remove-item { background: #e11d48; color: #fff; }
.btn-return { background: #059669; color: #fff; }
.btn-undo { background: #d97706; color: #fff; }
.btn-day-extend { padding: 2px 8px; font-size: 11px; background: #0284c7; color: #fff; border: 0; border-radius: 6px; cursor: pointer; margin-left: 8px; }

.old-price { text-decoration: line-through; opacity: .5; font-size: .7em; display: block; }

.extend-persons-list { display: flex; flex-direction: column; gap: 8px; }
.extend-person-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f4f7fb;
    border-radius: 12px;
    cursor: pointer;
    color: var(--ink);
}
.extend-person-item input { width: 18px; height: 18px; accent-color: #0284c7; }
.extend-person-item span { font-weight: 700; }

.discount-section {
    margin-bottom: 12px;
    padding: 12px;
    background: #f4f7fb;
    border-radius: 12px;
}
.discount-section label { font-size: 12px; font-weight: 750; display: block; margin-bottom: 8px; color: #4b5b70; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: #122033;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 650;
    box-shadow: var(--shadow);
    animation: slideIn .25s ease;
}
.toast.success { background: #065f46; }
.toast.error { background: #9f1239; }

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #122033;
    color: #dbe7f5;
}
.pagination-info { font-size: 12px; color: #93a0b5; }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    padding: 6px 11px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.pagination-btn.active { background: #fff; color: #122033; }

.end-date { color: #b45309; font-weight: 650; display: block; margin-top: 2px; font-size: 11px; }
.is-returned .end-date { color: #047857; }

.btn-add-item-detail {
    background: #059669;
    color: #fff;
    border: 0;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

#addItemProductGrid { max-height: 320px; overflow-y: auto; }

@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
}

@media (max-width: 1200px) {
    .sale-view { grid-template-columns: 270px minmax(0,1fr) 240px 86px; }
}

@media (max-width: 1000px) {
    .detail-content { grid-template-columns: 1fr 1fr; }
    .detail-payments { grid-column: span 2; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar:not(.hidden) { transform: translateX(0); }
    .content { margin-left: 0; }
    .sale-view { grid-template-columns: 1fr; height: auto; }
    .product-panel, .welcome-panel { min-height: 360px; }
    .numpad-panel { display: none; }
    .action-panel { flex-direction: row; flex-wrap: wrap; }
    .action-btn { flex: 1; min-width: 72px; }
    .stats-details { grid-template-columns: 1fr; }
    .header-date { display: none; }
}

@media (max-width: 700px) {
    .detail-content { grid-template-columns: 1fr; }
    .detail-summary, .detail-persons, .detail-payments { grid-column: 1; }
    .logo-text small { display: none; }
}
