/* =============================================
   NorthRiders Kort — Design System
   ============================================= */

:root {
    --primary: #7C6DFA;
    --primary-dark: #5A4FD1;
    --primary-light: rgba(124, 109, 250, 0.15);
    --accent: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;

    --bg: #0A0B14;
    --bg-card: #111221;
    --bg-elevated: #181A2E;
    --bg-glass: rgba(255,255,255,0.04);
    --bg-glass-hover: rgba(255,255,255,0.07);

    --border: rgba(255,255,255,0.08);
    --border-focus: rgba(124, 109, 250, 0.5);

    --text: #F0F0FF;
    --text-muted: #7879A0;
    --text-dim: #3E4060;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(124, 109, 250, 0.2);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #08090f;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('../bf.png') center center / min(70vw, 70vh) no-repeat;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* =============================================
   Background Orbs
   ============================================= */

.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.07;
    animation: floatOrb 12s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7C6DFA, transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #F59E0B, transparent);
    bottom: -150px;
    right: -150px;
    animation-delay: -4s;
    opacity: 0.08;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #10B981, transparent);
    top: 50%;
    left: 60%;
    animation-delay: -8s;
    opacity: 0.06;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* =============================================
   Header
   ============================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 9, 18, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px #F59E0B);
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab .material-icons-round {
    font-size: 1.1rem;
}

.nav-tab:hover {
    color: var(--text);
    background: var(--bg-glass-hover);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 12px rgba(124, 109, 250, 0.4);
}

/* =============================================
   Main Layout
   ============================================= */

.main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.tab-content {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Payment Tab — Scan Area
   ============================================= */

.payment-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.card-scan-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-scan-area::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.scan-ring {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 24px;
}

.scan-pulse {
    position: absolute;
    inset: -15px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: scanPulse 2.5s ease-out infinite;
}

.scan-pulse::after {
    content: '';
    position: absolute;
    inset: 15px;
    border: 1.5px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: scanPulse 2.5s ease-out infinite 0.8s;
}

@keyframes scanPulse {
    0% { transform: scale(0.7); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}

.scan-icon {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-glass));
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
}

.scan-icon .material-icons-round {
    font-size: 3rem;
    color: var(--primary);
    filter: drop-shadow(0 0 12px var(--primary));
}

.scan-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.scan-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.manual-search {
    position: relative;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 4px 4px 16px;
    gap: 8px;
    transition: var(--transition);
}

.search-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon-input {
    color: var(--text-muted);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
    padding: 8px 0;
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 20;
    box-shadow: var(--shadow);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover { background: var(--bg-glass-hover); }

.search-result-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-result-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.nfc-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.nfc-status .material-icons-round {
    font-size: 1rem;
}

.nfc-status.ready {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.nfc-status.error {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

/* =============================================
   User Panel
   ============================================= */

.user-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideInDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 0;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(124, 109, 250, 0.4);
}

.user-info { flex: 1; }

.user-name {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.user-card-id {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 2px;
}

.close-user-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.close-user-btn:hover {
    background: var(--danger);
    color: white;
    border-color: transparent;
}

.close-user-btn .material-icons-round { font-size: 1.1rem; }

.balance-display {
    margin: 20px 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.balance-display::after {
    content: '₿';
    position: absolute;
    right: -10px;
    top: -20px;
    font-size: 5rem;
    opacity: 0.08;
    font-weight: 900;
}

.balance-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-amount.low {
    color: #FCA5A5;
}

/* =============================================
   Products Grid
   ============================================= */

.products-section, .topup-section, .history-section {
    padding: 0 24px 24px;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.product-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.product-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: var(--transition);
    background: radial-gradient(circle at center, var(--product-color, var(--primary)), transparent 70%);
}

.product-btn:hover::before { opacity: 0.12; }

.product-btn:hover {
    border-color: var(--product-color, var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.product-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.product-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.product-btn-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.2;
}

.product-btn-price {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
}

/* =============================================
   Topup Section
   ============================================= */

.topup-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.topup-quick-btn {
    flex: 1;
    min-width: 70px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    color: var(--success);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.topup-quick-btn:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--success);
    transform: translateY(-2px);
}

.topup-custom {
    display: flex;
    gap: 8px;
}

.topup-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    gap: 8px;
    transition: var(--transition);
}

.topup-input-wrap:focus-within {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.currency-symbol {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.topup-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 0;
}

.topup-input::placeholder { color: var(--text-dim); }

.topup-confirm-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.topup-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.topup-confirm-btn .material-icons-round { font-size: 1.1rem; }

/* =============================================
   Transaction History
   ============================================= */

.history-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.refresh-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: auto;
}

.refresh-btn:hover { color: var(--primary); border-color: var(--primary); }
.refresh-btn .material-icons-round { font-size: 0.9rem; }

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tx-item:hover { background: var(--bg-glass-hover); }

.tx-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tx-icon .material-icons-round { font-size: 1.1rem; }

.tx-icon.purchase {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.tx-icon.topup {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.tx-info { flex: 1; min-width: 0; }

.tx-desc {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tx-amount {
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tx-amount.purchase { color: var(--danger); }
.tx-amount.topup { color: var(--success); }

/* =============================================
   Users Tab
   ============================================= */

.users-layout {
    max-width: 900px;
    margin: 0 auto;
}

.users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.create-user-form {
    margin-bottom: 24px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.form-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder { color: var(--text-dim); }

.form-input[readonly] {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.8rem;
}

.card-id-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}

.card-id-wrap .form-input { flex: 1; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn.nfc-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn .material-icons-round { font-size: 1.1rem; }

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.users-search-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.users-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.users-search-wrap .material-icons-round { color: var(--text-muted); }

.users-search {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
}

.users-search::placeholder { color: var(--text-muted); }

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #A78BFA);
    transform: scaleX(0);
    transition: var(--transition-slow);
}

.user-card:hover::before { transform: scaleX(1); }

.user-card:hover {
    border-color: rgba(124, 109, 250, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.user-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.user-card-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.user-card-name {
    font-weight: 700;
    font-size: 1rem;
}

.user-card-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.user-card-balance {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--success);
}

.user-card-balance.low { color: var(--danger); }

.user-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.user-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.user-card-actions {
    display: flex;
    gap: 6px;
}

.action-btn-sm {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn-sm:hover { color: var(--primary); border-color: var(--primary); }
.action-btn-sm.danger:hover { color: var(--danger); border-color: var(--danger); }
.action-btn-sm .material-icons-round { font-size: 0.95rem; }

.member-toggle-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* =============================================
   Admin Tab
   ============================================= */

.admin-layout {
    max-width: 900px;
    margin: 0 auto;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-section-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.admin-section-title .material-icons-round {
    color: var(--primary);
    font-size: 1.2rem;
}

.products-admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.product-admin-item:hover { background: var(--bg-glass-hover); }

.product-admin-color {
    width: 12px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}

.product-admin-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.product-admin-price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
}

.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.product-admin-price .member-badge::before {
    content: '★';
    font-size: 0.65rem;
}

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

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons-round { color: white; font-size: 1.4rem; }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =============================================
   Buttons
   ============================================= */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 109, 250, 0.4);
}

.btn-primary.btn-sm {
    padding: 8px 16px;
    font-size: 0.825rem;
}

.btn-primary .material-icons-round { font-size: 1.1rem; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
    background: var(--bg-glass-hover);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* =============================================
   Toast Notifications
   ============================================= */

.toast-container {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: var(--shadow);
    pointer-events: all;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.toast.removing {
    animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-text { font-size: 0.875rem; font-weight: 500; flex: 1; }

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary); }

/* =============================================
   Modal
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--danger);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-message {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* =============================================
   Success Overlay
   ============================================= */

.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(12px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-overlay.hidden { display: none; }

.success-card {
    text-align: center;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success-animation { margin-bottom: 24px; }

.success-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.5);
    animation: successGlow 1s ease-in-out infinite alternate;
}

@keyframes successGlow {
    from { box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); }
    to { box-shadow: 0 0 80px rgba(16, 185, 129, 0.7); }
}

.success-circle .material-icons-round {
    font-size: 3rem;
    color: white;
}

.success-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.success-detail {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.success-balance {
    font-size: 1rem;
    color: var(--success);
    font-weight: 600;
}

.success-low-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning);
    font-size: 0.85rem;
    font-weight: 700;
}

.success-low-balance .material-icons-round { font-size: 1.1rem; }

.success-low-balance.hidden { display: none; }

/* =============================================
   Utilities
   ============================================= */

.hidden { display: none !important; }

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state-small {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 20px;
}

.color-input {
    padding: 6px;
    height: 44px;
    cursor: pointer;
}

.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-picker-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.icon-picker-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text);
}

.icon-picker-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =============================================
   Mobile Bottom Navigation Bar
   ============================================= */

.mobile-bottom-nav {
    display: none; /* hidden by default on desktop */
}

/* =============================================
   Responsive — Mobile-First System
   ============================================= */

/* ── 1024px: Tablet Landscape ─────────────────── */
@media (max-width: 1024px) {
    .order-layout {
        grid-template-columns: 1fr 340px;
        gap: 18px;
    }

    .order-products-col .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

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

    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ── 768px: Tablet Portrait ───────────────────── */
@media (max-width: 768px) {
    .header-inner { padding: 0 16px; height: 60px; }
    .logo-text { font-size: 1.05rem; }
    .nav-tabs { gap: 2px; padding: 3px; }
    .nav-tab { padding: 7px 13px; font-size: 0.82rem; gap: 5px; }

    .main { padding: 20px 16px; }

    .order-layout { grid-template-columns: 1fr; gap: 16px; }
    .order-cart-col { position: static; min-height: auto; }
    .order-products-col .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .users-layout, .admin-layout { max-width: 100%; }
    .form-row { grid-template-columns: 1fr; gap: 14px; }
    .optank-layout { max-width: 100%; }
    .optank-card { padding: 24px 20px; }
    .optank-amounts { grid-template-columns: repeat(3, 1fr); }

    .report-cols { grid-template-columns: 1fr !important; }

    .toast-container { right: 12px; left: 12px; }
    .toast { min-width: unset; max-width: 100%; }
}

/* ── 640px: Large Mobile — Bottom Nav Kicks In ── */
@media (max-width: 640px) {

    /* ─── Show bottom nav bar ─── */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        background: rgba(17, 18, 33, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        gap: 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-family: 'Inter', sans-serif;
        font-size: 0.62rem;
        font-weight: 600;
        cursor: pointer;
        transition: color var(--transition);
        border-radius: var(--radius-sm);
        position: relative;
        letter-spacing: 0.01em;
    }

    .mobile-nav-btn .material-icons-round {
        font-size: 1.45rem;
        transition: transform var(--transition), color var(--transition);
    }

    .mobile-nav-btn::before {
        content: '';
        position: absolute;
        top: 4px;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 28px;
        height: 3px;
        background: var(--primary);
        border-radius: 99px;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

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

    .mobile-nav-btn.active::before {
        transform: translateX(-50%) scaleX(1);
    }

    .mobile-nav-btn.active .material-icons-round {
        transform: translateY(-2px);
    }

    .mobile-nav-btn:active .material-icons-round {
        transform: scale(0.88);
    }

    /* ─── Hide header nav on mobile ─── */
    .nav-tabs { display: none; }

    /* ─── Header: logo only ─── */
    .header-inner {
        padding: 0 16px;
        height: 54px;
        justify-content: center;
    }

    /* ─── Main: leave room for bottom bar ─── */
    .main {
        padding: 14px 12px 90px;
    }

    /* ─── Page title ─── */
    .page-title { font-size: 1.5rem; }

    /* ─── Order screen ─── */
    .order-products-col,
    .order-cart-col {
        padding: 18px 16px;
    }

    .order-col-title { font-size: 0.83rem; margin-bottom: 14px; }

    .order-products-col .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .order-products-col .product-btn { padding: 16px 10px; gap: 8px; }
    .order-products-col .product-btn-icon { width: 44px; height: 44px; font-size: 1.3rem; }
    .order-products-col .product-btn-name { font-size: 0.82rem; }
    .order-products-col .product-btn-price { font-size: 0.95rem; }

    /* ─── Cart ─── */
    .cart-total-amount { font-size: 1.5rem; }
    .pay-btn { padding: 15px 20px; font-size: 1rem; }

    /* ─── Scan screen — cover full viewport ─── */
    .scan-screen-inner { padding: 20px 16px; gap: 18px; }
    .scan-order-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 14px;
    }
    .scan-summary-total { margin-left: 0; }
    .scan-ring-lg { width: 150px; height: 150px; }
    .scan-icon-lg { width: 150px; height: 150px; }
    .scan-icon-lg .material-icons-round { font-size: 3.5rem; }
    .scan-title { font-size: 1.2rem; }

    /* ─── User topup panel ─── */
    .user-topup-panel { max-width: 100%; }
    .balance-amount { font-size: 1.6rem; }
    .topup-quick { gap: 6px; }
    .topup-custom { flex-direction: column; }
    .topup-confirm-btn { width: 100%; justify-content: center; }

    /* ─── Optank ─── */
    .optank-card { padding: 20px 16px; }
    .optank-amounts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .amount-btn { padding: 14px 6px; font-size: 0.9rem; }
    .optank-card-header { gap: 12px; margin-bottom: 20px; }
    .optank-title { font-size: 1.15rem; }
    .optank-confirm-actions { flex-direction: column; gap: 8px; }
    .optank-save-btn { width: 100%; }

    /* ─── Users ─── */
    .users-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .users-header .btn-primary { width: 100%; justify-content: center; }
    .users-grid { grid-template-columns: 1fr; }

    /* ─── Admin ─── */
    .admin-section { padding: 18px 16px; }
    .admin-section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .admin-section-header .btn-primary { width: 100%; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-value { font-size: 1.25rem; }

    /* ─── Forms ─── */
    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 18px 16px; }
    .form-actions { flex-direction: column-reverse; gap: 8px; }
    .form-actions .btn-primary,
    .form-actions .btn-ghost { width: 100%; justify-content: center; }

    /* ─── Modal ─── */
    .modal-overlay { padding: 16px; }
    .modal { padding: 24px 18px; }
    .modal-actions { flex-direction: column; gap: 8px; }
    .modal-actions .btn-primary,
    .modal-actions .btn-ghost,
    .modal-actions .btn-danger { width: 100%; justify-content: center; }

    /* ─── Toasts: slide up from bottom ─── */
    .toast-container {
        top: auto;
        bottom: 90px; /* above bottom nav */
        right: 12px;
        left: 12px;
    }

    .toast { min-width: unset; max-width: 100%; }

    /* ─── Reports ─── */
    .report-detail-header { flex-wrap: wrap; gap: 10px; }
    .report-detail-header .btn-ghost { width: 100%; justify-content: center; }
    .months-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── 480px: Small Mobile ──────────────────────── */
@media (max-width: 480px) {
    .logo-text { font-size: 0.95rem; }

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

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

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

    .cart-item { padding: 8px 10px; gap: 8px; }
    .cart-item-total { min-width: 50px; font-size: 0.85rem; }

    .scan-ring-lg { width: 130px; height: 130px; }
    .scan-icon-lg { width: 130px; height: 130px; }
    .scan-icon-lg .material-icons-round { font-size: 3rem; }

    .optank-confirm-row {
        flex-direction: column !important;
        gap: 12px;
        align-items: stretch;
    }
    .optank-confirm-arrow { display: none; }

    .success-title { font-size: 2rem; }
    .success-circle { width: 80px; height: 80px; }
    .success-circle .material-icons-round { font-size: 2.5rem; }

    .months-grid { grid-template-columns: 1fr !important; }

    .report-summary-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 360px: Very Small Mobile ─────────────────── */
@media (max-width: 360px) {
    .main { padding: 10px 8px 90px; }
    .header-inner { padding: 0 10px; }

    .order-col-title { font-size: 0.76rem; }
    .cart-total-amount { font-size: 1.3rem; }
    .pay-btn { font-size: 0.9rem; padding: 13px 12px; }

    .optank-amounts { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .amount-btn { padding: 12px 4px; font-size: 0.82rem; }

    .password-gate-card { padding: 1.75rem 1.1rem 1.4rem; }

    .mobile-nav-btn { font-size: 0.58rem; }
    .mobile-nav-btn .material-icons-round { font-size: 1.3rem; }
}

/* ── Safe-area for notched phones (iPhone X+) ─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 640px) {
        .mobile-bottom-nav {
            padding-bottom: calc(6px + env(safe-area-inset-bottom));
        }
        .main {
            padding-bottom: calc(90px + env(safe-area-inset-bottom));
        }
        .toast-container {
            bottom: calc(90px + env(safe-area-inset-bottom));
        }
    }
}

/* ── Touch devices: no hover transforms, bigger targets ─ */
@media (hover: none) and (pointer: coarse) {
    .product-btn:hover,
    .user-card:hover,
    .btn-primary:hover,
    .topup-quick-btn:hover,
    .topup-confirm-btn:hover,
    .search-btn:hover,
    .month-card:hover { transform: none; box-shadow: none; }

    .pay-btn:hover { transform: translateY(-1px); }

    /* Minimum 44px tap targets */
    .qty-btn { width: 36px; height: 36px; }
    .action-btn-sm { width: 38px; height: 38px; }
    .icon-btn { width: 44px; height: 44px; }
    .nav-tab { min-height: 44px; }
    .mobile-nav-btn { min-height: 56px; }
    .search-btn { padding: 12px 22px; }
}




/* =============================================
   ORDER SCREEN — Step 1
   ============================================= */

.order-screen {
    animation: fadeInUp 0.3s ease;
}

.order-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

.order-products-col,
.order-cart-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.order-products-col::before,
.order-cart-col::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.order-cart-col {
    position: sticky;
    top: 88px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Mobile: disable sticky cart completely — floating bar takes over */
@media (max-width: 640px) {
    .order-cart-col {
        display: none !important;
    }
    .order-layout {
        grid-template-columns: 1fr !important;
    }
}

.order-col-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-col-title .material-icons-round {
    font-size: 1.15rem;
    color: var(--primary);
}

/* Product grid in order screen — larger tiles */
.order-products-col .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.order-products-col .product-btn {
    padding: 22px 14px;
    gap: 12px;
}

.order-products-col .product-btn-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 1.6rem;
}

.order-products-col .product-btn-name {
    font-size: 0.95rem;
}

.order-products-col .product-btn-price {
    font-size: 1.1rem;
}

/* =============================================
   CART — Step 1 right column
   ============================================= */

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-dim);
    text-align: center;
}

.cart-empty .material-icons-round {
    font-size: 3.5rem;
    color: var(--text-dim);
}

.cart-empty p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.5;
}

.cart-empty-hint {
    font-size: 0.78rem !important;
    color: var(--text-dim) !important;
}

.cart-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideInRight 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cart-item-color {
    width: 10px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}

.cart-item-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

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

.cart-item-qty {
    font-size: 1rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.cart-item-total {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
    min-width: 60px;
    text-align: right;
}

.cart-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.cart-total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cart-total-amount {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
}

.pay-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.pay-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: var(--transition);
}

.pay-btn:hover::before { opacity: 1; }

.pay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(124, 109, 250, 0.5);
}

.pay-btn:active { transform: translateY(-1px) scale(0.99); }

.pay-btn .material-icons-round {
    font-size: 1.5rem;
    animation: pulseIcon 1.5s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.clear-cart-btn {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.clear-cart-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }
.clear-cart-btn .material-icons-round { font-size: 1.1rem; }

/* =============================================
   SCAN SCREEN — Step 2
   ============================================= */

.scan-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.scan-screen.hidden { display: none; }

.scan-screen-inner {
    width: 100%;
    max-width: 560px;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

/* Order summary chips at top of scan screen */
.scan-order-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
}

.scan-summary-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 5px 12px 5px 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.scan-summary-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.scan-summary-total {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--primary-light);
    border-radius: 99px;
    border: 1px solid rgba(124,109,250,0.3);
}

/* Large scan ring */
.scan-waiting-area { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.scan-ring-lg {
    position: relative;
    width: 180px;
    height: 180px;
}

.scan-ring-lg .scan-pulse {
    position: absolute;
    inset: -20px;
    border: 2.5px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: scanPulse 2.2s ease-out infinite;
}

.scan-ring-lg .scan-pulse-2 {
    animation-delay: 1.1s;
}

.scan-icon-lg {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-glass));
    border: 2px solid rgba(124,109,250,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(124,109,250,0.12), inset 0 0 40px rgba(124,109,250,0.04);
}

.scan-icon-lg .material-icons-round {
    font-size: 4.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 20px var(--primary));
    animation: scanIconPulse 2.2s ease-in-out infinite;
}

@keyframes scanIconPulse {
    0%, 100% { filter: drop-shadow(0 0 12px var(--primary)); transform: scale(1); }
    50%       { filter: drop-shadow(0 0 30px var(--primary)); transform: scale(1.06); }
}

/* Manual search on scan screen */
.scan-manual {
    width: 100%;
}

.scan-manual-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    font-weight: 600;
}

.cancel-scan-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 20px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cancel-scan-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
    background: var(--bg-glass-hover);
}

.cancel-scan-btn .material-icons-round { font-size: 1.1rem; }

/* =============================================
   USER TOPUP PANEL (after payment / for topup)
   ============================================= */

.user-topup-panel {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideInDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-topup-panel .user-panel-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-topup-panel .balance-display {
    margin: 20px 24px;
}

.user-topup-panel .topup-section,
.user-topup-panel .history-section {
    padding: 0 24px 24px;
}

/* Product button tap bounce */
@keyframes btnBounce {
    0%   { transform: translateY(-3px) scale(1); }
    40%  { transform: scale(0.93); }
    70%  { transform: scale(1.07); }
    100% { transform: scale(1); }
}

.product-btn.btn-bounce {
    animation: btnBounce 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   OPTANK TAB
   ============================================= */

.optank-layout {
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.optank-step {
    animation: fadeInUp 0.3s ease;
}

/* Card wrapper */
.optank-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.optank-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--success), transparent);
}

/* Recent top-ups list */
.recent-topups-card {
    margin-top: 20px;
    padding: 24px;
}

.recent-topups-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recent-topup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.recent-topup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    color: white;
    flex-shrink: 0;
}

.recent-topup-info { flex: 1; min-width: 0; }

.recent-topup-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-topup-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recent-topup-amount {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--success);
    flex-shrink: 0;
}

