:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --secondary: #03DAC5;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --green: #4CAF50;
    --orange: #FF9800;
    --red: #F44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.error-message {
    color: var(--red);
    text-align: center;
    margin-top: 12px;
    display: none;
}

/* Dashboard */
.dashboard-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 20px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    min-width: 80px;
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.stat-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
}

.stat-card .value.green { color: var(--green); }
.stat-card .value.orange { color: var(--orange); }
.stat-card .value.blue { color: var(--primary); }

/* Tab Content */
.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.table-header h3 {
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-paid {
    background: #E8F5E9;
    color: var(--green);
}

.badge-unpaid {
    background: #FFF3E0;
    color: var(--orange);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Responsive */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dashboard-header {
        padding: 16px 40px;
    }
    
    .tab-content {
        padding: 24px 40px;
    }
}

/* Pricing */
#settings-tab h4,
#pricing-tab h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

#settings-tab input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#settings-tab input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-save:hover {
    background: var(--primary-dark);
}

.btn-save:disabled {
    background: #9E9E9E;
    cursor: not-allowed;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 20px;
}

.detail-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.detail-total {
    font-weight: bold;
    font-size: 16px;
    color: var(--primary);
}

.detail-divider {
    border-top: 1px solid #eee;
    margin: 8px 0;
}

.table-container table {
    width: 100%;
    overflow-x: auto;
}

.table-container table tbody tr:hover {
    background: #f5f5f5;
}

