:root {
    --sidebar-width: 220px;
    --bottom-tabs-height: 4.25rem;
    --primary: #1B3664;
    --primary-light: #254a82;
    --primary-dark: #122648;
    --accent: #EF7F2D;
    --accent-hover: #d96f22;
    --primary-rgb: 27, 54, 100;
    --accent-rgb: 239, 127, 45;
    --bg: #F7F8FA;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.07);
    --card-shadow-hover: 0 12px 32px rgba(var(--primary-rgb), 0.13);
    --card-accent: linear-gradient(90deg, var(--primary), var(--accent));
    --bs-primary: #EF7F2D;
    --bs-primary-rgb: 239, 127, 45;
    --bs-body-font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
    --radius-pill: 50rem;
    --radius-card: 1rem;
}

html, body {
    font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
}

html,
body.app-body {
    overflow-x: clip;
    max-width: 100%;
}

body.app-body {
    background: var(--bg);
}

/* Bootstrap overrides */
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    font-weight: 500;
}

.btn-primary:focus,
.btn-primary:active:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.35);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

.page-header h1,
.page-header .h3 {
    color: var(--primary);
    font-weight: 700;
}

/* App shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 1rem;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 200;
}

[dir="rtl"] .app-sidebar { right: 0; }
[dir="ltr"] .app-sidebar { left: 0; }

.brand {
    margin-bottom: 1.5rem;
    padding: 0.85rem 0.75rem 1rem;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-bottom: none;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 150px;
    max-height: 72px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-section {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.85rem 0.85rem 0.25rem;
    margin-top: 0.35rem;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-nav-group + .sidebar-nav-group,
.sidebar-nav-group + a,
a + .sidebar-nav-group {
    margin-top: 0.15rem;
}

.sidebar-nav-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: 0.85rem 0.85rem 0.35rem;
    margin-top: 0.35rem;
    cursor: pointer;
    text-align: start;
    transition: color 0.2s, background 0.2s;
}

.sidebar-nav-section-toggle:hover,
.sidebar-nav-section-toggle:focus-visible {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.sidebar-nav-section-toggle:not(.collapsed) {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-nav-chevron {
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-nav-section-toggle:not(.collapsed) .sidebar-nav-chevron {
    transform: rotate(180deg);
}

.sidebar-nav-group .collapse.show,
.sidebar-nav-group .collapsing {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-nav-group .collapse a {
    padding-inline-start: 1.1rem;
}

.sidebar-nav-section:first-child {
    margin-top: 0;
    padding-top: 0.25rem;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    border-inline-start: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-nav .bi {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sidebar-nav a.active .bi {
    color: var(--accent);
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(var(--accent-rgb), 0.18);
    color: #fff;
    border-inline-start-color: var(--accent);
}

.app-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    min-height: 100vh;
}

@media (min-width: 992px) {
    .app-main {
        margin-inline-start: var(--sidebar-width);
    }
}

.app-topbar {
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent);
}

.topbar-end, .topbar-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-booking-btn {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    font-weight: 600;
}

.topbar-booking-btn:hover,
.topbar-booking-btn:focus {
    background: #e06a00 !important;
    border-color: #e06a00 !important;
    color: #fff !important;
}

.notification-bell-btn.dropdown-toggle::after {
    display: none;
}

.notification-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -6px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.notification-dropdown {
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: 24rem;
    padding: 0;
    overflow: hidden;
}

.notification-dropdown-header {
    border-bottom: 2px solid var(--accent);
    background: var(--primary);
    color: #fff;
}

.notification-dropdown-header a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.notification-dropdown-list {
    max-height: 16rem;
    overflow-y: auto;
}

.notification-dropdown-item.unread {
    background: rgba(13, 110, 253, 0.06);
}

.notification-dropdown-item .notification-item-link {
    white-space: normal;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.notification-dropdown-item .notification-item-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.notification-dropdown-footer {
    background: #f8f9fa;
}

.notification-inbox-card.notification-unread {
    border-inline-start: 4px solid var(--accent);
}

.notification-new-badge {
    background: var(--accent);
    color: #fff;
}

.row-suspended {
    opacity: 0.65;
    background-color: rgba(108, 117, 125, 0.08);
}

.row-suspended input:not([type="hidden"]),
.row-suspended select {
    pointer-events: none;
}

.row-suspended .btn-suspend-point,
.row-suspended .btn-suspend-price,
.row-suspended .btn-remove-point,
.row-suspended .btn-remove-price {
    pointer-events: auto;
}

.route-point-drag-handle {
    cursor: grab;
    color: #6c757d;
    display: inline-flex;
    padding: 0.25rem;
}

.route-point-drag-handle:active {
    cursor: grabbing;
}

.route-point-row.route-point-dragging {
    opacity: 0.5;
}

.route-point-order-display {
    font-weight: 600;
    min-width: 1.5rem;
    display: inline-block;
    text-align: center;
}

input.route-point-boarding:disabled,
input.route-point-alighting:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.branch-form .form-select {
    min-width: 180px;
}

.app-content {
    padding-bottom: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Unified card system */
.app-card,
.stat-card,
.page-card,
.chart-card,
.login-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.list-view.is-cards .record-card::before {
    display: none;
}

