/* style.css - Premium Native-Feel UX/UI for Bus Ticketing App */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-color-active: #990000;
    
    --primary: #990000;
    --primary-hover: #7f0000;
    --primary-light: #fef2f2;
    --primary-glow: 0 8px 24px rgba(153, 0, 0, 0.15);
    
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.12);
    
    --cyan: #990000;
    --cyan-light: rgba(153, 0, 0, 0.12);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Native Android App Feel Optimizations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
}

html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: linear-gradient(135deg, #dc2626 0%, #990000 100%);
    background-size: 100% 320px;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding-bottom: 3rem;
}

/* Custom premium ultra-thin scrollbar styling to avoid touch locking bugs */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(220, 38, 38, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 38, 38, 0.4);
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .app-container {
        padding: 0; /* Edge-to-edge native layout */
    }
    body {
        padding-bottom: 6rem !important; /* Extra bottom padding for mobile navigation bar */
    }
}

/* Header / App Bar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

@media (max-width: 768px) {
    header {
        position: sticky; /* Native Sticky Top App Bar */
        top: 0;
        z-index: 998;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        background: linear-gradient(135deg, #dc2626 0%, #990000 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem 1.25rem;
        margin-bottom: 0;
    }
    
    header .nav-tabs {
        display: none !important; /* Hide top tabs on mobile viewports */
    }
}

.logo-section h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .logo-section h1 {
        font-size: 1.4rem;
    }
}

.logo-section p {
    font-size: 0.8rem;
    color: #e0e7ff;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .logo-section p {
        display: none; /* Hide subtitle to save vertical space on mobile */
    }
}

.agent-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Navigation Tabs (Desktop/Tablet) */
.nav-tabs {
    display: flex;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tab-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.85;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.tab-btn.active {
    color: var(--primary);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    opacity: 1;
}

/* Native-feel Bottom Navigation Bar (Mobile Only) */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(25px);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 9999;
        justify-content: space-around;
        padding: 0.75rem 0 0.5rem 0; /* Taller padding for easy touch */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    }
    
    .nav-btn-mobile {
        background: transparent;
        border: none;
        color: #64748b;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        font-size: 0.65rem;
        font-weight: 700;
        cursor: pointer;
        transition: var(--transition);
        flex: 1;
        text-align: center;
    }
    
    .nav-btn-mobile .icon {
        font-size: 1.35rem; /* Larger icons for readability */
        transition: transform 0.2s;
    }
    
    .nav-btn-mobile:active .icon {
        transform: scale(0.9); /* Native tap feedback */
    }
    
    .nav-btn-mobile.active {
        color: var(--primary);
        text-shadow: none;
    }
    
    .nav-btn-mobile.active-logout {
        color: var(--danger);
    }
}

/* Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        background: var(--bg-card);
        margin: 1rem;
    }
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -1.25rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Modern Form Control */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .input-control {
        font-size: 16px; /* Prevent iOS/Android from auto-zooming on input focus */
        padding: 1rem;   /* Taller hit area */
        border-radius: 12px;
    }
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: var(--primary-glow);
    background: #ffffff;
}

/* Override default browser autofill background */
.input-control:-webkit-autofill,
.input-control:-webkit-autofill:hover, 
.input-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}


/* Search input on Route Select */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    padding-left: 2.75rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1.2rem;
}

/* Premium Route Cards Grid */
.route-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .route-selector-grid {
        grid-template-columns: 1fr; /* Full width list on mobile for better touch target */
    }
}

.route-select-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.route-select-card:hover {
    border-color: var(--primary);
}

.route-select-card:active {
    transform: scale(0.98); /* Native press effect */
}

.route-select-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 15px rgba(15, 98, 254, 0.1);
}