/* Mobile nav tabs - scrollable */
@media (max-width: 767px) {
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tab {
        flex: 0 0 auto;
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    #settings-tab input[type="number"] {
        width: 64px;
        padding: 4px 6px;
        font-size: 13px;
    }
    .table-header {
        padding: 12px;
    }
    .table-header h3 {
        font-size: 14px;
    }
    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Landing page */
body.landing { background: #FFFFFF; }

/* Landing buttons size to their content (the global .btn is width:100%) */
.landing .btn { width: auto; margin: 0; }
.hero .btn-lg { margin-top: 8px; }

/* Landing header mirrors the logged-in topbar brand (yellow block, no shop name) */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0;
    border-bottom: 1px solid #E0E0E0;
}
.landing-header .btn {
    align-self: center;
    margin: 0 24px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
}

.btn-outline {
    background: transparent;
    color: #1565C0;
    border: 1px solid #1565C0;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
}

.hero {
    text-align: center;
    padding: 64px 24px 40px;
}

.hero h1 {
    font-size: 32px;
    color: #212121;
    margin-bottom: 12px;
}

.hero-sub {
    color: #666666;
    margin-bottom: 24px;
}

.btn-lg {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
}

.features ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.features li::before { content: "✓ "; color: #4CAF50; font-weight: bold; }

.pricing {
    text-align: center;
    background: #E3F2FD;
    padding: 48px 24px;
}

.pricing h2 { font-size: 40px; color: #1565C0; }
.pricing h2 span { font-size: 16px; color: #666666; }

.landing-footer {
    text-align: center;
    padding: 24px;
    color: #666666;
    font-size: 13px;
}

/* Landing: app showcase mockup */
.showcase { padding: 8px 24px 48px; }
.lp-frame { max-width: 760px; margin: 0 auto; border: 1px solid #DCE3EC; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(21,101,192,0.18); background: #fff; }
.lp-frame-bar { display: flex; gap: 6px; padding: 10px 14px; background: #F1F4F8; border-bottom: 1px solid #E3E9F0; }
.lp-frame-bar span { width: 11px; height: 11px; border-radius: 50%; background: #CBD3DE; }
.lp-app { display: flex; min-height: 320px; }
.lp-side { flex: 0 0 150px; background: #fff; border-right: 1px solid #EDF1F5; padding: 12px 10px; }
.lp-side-brand { display: flex; align-items: center; gap: 6px; font-weight: 800; color: #1565C0; font-size: 14px; margin-bottom: 12px; }
.lp-logo { width: 16px; height: 16px; border-radius: 5px; background: #FDD835; display: inline-block; }
.lp-nav { display: block; width: 100%; text-align: left; border: none; background: transparent; font-family: inherit; padding: 7px 10px; border-radius: 7px; font-size: 12px; color: #5B6B7B; margin-bottom: 3px; cursor: pointer; }
.lp-nav:hover { background: #F0F5FF; color: #1565C0; }
.lp-nav.active { background: #1565C0; color: #fff; font-weight: 600; }
.lp-main { flex: 1; padding: 14px 16px; background: #F7F9FC; }
.lp-top { font-weight: 800; color: #212121; font-size: 14px; margin-bottom: 12px; }
.lp-kpis { display: flex; gap: 10px; margin-bottom: 12px; }
.lp-kpi { flex: 1; background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.lp-kpi span { display: block; font-size: 10px; color: #77879A; margin-bottom: 4px; }
.lp-kpi b { font-size: 16px; }
.lp-kpi b.blue { color: #1565C0; }
.lp-kpi b.green { color: #2E7D32; }
.lp-kpi b.orange { color: #EF6C00; }
.lp-chart { display: flex; align-items: flex-end; gap: 8px; height: 84px; background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 12px; }
.lp-chart i { flex: 1; background: #1565C0; border-radius: 4px 4px 0 0; opacity: 0.9; }
.lp-rows { background: #fff; border-radius: 10px; padding: 4px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.lp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #F0F3F7; font-size: 12px; }
.lp-row:last-child { border-bottom: none; }
.lp-row span { font-weight: 600; color: #212121; flex: none; }
.lp-row em { color: #8A97A6; font-style: normal; flex: 1; text-align: right; }
.lp-row b { color: #1565C0; flex: none; }

/* Landing mockup: interactive panels */
.lp-panel { display: none; }
.lp-panel.active { display: block; }
.lp-two { display: flex; gap: 12px; }
.lp-col { flex: 1; min-width: 0; }
.lp-field { display: flex; justify-content: space-between; gap: 8px; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 10px; }
.lp-field span { color: #77879A; }
.lp-field b { color: #212121; }
.lp-sub { font-size: 11px; font-weight: 700; color: #5B6B7B; margin: 8px 0 6px; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.lp-chip { border: 1px solid #DCE3EC; background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 11px; color: #5B6B7B; }
.lp-chip.active { background: #E3F2FD; border-color: #1565C0; color: #1565C0; font-weight: 600; }
.lp-summary { background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.lp-sum-title { font-weight: 800; color: #212121; font-size: 12px; margin-bottom: 8px; }
.lp-srow { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 4px 0; color: #5B6B7B; }
.lp-srow span:last-child { color: #212121; }
.lp-srow.total { border-top: 1px solid #EEF2F7; margin-top: 4px; padding-top: 8px; font-weight: 800; }
.lp-srow.total span { color: #1565C0; }
.lp-srow.total span:last-child { font-size: 14px; }
.lp-toggle { display: inline-flex; background: #EEF2F7; border-radius: 8px; padding: 2px; margin-bottom: 10px; }
.lp-toggle span { padding: 4px 12px; border-radius: 6px; font-size: 11px; color: #5B6B7B; }
.lp-toggle span.active { background: #fff; color: #1565C0; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.lp-search { background: #fff; border: 1px solid #E3E9F0; border-radius: 8px; padding: 8px 12px; font-size: 11px; color: #9AA7B4; margin-bottom: 10px; }
.lp-table { background: #fff; border-radius: 10px; padding: 4px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.lp-thead { display: flex; gap: 8px; padding: 8px 0 6px; border-bottom: 1px solid #EEF2F7; }
.lp-thead span { flex: 1; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: #9AA7B4; font-weight: 700; }
.lp-trow { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #F0F3F7; font-size: 12px; }
.lp-trow:last-child { border-bottom: none; }
.lp-trow > span { flex: 1; color: #212121; }
.lp-thead span:last-child, .lp-trow > span:last-child { flex: 0 0 auto; text-align: right; }
.lp-badge { border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.lp-badge.paid { background: #E8F5E9; color: #2E7D32; }
.lp-badge.unpaid { background: #FFF3E0; color: #EF6C00; }
.lp-badge.ready { background: #E3F2FD; color: #1565C0; }
.lp-rcards { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lp-rcard { border: 1px solid #DCE3EC; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 11px; color: #5B6B7B; }
.lp-rcard.active { background: #1565C0; border-color: #1565C0; color: #fff; font-weight: 600; }
.lp-hint { text-align: center; color: #8A97A6; font-size: 13px; margin: 12px 0 0; }

/* Landing: trust line, pricing note, chat button */
.hero-trust { color: #5B6B7B; font-size: 13px; margin: 14px 0 0; }
.pricing-note { max-width: 540px; margin: 10px auto 0; color: #45607A; font-size: 13px; }
.lp-chat { position: fixed; right: 18px; bottom: 18px; z-index: 900; background: #1565C0; color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(21,101,192,0.35); }
.lp-chat:hover { background: #0D47A1; }

/* Landing: how it works */
.how { padding: 40px 24px; max-width: 960px; margin: 0 auto; }
.how h2, .benefits h2, .faq h2 { text-align: center; font-size: 24px; color: #212121; margin-bottom: 24px; }
.how-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 0; margin: 0; }
.how-steps li { background: #F7F9FC; border-radius: 12px; padding: 20px; }
.how-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #1565C0; color: #fff; font-weight: 700; margin-bottom: 10px; }
.how-steps h3 { margin: 0 0 6px; font-size: 16px; color: #212121; }
.how-steps p { margin: 0; color: #5B6B7B; font-size: 14px; }

/* Landing: benefits */
.benefits { padding: 8px 24px 40px; max-width: 960px; margin: 0 auto; }
.benefit-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 0; margin: 0; }
.benefit-list li { border: 1px solid #E3E9F0; border-radius: 12px; padding: 18px; }
.benefit-list h3 { margin: 0 0 6px; font-size: 16px; color: #1565C0; }
.benefit-list p { margin: 0; color: #5B6B7B; font-size: 14px; }

/* Landing: FAQ */
.faq { padding: 8px 24px 48px; max-width: 760px; margin: 0 auto; }
.faq details { border: 1px solid #E3E9F0; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; color: #212121; }
.faq details p { margin: 10px 0 0; color: #5B6B7B; font-size: 14px; }

/* Landing: closing CTA */
.cta-final { text-align: center; background: #E3F2FD; padding: 48px 24px; }
.cta-final h2 { margin: 0 0 8px; color: #212121; font-size: 24px; }
.cta-final p { margin: 0 0 20px; color: #5B6B7B; }

@media (max-width: 560px) {
    .hero h1 { font-size: 26px; }
    .lp-app { flex-direction: column; min-height: 0; }
    .lp-side { flex: none; display: flex; gap: 6px; overflow-x: auto; border-right: none; border-bottom: 1px solid #EDF1F5; padding: 10px; }
    .lp-side-brand { display: none; }
    .lp-nav { white-space: nowrap; margin-bottom: 0; width: auto; }
    .lp-two { flex-direction: column; }
    .lp-kpi b { font-size: 13px; }
    .lp-row em { display: none; }
}

.auth-alt {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #666666;
}

.auth-alt a { color: #1565C0; text-decoration: none; font-weight: bold; }
.field-error {
    color: #F44336;
    font-size: 12px;
    margin: 4px 0 0;
    min-height: 14px;
}
.header-left { display: flex; align-items: center; gap: 12px; }

.trial-badge {
    background: #E3F2FD;
    color: #1565C0;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.lock-screen {
    position: fixed;
    inset: 0;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lock-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.lock-card h2 { color: #F44336; margin-bottom: 8px; }
.lock-amount { font-size: 24px; font-weight: bold; color: #212121; margin: 16px 0; }
.lock-note { color: #666666; font-size: 13px; }
.pay-qr { display: flex; justify-content: center; margin: 16px 0; min-height: 200px; }
.pay-qr img, .pay-qr canvas { border: 1px solid #E0E0E0; border-radius: 8px; }
#payLink { color: #1565C0; font-weight: bold; word-break: break-all; }
.lock-card .btn { margin: 4px; }

.billing-status {
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.btn-renew {
    background: transparent;
    color: #1565C0;
    border: 1px solid #1565C0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}
#adminTenantList input[type="url"] { padding: 6px; border: 1px solid #E0E0E0; border-radius: 6px; }
#adminTenantList button { margin: 2px; padding: 6px 10px; border-radius: 6px; border: 1px solid #1565C0; background: #FFFFFF; color: #1565C0; cursor: pointer; }
.pay-history td { font-size: 12px; color: #666666; background: #FAFAFA; }
.shop-identity {
    font-size: 15px;
    font-weight: bold;
    color: #FFFFFF;
}
#verifyEmail { font-weight: bold; word-break: break-all; }
.lock-card .btn:disabled { opacity: 0.5; cursor: default; }
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 64px; box-sizing: border-box; }
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #1565C0;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
}
.success-message {
    color: #2E7D32;
    background: #E8F5E9;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 14px;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-group select, .form-group input[type="number"], .form-group input[type="text"] { width: 100%; box-sizing: border-box; }
.detail-total { font-size: 18px; font-weight: bold; margin: 12px 0; }

/* ============================================================
   Dashboard redesign: app shell, sidebar, topbar, KPI, charts
   ============================================================ */

/* Topbar (full width, sits above the sidebar + content) */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: #1565C0;
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FDD835;
    color: #212121;
    padding: 8px 16px;
}

.brand-logo { font-size: 20px; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-brand .brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #212121;
}
.topbar-brand .shop-identity {
    color: #5B4B00;
    font-size: 12px;
    font-weight: 600;
    word-break: break-word;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.topbar-date { font-weight: 600; color: #FFFFFF; font-size: 14px; }
.topbar-clock { color: rgba(255,255,255,0.85); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Online / offline indicator */
.net-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #FFFFFF; background: rgba(255,255,255,0.15); }
.net-status .net-dot { width: 8px; height: 8px; border-radius: 50%; background: #BDBDBD; flex: none; }
.net-status.online .net-dot { background: #4CAF50; }
.net-status.offline { background: rgba(198,40,40,0.95); }
.net-status.offline .net-dot { background: #FFFFFF; }
@media (max-width: 820px) {
    .net-status { padding: 6px; }
    .net-status .net-label { display: none; }
}

.topbar .shop-identity-top { color: rgba(255,255,255,0.9); font-size: 13px; font-weight: 600; }

.shop-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #1565C0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-transform: uppercase;
}

.topbar .btn-logout { background: rgba(255,255,255,0.2); color: #FFFFFF; }
.topbar .btn-logout:hover { background: rgba(255,255,255,0.35); }
.topbar .btn-renew { color: #FFFFFF; border-color: #FFFFFF; }

.hamburger {
    display: inline-block;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #FFFFFF;
    padding: 4px 8px;
}

.page-title { color: #fff; font-size: 18px; font-weight: 600; margin-left: 4px; }

/* App shell */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - 60px); }

/* Sidebar */
.sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: #FFFFFF;
    border-right: 1px solid #E0E0E0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: width 0.15s ease;
}

.sidebar.collapsed {
    width: 64px;
    flex: 0 0 64px;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar.collapsed .nav-tab {
    justify-content: center;
}

.nav-icon {
    flex: none;
    width: 20px;
    height: 20px;
}

.sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border-bottom: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-tab {
    width: 100%;
    flex: none;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-tab:hover { background: #F0F5FF; color: var(--primary); }
.sidebar .nav-tab.active {
    background: #1565C0;
    color: #FFFFFF;
    border-bottom-color: transparent;
}

/* Main area */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px; }

/* Dashboard pane manages its own spacing */
#dashboard-tab { padding: 0; }

.greeting { padding: 20px 24px 0; }
.greeting h2 { font-size: 22px; color: var(--text-primary); }
.greeting-sub { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px 24px 0;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-card .kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
}

.kpi-card .kpi-value { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.kpi-card .kpi-value.blue { color: var(--primary); }
.kpi-card .kpi-value.green { color: var(--green); }
.kpi-card .kpi-value.orange { color: var(--orange); }

.kpi-delta { font-size: 13px; font-weight: 600; }
.kpi-delta.delta-up { color: var(--green); }
.kpi-delta.delta-down { color: var(--red); }

/* Cards / charts */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h3 { font-size: 16px; color: var(--text-primary); }

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 16px 24px 0;
}

.chart-card { display: flex; flex-direction: column; gap: 12px; }
.chart-wrap { position: relative; height: 260px; }

/* Recent transactions + quick actions */
.dash-bottom {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 16px 24px 24px;
    align-items: start;
}

.quick-actions-card { display: flex; flex-direction: column; gap: 12px; }

.quick-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }

.qa-btn {
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid #E0E0E0;
    background: #F8FAFF;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.qa-btn:hover { background: var(--primary); color: #FFFFFF; border-color: var(--primary); }

/* Responsive: collapse sidebar */
@media (max-width: 820px) {
    .app-shell { flex-direction: column; min-height: 0; }

    .hamburger { display: inline-block; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 260px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        overflow-y: auto;
    }

    .sidebar.open { transform: translateX(0); }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .dash-bottom { grid-template-columns: 1fr; }

    .greeting { padding: 16px 16px 0; }
    .kpi-grid { padding: 12px 16px 0; }
    .charts-grid { padding: 12px 16px 0; }
    .dash-bottom { padding: 12px 16px 20px; }
}

@media (max-width: 600px) {
    .page-title { display: none; }
}

/* Pricing editor (v2) */
.service-card {
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    background: #FAFAFA;
}

.editor-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.editor-row input[type="text"],
.editor-row input[type="number"],
.editor-row select,
.editor-sub input[type="text"],
.editor-sub select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 0;
}

.editor-row input[type="text"] {
    flex: 1 1 160px;
}

.editor-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.editor-sub input[type="text"] {
    flex: 0 1 120px;
}

.comp { display: inline-flex; align-items: center; gap: 4px; margin: 2px; }

#settings-tab .service-card table,
#pricing-tab .service-card table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

#settings-tab .service-card th,
#settings-tab .service-card td,
#pricing-tab .service-card th,
#pricing-tab .service-card td {
    padding: 6px 8px;
    text-align: left;
}

#settings-tab .service-card input[type="number"],
#settings-tab .service-card input[type="text"] {
    width: 90px;
}

#settings-tab .service-card select {
    max-width: 140px;
}

#settings-tab .service-card button {
    background: #EEEEEE;
    border: 1px solid #BDBDBD;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
}

#settings-tab .service-card button:hover {
    background: #E0E0E0;
}

@media (max-width: 600px) {
    .editor-row input[type="text"],
    .editor-row input[type="number"],
    .editor-row select {
        flex: 1 1 100%;
    }

    #settings-tab .service-card table,
    #pricing-tab .service-card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    #settings-tab .service-card input[type="number"],
    #settings-tab .service-card input[type="text"] {
        width: 72px;
    }
}

/* New Order form (v2) */
.order-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.order-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-summary {
    flex: 0 0 340px;
    max-width: 340px;
    position: sticky;
    top: 72px;
    align-self: flex-start;
}

.order-summary #orderSummary { padding: 4px 16px 12px; }

.order-summary .table-container > .form-group { padding: 0 16px; }

.order-summary .table-container > .btn {
    width: calc(100% - 32px);
    margin: 0 16px 10px;
}

.order-summary .table-container > .error-message { padding: 0 16px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    flex: none;
}

.order-main-header { margin-bottom: 0; }

.muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.order-main-header .muted { margin-top: 4px; }

.service-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
}

.service-card-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    padding: 16px 18px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.service-card-btn:hover {
    background: #F5F9FF;
    border-color: #90CAF9;
}

.service-card-btn .service-card-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.service-card-btn .service-card-name { line-height: 1.2; }

.service-card-btn.active {
    background: #E3F2FD;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary) inset;
}

.service-card-btn.active::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #2E7D32;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
}

.chip input {
    width: auto;
    margin: 0;
}

@media (max-width: 900px) {
    .order-layout {
        flex-direction: column;
        padding: 16px;
    }

    .order-main {
        flex: 1 1 auto;
    }

    .order-summary {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
        position: static;
    }
}

.status-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.status-btn { padding: 6px 12px; border: 1px solid #1565C0; background: #FFFFFF; color: #1565C0; border-radius: 16px; cursor: pointer; font-size: 13px; }
.status-btn.active { background: #1565C0; color: #FFFFFF; }

/* Toasts */
#toastHost { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #323232; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 320px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #2E7D32; }
.toast.error { background: #C62828; }

/* KPI card deltas */
.delta { font-size: 12px; margin-top: 4px; }
.delta.good { color: #2E7D32; }
.delta.bad { color: #C62828; }
.delta.neutral { color: #666666; }

/* New Order redesign: green primary CTA + summary */
#txSaveBtn {
    background: #2E7D32;
    border: 1px solid #2E7D32;
    color: #fff;
    margin-bottom: 8px;
}
#txSaveBtn:hover { background: #256428; border-color: #256428; }
#txPrintBtn {
    background: transparent;
    color: #1565C0;
    border: 1px solid #1565C0;
}
#txSaveBtn,
#txPrintBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-icon { width: 16px; height: 16px; flex: 0 0 auto; }
#txNotes { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #E0E0E0; border-radius: 8px; }

/* Customer search + card */
#new-tab .table-header { justify-content: space-between; }
.customer-search { position: relative; }
.customer-search input { width: 100%; box-sizing: border-box; padding: 12px 36px 12px 14px; font-size: 15px; border: 1px solid #D0D7E2; border-radius: 10px; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; font-size: 18px; cursor: pointer; color: #666; }
.customer-card { display: flex; align-items: center; gap: 12px; background: #F5F9FF; border: 1px solid #D6E4FF; border-radius: 10px; padding: 12px; margin-top: 10px; }
.customer-card .cc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #E3F2FD; display: flex; align-items: center; justify-content: center; }
.customer-card .cc-info { flex: 1; }
.customer-card .cc-name { font-weight: bold; }
.customer-card .cc-sub { display: block; color: #666; font-size: 13px; margin-top: 2px; }
.customer-card .cc-sub .cc-icon { vertical-align: -2px; margin-right: 4px; }

/* Receipt printing */
.receipt-print { display: none; }
@media print {
    body > *:not(#receiptPrint):not(#reportPrint) { display: none !important; }
    #receiptPrint, #reportPrint { display: block !important; width: 100%; color: #000; }
    #receiptPrint { padding: 4px; }
    #reportPrint { padding: 24px; }
}

/* Report Center */
.report-heading { margin-bottom: 16px; }
.report-heading h2 { margin: 0 0 4px; font-size: 22px; color: var(--text-primary); }
.report-heading .muted { margin: 0; }

.report-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.report-tab { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-secondary); text-align: left; }
.report-tab svg { flex: none; color: #90a4ae; }
.report-tab:hover { border-color: #bbdefb; }
.report-tab.active { background: #1565C0; border-color: #1565C0; color: #fff; }
.report-tab.active svg { color: #fff; }

.report-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; border-bottom: 1px solid #eee; }
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.filter-field input, .filter-field select { padding: 8px 10px; border: 1px solid #d5dbe3; border-radius: 8px; font-size: 14px; background: #fff; min-width: 150px; box-sizing: border-box; }
.filter-field input:focus, .filter-field select:focus { outline: none; border-color: #1565C0; box-shadow: 0 0 0 3px rgba(21,101,192,0.12); }
.filter-search { flex: 1 1 180px; }
.filter-search input { width: 100%; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: flex-end; }
.filter-actions .btn { width: auto; padding: 9px 14px; font-size: 14px; }
.filter-actions .btn-outline { padding: 8px 14px; font-size: 14px; }
.report-filters .error-message { width: 100%; margin: 0; }

.report-summary { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px; border-bottom: 1px solid #eee; }
.report-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: #F5F9FF; border: 1px solid #E3F0FF; border-radius: 10px; min-width: 150px; }
.report-stat-label { font-size: 12px; color: var(--text-secondary); }
.report-stat-value { font-size: 18px; font-weight: 700; color: #1565C0; }

.report-table { width: 100%; }
.report-table th.num, .report-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: none; padding: 0; color: #1565C0; font: inherit; cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

.badge-status-pending { background: #ECEFF1; color: #546E7A; }
.badge-status-ready { background: #E3F2FD; color: #1565C0; }
.badge-status-picked_up { background: #E8F5E9; color: var(--green); }

.report-print { display: none; }
.report-print-summary { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.report-print-foot { margin-top: 16px; font-size: 12px; color: #555; }

@media (max-width: 820px) {
    .report-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .report-tabs { grid-template-columns: 1fr; }
    .filter-actions { margin-left: 0; width: 100%; }
    .filter-actions .btn, .filter-actions .btn-outline { flex: 1 1 auto; }
}
@media print {
    #reportPrint h1 { font-size: 20px; margin: 0 0 4px; }
    #reportPrint h2 { font-size: 16px; margin: 0 0 8px; }
    #reportPrint .report-table th, #reportPrint .report-table td { border: 1px solid #bbb; padding: 6px 8px; }
    #reportPrint .badge { border: 1px solid #999; }
    #reportPrint .report-stat-value { color: #000; }
}

/* Customers page */
.customers-header { align-items: flex-start; }
.customers-header .muted { margin: 2px 0 0; }
.customers-header .btn-add-customer { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 14px; flex: none; }
.customers-toolbar { padding: 12px 16px; border-bottom: 1px solid #eee; }
.customers-toolbar .customer-search { max-width: 420px; }
.customers-toolbar .customer-search input { padding: 11px 36px 11px 14px; font-size: 14px; }
.customers-toolbar .customer-search input:focus { outline: none; border-color: #1565C0; box-shadow: 0 0 0 3px rgba(21,101,192,0.12); }

.customers-table .cust-name { font-weight: 600; color: var(--text-primary); }
.customers-table .cust-sub { display: block; color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.customers-table .cust-sub-empty { font-style: italic; opacity: 0.85; }
.customers-table .cust-phone { color: #1565C0; text-decoration: none; }
.customers-table .cust-phone:hover { text-decoration: underline; }
.customers-table .cust-missing { color: var(--text-secondary); }
.customers-table .col-visits { text-align: right; font-variant-numeric: tabular-nums; }
.customers-table .col-actions { width: 48px; text-align: right; }

.icon-menu-btn { background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; color: #64748b; line-height: 0; }
.icon-menu-btn:hover { background: #f1f5f9; color: #1565C0; }

.customer-menu { position: fixed; z-index: 200; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; min-width: 172px; display: flex; flex-direction: column; }
.customer-menu button { text-align: left; background: none; border: none; padding: 9px 12px; font-size: 14px; border-radius: 6px; cursor: pointer; color: var(--text-primary); }
.customer-menu button:hover { background: #F0F6FF; color: #1565C0; }

.pagination-bar { align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.page-info { color: var(--text-secondary); font-size: 13px; }
.page-controls { display: flex; align-items: center; gap: 10px; }
.page-indicator { font-size: 13px; color: var(--text-secondary); }
.pagination-bar .btn-outline { width: auto; padding: 6px 12px; font-size: 13px; }
.pagination-bar .btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

.detail-list .detail-row { border-bottom: 1px solid #f0f0f0; }
.detail-list .detail-row:last-child { border-bottom: none; }
.detail-list .detail-row span:last-child { text-align: right; word-break: break-word; }
.cust-view-note { color: var(--text-secondary); font-size: 13px; margin-top: 12px; }
.cust-orders-table { width: 100%; border-collapse: collapse; }
.cust-orders-table th, .cust-orders-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; font-size: 13px; }
.cust-orders-table th { background: #fafafa; font-weight: 600; color: var(--text-secondary); }

@media (max-width: 640px) {
    .customers-header { flex-direction: column; gap: 12px; }
    .customers-header .btn-add-customer { width: 100%; justify-content: center; }
    .customers-table thead { display: none; }
    .customers-table, .customers-table tbody, .customers-table tr, .customers-table td { display: block; }
    .customers-table tr { position: relative; border: 1px solid #eee; border-radius: 10px; margin: 12px; padding: 12px; }
    .customers-table td { border: none; padding: 3px 0; }
    .customers-table .col-actions { position: absolute; top: 6px; right: 6px; width: auto; padding: 0; }
    .customers-table td.cust-contact::before { content: "Contact: "; color: var(--text-secondary); }
    .customers-table td.col-visits { text-align: left; }
    .customers-table td.col-visits::before { content: "Visits: "; color: var(--text-secondary); }
    .pagination-bar { justify-content: center; }
}

/* Sidebar nav group dividers */
.sidebar .nav-divider {
    height: 1px;
    background: #E8ECF0;
    margin: 6px 6px;
    flex: none;
}
.sidebar.collapsed .nav-divider { margin: 6px 2px; }

/* Settings */
.settings-heading { margin-bottom: 16px; }
.settings-heading h2 { margin: 0 0 4px; font-size: 22px; color: var(--text-primary); }
.settings-heading .muted { margin: 0; }
.settings-section { margin-bottom: 16px; }
.shop-profile-wrap { padding: 4px 16px 16px; }
.shop-profile-wrap .form-group:last-of-type { margin-bottom: 8px; }
.settings-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.settings-tab { padding: 9px 16px; border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.settings-tab:hover { border-color: #bbdefb; color: #1565C0; }
.settings-tab.active { background: #1565C0; border-color: #1565C0; color: #fff; }
.receipt-paper-wrap { padding: 4px 16px 16px; }
.receipt-paper-wrap .muted { margin: 0 0 8px; }

/* Orders: All / To Do toggle + queue actions */
.orders-view-toggle { display: flex; gap: 2px; background: #EEF2F7; border-radius: 8px; padding: 3px; flex: none; }
.view-toggle-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.view-toggle-btn.active { background: #fff; color: #1565C0; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.next-step-btn { border: 1px solid #1565C0; background: #fff; color: #1565C0; border-radius: 6px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.next-step-btn:hover { background: #E3F2FD; }
.next-step-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.next-step-btn:disabled:hover { background: #fff; }
.status-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Dashboard date-range filter */
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.dash-range-presets { display: flex; flex-wrap: wrap; gap: 4px; background: #EEF2F7; border-radius: 10px; padding: 3px; }
.range-btn { border: none; background: transparent; padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.range-btn.active { background: #fff; color: #1565C0; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.dash-custom-range { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }
.dash-custom-range input[type="date"] { padding: 7px 10px; border: 1px solid #d5dbe3; border-radius: 8px; font-size: 13px; background: #fff; }
.dash-custom-range input[type="date"]:focus { outline: none; border-color: #1565C0; box-shadow: 0 0 0 3px rgba(21,101,192,0.12); }
.dash-range-label { margin: 0 0 12px; color: var(--text-secondary); font-size: 13px; }

/* Thermal 58mm receipt */
.receipt-thermal { max-width: 220px; margin: 0 auto; color: #000; font-size: 11px; line-height: 1.45; font-family: 'Courier New', Courier, monospace; }
.receipt-thermal .rt-shop { text-align: center; font-size: 14px; font-weight: 800; }
.receipt-thermal .rt-sub { text-align: center; }
.receipt-thermal .rt-sep { border-top: 1px dashed #000; margin: 6px 0; }
.receipt-thermal .rt-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt-thermal .rt-row > span:first-child { flex: none; }
.receipt-thermal .rt-row > span:last-child { text-align: right; min-width: 0; overflow-wrap: break-word; }
.receipt-thermal .rt-item { margin-top: 2px; }
.receipt-thermal .rt-note { margin-top: 4px; }
.receipt-thermal .rt-total { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; margin-top: 4px; }
.receipt-thermal .rt-foot { text-align: center; margin-top: 6px; }

/* A4 order slip */
.receipt-a4 { color: #000; font-size: 13px; line-height: 1.5; }
.receipt-a4 .ra-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.receipt-a4 .ra-shop { font-size: 22px; font-weight: 800; }
.receipt-a4 .ra-sub { color: #333; }
.receipt-a4 .ra-meta { text-align: right; }
.receipt-a4 .ra-bill { margin-bottom: 12px; }
.receipt-a4 .ra-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.receipt-a4 .ra-table th, .receipt-a4 .ra-table td { border: 1px solid #000; padding: 6px 8px; text-align: left; }
.receipt-a4 .ra-table .num { text-align: right; }
.receipt-a4 .ra-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; margin: 8px 0; }
.receipt-a4 .ra-status { margin-top: 4px; }
.receipt-a4 .ra-notes { margin-top: 4px; }
.receipt-a4 .ra-foot { margin-top: 16px; text-align: center; color: #333; }

/* PWA update prompt */
.sw-update-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1200; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #212121; color: #fff; border-radius: 10px; padding: 12px 16px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.sw-update-bar button { flex: none; border: none; border-radius: 8px; background: #1565C0; color: #fff; font-size: 14px; font-weight: 600; padding: 8px 16px; cursor: pointer; }

/* Guided setup wizard */
.setup-wizard { position: fixed; inset: 0; background: #F5F5F5; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1500; }
.setup-card { background: #FFFFFF; border-radius: 14px; padding: 28px; max-width: 460px; width: 100%; box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
.setup-card h2 { margin: 0 0 10px; color: #1565C0; }
.setup-card p { color: #444444; font-size: 14px; }
.setup-note { color: #8A97A6; font-size: 13px; }
.setup-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.setup-dot { width: 8px; height: 8px; border-radius: 50%; background: #D5DDE6; }
.setup-dot.done { background: #90CAF9; }
.setup-dot.active { background: #1565C0; transform: scale(1.25); }
.setup-pricing { border: 1px solid #E3E9F0; border-radius: 10px; padding: 4px 14px; margin: 10px 0; }
.setup-prow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F0F3F7; font-size: 14px; }
.setup-prow:last-child { border-bottom: none; }
.setup-prow span:first-child { font-weight: 600; color: #212121; }
.setup-prow span:last-child { color: #5B6B7B; }
.setup-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.setup-actions .btn, .setup-actions .btn-outline { width: auto; margin: 0; padding: 10px 18px; }

/* New Order: numeric fields — hide spinner arrows (cleaner, less fiddly entry) */
#new-tab input[type="number"]::-webkit-outer-spin-button,
#new-tab input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#new-tab input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Demo mode banner */
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; background: #FFF8E1; color: #5B4B00; border-bottom: 1px solid #FFE082; padding: 8px 16px; font-size: 13px; }
.demo-banner a { color: #1565C0; font-weight: 600; }

/* Landing hero action row */
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
