:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #10b981;
    --accent-hover: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-800: #334155;
    --gray-700: #475569;
    --gray-500: #64748b;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background-color: #0b1120;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 76px; /* Space for bottom nav */
    user-select: none;
}

/* App Header */
.app-header {
    background: #111827;
    border-bottom: 1px solid #1f2937;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 11px;
    color: #94a3b8;
}

/* Status Indicators */
.header-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #1f2937;
    color: #9ca3af;
    border: 1px solid #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* Live Stats Bar */
.live-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 14px;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
}

.stat-chip {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.stat-val {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    margin-top: 2px;
}

.stat-chip.accent-chip .stat-val {
    color: #38bdf8;
}

.stat-chip.money-chip .stat-val {
    color: #4ade80;
}

/* Main Container */
.main-content {
    flex: 1;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 14px;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

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

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

/* Card Styles */
.app-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quick Vehicle Selection Buttons */
.vehicle-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.btn-vehicle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    color: #f8fafc;
    position: relative;
    overflow: hidden;
}

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

.btn-vehicle.motor {
    border-color: #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), rgba(30, 41, 59, 0.9));
}

.btn-vehicle.mobil {
    border-color: #10b981;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), rgba(30, 41, 59, 0.9));
}

.btn-vehicle.truk {
    border-color: #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(30, 41, 59, 0.9));
}

.vehicle-icon {
    font-size: 38px;
    margin-bottom: 6px;
}

.vehicle-name {
    font-size: 16px;
    font-weight: 700;
}

.vehicle-rate-tag {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 12px;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}

.app-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

.app-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.plate-input-big {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Action Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

/* QR Code Scanner Section */
.scanner-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 14px;
    border: 2px solid #334155;
}

#qr-reader {
    width: 100% !important;
    border: none !important;
}

#qr-reader__scan_region {
    background: rgba(0,0,0,0.2);
}

.scanner-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-laser {
    width: 80%;
    height: 2px;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: scanAnim 2s infinite ease-in-out;
}

@keyframes scanAnim {
    0%, 100% { transform: translateY(-70px); }
    50% { transform: translateY(70px); }
}

/* Scanner Action Bar */
.scanner-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-tool {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

/* Checkout Detail Card */
.checkout-card {
    background: #1e293b;
    border: 2px solid #3b82f6;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.checkout-ticket-num {
    font-size: 16px;
    font-weight: 800;
    color: #60a5fa;
}

.checkout-duration-tag {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: #cbd5e1;
}

.detail-row.grand-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px dashed #475569;
    font-size: 18px;
    font-weight: 800;
    color: #4ade80;
}

/* Quick Cash Nominal Buttons */
.cash-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.btn-preset {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.btn-preset:active {
    background: #2563eb;
    border-color: #2563eb;
}

/* Thermal Receipt Preview Paper Look */
.receipt-paper {
    background: #ffffff;
    color: #111827;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 16px 14px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    margin: 12px 0;
    position: relative;
    border-top: 4px dashed #9ca3af;
    border-bottom: 4px dashed #9ca3af;
}

.receipt-paper .r-center {
    text-align: center;
}

.receipt-paper .r-bold {
    font-weight: bold;
}

.receipt-paper .r-big {
    font-size: 16px;
    font-weight: bold;
}

.receipt-paper .r-divider {
    border-bottom: 1px dashed #6b7280;
    margin: 8px 0;
}

.receipt-paper .r-qr {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #111827;
    border-top: 1px solid #1f2937;
    display: flex;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    gap: 3px;
}

.nav-item.active {
    color: #38bdf8;
}

.nav-icon {
    font-size: 20px;
}

/* Modals */
.app-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.app-modal.show {
    display: flex;
}

.modal-dialog {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
}

.btn-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
}

/* Sound indicator flash */
.flash-success {
    animation: flashGreen 0.4s ease-out;
}

@keyframes flashGreen {
    0% { background-color: rgba(16, 185, 129, 0.4); }
    100% { background-color: transparent; }
}

.flash-danger {
    animation: flashRed 0.5s ease-out;
}

@keyframes flashRed {
    0% { background-color: rgba(239, 68, 68, 0.5); }
    100% { background-color: transparent; }
}
