html {
    overflow-y: scroll;
}

body {
    font-family: "Outfit", system-ui, -apple-system, sans-serif;
    background: #0c1222;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.35), transparent),
        radial-gradient(ellipse 80% 50% at 100% 50%, rgba(139, 92, 246, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(16, 185, 129, 0.08), transparent);
    color: #1f2937;
    min-height: 100vh;
}

/* Logged-in app area: light surface */
body.app-logged-in {
    background: linear-gradient(180deg, #f0f4fc 0%, #f8fafc 45%, #eef2ff 100%);
    background-image: none;
}

/* —— Login hero (logged out) —— */
.login-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 3rem);
    padding: 2rem 1rem;
}

.login-hero-glow {
    position: absolute;
    width: min(520px, 90vw);
    height: min(520px, 90vw);
    border-radius: 50%;
    background: conic-gradient(from 210deg at 50% 50%, #3b82f6, #8b5cf6, #06b6d4, #3b82f6);
    opacity: 0.22;
    filter: blur(72px);
    pointer-events: none;
    animation: login-glow-spin 28s linear infinite;
}

@keyframes login-glow-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-hero-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.login-mark {
    display: block;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #0891b2 100%);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.45);
    position: relative;
}

.login-mark::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    opacity: 0.9;
}

.login-title {
    font-weight: 700;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.login-tagline {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.9rem;
}

.login-label {
    color: rgba(226, 232, 240, 0.85);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-input {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.45);
    color: #f1f5f9;
    padding: 0.65rem 1rem;
}

.login-input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.login-input:focus {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.65);
    color: #f8fafc;
}

.btn-login {
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-login:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(37, 99, 235, 0.5);
    filter: brightness(1.05);
}

.login-footnote {
    color: rgba(148, 163, 184, 0.65);
}

/* Logged-in top bar (avoid Bootstrap d-flex + d-none on same node — breaks display) */
.app-top-bar {
    display: none;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

body.app-logged-in .app-top-bar {
    display: flex;
}

.app-top-bar-actions {
    min-width: 0;
}

.mds-logout-btn {
    display: none;
    margin-top: 0.35rem;
}

body.app-logged-in .mds-logout-btn {
    display: inline-block;
}

.app-title {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #1e3a8a, #4338ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card-clean {
    border: 1px solid #e6edf7;
    border-radius: 14px;
}

.seat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 20px 1fr 1fr;
    direction: rtl;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.seat-aisle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #e2e8f0;
    border-radius: 3px;
    min-height: 20px;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.seat-btn, .seat-aisle {
    direction: ltr;
}

.seat-btn {
    border: 0;
    border-radius: 4px;
    padding: 2px 1px;
    font-weight: 600;
    font-size: 0.6rem;
    min-height: 32px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.seat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.seat-empty {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.seat-booked {
    background: #fecaca;
    color: #991b1b;
    border: 1px solid #fca5a5;
    cursor: default;
}

.seat-boarded {
    background: #bfdbfe;
    color: #1e40af;
    border: 2px solid #60a5fa;
    cursor: default;
}

.seat-cabin {
    border: 2px solid #f59e0b;
}

.seat-empty.seat-cabin {
    background: #fef3c7;
    color: #92400e;
}

.seat-btn:not(.seat-booked):not(.seat-boarded).seat-cabin:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.seat-number-label {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.seat-booked-by {
    font-size: 0.45rem;
    font-weight: 500;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.seat-remark-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.seat-btn {
    position: relative;
}

thead th {
    background: #f8fafc;
    font-size: 0.85rem;
    color: #475569;
}

.ticket-print {
    max-width: 780px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}

.ticket-print h3 {
    margin-bottom: 8px;
}

.report-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 72px;
}

.seat-detail-boarded-badge {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.seat-detail-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.seat-detail-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.seat-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.seat-detail-table tr {
    border-bottom: 1px solid #e6edf7;
}

.seat-detail-table td {
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.seat-detail-table td:first-child {
    color: #64748b;
    width: 40%;
}

.seat-detail-table td:last-child {
    color: #1e293b;
    text-align: right;
}

/* seat detail offcanvas — compact, no scroll */
#seatDetailCanvas .offcanvas-body {
    padding: 0.75rem 1rem;
    overflow-y: visible;
}

.seat-detail-boarded-badge {
    margin-top: 0.5rem;
    padding: 0.35rem;
    font-size: 0.8rem;
}

#detailShareBtn,
#boardPassengerBtn,
#receivePaymentBtn,
#confirmPaymentBtn,
#cancelPaymentBtn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

@media print {
    body * {
        visibility: hidden;
    }

    .ticket-print,
    .ticket-print * {
        visibility: visible;
    }

    .ticket-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: 0;
    }
}

/* ── Fixed header/footer layout (app-logged-in) ── */
body.app-logged-in {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body.app-logged-in > header {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: #fff;
}

body.app-logged-in > header .app-title {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #1e3a8a, #4338ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.app-logged-in > .app-main-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

body.app-logged-in > footer {
    flex-shrink: 0;
    background: #fff;
}

.app-section-half {
    display: flex;
    flex-direction: column;
}

.app-section-half .card-body {
    flex: 1;
    min-height: 0;
}

/* Nepali datepicker popup */
.nepali-datepicker-popup {
    display: none;
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    width: 270px;
    font-size: 0.85rem;
    top: 100%;
    left: 0;
    margin-top: 4px;
}
.nepali-datepicker-popup .nep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.nepali-datepicker-popup .nep-nav {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: #333;
}
.nepali-datepicker-popup .nep-nav:hover {
    background: #f0f0f0;
}
.nepali-datepicker-popup .nep-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.nepali-datepicker-popup .nep-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
.nepali-datepicker-popup .nep-table th {
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
    padding: 2px 0;
}
.nepali-datepicker-popup .nep-table td {
    padding: 3px 0;
    width: 14.28%;
}
.nepali-datepicker-popup .nep-day {
    cursor: pointer;
    border-radius: 4px;
    padding: 3px 0;
    font-size: 0.82rem;
    color: #333;
}
.nepali-datepicker-popup .nep-day:hover {
    background: #e8f0fe;
}
.nepali-datepicker-popup .nep-day.selected {
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
}
.nepali-datepicker-popup .nep-day.today {
    border: 1px solid #0d6efd;
    border-radius: 4px;
}

/* ── Multi-seat selection ── */
.seat-empty.seat-selected {
    background: #c7d2fe;
    color: #3730a3;
    border: 2px solid #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.seat-empty.seat-selected:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.seat-checkmark {
    position: absolute;
    top: 0;
    right: 2px;
    font-size: 0.6rem;
    font-weight: 900;
    color: #6366f1;
    line-height: 1;
}

#selectionBar {
    transition: opacity 0.15s ease;
}

/* bulk seat rows */
.bulk-seat-row {
    background: #f8fafc;
    border-color: #e2e8f0 !important;
}

.bulk-seat-row .badge {
    font-size: 1rem;
}

.bulk-seat-row .form-control-sm {
    font-size: 0.8rem;
}