.optank-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.optank-step-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.optank-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.optank-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Fixed amount buttons */
.optank-amounts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.amount-btn {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.amount-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--success), #059669);
    opacity: 0;
    transition: var(--transition);
}

.amount-btn span {
    position: relative;
    z-index: 1;
}

.amount-btn:hover {
    border-color: var(--success);
    color: var(--success);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.amount-btn.selected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.amount-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.65rem;
    color: var(--success);
}

/* Divider */
.optank-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.optank-divider::before,
.optank-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Custom amount input */
.optank-custom-wrap {
    margin-bottom: 24px;
}

.optank-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    transition: var(--transition);
}

.optank-input-group:focus-within {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.optank-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-right: 10px;
    border-right: 1px solid var(--border);
    margin-right: 10px;
    line-height: 1;
    flex-shrink: 0;
}

.optank-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 16px 0;
    min-width: 0;
}

.optank-input::placeholder { color: var(--text-dim); }

/* Selected display */
.optank-selected-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    animation: fadeInUp 0.2s ease;
}

.optank-selected-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.optank-selected-amount {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--success);
}

/* Next / Scan button */
.optank-next-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.optank-next-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.optank-next-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45);
}

.optank-next-btn .material-icons-round {
    font-size: 1.4rem;
    animation: pulseIcon 1.8s ease-in-out infinite;
}

