/* ==========================================================
   WARUNG POS — SINGLE SOURCE OF TRUTH CSS
   Mobile-first responsive rewrite.
   All variables in ONE :root. NO duplicate rule blocks.
   ========================================================== */

:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;

    /* Previously missing — now defined */
    --surface-color: #1e293b;
    --text-color: #f8fafc;
    --border-color: rgba(255, 255, 255, 0.1);
    --danger-color: #ef4444;
}

/* ---- Reset ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg-color);
}

body {
    background-image:
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* ---- Glassmorphism helper ---- */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* ---- App Container ---- */
.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100dvh;
}

/* ---- Header ---- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clock {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* ---- Header Controls ---- */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---- Main Content Layout ---- */
.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

/* ---- Products Section ---- */
.products-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    outline: none;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ---- Products Grid ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Product Card ---- */
.product-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.8);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.product-card:hover::before {
    transform: translateX(100%);
}

.product-icon {
    font-size: 2.5rem;
    color: var(--text-main);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.product-info {
    text-align: center;
    width: 100%;
}

.product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Product Stock Badge */
.product-stock {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid var(--glass-border);
}

.stock-low {
    background: rgba(239, 68, 68, 0.8);
    border-color: var(--danger);
}

/* ---- Cart Section ---- */
.cart-section {
    flex: 1.5;
    min-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.cart-section h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-muted);
    margin-top: 50px;
    font-style: italic;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    animation: slideIn 0.15s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.item-details {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 600;
}

.item-price-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

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

.item-qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.item-total {
    font-weight: 700;
    min-width: 80px;
    text-align: right;
    color: var(--accent-color);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
}

/* ---- Cart Summary & Checkout ---- */
.cart-summary {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: auto;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 1rem;
}

.total-row {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 1px dashed var(--glass-border);
    padding-top: 5px;
    margin-top: 5px;
}

.payment-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.payment-section label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.payment-section input {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}

.payment-section input:focus {
    border-color: var(--accent-color);
}

.change-row {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 600;
    color: var(--accent-color);
}

.checkout-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.checkout-btn:disabled {
    background: var(--glass-border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ---- History (consolidated — single definition) ---- */
.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    position: relative;
}

.history-time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.history-amount {
    font-weight: 700;
    color: var(--accent-color);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px 0;
}

/* ---- Delete button (consolidated — single definition) ---- */
.delete-item-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.15s;
    margin-left: 10px;
}

.delete-item-btn:hover {
    opacity: 1;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    padding: 40px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.15s;
    width: 90%;
    max-width: 400px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.success-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.modal-content h2 {
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.modal-content strong {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.close-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

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

/* ---- FAB Cart (desktop: hidden, mobile: shown) ---- */
.fab-cart {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 100;
}

.fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
}

/* ---- Report UI ---- */
.report-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-btn:hover {
    background: var(--accent-color);
    color: white;
}

.report-modal {
    max-width: 600px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.report-header h2 {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin: 0;
}

.qty-quick-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, opacity 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    flex: 1;
}

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

.close-report-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.15s;
}

.close-report-btn:hover {
    color: var(--danger);
}

.report-summary {
    background: rgba(15, 23, 42, 0.5);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.report-summary p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 5px;
}

.total-income-text {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0;
}

.report-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: hidden;
}

.report-history h4 {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.reset-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

/* ---- User Info & Login ---- */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.online {
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

#activeUserName {
    font-weight: 600;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 5px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.logout-btn:hover {
    opacity: 1;
}

.login-modal {
    max-width: 400px;
    width: 90%;
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.15s;
}

.login-input:focus {
    border-color: var(--primary-color);
}

.login-error {
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
    min-height: 20px;
}

/* ---- Tab UI in Report ---- */
.report-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 15px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.2);
    font-weight: 600;
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ---- Expense UI ---- */
.expense-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

.upload-section {
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.upload-section:hover {
    border-color: var(--primary-color);
}

.upload-label {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-label:hover {
    background: var(--primary-hover);
}

/* ---- WiFi Reminder Banner ---- */
.wifi-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.close-banner-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    right: 20px;
}

/* ---- Owner Dashboard ---- */
.owner-dashboard {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.owner-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 20px;
}

.kasir-online {
    color: var(--accent-color);
    font-weight: bold;
}

.kasir-offline {
    color: var(--danger);
    font-weight: bold;
}

/* ---- Owner Stats ---- */
.owner-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stat-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-info h3 {
    margin: 5px 0 0 0;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* ---- Owner Transactions ---- */
.owner-transactions-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 0 20px 20px 20px;
}

.owner-transactions-container h2 {
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.owner-transactions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: var(--text-main);
}

.owner-transactions-table th {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
}

.owner-transactions-table td {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.owner-transactions-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ---- Chat UI ---- */
.chat-modal {
    max-width: 400px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    position: relative;
    word-wrap: break-word;
}

.chat-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: top;
}

.chat-bubble.mine {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-bubble.other {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-sender {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 3px;
    display: block;
}

.chat-time {
    font-size: 0.65rem;
    opacity: 0.5;
    text-align: right;
    display: block;
    margin-top: 5px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ---- Icon-only Button ---- */
.icon-only-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.icon-only-btn i {
    margin: 0;
}

/* ---- PWA Bottom Nav Bar ---- */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--surface-color);
    display: none; /* shown via media query on mobile */
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 4px;
    width: 60px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon-wrapper {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--surface-color);
}

/* ---- Bottom Sheet ---- */
.bottom-sheet {
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    position: fixed;
    transform: translateY(100%);
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 2000;
}

.bottom-sheet.show {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: var(--border-color);
    border-radius: 10px;
    margin: 0 auto 15px auto;
}

.cart-section.bottom-sheet {
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    z-index: 2000;
}

/* ---- More Menu Grid ---- */
.more-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-color);
    cursor: pointer;
}

.more-item i {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 15px;
    color: var(--text-main);
}


/* ==========================================================
   PRINT RECEIPT STYLES
   ========================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    .print-receipt-container, .print-receipt-container * {
        visibility: visible;
    }
    .print-receipt-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: black;
        font-family: monospace;
    }
}


/* ==========================================================
   RESPONSIVE — TABLET (max-width: 900px)
   ========================================================== */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .products-section {
        flex: 1;
        width: 100%;
        padding: 10px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cart-section {
        min-width: unset;
    }

    .app-header {
        flex-direction: column;
        gap: 15px;
    }

    .header-controls {
        gap: 10px;
    }

    .expense-btn, .report-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .owner-dashboard {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        border-radius: 12px;
        padding: 15px;
    }

    /* --- Owner Stats (2-col grid on mobile) --- */
    .owner-stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0;
    }

    .stat-card {
        padding: 15px 12px;
        gap: 10px;
    }

    .stat-card:hover {
        transform: none;
    }

    .stat-icon {
        font-size: 1.8rem;
        padding: 10px;
    }

    .stat-info h3 {
        font-size: 1.2rem;
    }

    .stat-info p {
        font-size: 0.8rem;
    }

    /* --- Owner Action Bar (horizontal, scrollable, NOT hidden) --- */
    .owner-action-bar {
        display: flex;
        flex-direction: column; /* Stack buttons vertically for easier tapping */
        gap: 10px;
        padding: 15px;
        border-radius: 12px;
    }

    .owner-action-bar::-webkit-scrollbar {
        display: none;
    }

    .owner-action-bar button {
        width: 100%;
        min-height: 50px;
        justify-content: center;
    }

    /* --- Owner Transactions Table (card-based) --- */
    .owner-transactions-container {
        margin: 0;
        padding: 15px;
        border-radius: 12px;
    }

    .styled-table, .owner-transactions-table {
        display: block;
        width: 100%;
    }

    .styled-table thead, .owner-transactions-table thead {
        display: none;
    }

    .styled-table tbody, .owner-transactions-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .styled-table tr, .owner-transactions-table tr {
        display: flex;
        flex-direction: column;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 12px;
    }

    .styled-table td, .owner-transactions-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        text-align: right;
    }

    .styled-table td::before, .owner-transactions-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        margin-right: 15px;
    }

    /* --- Table Container --- */
    .table-container {
        border-radius: 0;
        background: transparent;
        padding: 0;
        border: none;
    }

    /* --- Touch Targets (min 44px) --- */
    .qty-btn {
        width: 36px;
        height: 36px;
    }

    .checkout-btn,
    .close-modal-btn,
    .reset-btn,
    .report-btn,
    .expense-btn,
    .tab-btn {
        min-height: 44px;
    }

    .nav-item {
        min-height: 44px;
        min-width: 44px;
    }

    /* --- Login Box --- */
    .login-modal {
        width: 95vw;
    }

    .login-box {
        width: 90%;
        padding: 20px;
    }

    /* --- History on mobile --- */
    .history-list {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   RESPONSIVE — SMALL PHONES (max-width: 380px) — ONE BLOCK
   ========================================================== */
@media (max-width: 380px) {

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .owner-stats-container {
        grid-template-columns: 1fr;
    }

    .product-card {
        padding: 10px;
    }

    .product-name {
        font-size: 0.82rem;
    }

    .product-price {
        font-size: 0.88rem;
    }

    .product-icon {
        height: 50px;
        font-size: 1.6rem;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-info h3 {
        font-size: 1rem;
    }

    .stat-info p {
        font-size: 0.75rem;
    }

    .app-header h1 {
        font-size: 1rem;
    }

    .clock {
        font-size: 0.8rem;
    }

    .more-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .total-income-text {
        font-size: 1.6rem;
    }
}

/* ==========================================================
   OWNER BAR (COMPACT)
   ========================================================== */
.owner-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-color);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 5px;
}

