/* ==================================================================
   Online Bus Ticket Booking System — Stylesheet
   Design concept: "Departure Board"
   --------------------------------------------------------------
   Palette:
     --ink        #1B2430   (near-black navy, primary text/bg)
     --rail       #0F1620   (deepest navy, header/footer)
     --paper      #F6F3EC   (warm ticket paper background)
     --amber      #E8A23D   (transit amber accent — CTAs, highlights)
     --signal     #3E7C59   (departure-board green for "available/success")
     --alert      #B5453A   (departure-board red for cancel/error)
   Type:
     Display: "Space Grotesk" — geometric, slightly industrial, reads like
       modern transit signage.
     Body: "Inter" — clean and legible for forms/tables.
     Mono: "IBM Plex Mono" — used for ticket codes, seat numbers, times,
       prices: anything that should feel "stamped" rather than "written".
   Signature element: the perforated ticket-stub divider (.stub-divider)
     and split-flap style departure rows, echoing analogue bus station
     departure boards.
   ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --ink: #1B2430;
    --rail: #0F1620;
    --paper: #F6F3EC;
    --paper-dim: #ECE7DA;
    --amber: #E8A23D;
    --amber-dark: #C8822A;
    --signal: #3E7C59;
    --alert: #B5453A;
    --line: #D8D2C2;
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
h3,
h4 {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0 0 .5em 0;
    letter-spacing: -0.01em;
}

a {
    color: var(--amber-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.02em;
}

/* ---------------- Layout shell & Sidebar ---------------- */

/* ---------------- Layout shell & Sidebar (Collapsible Drawer Navigation) ---------------- */

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--paper);
}

.app-header {
    display: flex;
    background: var(--rail);
    color: var(--paper);
    padding: 16px 24px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--amber);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header .brand:hover {
    text-decoration: none;
}

.app-header .brand .dot {
    width: 10px;
    height: 10px;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(232, 162, 61, 0.25);
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
}

.hamburger-menu span {
    width: 22px;
    height: 2px;
    background: var(--paper);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.sidebar-toggle-checkbox {
    display: none;
}

.sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 22, 32, 0.6);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-toggle-checkbox:checked ~ .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    width: 280px;
    background: var(--rail);
    color: var(--paper-dim);
    border-right: 3px solid var(--amber);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

.sidebar-toggle-checkbox:checked ~ .sidebar {
    transform: translateX(0);
}

.sidebar-header {
    margin-bottom: 32px;
}

.sidebar .brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .brand:hover {
    text-decoration: none;
}

.sidebar .brand .dot {
    width: 12px;
    height: 12px;
    background: var(--amber);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(232, 162, 61, 0.25);
}

/* User Profile Box */
.user-profile-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--rail);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-name {
    color: var(--paper);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .role-badge {
    align-self: flex-start;
    padding: 2px 8px;
    font-size: 0.65rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-section-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8d8674;
    margin: 18px 0 6px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--paper-dim);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--amber);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(232, 162, 61, 0.08);
    color: var(--amber);
    border-left-color: var(--amber);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn.btn-outline-light {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: var(--paper);
}

.btn.btn-outline-light:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

main.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.narrow {
    max-width: 480px;
}

footer.site-footer {
    text-align: center;
    color: #8d8674;
    font-size: 0.82rem;
    padding: 28px 0 40px;
}

/* ---------------- Buttons & forms ---------------- */

.btn {
    display: inline-block;
    font-family: 'Space Grotesk', Arial;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 11px 22px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    background: var(--amber);
    color: var(--rail);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover {
    background: var(--amber-dark);
    text-decoration: none;
}

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

.btn.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--paper-dim);
    color: var(--paper);
}

.btn.btn-ghost:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: transparent;
}

.btn.btn-outline {
    background: transparent;
    border: 1.5px solid var(--ink);
    color: var(--ink);
}

.btn.btn-outline:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn.btn-danger {
    background: var(--alert);
    color: #fff;
}

.btn.btn-danger:hover {
    background: #95362c;
}

.btn.btn-small {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

form .field {
    margin-bottom: 18px;
}

form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6452;
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    min-width: 0;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.4;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(232, 162, 61, 0.18);
}

/* Normalize datetime-local, date, and time inputs so the text
   sits fully inside the input box across Chrome/Edge/Firefox. */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    min-height: 44px;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