.optank-next-btn:disabled .material-icons-round {
    animation: none;
}

/* Scan card step */
.optank-amount-pill {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 99px;
    padding: 6px 16px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--success);
    white-space: nowrap;
    flex-shrink: 0;
}

.optank-scan-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 32px 0;
}

.optank-scan-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.optank-scan-manual {
    margin-top: 8px;
    margin-bottom: 20px;
}

/* Confirm step */
.optank-confirm-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.optank-user-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.optank-user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(124, 109, 250, 0.35);
}

.optank-user-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.optank-user-card {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 2px;
}

.optank-confirm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.optank-confirm-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.optank-confirm-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.optank-confirm-value {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.optank-new-balance {
    color: var(--success);
}

.optank-confirm-arrow {
    color: var(--success);
    flex-shrink: 0;
}

.optank-confirm-arrow .material-icons-round {
    font-size: 1.5rem;
}

.optank-confirm-amount-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    padding: 12px 20px;
}

.optank-confirm-amount-row .material-icons-round {
    font-size: 1.2rem;
}

/* Confirm action buttons */
.optank-confirm-actions {
    display: flex;
    gap: 12px;
}

.optank-save-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.optank-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
}

.optank-save-btn:active { transform: scale(0.98); }

.optank-save-btn .material-icons-round { font-size: 1.2rem; }