.page-card::before,
.chart-card::before,
.stat-card::before,
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--card-accent);
}

.stat-card,
.chart-card,
.trip-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover,
.chart-card:hover,
.trip-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.card-grid,
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .card-grid,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.page-card,
.stat-card,
.chart-card,
.ticket-pass,
.list-view.is-cards .table-modern tbody tr.record-card {
    max-width: 100%;
    min-width: 0;
}

.page-card {
    padding: 1.25rem;
}

.page-card > h5,
.page-card > .h5 {
    color: var(--primary);
    font-weight: 700;
    padding-bottom: 0.65rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(var(--accent-rgb), 0.22);
}

.table-modern {
    margin-bottom: 0;
}

.table-modern thead {
    background: rgba(var(--primary-rgb), 0.06);
}

.table-modern thead th {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.table-modern th,
.table-modern td {
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.04);
}

.search-bar {
    max-width: 320px;
}

.filter-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 1.1rem 1.25rem 1.2rem;
    margin-bottom: 1.25rem;
}

.filter-panel-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) minmax(140px, 0.85fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) auto;
    gap: 0.85rem 1rem;
    align-items: end;
}

.filter-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.filter-search-wrap {
    position: relative;
}

.filter-search-wrap .bi {
    position: absolute;
    inset-inline-start: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1rem;
}

.filter-search-wrap .form-control {
    padding-inline-start: 2.35rem;
}

.filter-panel .form-control,
.filter-panel .form-select {
    min-height: 2.5rem;
    border-radius: 0.65rem;
}