.route-select-card .cities {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.route-select-card .cities .arrow {
    color: var(--primary);
    font-weight: bold;
}

.route-select-card.active .cities .arrow {
    color: var(--primary);
}

.route-select-card .price {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

.route-select-card.active .price {
    color: var(--primary);
}

.route-select-card .badge {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    font-size: 0.65rem;
    background: rgba(15, 98, 254, 0.1);
    color: var(--primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: bold;
}

.route-select-card.active .badge {
    background: var(--primary);
    color: white;
}

/* Bus Cabin Layout & 3D Seats */
.seat-selector-container {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.seat-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-chair {
    width: 14px;
    height: 14px;
    border-radius: 3px 3px 2px 2px;
    position: relative;
}

.legend-chair::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: inherit;
    border-radius: 1px;
}

.legend-chair.available {
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.legend-chair.selected {
    background: var(--primary);
    border: 1px solid var(--primary);
}

.legend-chair.occupied {
    background: #e2e8f0;
    border: 1px solid transparent;
}

.bus-cabin {
    border: 2px solid var(--border-color);
    border-radius: 24px 24px 10px 10px;
    padding: 1.5rem 1.25rem;
    background: #f8fafc;
    max-width: 250px;
    margin: 0 auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05), var(--shadow);
    border-top: 3px solid rgba(0, 0, 0, 0.05);
}

.bus-front {
    padding-bottom: 1rem;
    border-bottom: 2px dashed #e2e8f0;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.driver-seat {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.entry-door {
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 800;
    border: 1px dashed #cbd5e1;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.seat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 24px 1fr 1fr;
    gap: 0.85rem 0.6rem; /* Slightly larger gaps for mobile tapping */
    align-items: center;
}

/* 3D Seat Styles */
.seat {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.65rem 0; /* Larger touch area */
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px 6px 4px 4px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
    box-shadow: 0 4px 0 #e2e8f0;
}

.seat::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: inherit;
    border-radius: 0 0 3px 3px;
    opacity: 0.7;
}

.seat:hover:not(.occupied) {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.seat:active:not(.occupied) {
    transform: translateY(2px); /* Physical push effect */
    box-shadow: 0 1px 0 #cbd5e1;
}

.seat.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 3px 0 #0050e6, 0 0 10px rgba(15, 98, 254, 0.3);
}

.seat.selected::after {
    background: var(--primary);
}

.seat.occupied {
    background: #e2e8f0;
    border-color: transparent;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.seat.occupied::after {
    display: none;
}

.aisle {
    grid-column: 3;
    text-align: center;
    font-size: 0.55rem;
    color: rgba(0, 0, 0, 0.05);
    user-select: none;
}

/* Floating / Sidebar Checkout Panel */
.checkout-panel {
    position: sticky;
    top: 1.5rem;
}

.checkout-summary-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .checkout-summary-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 1rem;
        padding: 1.5rem;
    }
}

.checkout-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-title .badge-active {
    background: var(--cyan-light);
    color: var(--cyan);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: bold;
}

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

.summary-row .label {
    color: var(--text-secondary);
}

.summary-row .value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.summary-divider {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 1.25rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-total .total-label {
    font-weight: 700;
    color: var(--text-primary);
}

.summary-total .total-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--cyan);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.25);
}

/* Buttons */
.btn {
    width: 100%;
    background: var(--primary);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem; /* Larger touch area */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--primary-glow);
}