/* =============================================
   MONTHLY REPORTS
   ============================================= */

.reports-months { animation: fadeInUp 0.3s ease; }

.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.month-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.month-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #A78BFA);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-slow);
}

.month-card:hover::before { transform: scaleX(1); }

.month-card:hover {
    border-color: rgba(124,109,250,0.35);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}

.month-card-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-card-label .material-icons-round { font-size: 1.1rem; color: var(--primary); }

.month-card-stats { display: flex; flex-direction: column; gap: 6px; }

.month-card-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.month-card-stat-label { color: var(--text-muted); }
.month-card-stat-value { font-weight: 700; }

.month-card-revenue {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--success);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Report detail */
.report-detail { animation: fadeInUp 0.3s ease; }

.report-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.report-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.report-back-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: var(--bg-glass-hover); }
.report-back-btn .material-icons-round { font-size: 1rem; }

.report-detail-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; flex: 1; }

/* Summary metric cards */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.report-metric {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.report-metric::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
}

.report-metric.revenue::after   { background: var(--success); }
.report-metric.sales::after     { background: var(--primary); }
.report-metric.topups::after    { background: var(--accent); }
.report-metric.customers::after { background: #EC4899; }

.report-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.report-metric.revenue   .report-metric-icon { background: rgba(16,185,129,0.15);  color: var(--success); }
.report-metric.sales     .report-metric-icon { background: rgba(124,109,250,0.15); color: var(--primary); }
.report-metric.topups    .report-metric-icon { background: rgba(245,158,11,0.15);  color: var(--accent); }
.report-metric.customers .report-metric-icon { background: rgba(236,72,153,0.12);  color: #EC4899; }

.report-metric-icon .material-icons-round { font-size: 1.15rem; }

.report-metric-value {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.report-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Membership pricing breakdown */
.report-membership-section {
    margin-bottom: 24px;
}

.report-membership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.report-membership-stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
}

.report-membership-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 6px 0 4px;
}

.report-membership-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.report-membership-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.report-membership-stat.member .report-membership-value  { color: var(--primary); }
.report-membership-stat.regular .report-membership-value { color: var(--text); }
.report-membership-stat.discount .report-membership-value { color: var(--warning); }

/* Two-col layout */
.report-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.report-col {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.report-col-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.report-col-title .material-icons-round { font-size: 1rem; color: var(--primary); }

/* Product bar rows */
.report-product-row { margin-bottom: 14px; }

.report-product-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    gap: 8px;
}

.report-product-name {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}

.report-product-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    border: none;
}