.owner-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.badge-pemilik {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.income-today {
    font-weight: 600;
}

.owner-bar-actions {
    display: flex;
    gap: 10px;
}

.owner-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.owner-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.owner-btn.accent {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.owner-btn:active {
    transform: scale(0.96);
}

@media (max-width: 768px) {
    .owner-bar {
        margin: 0;
        border-radius: 12px;
    }
}

/* Performance Improvements */
button, a, input, select, textarea, .product-card, .nav-item, .more-item, .sheet-handle {
    touch-action: manipulation;
}

.main-content, .products-section, .cart-items, .chat-messages, .history-list, .best-seller-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === TRANSACTION CARDS (Owner Dashboard) === */
.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.tx-header h2 {
    margin: 0;
    font-size: 1.15rem;
}
.tx-count-badge {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}
.tx-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-right: 4px;
}
.tx-cards-list::-webkit-scrollbar {
    width: 4px;
}
.tx-cards-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
.tx-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.tx-card:hover {
    border-color: rgba(167, 139, 250, 0.4);
}
.tx-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.tx-card-time {
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tx-card-id {
    color: #a78bfa;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(167, 139, 250, 0.15);
    padding: 3px 10px;
    border-radius: 6px;
}
.tx-card-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.tx-item-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    white-space: nowrap;
}
.tx-item-pill b {
    color: #60a5fa;
}
.tx-card-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px dashed rgba(255,255,255,0.08);
    padding-top: 10px;
}
.tx-card-total {
    font-size: 1.1rem;
    font-weight: 800;
    color: #34d399;
}
.tx-empty {
    text-align: center;
    color: var(--text-muted, #94a3b8);
    padding: 40px 20px;
    font-size: 1rem;
    opacity: 0.7;
    line-height: 2;
}
@media (max-width: 768px) {
    .tx-cards-list {
        max-height: 400px;
    }
    .tx-card {
        padding: 12px;
    }
    .tx-card-total {
        font-size: 1rem;
    }
}