.btn:active:not(:disabled) {
    transform: scale(0.97); /* Physical tap depression */
    box-shadow: 0 0 10px rgba(159, 18, 57, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

/* History Grid / List */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-search {
    max-width: 300px;
    flex-grow: 1;
}

@media (max-width: 768px) {
    .history-search {
        max-width: 100%; /* Full width search on mobile */
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

@media (max-width: 768px) {
    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    white-space: nowrap;
    background: #ffffff;
}

tr {
    transition: var(--transition);
}

tr:hover td {
    background: #f8fafc;
}

.ticket-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-family: monospace;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(15, 98, 254, 0.15);
    font-weight: bold;
}

.action-btn-sm {
    background: var(--cyan-light);
    color: var(--cyan);
    border: 1px solid rgba(15, 98, 254, 0.15);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.action-btn-sm:active {
    transform: scale(0.95);
}

.action-btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-btn-danger:active {
    background: var(--danger);
    color: white;
}

/* Route grid */
.route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.route-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.route-info .cities {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.route-info .price {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--cyan);
    font-weight: 700;
    margin-top: 0.25rem;
}

.route-actions {
    display: flex;
    gap: 0.4rem;
}

/* Checker Panel CSS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.stat-card .value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.35rem;
}

.stat-card.stat-boarded .value {
    color: var(--success);
}

.stat-card.stat-pending .value {
    color: var(--warning);
}

.stat-card.stat-total .value {
    color: var(--primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.boarded {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.claimed {
    background: var(--cyan-light);
    color: var(--cyan);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-badge.unclaimed {
    background: rgba(244, 63, 94, 0.08);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Payment Status Badges */
.status-badge.pembayaran-belum {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.pembayaran-proses {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.pembayaran-lunas {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Upload input helper */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--cyan);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 0; /* Larger tap area */
}

.link-btn:hover {
    color: #fef08a;
}

.link-btn:active {
    opacity: 0.7;
}

/* Meal Voucher Scanner Layout */
.scanner-container {
    max-width: 500px;
    margin: 1.5rem auto;
}

.scan-box {
    border: 2px dashed rgba(153, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    background: #f8fafc;
    text-align: center;
    transition: var(--transition);
}

.scan-box:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.scan-box-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: scanner-pulse 2s infinite ease-in-out;
}

@keyframes scanner-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; text-shadow: 0 0 15px rgba(251, 191, 36, 0.6); }
    100% { transform: scale(1); opacity: 0.7; }
}

.verification-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: left;
    margin-top: 1.5rem;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.verification-result.success {
    border-top-color: var(--success);
}

.verification-result.error {
    border-top-color: var(--danger);
}

.result-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Role-Based Login Screen */
/* Role-Based Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f4f6f9;
    background-image: linear-gradient(185deg, #990000 0%, #730000 50%, #4a0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .login-overlay {
        padding: 0;
        background: #ffffff;
        display: block; /* Fix flex-centering layout cutoff bug on small mobile screens */
    }
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: left;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .login-card {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
        padding: 1.5rem 1.25rem;
        margin: 0 auto;
        justify-content: flex-start;
    }
    
    .login-brand-header {
        margin-bottom: 1.25rem;
    }
    
    .brand-logo-container {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    
    .brand-logo-icon {
        font-size: 1.8rem;
    }
    
    .login-logo-title {
        font-size: 1.5rem;
    }
    
    .welcome-section {
        margin-bottom: 1.25rem;
    }
    
    .welcome-title {
        font-size: 1.15rem;
    }
    
    .welcome-desc {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    .form-group-modern {
        margin-bottom: 0.85rem;
    }
    
    .btn-login-modern {
        margin-top: 1.25rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .demo-accounts-card {
        margin-top: 1.25rem;
    }
}

/* Brand Section */
.login-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo-container {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #dc2626 0%, #990000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(153, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.brand-logo-icon {
    font-size: 2.2rem;
    color: #ffffff;
}

.login-logo-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.login-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 1.75rem;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.welcome-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Modern Input Controls */
.form-group-modern {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.input-label-modern {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.input-wrapper-modern {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s ease;
    padding: 0 0.75rem;
}

.input-wrapper-modern.focused {
    border-color: #990000;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.08);
}

.input-icon-left {
    color: #64748b;
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.input-field-modern {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0;
    font-size: 0.92rem;
    color: #0f172a;
    outline: none;
    font-weight: 500;
    line-height: 1.25;
}

.input-field-modern::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-icon-right {
    color: #64748b;
    font-size: 1.25rem;
    margin-left: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.input-icon-right:hover {
    color: #1e293b;
}

.forgot-password-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: #990000;
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Login Button Modern */
.btn-login-modern {
    width: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #990000 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 0.85rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(153, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-login-modern:hover {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 6px 16px rgba(153, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn-login-modern:active {
    transform: translateY(1px);
}

.btn-login-modern:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner-modern {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Demo Accounts Box */
.demo-accounts-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    margin-top: 2rem;
    overflow: hidden;
    transition: all 0.25s ease;
}

.demo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    cursor: pointer;
    user-select: none;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.demo-card-header:hover {
    background: #e2e8f0;
}

.demo-header-icon {
    font-size: 1.15rem;
    color: #990000;
}

.demo-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-expand-icon {
    font-size: 1.25rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.demo-card-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #f8fafc;
}

.demo-account-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.demo-account-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
    transform: translateX(2px);
}

.demo-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    width: 76px;
    justify-content: center;
    margin-right: 0.75rem;
}

.badge-agen {
    background: #fee2e2;
    color: #990000;
}

.badge-checker {
    background: #fef3c7;
    color: #b45309;
}

.badge-resto {
    background: #dcfce7;
    color: #15803d;
}

.badge-icon {
    font-size: 0.85rem;
}

.demo-details {
    flex-grow: 1;
}

.demo-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
}

.demo-creds {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 1px;
}

.demo-item-arrow {
    font-size: 1.15rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.demo-account-item:hover .demo-item-arrow {
    color: #990000;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    
    /* Fix for mobile hide */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@media (max-width: 768px) {
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 5.5rem; /* Above bottom nav */
        justify-content: center;
    }
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    position: relative;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

/* Native Mobile Bottom Sheet Effect for Modals */
@media (max-width: 768px) {
    .modal-overlay {
        align-items: flex-end; /* Align to bottom */
        padding: 0; /* Full width */
    }

    .modal-content {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        padding: 1.75rem 1.25rem 2.5rem 1.25rem;
        animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes slideUp {
        0% { transform: translateY(100%); }
        100% { transform: translateY(0); }
    }
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

/* Thermal Ticket Style */
.ticket-print-area {
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.15);
    line-height: 1.4;
}

.ticket-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.ticket-header .title {
    font-size: 1.35rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.ticket-header .subtitle {
    font-size: 0.75rem;
    color: #444;
}

.ticket-details-grid {
    font-size: 0.85rem;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.ticket-row .label {
    color: #444;
}

.ticket-row .value {
    font-weight: bold;
}

.ticket-divider {
    border-top: 1px dashed #000;
    margin: 0.75rem 0;
}

.ticket-total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 0.5rem 0;
    margin: 0.75rem 0;
}

.ticket-footer {
    text-align: center;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

.ticket-barcode {
    text-align: center;
    margin-top: 0.75rem;
    font-weight: bold;
    letter-spacing: 4px;
    font-size: 0.85rem;
    border: 1px solid #000;
    padding: 0.4rem;
    background: #fafafa;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem; /* Better tap target */
}

.close-modal:active {
    color: var(--text-primary);
    transform: scale(0.9);
}

.print-actions {
    display: flex;
    gap: 0.75rem;
}

/* Image preview modal styling */
.img-preview-container {
    max-width: 100%;
    max-height: 350px;
    margin: 0.75rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.img-preview-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* PRINT MEDIA STYLING */
@media print {
    body * {
        visibility: hidden;
        background: transparent !important;
    }
    
    .modal-overlay, .modal-content, .ticket-print-area, .ticket-print-area * {
        visibility: visible;
    }
    
    .modal-overlay {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: transparent !important;
        backdrop-filter: none !important;
        padding: 0;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0;
        margin: 0;
        max-width: 100%;
        width: 100%;
        animation: none;
    }
    
    .ticket-print-area {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto;
        color: #000 !important;
        background: #fff !important;
    }

    .close-modal, .print-actions, .modal-title, .modal-body-title {
        display: none !important;
    }
}

/* Agent Nav Desktop Wrapper */
.agent-nav-desktop-container {
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .agent-nav-desktop-container {
        display: none;
    }
}

/* KAI Access style route selector card styling */
.kai-route-card select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    cursor: pointer;
    outline: none;
    padding-right: 1.5rem;
}

.kai-route-card select:focus {
    color: var(--primary);
}

.btn-swap:hover {
    background-color: var(--primary-light) !important;
    border-color: var(--primary) !important;
    transform: translateY(-50%) rotate(180deg) scale(1.08) !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15) !important;
}

.btn-swap:active {
    transform: translateY(-50%) rotate(180deg) scale(0.95) !important;
}

/* Responsive Grid & Layout Utility */
.grid-2col-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Ticket journey card responsive details */
.ticket-journey-info {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    align-items: center;
}

.ticket-price-capacity {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 60px;
}

@media (max-width: 768px) {
    .grid-2col-responsive {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Responsive Stacked Tables (transformed to cards) */
    .table-container {
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    .table-container table {
        border: none;
        background: transparent;
        display: block;
        width: 100%;
    }
    
    .table-container thead {
        display: none;
    }
    
    .table-container tbody {
        display: block;
        width: 100%;
        background: transparent;
    }
    
    .table-container tr {
        display: block;
        width: 100%;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        margin-bottom: 1rem;
        padding: 1.25rem 1rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    }
    
    .table-container td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0;
        border-bottom: 1px solid #f1f5f9;
        white-space: normal;
        text-align: right;
        font-size: 0.85rem;
    }
    
    .table-container td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .table-container td:first-child {
        padding-top: 0;
    }
    
    .table-container td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    /* Force child elements of td to wrap or fit nicely */
    .table-container td > * {
        text-align: right;
    }
    
    /* Ticket journey cards stack on mobile */
    .ticket-journey-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .ticket-price-capacity {
        text-align: left;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: auto;
        border-top: 1px dashed var(--border-color);
        padding-top: 0.75rem;
    }
    
    .ticket-price-capacity > div {
        text-align: left !important;
    }

    /* Prevent summary text clipping by handling flex layout */
    .summary-row {
        gap: 1rem;
    }
    .summary-row .value {
        word-break: break-word;
    }
    .summary-total .total-amount {
        font-size: 1.5rem; /* slightly smaller to fit screen */
    }
}

/* Modern Icon Styling */
.material-symbols-outlined {
    font-size: 1.2rem;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tab-btn .material-symbols-outlined,
.tab-nav-item .material-symbols-outlined,
.nav-btn-mobile .material-symbols-outlined,
.action-btn-sm .material-symbols-outlined,
.btn .material-symbols-outlined {
    margin-right: 0.35rem;
    font-size: 1.25rem;
}

.nav-btn-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.nav-btn-mobile .icon.material-symbols-outlined {
    font-size: 1.5rem;
    margin-right: 0;
}