.report-product-meta { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.report-product-bar-track {
    height: 6px;
    background: var(--bg-glass);
    border-radius: 99px;
    overflow: hidden;
}

.report-product-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.report-product-revenue {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--success);
    text-align: right;
    margin-top: 3px;
}

/* Customer rows */
.report-customer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.report-customer-row:last-child { border-bottom: none; }

.report-customer-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
}

.report-customer-rank.gold   { background: rgba(245,158,11,0.2);  color: #F59E0B; }
.report-customer-rank.silver { background: rgba(148,163,184,0.2); color: #94A3B8; }
.report-customer-rank.bronze { background: rgba(180,120,80,0.2);  color: #B47850; }

.report-customer-name { flex: 1; font-size: 0.875rem; font-weight: 600; }
.report-customer-count { font-size: 0.75rem; color: var(--text-muted); }
.report-customer-spent { font-size: 0.875rem; font-weight: 700; color: var(--success); }

/* Daily bar chart */
.report-chart-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.report-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 150px;
    padding-top: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.report-chart-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 28px;
    max-width: 54px;
    height: 100%;
    justify-content: flex-end;
}

.report-chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: height 0.8s cubic-bezier(0.4,0,0.2,1);
    min-height: 3px;
    cursor: pointer;
    position: relative;
}

.report-chart-bar:hover { filter: brightness(1.2); }

.report-chart-bar-tooltip {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.report-chart-bar:hover .report-chart-bar-tooltip { opacity: 1; }

.report-chart-day {
    font-size: 0.6rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.report-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.report-empty .material-icons-round {
    font-size: 2.5rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 8px;
}

.no-reports-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-reports-state .material-icons-round {
    font-size: 3rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 12px;
}

@media (max-width: 720px) {
    .report-cols { grid-template-columns: 1fr; }
    .report-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .months-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Print */
@media print {
    .header, .nav-tabs, .bg-orbs,
    .report-back-btn, #reportPrintBtn,
    .admin-section:not(:last-child) { display: none !important; }
    body { background: white !important; color: #111 !important; }
    .report-detail { display: block !important; }
    .report-metric, .report-col, .report-chart-section {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
        break-inside: avoid;
    }
    .report-metric-value, .report-detail-title { color: #111 !important; }
    .report-metric-label, .report-col-title { color: #555 !important; }
    .report-product-bar-track { background: #ddd !important; }
    .report-chart-bar { background: #6C63FF !important; }
}

/* =============================================
   PASSWORD GATE
   ============================================= */

.password-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 11, 20, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-gate.gate-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-gate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(124, 109, 250, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    animation: gateCardIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes gateCardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.password-gate-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.password-gate-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(124, 109, 250, 0.7));
}

.password-gate-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.password-gate-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.5rem;
}

/* Input wrapper */
.password-gate-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.password-gate-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 109, 250, 0.18);
}

.password-gate-input-wrap.gate-shake {
    animation: gateShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

@keyframes gateShake {
    10%, 90% { transform: translateX(-3px); }
    20%, 80% { transform: translateX(5px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.password-gate-lock-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    padding-left: 0.85rem;
    flex-shrink: 0;
}

.password-gate-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    padding: 0.85rem 0.75rem;
    letter-spacing: 0.1em;
}

.password-gate-input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0;
}

.password-gate-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.6rem 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.password-gate-toggle:hover { color: var(--text); }
.password-gate-toggle .material-icons-round { font-size: 1.1rem; }

/* Error message */
.password-gate-error {
    font-size: 0.82rem;
    color: var(--danger);
    text-align: center;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s, transform 0.25s;
    min-height: 1.1em;
    margin-top: -0.5rem;
}

.password-gate-error.gate-error-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Remember me */
.password-gate-remember {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-muted);
    user-select: none;
    transition: color var(--transition);
    width: 100%;
}

.password-gate-remember:hover { color: var(--text); }

.member-checkbox-label {
    width: auto;
    margin-top: 1rem;
}

.password-gate-remember input[type="checkbox"] {
    display: none;
}

.password-gate-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-focus);
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition);
    position: relative;
}

.password-gate-remember input:checked + .password-gate-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.password-gate-remember input:checked + .password-gate-checkbox::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* Submit button */
.password-gate-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 20px rgba(124, 109, 250, 0.35);
    margin-top: 0.25rem;
}

.password-gate-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(124, 109, 250, 0.45);
}