.filter-panel-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-panel-actions .btn {
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-inline: 1rem;
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .filter-panel-grid {
        grid-template-columns: minmax(200px, 1.4fr) minmax(140px, 0.8fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr);
    }

    .filter-panel-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .filter-panel {
        padding: 1rem;
    }

    .filter-panel-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-field-search {
        grid-column: 1 / -1;
    }

    .filter-panel-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .filter-panel-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .filter-panel-grid {
        grid-template-columns: 1fr;
    }
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    padding: 2.25rem 2rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-brand .brand-logo {
    max-width: 200px;
    margin-bottom: 0.75rem;
}

.login-brand .login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

.login-card .form-label {
    font-weight: 500;
    color: var(--primary);
}

.login-card .btn-primary {
    padding: 0.65rem;
    font-size: 1.05rem;
    margin-top: 0.25rem;
}

.login-demo {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

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

.stat-card-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-welcome .welcome-logo {
    width: 56px;
    height: auto;
    flex-shrink: 0;
}

.stat-card-welcome .welcome-text h3 {
    margin-bottom: 0.25rem;
}

.stat-card-welcome .welcome-text .value {
    font-size: 1.35rem;
}

.dashboard-kpi-grid {
    margin-bottom: 1.25rem;
}

.stat-card-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 100%;
}

.stat-card-kpi-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.stat-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.stat-card-icon.tone-primary { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.stat-card-icon.tone-accent { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.stat-card-icon.tone-blue { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.stat-card-icon.tone-green { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.stat-card-icon.tone-navy { background: rgba(var(--primary-rgb), 0.15); color: var(--primary-dark); }
.stat-card-icon.tone-red { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}

.stat-card-change.positive { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.stat-card-change.negative { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.stat-card-change.neutral { background: rgba(100, 116, 139, 0.1); color: var(--text-muted); }

.stat-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dashboard-currency-note {
    font-size: 0.875rem;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 992px) {
    .dashboard-charts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.chart-card {
    padding: 1.25rem;
}

.chart-card h3 {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(var(--accent-rgb), 0.18);
}

.chart-container {
    position: relative;
    height: 260px;
    max-width: 100%;
    min-width: 0;
}

.chart-container canvas {
    max-width: 100%;
}

.chart-container-sm {
    height: 240px;
}

/* Mobile app chrome */
.mobile-menu-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.55rem;
    line-height: 1;
}

.mobile-menu-btn .bi {
    font-size: 1.45rem;
}

.mobile-page-title {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-nav-drawer {
    width: min(280px, 88vw);
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
}

.mobile-nav-drawer-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 1.15rem;
}

.mobile-nav-drawer-header .brand {
    margin: 0;
    padding: 0.65rem 0.75rem;
    flex: 1;
}

.mobile-nav-drawer-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.15rem 1.25rem;
    gap: 0.5rem;
}

.mobile-drawer-branch-form {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
}

.mobile-drawer-branch-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mobile-drawer-nav {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.mobile-drawer-actions {
    display: grid;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-bottom-tabs {
    position: fixed;
    inset-inline: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.1rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: var(--bottom-tabs-height);
    padding: 0.35rem max(0.35rem, env(safe-area-inset-left, 0px)) calc(0.35rem + env(safe-area-inset-bottom, 0px)) max(0.35rem, env(safe-area-inset-right, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(var(--primary-rgb), 0.08);
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    min-height: 3rem;
    padding: 0.4rem 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 0.65rem;
    transition: color 0.2s, background 0.2s;
}

.bottom-tab .bi {
    font-size: 1.25rem;
}

.bottom-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-tab:hover,
.bottom-tab:focus {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
}

.bottom-tab.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

/* List view toggle */
.list-view-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.list-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--card-shadow);
}

.list-view-toggle button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.list-view-toggle button.active {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 991.98px) {
    .list-view-toolbar {
        display: none !important;
    }
}

.list-view.is-cards.page-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.list-view.is-cards.page-card::before {
    display: none;
}

.list-view.is-cards .table-responsive {
    overflow: visible;
}

.list-view.is-cards .table-modern thead {
    display: none;
}

.list-view.is-cards .table-modern tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 992px) {
    .list-view.is-cards .table-modern tbody {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.list-view.is-cards .table-modern tbody tr.record-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    padding: 0;
    min-width: 0;
    min-height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-inline-start: 3px solid transparent;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    animation: recordCardIn 0.35s ease both;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.list-view.is-cards .record-card:nth-child(3n+2) {
    animation-delay: 0.05s;
}

.list-view.is-cards .record-card:nth-child(3n+3) {
    animation-delay: 0.1s;
}

.list-view.is-cards .table-modern tbody tr.record-card:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(var(--accent-rgb), 0.25);
    border-inline-start-color: var(--accent);
}

.list-view.is-cards .table-hover > tbody > tr.record-card:hover > td,
.list-view.is-cards .table-modern tbody tr.record-card:hover > td {
    --bs-table-hover-bg: transparent;
    background-color: transparent !important;
}

.list-view.is-cards .table-modern tbody tr:has(.table-empty) {
    grid-column: 1 / -1;
    display: block;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-card);
    box-shadow: none;
    animation: none;
}

.list-view.is-cards .record-card-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    padding: 1rem 1.1rem 0.85rem;
    background: var(--primary);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}

.list-view.is-cards .record-card-title-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    word-break: break-word;
    min-width: 0;
    flex: 1;
}

.list-view.is-cards .table-modern td.record-card-hidden {
    display: none !important;
}

.list-view.is-cards .table-modern td.record-card-field,
.list-view.is-cards .table-modern td.record-card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.65rem 1.1rem 0;
    border: none;
    text-align: start !important;
}

.list-view.is-cards .table-modern td.record-card-field-full {
    grid-column: 1 / -1;
}

.list-view.is-cards .table-modern td.record-card-field::before,
.list-view.is-cards .table-modern td.record-card-status::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.list-view.is-cards .table-modern .record-card-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.list-view.is-cards .record-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.list-view.is-cards .record-card-badge.badge-success {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.list-view.is-cards .record-card-badge.badge-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b91c1c;
}

.list-view.is-cards .record-card-badge.badge-muted {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.list-view.is-cards .record-card-badge.badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.list-view.is-cards .table-modern td.is-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem 1rem;
    margin-top: 0.15rem;
    border-top: 3px solid var(--accent);
    background: #fff;
}

.list-view.is-cards .table-modern td[data-label=""]::before,
.list-view.is-cards .table-modern td.is-actions::before {
    display: none;
}

.list-view.is-cards .table-modern .btn-group-actions {
    display: flex;
    flex: 1;
    gap: 0.5rem;
    width: 100%;
}

.list-view.is-cards .table-modern .btn-action-view,
.list-view.is-cards .table-modern .btn-action-edit,
.list-view.is-cards .table-modern .btn-action-delete,
.list-view.is-cards .table-modern .btn-action-toggle {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.75rem;
}

.list-view.is-cards .table-modern .btn-action-edit {
    background: rgba(var(--primary-rgb), 0.06);
}

.list-view.is-cards .table-modern .btn-action-delete {
    background: rgba(220, 53, 69, 0.06);
}

.list-view.is-cards .table-modern .btn-action-toggle {
    background: rgba(25, 135, 84, 0.06);
}

.list-view.is-cards .table-modern .table-empty td {
    display: block;
    text-align: center !important;
    padding: 0 !important;
}

.list-view.is-cards .table-modern .table-empty td::before {
    display: none;
}

.list-view.is-cards .table-empty-icon {
    font-size: 2.5rem;
    opacity: 0.45;
}

@media (max-width: 991.98px) {
    .app-topbar {
        min-height: 3.25rem;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        align-items: center;
    }

    .topbar-start {
        flex: 1;
        min-width: 0;
        gap: 0.65rem;
        align-items: center;
    }

    .topbar-end {
        flex-shrink: 0;
        gap: 0.35rem;
    }

    .topbar-end .topbar-btn-text {
        display: none;
    }

    .topbar-icon-btn {
        padding: 0.35rem 0.5rem;
    }

    .topbar-branch-icon {
        display: none;
    }

    .branch-form .form-select {
        min-width: 180px;
        font-size: 0.85rem;
    }

    .stat-card,
    .stat-card-kpi {
        padding: 0.85rem 0.9rem;
    }

    .stat-card-kpi .value {
        font-size: 1.25rem;
        word-break: break-word;
        line-height: 1.3;
    }

    .stat-card-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.05rem;
    }

    .list-view.is-cards .table-modern tbody {
        grid-template-columns: 1fr;
    }

    .list-view.is-cards .table-modern tbody tr.record-card {
        grid-template-columns: 1fr;
    }

    .trip-card {
        padding: 1rem;
    }

    .trip-card-route {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .trip-card-time {
        font-size: 1.05rem;
    }

    .booking-wizard .page-header {
        display: none;
    }

    .booking-stepper {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
        margin-bottom: 0.5rem;
    }

    .app-content.container-fluid {
        --bs-gutter-x: 0;
        padding-top: 1rem;
        padding-bottom: calc(var(--bottom-tabs-height) + env(safe-area-inset-bottom, 0px) + 1rem);
        padding-inline: 0.75rem;
    }

    .page-header h1,
    .page-header .h3 {
        font-size: 1.15rem;
    }

    .page-header > h1,
    .page-header > .h3 {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .page-header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-header-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-card {
        padding: 1rem;
        border-radius: var(--radius-card);
    }

    .page-card dl.row dt {
        font-size: 0.82rem;
        color: var(--text-muted);
        margin-bottom: 0.15rem;
    }

    .page-card dl.row dd {
        margin-bottom: 0.75rem;
    }

    .ticket-pass {
        max-width: 100%;
    }

    .ticket-pass-inner {
        flex-direction: column;
    }

    .ticket-pass-main {
        padding: 1rem;
    }

    .ticket-pass-perforation {
        width: auto;
        height: 0;
        border-inline-start: none;
        border-top: 2px dashed rgba(var(--primary-rgb), 0.2);
        margin: 0 1rem;
    }

    .ticket-pass-perforation::before,
    .ticket-pass-perforation::after {
        top: 50%;
        left: auto;
        transform: translateY(-50%);
    }

    .ticket-pass-perforation::before {
        inset-inline-start: -9px;
    }

    .ticket-pass-perforation::after {
        inset-inline-end: -9px;
        bottom: auto;
    }

    .ticket-pass-qr-panel {
        flex: 1 1 auto;
        border-inline-start: none;
        border-top: 1px solid var(--border);
        padding: 1rem;
    }

    .ticket-pass-qr-wrap {
        width: min(160px, 70vw);
        height: min(160px, 70vw);
    }

    .ticket-pass-point strong,
    .ticket-pass-trip-row span {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .search-bar {
        max-width: none;
        width: 100%;
    }

    .login-page {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .login-card {
        max-width: none;
    }
}

@media (max-width: 360px) {
    .bottom-tab {
        font-size: 0.58rem;
        padding: 0.35rem 0.1rem;
        gap: 0.15rem;
    }

    .bottom-tab .bi {
        font-size: 1.1rem;
    }
}

/* Pill buttons & inputs */
.btn {
    border-radius: var(--radius-pill);
    font-weight: 500;
    padding-inline: 1.1rem;
}

.btn-sm {
    padding-inline: 0.85rem;
}

.form-control,
.form-select {
    border-radius: 0.75rem;
}

.input-group .form-control {
    border-radius: 0.75rem 0 0 0.75rem;
}

[dir="rtl"] .input-group .form-control {
    border-radius: 0 0.75rem 0.75rem 0;
}

.input-group .btn {
    border-radius: 0 0.75rem 0.75rem 0;
}

[dir="rtl"] .input-group .btn {
    border-radius: 0.75rem 0 0 0.75rem;
}

/* Table action buttons */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.status-badge.status-active {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.status-badge.status-inactive {
    background: rgba(220, 53, 69, 0.12);
    color: #b91c1c;
}

.btn-group-actions {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-action-edit,
.btn-action-delete,
.btn-action-toggle,
.btn-action-view {
    font-size: 0.8rem;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid;
    background: transparent;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-action-edit {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-action-edit:hover {
    background: var(--primary);
    color: #fff;
}

.btn-action-delete {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-action-delete:hover {
    background: #dc3545;
    color: #fff;
}

.btn-action-toggle {
    color: #198754;
    border-color: #198754;
}

.btn-action-toggle:hover {
    background: #198754;
    color: #fff;
}

.btn-action-toggle.is-inactive {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-action-toggle.is-inactive:hover {
    background: #6c757d;
    color: #fff;
}

.btn-action-view {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
    display: inline-block;
}

.btn-action-view:hover {
    background: var(--accent);
    color: #fff;
}

.table-empty {
    padding: 2.5rem 1rem !important;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* CRUD Modals */
.modal-backdrop.show {
    backdrop-filter: blur(3px);
}

.crud-modal .modal-content {
    border: none;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(var(--primary-rgb), 0.2);
}

.crud-modal .modal-header {
    background: var(--primary);
    color: #fff;
    border-bottom: 3px solid var(--accent);
    padding: 1rem 1.25rem;
}

.crud-modal .modal-header-danger {
    background: #dc3545;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.crud-modal .modal-header-warning {
    background: var(--primary);
    border-bottom: 3px solid var(--accent);
}

.crud-modal .modal-header-warning .bi-exclamation-triangle {
    color: var(--accent);
}

.app-dialog-message {
    white-space: pre-line;
}

.app-dialog-footer {
    border-color: var(--border) !important;
}

.crud-modal .modal-body {
    padding: 1.25rem;
    max-height: calc(100vh - 200px);
}

.crud-modal-loading {
    display: flex;
    justify-content: center;
    padding: 2.5rem;
}

.modal-form-footer {
    border-color: var(--border) !important;
}

/* Toast */
.toast {
    border-radius: var(--radius-pill);
    min-width: min(280px, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
}

form.is-submitting {
    pointer-events: none;
}

form.is-submitting .btn[type="submit"]:disabled {
    opacity: 0.85;
}

/* Icons */
.icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.page-header .page-title-icon {
    color: var(--accent);
    margin-inline-end: 0.35rem;
}

.btn-action-edit .bi,
.btn-action-delete .bi,
.btn-action-toggle .bi,
.btn-action-view .bi {
    font-size: 0.85rem;
}

.table-empty-icon {
    font-size: 2rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.topbar-end .btn .bi,
.topbar-start .bi {
    font-size: 0.95rem;
}

.branch-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Booking wizard */
.booking-wizard {
    max-width: 960px;
    margin-inline: auto;
}

.booking-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.booking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 72px;
}

.booking-step-num {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--border);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.booking-step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.booking-step.active .booking-step-num {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}

.booking-step.active .booking-step-label {
    color: var(--primary);
    font-weight: 700;
}

.booking-step.completed .booking-step-num {
    background: var(--primary);
    color: #fff;
}

.booking-step-line {
    flex: 1;
    min-width: 2rem;
    max-width: 4rem;
    height: 2px;
    background: var(--border);
    margin-bottom: 1.25rem;
}

.wizard-panel-title {
    color: var(--primary);
    font-weight: 700;
}

.booking-currency-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(var(--primary-rgb), 0.06);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    color: var(--primary);
}

.booking-currency-badge strong {
    color: var(--accent);
}

.booking-leg .card-header {
    background: rgba(var(--primary-rgb), 0.04);
    font-weight: 600;
    color: var(--primary);
}

.route-timeline {
    position: relative;
    padding-inline-start: 1.5rem;
    border-inline-start: 2px solid var(--border);
    margin-inline-start: 0.5rem;
}

.route-timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

.route-timeline-item.last {
    padding-bottom: 0;
}

.route-timeline-dot {
    position: absolute;
    inset-inline-start: -1.65rem;
    top: 0.25rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--accent);
}

.route-timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.route-timeline-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-hover);
}

.trip-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    cursor: pointer;
    background: #fff;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.trip-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--card-accent);
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.trip-card:hover::before,
.trip-card.selected::before {
    opacity: 1;
}

.trip-card:hover {
    border-color: rgba(var(--accent-rgb), 0.35);
}

.trip-card.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
    box-shadow: var(--card-shadow-hover);
}

.trip-card-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.trip-card-time {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.trip-card-date,
.trip-card-route,
.trip-card-bus {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.trip-card-select {
    color: var(--border);
    font-size: 1.25rem;
}

.trip-card.selected .trip-card-select {
    color: var(--accent);
}

.trip-card.disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

.trip-card-seats {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    padding: 0.2rem 0.65rem;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: var(--radius-pill);
}

.trip-card-seats.no-seats {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.seats-limit-hint {
    padding: 0.75rem 1rem;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 0.65rem;
    font-size: 0.9rem;
    color: var(--primary);
}

.passenger-card .card-header {
    background: rgba(var(--primary-rgb), 0.04);
    font-weight: 600;
    color: var(--primary);
}

.price-preview-box {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.04), rgba(var(--accent-rgb), 0.06));
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
}

.price-preview-total {
    font-size: 1.25rem;
    color: var(--primary);
}

.review-section h6 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.review-leg {
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.login-input-icon {
    color: var(--text-muted);
}

.login-input-group .input-group-text {
    background: #fff;
    border-color: var(--border);
}

.btn-row-action {
    padding: 0.15rem 0.4rem;
    line-height: 1.2;
}

.table-add-row {
    margin-top: 0.5rem;
}

.table-add-row .bi {
    margin-inline-end: 0.25rem;
}

/* Ticket pass (boarding pass style) */
.ticket-passes-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ticket-pass {
    position: relative;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.ticket-pass-accent {
    height: 4px;
    background: var(--card-accent);
}

.ticket-pass-inner {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
}

.ticket-pass-main {
    flex: 1 1 280px;
    padding: 1.25rem 1.5rem;
    min-width: 0;
}

.ticket-pass-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ticket-pass-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticket-pass-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.ticket-pass-brand-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    line-height: 1.2;
}

.ticket-pass-brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ticket-pass-route {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--accent-rgb), 0.06));
    border-radius: 0.75rem;
}

.ticket-pass-point {
    flex: 1;
    min-width: 0;
}

.ticket-pass-point-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.ticket-pass-point strong {
    display: block;
    color: var(--primary);
    font-size: 1rem;
    word-break: break-word;
}

.ticket-pass-arrow {
    color: var(--accent);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ticket-pass-passenger {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.ticket-pass-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.ticket-pass-passenger-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.ticket-pass-passenger-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ticket-pass-sep {
    margin: 0 0.35rem;
}

.ticket-pass-trip {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.ticket-pass-trip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.ticket-pass-trip-row .bi {
    color: var(--accent);
}

.ticket-pass-booking-ref {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-pass-booking-ref strong {
    color: var(--primary);
    margin-inline-start: 0.35rem;
}

.ticket-pass-perforation {
    width: 0;
    border-inline-start: 2px dashed rgba(var(--primary-rgb), 0.2);
    margin: 1rem 0;
    position: relative;
}

.ticket-pass-perforation::before,
.ticket-pass-perforation::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--bg);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
}

.ticket-pass-perforation::before { top: -9px; }
.ticket-pass-perforation::after { bottom: -9px; }

.ticket-pass-qr-panel {
    flex: 0 0 220px;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.03), rgba(var(--accent-rgb), 0.04));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-inline-start: 1px solid var(--border);
}

.ticket-pass-qr-wrap {
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.08);
    margin-bottom: 0.75rem;
}

.ticket-pass-qr-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ticket-pass-number-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ticket-pass-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.ticket-pass-number:hover {
    background: rgba(var(--primary-rgb), 0.06);
}

.ticket-pass-qr-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    max-width: 180px;
    line-height: 1.4;
}

.ticket-print-sheet {
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.ticket-print-header {
    margin-bottom: 1rem;
    text-align: end;
}

.print-body {
    background: #fff;
}

@media print {
    .screen-only,
    .app-shell,
    .app-sidebar,
    .app-topbar,
    .app-bottom-tabs,
    .mobile-nav-drawer {
        display: none !important;
    }

    body.print-body {
        background: #fff;
    }

    .ticket-print-sheet {
        padding: 0;
        max-width: none;
    }

    .ticket-pass {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }

    .ticket-pass-number {
        cursor: default;
    }

    .ticket-pass-number .bi {
        display: none;
    }
}

/* Trip manifest print — passengers (portrait) */
.trip-manifest-passengers-sheet {
    padding: 0.5rem;
    max-width: 210mm;
    margin: 0 auto;
    color: #1a1a1a;
}

.trip-manifest-passengers-page {
    background: #fff;
    padding: 0.25rem 0;
}

.trip-manifest-passengers-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--primary, #1e3a5f);
}

.trip-manifest-passengers-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.trip-manifest-passengers-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.trip-manifest-passengers-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary, #1e3a5f);
    line-height: 1.2;
}

.trip-manifest-passengers-trip-line {
    margin: 0.1rem 0 0;
    font-size: 0.62rem;
    color: #4b5563;
    line-height: 1.35;
}

.trip-manifest-passengers-pagenum {
    font-size: 0.65rem;
    color: #6b7280;
    white-space: nowrap;
}

.trip-manifest-passengers-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.62rem;
    color: #374151;
}

.trip-manifest-passengers-table {
    width: 100%;
    table-layout: fixed;
    font-size: 7.5pt;
    line-height: 1.15;
    margin-bottom: 0.35rem;
    border-collapse: collapse;
}

.trip-manifest-passengers-table thead th {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 1px 3px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.trip-manifest-passengers-table tbody td {
    border: 1px solid #e2e8f0;
    padding: 1px 3px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 4.5mm;
    max-height: 4.5mm;
}

.trip-manifest-passengers-table .col-num { width: 5%; }
.trip-manifest-passengers-table .col-ticket { width: 14%; }
.trip-manifest-passengers-table .col-name { width: 28%; }
.trip-manifest-passengers-table .col-type { width: 4%; }
.trip-manifest-passengers-table .col-route { width: 44%; }
.trip-manifest-passengers-table .col-board { width: 5%; }

.trip-manifest-passengers-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trip-manifest-passengers-route {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 7pt;
}

.trip-manifest-passengers-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.4rem;
}

.trip-manifest-passengers-signature-line {
    border-top: 1px solid #374151;
    padding-top: 0.2rem;
    font-size: 0.62rem;
    color: #4b5563;
}

.trip-manifest-passengers-footer {
    margin-top: 0.25rem;
    font-size: 0.58rem;
    color: #9ca3af;
    text-align: center;
}

.trip-manifest-passengers-page-break {
    break-after: page;
    page-break-after: always;
}

/* Trip manifest print — parcels (landscape) */
.trip-manifest-parcels-sheet {
    padding: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    color: #1a1a1a;
}

.trip-manifest-sheet {
    padding: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    color: #1a1a1a;
}

.trip-manifest-page {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.trip-manifest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary, #1e3a5f);
}

.trip-manifest-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.trip-manifest-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.trip-manifest-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary, #1e3a5f);
    line-height: 1.2;
}

.trip-manifest-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.trip-manifest-doc-meta {
    text-align: end;
    font-size: 0.85rem;
    line-height: 1.6;
}

.trip-manifest-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

.trip-manifest-info-grid-compact {
    grid-template-columns: repeat(4, 1fr);
}

.trip-manifest-info-grid .label {
    display: block;
    color: #6b7280;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.trip-manifest-info-grid .value {
    font-weight: 600;
}

.trip-manifest-stops {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.82rem;
}

.trip-manifest-stops-label {
    font-weight: 600;
    color: var(--primary, #1e3a5f);
    margin-inline-end: 0.35rem;
}

.trip-manifest-stop-arrow {
    color: #9ca3af;
    font-size: 0.75rem;
}

.trip-manifest-stop {
    font-weight: 500;
}

.trip-manifest-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.trip-manifest-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 0.45rem 0.5rem;
    background: #f0f4f8;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.trip-manifest-stat .num {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary, #1e3a5f);
    line-height: 1.2;
}

.trip-manifest-stat .lbl {
    display: block;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.trip-manifest-table {
    font-size: 0.78rem;
    margin-bottom: 1rem;
}

.trip-manifest-table thead th {
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
    padding: 0.35rem 0.5rem;
}

.trip-manifest-table tbody td {
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
}

.trip-manifest-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.trip-manifest-check {
    font-weight: 700;
    color: #059669;
}

.trip-manifest-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
    font-style: italic;
}

.trip-manifest-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
}

.trip-manifest-signature-line {
    border-top: 1px solid #374151;
    padding-top: 0.35rem;
    font-size: 0.78rem;
    color: #4b5563;
}

.trip-manifest-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #d1d5db;
    font-size: 0.72rem;
    color: #9ca3af;
    text-align: center;
}

.trip-manifest-page-break {
    height: 0;
    margin: 0;
    border: none;
}

@media print {
    @page trip-manifest-passengers {
        size: A4 portrait;
        margin: 8mm;
    }

    @page trip-manifest-parcels {
        size: A4 landscape;
        margin: 12mm;
    }

    .trip-manifest-passengers-sheet {
        page: trip-manifest-passengers;
        padding: 0;
        max-width: none;
    }

    .trip-manifest-passengers-page {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .trip-manifest-passengers-table thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .trip-manifest-parcels-sheet {
        page: trip-manifest-parcels;
        padding: 0;
        max-width: none;
    }

    .trip-manifest-parcels-sheet .trip-manifest-page {
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .trip-manifest-parcels-sheet .trip-manifest-table thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .trip-manifest-parcels-sheet .trip-manifest-stat {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .trip-manifest-sheet {
        padding: 0;
        max-width: none;
    }

    .trip-manifest-page {
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .trip-manifest-page-break {
        break-after: page;
        page-break-after: always;
    }

    .trip-manifest-table thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .trip-manifest-stat {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .trip-manifest-stops {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@media (max-width: 768px) {
    .trip-manifest-info-grid,
    .trip-manifest-info-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .trip-manifest-signatures {
        grid-template-columns: 1fr;
    }
}

/* Boarding gate */

/* Boarding gate */
.boarding-page {
    max-width: 1200px;
    margin: 0 auto;
}

.boarding-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.boarding-hero-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.boarding-hero-title .bi {
    color: var(--accent);
    margin-inline-end: 0.35rem;
}

.boarding-hero-sub {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.boarding-date-form {
    min-width: 160px;
}

.boarding-trip-chips {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.boarding-trip-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: #fff;
    text-decoration: none;
    color: var(--text);
    min-width: 140px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.boarding-trip-chip:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.boarding-trip-chip.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--accent-rgb), 0.08));
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.1);
}

.boarding-trip-chip-time {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}

.boarding-trip-chip-route {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.boarding-trip-chip-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.boarding-empty-trips {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.boarding-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.boarding-stat {
    flex: 1 1 100px;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(var(--primary-rgb), 0.05);
}

.boarding-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.boarding-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.boarding-stat-success {
    background: rgba(25, 135, 84, 0.08);
}

.boarding-stat-success .boarding-stat-value {
    color: #198754;
}

.boarding-stat-warning {
    background: rgba(var(--accent-rgb), 0.1);
}

.boarding-stat-warning .boarding-stat-value {
    color: var(--accent);
}

.boarding-scan-card {
    position: relative;
}

.boarding-qr-reader {
    width: 100%;
    min-height: 280px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #111;
}

.boarding-qr-reader video {
    border-radius: 0.75rem;
}

.boarding-qr-placeholder {
    position: absolute;
    inset: 1.25rem 1.25rem auto 1.25rem;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    background: rgba(var(--primary-rgb), 0.04);
    border-radius: 0.75rem;
    border: 1px dashed var(--border);
    pointer-events: none;
    z-index: 1;
}

.boarding-qr-placeholder .bi {
    font-size: 2rem;
    color: var(--accent);
}

.boarding-manual-input {
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.02em;
}

.boarding-row-boarded {
    opacity: 0.72;
}

.boarding-passenger-modal .modal-content {
    border: none;
    border-radius: var(--radius-card);
    overflow: hidden;
}

.boarding-modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
}

.boarding-modal-header .modal-title .bi {
    margin-inline-end: 0.35rem;
}

.boarding-modal-body {
    position: relative;
}

.boarding-passenger-card {
    text-align: center;
    margin-bottom: 1.25rem;
}

.boarding-passenger-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.boarding-passenger-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.boarding-passenger-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.boarding-detail-list dt {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.boarding-detail-list dd {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.65rem;
}

.boarding-modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.boarding-board-btn {
    min-width: 140px;
    font-weight: 600;
}

.boarding-success-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    animation: boardingFadeIn 0.2s ease;
}

.boarding-success-check {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: boardingPop 0.35s ease;
}

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

@keyframes boardingPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 991.98px) {
    .boarding-qr-reader,
    .boarding-qr-placeholder {
        min-height: 240px;
        height: 240px;
    }
}

/* Parcel label */
.parcel-labels-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.parcel-label {
    position: relative;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.parcel-label-accent {
    height: 4px;
    background: var(--card-accent);
}

.parcel-label-inner {
    display: flex;
    flex-wrap: wrap;
}

.parcel-label-main {
    flex: 1 1 280px;
    padding: 1.25rem 1.5rem;
}

.parcel-label-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.parcel-label-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.parcel-label-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.parcel-label-brand-name {
    font-weight: 700;
    color: var(--primary);
}

.parcel-label-brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.parcel-label-route {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--accent-rgb), 0.06));
    border-radius: 0.75rem;
}

.parcel-label-point {
    flex: 1;
    min-width: 0;
}

.parcel-label-point-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.parcel-label-point strong {
    color: var(--primary);
}

.parcel-label-arrow {
    color: var(--accent);
}

.parcel-label-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.parcel-label-party-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.parcel-label-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.88rem;
}

.parcel-label-meta .bi {
    color: var(--accent);
    margin-inline-end: 0.35rem;
}

.parcel-label-perforation {
    width: 0;
    border-inline-start: 2px dashed rgba(var(--primary-rgb), 0.2);
    margin: 1rem 0;
}

.parcel-label-qr-panel {
    flex: 0 0 220px;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.03), rgba(var(--accent-rgb), 0.04));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-inline-start: 1px solid var(--border);
}

.parcel-label-qr-wrap {
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.parcel-label-qr-wrap svg {
    width: 100%;
    height: 100%;
}

.parcel-label-number-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.parcel-label-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}

.parcel-label-qr-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@media print {
    .parcel-label {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Parcel operations (shared with boarding patterns) */
.parcel-ops-page,
.parcel-delivery-page {
    max-width: 1200px;
    margin: 0 auto;
}

.parcel-ops-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.parcel-ops-hero-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.parcel-ops-hero-title .bi {
    color: var(--accent);
    margin-inline-end: 0.35rem;
}

.parcel-ops-hero-sub {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.parcel-ops-date-form {
    min-width: 160px;
}

.parcel-ops-trip-chips {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
}

.parcel-ops-trip-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: #fff;
    text-decoration: none;
    color: var(--text);
    min-width: 140px;
}

.parcel-ops-trip-chip.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--accent-rgb), 0.08));
}

