:root {
    --sidebar-width: 260px;
    --admin-primary: #232f3e;
    --admin-accent: #f68b1e;
}

body { margin: 0; background: #f4f6f9; font-family: 'Inter', sans-serif; }

.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--admin-primary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-store-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: #bbf7d0;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.admin-store-status:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #fff;
}
.store-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
    animation: store-pulse 2s infinite;
}
@keyframes store-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25); }
    50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.12); }
}
.admin-sidebar-store-link {
    background: rgba(246, 139, 30, 0.15) !important;
    color: #fff !important;
    font-weight: 600;
    margin: 0 12px 8px;
    border-radius: 8px;
}
.admin-sidebar-store-link:hover {
    background: rgba(246, 139, 30, 0.28) !important;
}
.admin-logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    text-align: center;
}
.admin-logo-img {
    height: 96px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.admin-logo-label {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-nav { padding: 16px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.sidebar-nav a.active { border-left: 3px solid var(--admin-accent); }
.sidebar-nav hr { border-color: rgba(255,255,255,0.1); margin: 12px 20px; }

.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.admin-header {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.page-title { font-size: 1.3rem; font-weight: 600; margin: 0; flex: 1; min-width: 0; }
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--admin-primary);
    padding: 4px 8px;
    border-radius: 6px;
}
.sidebar-toggle:hover { background: #f4f6f9; }
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.admin-store-btn {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #111;
    font-weight: 600;
    white-space: nowrap;
}
.admin-store-btn:hover {
    background: #e47911;
    border-color: #e47911;
    color: #111;
}
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}
.admin-sidebar-overlay.show { display: block; }
body.admin-sidebar-open { overflow: hidden; }

.admin-store-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
    color: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(35, 47, 62, 0.15);
}
.admin-store-banner h2 {
    margin: 8px 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
}
.admin-store-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    max-width: 560px;
}
.admin-store-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.store-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.2);
    color: #bbf7d0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-content { padding: 24px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
}
.bg-primary { background: #3b82f6; }
.bg-success { background: #10b981; }
.bg-info { background: #06b6d4; }
.bg-warning { background: #f59e0b; }
.bg-danger { background: #ef4444; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: #666; }

.admin-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header-flex h3 { margin: 0; font-size: 1.1rem; }

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.search-form-admin { display: flex; gap: 8px; }
.search-form-admin input { min-width: 250px; }

.admin-table { margin: 0; }
.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid #dee2e6;
}
.admin-table td { vertical-align: middle; font-size: 0.9rem; }

.product-cell { display: flex; align-items: center; gap: 10px; }
.product-cell img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; }

.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.quick-action-btn:hover { background: #e9ecef; }

.category-stats { list-style: none; padding: 0; }
.category-stats li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.form-actions { display: flex; gap: 12px; }

.status-badge { padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 500; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-processing { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #d1fae5; color: #065f46; }
.status-delivered { background: #bbf7d0; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { font-weight: 700; border-top: 1px solid #dee2e6; margin-top: 8px; padding-top: 10px; }

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 16px; }
    .admin-header { padding: 12px 16px; flex-wrap: wrap; }
    .page-title { font-size: 1.1rem; width: calc(100% - 48px); }
    .admin-header-actions { width: 100%; justify-content: space-between; }
    .search-form-admin { width: 100%; }
    .search-form-admin input { min-width: 0; flex: 1; }
    .admin-toolbar { flex-direction: column; align-items: stretch; }
    .admin-toolbar .btn { width: 100%; }
    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .finance-intro { flex-direction: column; }
    .finance-intro-meta { white-space: normal; width: 100%; }
    .reports-table { font-size: 0.82rem; }
}

@media (max-width: 768px) {
    .admin-store-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-store-banner-actions {
        width: 100%;
    }
    .admin-store-banner-actions .btn {
        flex: 1;
        min-width: 140px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.25rem; }
    .admin-card { padding: 16px; }
    .finance-period-revenue { font-size: 1.3rem; }
    .admin-header-logout-btn .admin-logout-text { display: none; }
}

@media (max-width: 576px) {
    .admin-content { padding: 12px; }
    .admin-header { gap: 10px; }
    .admin-store-btn-text { display: none; }
    .admin-store-btn { padding: 6px 10px; }
    .admin-logo-img { height: 72px; }
    .sidebar-nav a { padding: 11px 16px; font-size: 0.88rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { flex-direction: column; text-align: center; }
    .stat-icon { margin: 0 auto; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
    .reports-day-block summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Admin login */
.admin-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--admin-primary) 0%, #37475a 55%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.admin-login-shell { width: 100%; max-width: 460px; }
.admin-login-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.admin-login-brand { text-align: center; margin-bottom: 24px; }
.admin-login-logo {
    height: 72px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 12px;
}
.admin-login-badge {
    display: inline-block;
    background: rgba(246, 139, 30, 0.12);
    color: var(--admin-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.admin-login-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111;
}
.admin-login-brand p {
    margin: 0;
    color: #666;
    font-size: 0.92rem;
}
.admin-login-submit {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    font-weight: 600;
}
.admin-login-submit:hover {
    background: #e47911;
    border-color: #e47911;
}
.admin-login-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
}
.admin-login-footer a {
    color: #007185;
    text-decoration: none;
}
.admin-login-footer a:hover { text-decoration: underline; }
.admin-login-logout-form { margin: 0; }

/* Admin logout controls */
.admin-logout-form { margin: 0; }
.admin-sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.admin-header-login-btn {
    font-weight: 600;
    white-space: nowrap;
}
.admin-header-login-btn:hover { color: #fff; }
.admin-header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-header-logout-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}
.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}
.admin-user-name { font-size: 0.9rem; font-weight: 500; }
.admin-user-icon { font-size: 1.4rem; }

/* Financial management */
.finance-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.finance-intro-copy h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
}
.finance-intro-copy p {
    margin: 0;
    color: #666;
    max-width: 720px;
}
.finance-intro-meta {
    color: #888;
    font-size: 0.85rem;
    white-space: nowrap;
}
.finance-section { margin-bottom: 28px; }
.finance-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.finance-period-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.finance-period-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-top: 4px solid var(--admin-accent);
}
.finance-period-week { border-top-color: #3b82f6; }
.finance-period-month { border-top-color: #10b981; }
.finance-period-year { border-top-color: #8b5cf6; }
.finance-period-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}
.finance-period-label {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}
.finance-period-range {
    font-size: 0.82rem;
    color: #888;
}
.finance-period-revenue {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--admin-primary);
    line-height: 1.2;
}
.finance-period-caption {
    margin: 4px 0 14px;
    font-size: 0.82rem;
    color: #888;
}
.finance-period-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.finance-mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.finance-mini-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
}
.finance-mini-label {
    font-size: 0.78rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.finance-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.finance-inventory-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.finance-inventory-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}
.finance-inventory-label {
    font-size: 0.82rem;
    color: #666;
}
.finance-inventory-sold { border-left: 4px solid #3b82f6; }
.finance-inventory-remaining { border-left: 4px solid #10b981; }
.finance-inventory-ok { border-left: 4px solid #10b981; }
.finance-inventory-low { border-left: 4px solid #f59e0b; }
.finance-inventory-out { border-left: 4px solid #ef4444; }
.stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.stock-badge-ok { background: #d1fae5; color: #065f46; }
.stock-badge-low { background: #fef3c7; color: #92400e; }
.stock-badge-out { background: #fee2e2; color: #991b1b; }
.finance-product-table .product-cell img {
    width: 44px;
    height: 44px;
}

.product-edit-preview {
    padding: 16px 20px;
}

.product-edit-preview-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
}

/* Admin sellers (/panel/vendors) */
.admin-vendors-header {
    margin-bottom: 20px;
}

.admin-vendors-header .page-title {
    display: flex;
    align-items: center;
}

.admin-vendors-stats {
    margin-bottom: 20px;
}

.admin-vendors-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.admin-vendors-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #d5d9d9;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-vendors-filter-btn:hover {
    border-color: var(--admin-accent, #ff9900);
    color: #111;
}

.admin-vendors-filter-btn.active {
    background: #232f3e;
    border-color: #232f3e;
    color: #fff;
}

.admin-vendors-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
}

.admin-vendors-filter-btn.active .admin-vendors-filter-count {
    background: rgba(255, 255, 255, 0.2);
}

.admin-vendors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.admin-vendor-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    border-top: 4px solid #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-vendor-card-pending { border-top-color: #f59e0b; }
.admin-vendor-card-active { border-top-color: #10b981; }
.admin-vendor-card-suspended { border-top-color: #ef4444; }

.admin-vendor-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-vendor-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-vendor-card-brand h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.admin-vendor-card-logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f4f6f9;
}

.admin-vendor-card-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.4rem;
}

.admin-vendor-card-location {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.admin-vendor-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.vendor-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.vendor-status-active {
    background: #d1fae5;
    color: #065f46;
}

.vendor-status-suspended {
    background: #fee2e2;
    color: #991b1b;
}

.admin-vendor-card-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #555;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-vendor-card-meta,
.admin-vendor-card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.84rem;
    color: #555;
}

.admin-vendor-card-meta span,
.admin-vendor-card-stats div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-vendor-card-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.admin-vendor-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.admin-vendors-empty {
    text-align: center;
    padding: 48px 24px;
}

.admin-vendors-empty i {
    font-size: 2.5rem;
    color: #adb5bd;
    margin-bottom: 12px;
}

.admin-vendors-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .admin-vendor-card-top {
        flex-direction: column;
    }

    .admin-vendor-card-stats {
        flex-direction: column;
        gap: 6px;
    }
}

/* Supermarket inventory (/panel/inventory) */
.supermarket-inventory {
    margin: -4px 0 0;
}

.supermarket-pos-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f5132 0%, #146c43 50%, #198754 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 81, 50, 0.25);
}

.supermarket-pos-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.supermarket-pos-brand > i {
    font-size: 1.8rem;
    opacity: 0.95;
}

.supermarket-pos-brand strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.supermarket-pos-brand span {
    display: block;
    font-size: 0.78rem;
    opacity: 0.85;
}

.supermarket-pos-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.supermarket-pos-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.supermarket-alert {
    margin-bottom: 12px;
}

.supermarket-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.supermarket-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.supermarket-mode-tab.active {
    color: #fff;
}

.supermarket-mode-tab-in.active { background: #198754; border-color: #198754; }
.supermarket-mode-tab-out.active { background: #dc3545; border-color: #dc3545; }
.supermarket-mode-tab-count.active { background: #0d6efd; border-color: #0d6efd; }
.supermarket-mode-tab-shelf.active { background: #495057; border-color: #495057; }

.supermarket-mode-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    font-size: 0.72rem;
    line-height: 20px;
    text-align: center;
}

.supermarket-mode-tab.active .supermarket-mode-badge {
    background: rgba(255, 255, 255, 0.25);
}

.supermarket-scanner {
    padding: 16px 18px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #232f3e;
    border: 2px solid #37475a;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.supermarket-scanner.scan-flash {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.35);
}

.supermarket-scanner-out.scan-flash {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.35);
}

.supermarket-scanner-count.scan-flash {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

.supermarket-scanner-out .supermarket-scan-icon { color: #f87171; }
.supermarket-scanner-count .supermarket-scan-icon { color: #60a5fa; }
.supermarket-scanner-out .supermarket-scan-input { border-color: #dc3545; }
.supermarket-scanner-count .supermarket-scan-input { border-color: #0d6efd; }

.supermarket-scan-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.supermarket-scan-icon {
    color: #ff9900;
    font-size: 1.5rem;
}

.supermarket-scan-input {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    border: 2px solid #ff9900;
    border-radius: 8px;
    background: #fff;
    font-size: 1.15rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.04em;
}

.supermarket-scan-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.35);
}

.supermarket-scan-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.supermarket-scan-qty span {
    min-width: 28px;
    text-align: center;
}

.supermarket-scan-btn {
    font-weight: 700;
    white-space: nowrap;
}

.supermarket-scan-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #aab7b8;
}

.supermarket-unknown {
    margin-bottom: 16px;
    padding: 14px 16px;
}

.supermarket-layout {
    display: grid;
    grid-template-columns: minmax(300px, 38%) 1fr;
    gap: 16px;
    align-items: start;
}

.supermarket-layout-shelf-only {
    grid-template-columns: 1fr;
}

.supermarket-side-panels {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

@media (max-width: 991px) {
    .supermarket-layout {
        grid-template-columns: 1fr;
    }
}

.supermarket-cart {
    position: sticky;
    top: 12px;
    padding: 0;
    overflow: hidden;
}

.supermarket-cart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ecef;
}

.supermarket-cart-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supermarket-cart-total {
    padding: 4px 12px;
    border-radius: 999px;
    background: #198754;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.supermarket-cart-total-out { background: #dc3545; }
.supermarket-cart-total-count { background: #0d6efd; }

.supermarket-panel-in .supermarket-cart-head { border-top: 3px solid #198754; }
.supermarket-panel-out .supermarket-cart-head { border-top: 3px solid #dc3545; }
.supermarket-panel-count .supermarket-cart-head { border-top: 3px solid #0d6efd; }

.supermarket-cart-item-out {
    background: #fff5f5;
}

.supermarket-cart-item-count {
    background: #f8fbff;
}

.supermarket-cart-empty {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}

.supermarket-cart-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.supermarket-cart-list {
    max-height: 420px;
    overflow-y: auto;
}

.supermarket-cart-item {
    display: grid;
    grid-template-columns: 28px 48px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.supermarket-cart-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
}

.supermarket-cart-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #eee;
}

.supermarket-cart-img-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

.supermarket-cart-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.supermarket-cart-info strong {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supermarket-cart-info span {
    font-size: 0.75rem;
    color: #666;
}

.supermarket-cart-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.supermarket-cart-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.supermarket-cart-qty input {
    width: 48px;
    text-align: center;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    padding: 4px;
    font-weight: 600;
}

.supermarket-cart-remove {
    border: none;
    background: transparent;
    color: #dc3545;
    padding: 4px;
    cursor: pointer;
}

.supermarket-cart-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e8ecef;
    background: #fafbfc;
}

.supermarket-shelf {
    background: #fff;
    border: 1px solid #e8ecef;
    border-radius: 10px;
    padding: 14px 16px;
}

.supermarket-shelf-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.supermarket-shelf-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supermarket-shelf-search {
    max-width: 220px;
}

.supermarket-shelf-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.supermarket-shelf-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d5d9d9;
    border-radius: 999px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.supermarket-shelf-filter.active {
    background: #0f5132;
    border-color: #0f5132;
    color: #fff;
}

.supermarket-shelf-empty {
    text-align: center;
    padding: 40px 16px;
    color: #888;
}

.supermarket-shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.supermarket-shelf-item {
    border: 1px solid #e8ecef;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    transition: box-shadow 0.15s;
}

.supermarket-shelf-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.supermarket-shelf-item h3 {
    margin: 8px 0 2px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.supermarket-shelf-sku {
    margin: 0;
    font-size: 0.72rem;
    color: #888;
    font-family: ui-monospace, monospace;
}

.supermarket-shelf-item-top {
    position: relative;
}

.supermarket-shelf-img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
}

.supermarket-shelf-img-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.5rem;
}

.supermarket-shelf-item .stock-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    background: #fff;
    border: 1px solid #dee2e6;
}

.supermarket-shelf-ok .stock-badge { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.supermarket-shelf-low .stock-badge { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.supermarket-shelf-out .stock-badge { background: #f8d7da; color: #842029; border-color: #f5c2c7; }

.supermarket-shelf-out {
    opacity: 0.85;
    border-color: #f5c2c7;
}

.supermarket-shelf-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.supermarket-shelf-actions .btn {
    flex: 1;
    padding: 4px 0;
}

.supermarket-activity {
    padding: 0;
    overflow: hidden;
}

.supermarket-activity-head {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ecef;
}

.supermarket-activity-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supermarket-session-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e8ecef;
}

.supermarket-session-stat {
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    background: #f8f9fa;
}

.supermarket-session-stat span {
    display: block;
    font-size: 0.72rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.supermarket-session-stat strong {
    display: block;
    font-size: 1.2rem;
    margin-top: 2px;
}

.supermarket-session-stat-in strong { color: #198754; }
.supermarket-session-stat-out strong { color: #dc3545; }
.supermarket-session-stat-count strong { color: #0d6efd; }

.supermarket-activity-empty {
    margin: 0;
    padding: 16px;
    font-size: 0.85rem;
    color: #888;
}

.supermarket-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.supermarket-activity-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
}

.supermarket-activity-item:last-child {
    border-bottom: none;
}

.supermarket-activity-time {
    font-size: 0.72rem;
    color: #888;
}

.supermarket-activity-in { border-left: 3px solid #198754; }
.supermarket-activity-out { border-left: 3px solid #dc3545; }
.supermarket-activity-count { border-left: 3px solid #0d6efd; }

/* Daily reports */
.reports-filter-form { margin: 0; }
.reports-filter-form .form-select { min-width: 140px; }
.reports-table th,
.reports-table td { white-space: nowrap; }
.reports-row-today { background: #fffbeb; }
.reports-today-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.reports-money-cell { color: #065f46; font-weight: 600; }
.reports-total-row {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
}
.reports-total-row th { font-weight: 700; }
.reports-daily-products { display: flex; flex-direction: column; gap: 10px; }
.reports-day-block {
    border: 1px solid #e8ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.reports-day-block summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: #fafbfc;
}
.reports-day-block summary::-webkit-details-marker { display: none; }
.reports-day-title { font-weight: 600; }
.reports-day-summary {
    font-size: 0.88rem;
    color: #666;
}
.reports-day-empty {
    margin: 0;
    padding: 14px 16px;
    color: #888;
    font-size: 0.9rem;
}