.password-gate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(124, 109, 250, 0.3);
}

.password-gate-btn .material-icons-round { font-size: 1.1rem; }

.password-gate-saldo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1.1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color var(--transition);
}

.password-gate-saldo-link:hover { color: var(--primary); }
.password-gate-saldo-link .material-icons-round { font-size: 1rem; }

@media (max-width: 480px) {
    .password-gate-card {
        margin: 1rem;
        padding: 2rem 1.5rem 1.75rem;
    }
}

/* =============================================
   LOGOUT BUTTON
   ============================================= */

/* Desktop — in the header, right of nav tabs */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius);
    color: var(--danger);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    margin-left: 12px;
    flex-shrink: 0;
}

.logout-btn .material-icons-round {
    font-size: 1.05rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Hide the text label on tablet to save space, keep icon only */
@media (max-width: 900px) {
    .logout-btn-text { display: none; }
    .logout-btn { padding: 8px 10px; margin-left: 8px; }
}

/* On mobile the desktop button is hidden (bottom nav handles it) */
@media (max-width: 640px) {
    .logout-btn { display: none; }
}

/* Mobile bottom nav — logout is the 5th tab, styled danger-red */
.mobile-logout-btn {
    color: rgba(239, 68, 68, 0.75) !important;
}

.mobile-logout-btn::before {
    background: var(--danger) !important;
}

.mobile-logout-btn.active,
.mobile-logout-btn:focus {
    color: var(--danger) !important;
}

.mobile-logout-btn .material-icons-round {
    transition: transform var(--transition), color var(--transition);
}

.mobile-logout-btn:active .material-icons-round {
    transform: scale(0.85) rotate(-10deg) !important;
}

/* =============================================
   MOBILE FLOATING CART BAR
   (shown on ≤640px when cart has items)
   ============================================= */

.mobile-cart-bar {
    display: none; /* JS controls visibility; CSS controls responsiveness */
}

@media (max-width: 640px) {
    .mobile-cart-bar {
        display: block;
        position: fixed;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* sit above bottom nav */
        left: 12px;
        right: 12px;
        z-index: 290;
        animation: mobileCartSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    .mobile-cart-bar.hidden {
        display: none !important;
    }

    @keyframes mobileCartSlideUp {
        from { opacity: 0; transform: translateY(20px) scale(0.97); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    .mobile-cart-bar-inner {
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--bg-elevated);
        border: 1px solid rgba(124, 109, 250, 0.35);
        border-radius: var(--radius-lg);
        padding: 12px 14px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,109,250,0.1);
        backdrop-filter: blur(12px);
    }

    .mobile-cart-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .mobile-cart-badge {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary), #A78BFA);
        color: white;
        font-size: 0.78rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(124, 109, 250, 0.5);
    }

    .mobile-cart-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-cart-total {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text);
        letter-spacing: -0.02em;
        flex-shrink: 0;
    }

    .mobile-cart-pay-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: linear-gradient(135deg, var(--primary), #A78BFA);
        color: white;
        border: none;
        border-radius: var(--radius);
        padding: 10px 16px;
        font-family: 'Inter', sans-serif;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        flex-shrink: 0;
        transition: transform var(--transition), box-shadow var(--transition);
        box-shadow: 0 4px 14px rgba(124, 109, 250, 0.4);
    }

    .mobile-cart-pay-btn .material-icons-round {
        font-size: 1.1rem;
    }

    .mobile-cart-pay-btn:active {
        transform: scale(0.95);
    }

    /* Also: give the products column some bottom breathing room
       when the cart bar + bottom nav are both visible */
    .order-products-col {
        padding-bottom: 16px;
    }
}