.parcel-ops-trip-chip-time {
    font-weight: 700;
    color: var(--primary);
}

.parcel-ops-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.parcel-ops-stat {
    flex: 1 1 100px;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(var(--primary-rgb), 0.05);
}

.parcel-ops-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.parcel-ops-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.parcel-ops-stat-success {
    background: rgba(25, 135, 84, 0.08);
}

.parcel-ops-stat-success .parcel-ops-stat-value {
    color: #198754;
}

.parcel-ops-stat-warning {
    background: rgba(var(--accent-rgb), 0.1);
}

.parcel-ops-stat-warning .parcel-ops-stat-value {
    color: var(--accent);
}

.parcel-ops-scan-card {
    position: relative;
}

.parcel-ops-qr-reader {
    width: 100%;
    min-height: 280px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #111;
}

.parcel-ops-qr-placeholder {
    position: absolute;
    inset: 1.25rem 1.25rem auto 1.25rem;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    background: rgba(var(--primary-rgb), 0.04);
    border-radius: 0.75rem;
    border: 1px dashed var(--border);
    pointer-events: none;
    z-index: 1;
}

.parcel-ops-manual-input {
    font-family: ui-monospace, Consolas, monospace;
}

.parcel-ops-row-done {
    opacity: 0.72;
}

.parcel-ops-modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}