/* WebKit (Chrome/Edge): keep the editable datetime parts aligned */
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
    display: flex;
    align-items: center;
    padding: 0;
    line-height: 1.4;
}

input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

/* Calendar picker icon — pinned right with breathing room */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 2px;
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .field {
    flex: 1;
    min-width: 0;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 28px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #FBEAE8;
    border-color: var(--alert);
    color: #7d2e25;
}

.alert-success {
    background: #E9F3EC;
    border-color: var(--signal);
    color: #244a32;
}

.alert-warning {
    background: #FFF3E0;
    border-color: var(--amber-dark);
    color: #7a4a06;
}

/* ---------------- Signature element: ticket stub ---------------- */

.ticket {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    overflow: hidden;
    box-shadow: 0 2px 0 rgba(27, 36, 48, 0.04);
}

.ticket .ticket-main {
    padding: 22px 24px;
}

.ticket .ticket-stub {
    background: var(--rail);
    color: var(--paper);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 150px;
    position: relative;
}

.stub-divider {
    position: relative;
    width: 0;
    border-left: 2px dashed var(--line);
}

.stub-divider::before,
.stub-divider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--paper);
    border-radius: 50%;
    left: -10px;
}

.stub-divider::before {
    top: -9px;
}

.stub-divider::after {
    bottom: -9px;
}

.ticket .route-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket .route-line .arrow {
    color: var(--amber);
}

.ticket .meta-row {
    display: flex;
    gap: 28px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ticket .meta-item .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8d8674;
    margin-bottom: 2px;
}

.ticket .meta-item .value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
}

.ticket .stub-price {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--amber);
}

.ticket .stub-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--paper-dim);
    margin-top: 4px;
}

/* ---------------- Departure board table ---------------- */

table.board {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--line);
    /* No overflow:hidden here on purpose — that used to clip the
       "•••" actions dropdown menu (see .action-dropdown-menu below)
       since it's a position:absolute child that opens past the
       table's own box. Corners are rounded explicitly on the
       header/last-row cells instead, so the table still looks
       clean without cutting off anything that pops out of it. */
}

table.board thead tr:first-child th:first-child {
    border-top-left-radius: 6px;
}

table.board thead tr:first-child th:last-child {
    border-top-right-radius: 6px;
}

table.board tbody tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

table.board tbody tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

table.board th {
    background: var(--rail);
    color: var(--paper-dim);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
}

table.board td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

table.board tr:last-child td {
    border-bottom: none;
}

table.board tr:hover td {
    background: var(--paper-dim);
}

table.board .mono-cell {
    font-family: 'IBM Plex Mono', monospace;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-pending {
    background: #FFF3E0;
    color: var(--amber-dark);
}

.badge-confirmed {
    background: #E9F3EC;
    color: var(--signal);
}

.badge-cancelled {
    background: #FBEAE8;
    color: var(--alert);
}

.badge-scheduled {
    background: #FFF3E0;
    color: var(--amber-dark);
}

/* ---------------- Stats / dashboard ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--rail);
    color: var(--paper);
    border-radius: 8px;
    padding: 20px 22px;
}

.stat-card .stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--amber);
    word-break: break-all;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--paper-dim);
    margin-top: 4px;
}

.section-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    color: var(--amber-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #8d8674;
}

.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar a {
    padding: 10px 18px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #8d8674;
    border-bottom: 2px solid transparent;
}

.tab-bar a.active {
    color: var(--ink);
    border-bottom-color: var(--amber);
}

.tab-bar a:hover {
    text-decoration: none;
    color: var(--ink);
}

.actions-row {
    display: flex;
    gap: 8px;
}

@media (max-width: 640px) {
    .site-header {
        padding: 14px 18px;
        flex-wrap: wrap;
        gap: 10px;
    }

    main.container {
        padding: 24px 18px 60px;
    }

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

    .stub-divider {
        display: none;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ---------------- Booking Layout side-by-side ---------------- */
.booking-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
    align-items: start;
}

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

    table.board {
        display: block;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
}

/* ---------------- Bus Seat Map Layout ---------------- */
.bus-container {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 60px 24px 24px 24px; /* extra top padding for steering wheel */
    position: relative;
    max-width: 380px;
    margin: 0 auto 24px auto;
    box-shadow: 0 4px 12px rgba(27, 36, 48, 0.05);
}