/* =============================================
   Insufficient Funds Overlay
   ============================================= */

.funds-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fundsOverlayIn 0.25s ease;
}

.funds-overlay.hidden {
    display: none;
}

@keyframes fundsOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.funds-card {
    background: var(--bg-card);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-xl);
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.2), var(--shadow);
    animation: fundsCardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fundsCardIn {
    from { opacity: 0; transform: scale(0.82) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.funds-card.funds-shake {
    animation: fundsCardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
               fundsShake 0.5s 0.3s ease;
}

@keyframes fundsShake {
    0%, 100% { transform: translateX(0); }
    18%      { transform: translateX(-10px); }
    36%      { transform: translateX(10px); }
    54%      { transform: translateX(-7px); }
    72%      { transform: translateX(7px); }
    86%      { transform: translateX(-3px); }
}

.funds-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.funds-icon-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fundsIconPulse 2s ease-in-out infinite;
}

@keyframes fundsIconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50%      { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.funds-icon {
    font-size: 2.2rem !important;
    color: var(--danger);
}

.funds-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.funds-user {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.funds-breakdown {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.funds-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.funds-row-shortfall {
    padding-top: 4px;
}

.funds-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.funds-label .material-icons-round {
    font-size: 1rem;
}

.funds-label-shortfall {
    color: var(--danger);
    font-weight: 700;
}

.funds-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.funds-value-balance {
    color: #F59E0B;
}

.funds-value-shortfall {
    font-size: 1.15rem;
    color: var(--danger);
}

.funds-divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}

.funds-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.funds-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 12px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    width: 100%;
    justify-content: center;
}

.funds-close-btn:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(239, 68, 68, 0.4);
}

.funds-close-btn:active {
    transform: scale(0.97);
}

/* =============================================
   Tabs System
   ============================================= */

/* ── Badge on nav tab ── */
.nav-tab {
    position: relative;
}

.tab-count-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    border-radius: 9px;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg);
}