.parcel-ops-modal-body {
    position: relative;
}

.parcel-ops-card {
    text-align: center;
    margin-bottom: 1rem;
}

.parcel-ops-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.parcel-ops-name {
    font-weight: 700;
    color: var(--primary);
    font-family: ui-monospace, Consolas, monospace;
}

.parcel-ops-detail-list dt {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.parcel-ops-success-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.parcel-ops-success-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* Delivery stepper */
.delivery-stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
}

.delivery-step.active,
.delivery-step.done {
    opacity: 1;
}

.delivery-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.delivery-step.active .delivery-step-num {
    background: var(--accent);
    color: #fff;
}

.delivery-step.done .delivery-step-num {
    background: #198754;
    color: #fff;
}

.delivery-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    min-width: 24px;
}

.delivery-qr-display {
    max-width: 220px;
    margin: 0 auto;
    padding: 0.75rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
}

.delivery-qr-display svg {
    width: 100%;
    height: auto;
}

@media (max-width: 767.98px) {
    .parcel-label-inner {
        flex-direction: column;
    }

    .parcel-label-parties {
        grid-template-columns: 1fr;
    }

    .parcel-label-qr-panel {
        flex: 1 1 auto;
        border-inline-start: none;
        border-top: 1px solid var(--border);
    }
}

/* Settings — branding preview */
.branding-logo-preview {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

.branding-preview-shell {
    display: flex;
    min-height: 160px;
    background: #f8fafc;
}

.branding-preview-sidebar {
    width: 38%;
    padding: 1rem;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.branding-preview-logo {
    max-height: 40px;
    max-width: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.branding-preview-main {
    flex: 1;
    padding: 1rem;
}

.branding-preview-topbar {
    height: 28px;
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    background: var(--primary);
    border-bottom: 3px solid var(--accent);
}

.branding-preview-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.branding-hex-input {
    font-family: ui-monospace, Consolas, monospace;
    text-transform: uppercase;
}