.steering-wheel {
    position: absolute;
    top: 18px;
    right: 24px;
    color: #4b5563;
}

.bus-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px 12px;
    justify-items: center;
    align-items: center;
}

/* Seat button styling */
.seat {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: #9ca3af;
    transition: transform 0.15s ease, color 0.15s ease;
}

.seat:focus {
    outline: none;
}

.seat .seat-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
}

.seat .seat-part {
    fill: #f9f9f7;
    stroke: #d1d5db;
    stroke-width: 1.5px;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.seat .seat-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

/* Hover effects for available seats */
.seat.available:hover {
    transform: scale(1.08);
}
.seat.available:hover .seat-part {
    stroke: var(--amber-dark);
    fill: #fffbeb;
}
.seat.available:hover .seat-label {
    color: var(--amber-dark);
}

/* Selected state (Green) */
.seat.selected {
    transform: scale(1.05);
}
.seat.selected .seat-part {
    fill: #e6f4ea;
    stroke: var(--signal);
    stroke-width: 2px;
}
.seat.selected .seat-label {
    color: var(--signal);
    font-weight: 700;
}

/* Booked state (Blue-gray) */
.seat.booked {
    cursor: not-allowed;
}
.seat.booked .seat-part {
    fill: #cbd5e1;
    stroke: #94a3b8;
}
.seat.booked .seat-label {
    color: #64748b;
}

/* Toilet & Door decorations */
.grid-toilet, .grid-door {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.toilet-icon-container, .door-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6b7280;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    gap: 4px;
}

.toilet-icon-container svg, .door-icon-container svg {
    color: #8d8674;
}

.aisle-space, .empty-space {
    width: 32px;
    height: 32px;
}

/* Seat map Legend */
.seat-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.82rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: #6b6452;
}

.legend-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.legend-icon .seat-part {
    stroke-width: 1.5px;
}

.legend-item.available .seat-part { fill: #f9f9f7; stroke: #d1d5db; }
.legend-item.booked .seat-part { fill: #cbd5e1; stroke: #94a3b8; }
.legend-item.selected .seat-part { fill: #e6f4ea; stroke: var(--signal); }
.legend-item.processing .seat-part { fill: #fce7f3; stroke: #ec4899; }
.legend-item.luxury-available .seat-part { fill: #fef9ee; stroke: var(--amber); }

/* ============== Luxury Bus Seat Layout ============== */

.bus-container.luxury {
    border: 2px solid var(--amber);
    background: linear-gradient(180deg, #fffbf0 0%, #ffffff 100%);
    box-shadow: 0 4px 20px rgba(232, 162, 61, 0.12);
}

.luxury-badge {
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--amber-dark);
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--amber);
}



/* Luxury available seats: premium amber tint */
.seat.luxury-seat .seat-part {
    fill: #fef9ee;
    stroke: var(--amber);
    stroke-width: 1.5px;
}
.seat.luxury-seat .seat-label {
    color: var(--amber-dark);
}
.seat.luxury-seat:hover {
    transform: scale(1.08);
}
.seat.luxury-seat:hover .seat-part {
    fill: #fde68a;
    stroke: var(--amber-dark);
}

/* Selected luxury seat uses the same green as standard */
.seat.luxury-seat.selected .seat-part {
    fill: #e6f4ea;
    stroke: var(--signal);
    stroke-width: 2px;
}
.seat.luxury-seat.selected .seat-label {
    color: var(--signal);
    font-weight: 700;
}

/* ============== SuperAdmin Styles ============== */

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-badge-super_admin {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--amber-dark);
    border: 1px solid var(--amber);
}

.role-badge-admin {
    background: #e0e7ff;
    color: #3730a3;
}

.role-badge-passenger {
    background: #E9F3EC;
    color: var(--signal);
}

/* Password reset inline form */
.reset-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.reset-password-form .password-wrapper {
    width: 180px;
}

.reset-password-form input[type="password"],
.reset-password-form input[type="text"] {
    width: 100%;
    padding: 6px 36px 6px 10px !important;
    font-size: 0.85rem;
}

.reset-password-form .btn {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* Actions Dropdown Menu */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: var(--radius);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-dropdown-btn:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    min-width: 150px;
    padding: 6px 0;
    overflow: hidden;
}

.action-dropdown.active .action-dropdown-menu {
    display: block;
}

.action-dropdown-menu a,
.action-dropdown-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--ink);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
    font-family: inherit;
}

.action-dropdown-menu a:hover,
.action-dropdown-menu button:hover {
    background: #f3f4f6;
}

.action-dropdown-menu .btn-danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ==================================================================
   Thermal Ticket Redesign
   ================================================================== */

.thermal-ticket-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.thermal-ticket {
    background: #ede9df;
    color: #1a1a1a;
    width: 380px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #d0c9b9;
    padding: 24px 20px 16px 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    position: relative;
    box-sizing: border-box;
}

/* Notches (Punch holes) */
.thermal-ticket::before,
.thermal-ticket::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--paper); /* Matches page background to look like cutout */
    border-radius: 50%;
    bottom: 56px; /* Positioned right at the perforated divider line */
}