.tab-count-badge.hidden { display: none; }

/* ── List view ── */
.tabs-list-view { padding: 0; }

.tabs-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.tabs-page-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.new-tab-form { margin-bottom: 24px; }

/* ── Tabs grid ── */
.tabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

/* ── Empty state ── */
.tabs-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.tabs-empty-state .material-icons-round {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.35;
}

.tabs-empty-state p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.tabs-empty-hint {
    font-size: 0.82rem;
    color: var(--text-dim) !important;
    margin-top: 8px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ── Tab card ── */
.tab-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--tab-color, var(--primary));
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    animation: tabCardIn 0.3s ease;
}

@keyframes tabCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
    pointer-events: none;
}

.tab-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    border-color: var(--tab-color, var(--primary));
}

.tab-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.tab-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-card-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition);
    flex-shrink: 0;
}

.tab-card-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

.tab-card-delete .material-icons-round { font-size: 1.1rem; }

.tab-card-body { display: flex; flex-direction: column; gap: 4px; }

.tab-card-total {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--tab-color, var(--primary));
    letter-spacing: -0.04em;
    line-height: 1;
}

.tab-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tab-card-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
}

.tab-item-chip {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-item-more {
    background: var(--bg-glass);
    color: var(--text-muted);
}

.tab-card-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    color: var(--tab-color, var(--primary));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    width: 100%;
    margin-top: auto;
}

.tab-card-open-btn:hover {
    background: rgba(255,255,255,0.09);
    border-color: var(--tab-color, var(--primary));
}

.tab-card-open-btn:active { transform: scale(0.97); }
.tab-card-open-btn .material-icons-round { font-size: 1rem; }

/* ── Detail view ── */
.tabs-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tabs-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tabs-detail-title-wrap {
    flex: 1;
    min-width: 0;
}

.tabs-detail-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabs-detail-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.tabs-back-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}

.tabs-back-btn:hover { background: var(--bg-glass-hover); }

.tabs-delete-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.tabs-delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.tabs-detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.tabs-products-col,
.tabs-items-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-height: 0;
}

/* ── Scan view ── */
.tab-scan-view {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .tabs-detail-layout {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .tabs-products-col,
    .tabs-items-col {
        overflow: visible;
    }
}

@media (max-width: 600px) {
    .tabs-grid {
        grid-template-columns: 1fr;
    }

    .tabs-page-header {
        flex-wrap: wrap;
    }
}

/* ── Tab Cash Payment ── */
.tab-cash-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.tab-cash-divider::before,
.tab-cash-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.tab-cash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    padding: 14px 24px;
    background: rgba(16, 185, 129, 0.1);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-lg);
    color: #10B981;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                box-shadow var(--transition), transform var(--transition);
    letter-spacing: -0.01em;
}

.tab-cash-btn:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}

.tab-cash-btn:active {
    transform: scale(0.97);
}

.tab-cash-btn .material-icons-round {
    font-size: 1.3rem;
}

.tab-cash-amount {
    background: rgba(16, 185, 129, 0.18);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.9rem;
    font-weight: 800;
    margin-left: 4px;
}

.cash-btn-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.cash-btn-row .tab-cash-btn {
    width: auto;
    max-width: none;
    flex: 1;
    padding: 14px 12px;
    font-size: 0.88rem;
    white-space: nowrap;
}

.cash-btn-row .tab-cash-amount {
    margin-left: 0;
}

.tab-cash-btn.member {
    background: var(--primary-light);
    border-color: rgba(124, 109, 250, 0.4);
    color: var(--primary);
}

.tab-cash-btn.member:hover {
    background: rgba(124, 109, 250, 0.18);
    border-color: rgba(124, 109, 250, 0.7);
    box-shadow: 0 0 24px rgba(124, 109, 250, 0.2);
}

.tab-cash-btn.member .tab-cash-amount {
    background: rgba(124, 109, 250, 0.18);
}

@media (max-width: 480px) {
    .cash-btn-row {
        flex-direction: column;
    }
    .cash-btn-row .tab-cash-btn {
        white-space: normal;
    }
}

/* ── Tab Payments in Reports ── */
.report-tabs-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.tab-pay-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: background var(--transition);
}

.tab-pay-row:hover { background: var(--bg-glass-hover); }

.tab-pay-icon {
    width: 36px;
    height: 36px;
    background: rgba(124, 109, 250, 0.12);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.tab-pay-icon .material-icons-round { font-size: 1.1rem; }

.tab-pay-info {
    flex: 1;
    min-width: 0;
}

.tab-pay-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-pay-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tab-pay-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-pay-badge-card {
    background: rgba(124, 109, 250, 0.15);
    color: var(--primary);
}

.tab-pay-badge-cash {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.tab-pay-total {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
}

/* =============================================
   Public Balance Check Page (saldo.html)
   ============================================= */

.saldo-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 32px;
}

.saldo-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saldo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow);
}

.saldo-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.saldo-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: white;
}

.saldo-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.saldo-page .balance-amount {
    font-size: 2.6rem;
    color: var(--success);
    margin-bottom: 4px;
}

.saldo-page .success-low-balance {
    margin: 14px auto 0;
    max-width: fit-content;
}

.saldo-retry-btn {
    margin: 24px auto 0;
    width: 100%;
    justify-content: center;
}

.saldo-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.saldo-state-icon.error { color: var(--danger); }

.saldo-state-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