.thermal-ticket::before {
    left: -11px;
    border-right: 1px solid #d0c9b9;
}

.thermal-ticket::after {
    right: -11px;
    border-left: 1px solid #d0c9b9;
}

/* Header Brand Logo styling */
.ticket-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: #121c2b;
}

.ticket-bus-svg {
    margin-bottom: 6px;
    color: var(--amber);
}

.ticket-brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    line-height: 1.1;
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
}

.ticket-brand-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background-color: #121c2b;
}

.ticket-brand-sub {
    font-family: 'Space Grotesk', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.88rem;
    align-self: center;
    margin-top: 1px;
    padding-left: 32px; /* Indent like the reference image */
}

.ticket-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    margin: 12px 0 16px 0;
    color: #121c2b;
}

/* Route display: FROM/TO side-by-side */
.ticket-route {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.ticket-route-col {
    display: flex;
    flex-direction: column;
}

.ticket-route-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.ticket-route-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #121c2b;
    line-height: 1.2;
    word-break: break-word;
}

/* Table styling: clean borders and padding */
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #1a1a1a;
    margin-bottom: 14px;
    background: transparent;
}

.ticket-table td {
    padding: 7px 10px;
    border: 1px solid #1a1a1a;
    font-size: 0.88rem;
    vertical-align: middle;
    color: #1a1a1a;
}

.ticket-table td.label-col {
    width: 38%;
    font-weight: 500;
}

.ticket-table td.value-col {
    width: 62%;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    word-break: break-all;
}

/* Gap between first and second details table */
.ticket-table-gap {
    height: 6px;
}

/* Price Section */
.ticket-price-container {
    text-align: center;
    margin: 18px 0 16px 0;
}

.ticket-price-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #121c2b;
}

/* Slogan Section */
.ticket-slogan {
    text-align: center;
    margin: 8px 0 16px 0;
}

.ticket-slogan-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--signal);
    letter-spacing: 0.2px;
}

/* Divider & Perforated cut line */
.ticket-divider-container {
    margin: 0 -20px; /* Pull into margins to touch edge punchouts */
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.ticket-perforated-line {
    width: 100%;
    border-top: 1.5px dashed #b0a896;
}

/* Baggage & Icons Footer */
.ticket-footer-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    color: #666;
}

.ticket-footer-icons svg {
    opacity: 0.75;
}

/* Print Layout Styles */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    
    /* Hide everything except the ticket itself */
    .site-header,
    .site-footer,
    .actions-row,
    .alert,
    .section-eyebrow,
    h1,
    .btn,
    nav {
        display: none !important;
    }
    
    main.container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .thermal-ticket-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .thermal-ticket {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 380px !important;
        margin: 0 auto !important;
        background: #fff !important;
    }
    
    /* Make punchouts solid white to mask borders on print */
    .thermal-ticket::before,
    .thermal-ticket::after {
        background: #fff !important;
        border: none !important;
    }
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper input {
    padding-right: 44px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--amber-dim);
}

.password-toggle:focus {
    outline: none;
}

.password-wrapper input[type="password"] ~ .password-toggle .eye-closed {
    display: none;
}

.password-wrapper input[type="password"] ~ .password-toggle .eye-open {
    display: inline;
}

.password-wrapper input[type="text"] ~ .password-toggle .eye-closed {
    display: inline;
}

.password-wrapper input[type="text"] ~ .password-toggle .eye-open {
    display: none;
}