* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mobile admin shell: matches the passenger and driver off-canvas navigation. */
.mobile-menu-toggle,
.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .top-nav {
        min-height: 68px;
        padding: 9px 12px;
        gap: 8px;
    }

    .top-nav .logo {
        gap: 7px;
        min-width: 0;
    }

    .top-nav .logo img {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .top-nav .logo-text {
        min-width: 0;
    }

    .top-nav .logo-text h2 {
        font-size: 1.05rem;
    }

    .top-nav .logo-text p {
        display: none;
    }

    .top-nav .nav-right {
        margin-left: auto;
        gap: 6px;
        min-width: 0;
    }

    .top-nav .user-info .greeting,
    .top-nav .user-info .logout-top-btn {
        display: none;
    }

    .top-nav .user-info {
        gap: 0;
    }

    .top-nav .avatar {
        width: 36px;
        height: 36px;
    }

    .notification-btn {
        width: 40px;
        height: 40px;
    }

    .notification-dropdown {
        position: fixed;
        top: 66px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: min(70vh, 520px);
    }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 3201;
    }

    .container {
        display: block;
        width: 100%;
        height: auto;
        min-height: calc(100dvh - 68px);
        overflow: visible;
    }

    .sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, 310px);
        height: 100dvh;
        padding: 82px 0 20px;
        z-index: 3200;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.28);
    }

    .sidebar.mobile-menu-open {
        transform: translateX(0);
    }

    .sidebar .menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: visible;
    }

    .sidebar .menu-item {
        width: 100%;
        min-height: 52px;
        flex-shrink: 0;
        border-left: 4px solid transparent;
        border-bottom: 0;
    }

    .sidebar .menu-item.active {
        border-left-color: #87ceeb;
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 3190;
        cursor: pointer;
    }

    .mobile-menu-overlay.mobile-menu-open {
        display: block;
    }

    main.content,
    .content {
        width: 100%;
        min-width: 0;
        max-height: none !important;
        overflow-x: hidden;
        overflow-y: visible !important;
        padding: 14px 12px 32px;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .section-header h1 {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    .overview-cards,
    .dashboard-grid,
    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    .management-header,
    .filter-section,
    .report-controls,
    .date-filter,
    .profile-actions {
        width: 100%;
        align-items: stretch;
    }

    .filter-section,
    .report-controls,
    .date-filter {
        flex-direction: column;
    }

    .search-input,
    .filter-select,
    .date-filter input,
    .date-filter select,
    .management-header .add-btn {
        width: 100%;
        max-width: none;
        min-height: 44px;
    }

    .table-container,
    .management-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bookings-table,
    .management-table {
        min-width: 680px;
    }

    .profile-container {
        width: 100%;
        padding: 0;
    }

    .profile-card {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px 22px;
    }

    .profile-actions {
        flex-direction: column;
        padding: 12px 0 0;
    }

    .profile-actions button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .modal {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 24px);
        margin: 0;
        overflow-y: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer button {
        flex: 1 1 130px;
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .top-nav {
        padding-inline: 8px;
    }

    .top-nav .avatar {
        display: none;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .card,
    .panel,
    .chart-card {
        padding: 14px;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
    }
}

html, body {
    min-height: 100%;
}

body {
    background: linear-gradient(180deg, #87ceeb 0%, #e0f6ff 25%, #ffffff 50%, #e0f6ff 75%, #87ceeb 100%);
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: none;
}

body > * {
    position: relative;
    z-index: 1;
}

/* ============ TOP NAVIGATION ============ */
#edit-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.45);
}

#edit-profile-dialog {
    width: 100%;
    max-width: 760px;
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

#edit-profile-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 40px);
    margin: 0;
}

#edit-profile-title {
    flex-shrink: 0;
    margin: 0;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    color: #2c6ef2;
    font-size: 1.25rem;
}

.edit-profile-body {
    min-height: 0;
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.edit-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.edit-profile-grid > div, .edit-profile-qr-upload { min-width: 0; }
#edit-profile-form input { max-width: 100%; min-width: 0; }
.edit-profile-qr { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.edit-profile-qr-upload { flex: 1 1 170px; }
#editCompanyGcashQRFile { width: 100%; }
#edit-profile-footer { flex-shrink: 0; flex-wrap: wrap; }

@media (max-width: 600px) {
    #edit-profile-modal { padding: 12px; }
    #edit-profile-dialog, #edit-profile-form { max-height: calc(100dvh - 24px); }
    .edit-profile-grid { grid-template-columns: minmax(0, 1fr); }
    #edit-profile-title, .edit-profile-body { padding: 16px; }
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: linear-gradient(135deg, #405d73 0%, #2d4a63 100%);
    color: white;
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
}

.logo-text p {
    font-size: 0.85rem;
    color: #b0d4b0;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.logout-top-btn {
    border: none;
    background: #e74c3c;
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.logout-top-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.greeting {
    text-align: right;
}

.greeting p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.greeting small {
    display: block;
    font-size: 0.8rem;
    color: #b0d4b0;
}

.logout-btn {
    background: #ff4d4d;
    border: none;
    color: white;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #ff1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 77, 77, 0.3);
}

/* ============ MAIN CONTAINER ============ */
.container {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    min-height: calc(100vh - 80px);
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #405d73 0%, #2d4a63 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    position: relative;
}

.sidebar::before {
    content: none;
}

.sidebar * {
    position: relative;
    z-index: 1;
}

.menu {
    list-style: none;
}

.menu-item {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
    color: white;
}

.menu-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #81d4fa;
    padding-left: 24px;
}

.menu-item.active {
    background: rgba(129, 212, 250, 0.2);
    border-left-color: #81d4fa;
    color: #81d4fa;
}

/* submenu removed — top-level menu items used for Dashboard, Bookings, Reports */

.logout-item {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.logout-item:hover {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
}

/* ============ MAIN CONTENT ============ */
.content {
    position: relative;
    flex: 1;
    padding: 28px;
    background: transparent;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section {
    padding-bottom: 24px;
}

.content > * {
    position: relative;
    z-index: 1;
}

.section {
    display: none;
    animation: fadeIn 0.25s ease;
    overflow: visible;
}

.section.active {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: visible;
}

/* Dashboard panels now use a responsive grid */
#dashboard {
    display: grid;
    gap: 22px;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.dashboard-panels .panel {
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.dashboard-panels .panel .panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
}

.daily-panel .panel-body canvas,
.pie-panel .panel-body canvas {
    width: 100% !important;
    height: 100% !important;
}

.pie-panel .panel-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.section-header { margin-bottom: 22px; }

.preview-table th, .preview-table td { font-size: 0.92rem; padding: 10px; }
.mini-stats small { font-size: 0.8rem; }
.mini-stats strong { font-size: 1.05rem; }

@media (max-height: 820px) {
    .content { padding: 12px; }
    .dashboard-panels { gap: 8px; }
    .dashboard-panels .panel-body { padding: 6px; }
    .preview-table th, .preview-table td { font-size: 0.8rem; padding: 5px; }
    .dashboard-panels .panel-header h3 { font-size: 0.95rem; }
    .daily-panel .panel-body canvas { height: 200px !important; }
    .pie-panel .panel-body canvas { height: 160px !important; max-width: 240px; }
}

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

.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: auto;
    max-width: calc(100vw - 40px);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.toast {
    min-width: 260px;
    max-width: 320px;
    background: rgba(33, 33, 33, 0.95);
    color: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid #2ecc71;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.section-header {
    margin-bottom: 30px;
}
.section-header h1 {
    font-size: 2.4rem;
    color: #0f2b2a;
    margin-bottom: 6px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

/* Date badge shown on the report page (top-right) */
.date-badge {
    position: absolute;
    right: 28px;
    top: 28px;
    background: #ffffff;
    border: 1px solid rgba(15, 43, 42, 0.06);
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(20,40,40,0.06);
    color: #1f4037;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.section-header p {
    color: #666;
    font-size: 0.95rem;
}

/* ============ OVERVIEW CARDS (KPIs) ============ */
.overview-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 18px;
    margin-bottom: 28px;
    align-items: center;
    overflow-x: auto; /* allow horizontal scroll on small viewports */
    padding-bottom: 6px;
}

.card {
    background: #fff;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(30, 60, 60, 0.04);
    border: 1px solid rgba(15, 43, 42, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    flex: 1 1 220px; /* allow cards to sit horizontally and shrink if needed */
    min-width: 220px;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(20, 40, 40, 0.08);
}

.card .card-content { display:flex; flex-direction:column; gap:6px; }
.card .card-label { font-size:0.9rem; color:#788585; font-weight:600; }
.card .card-value { font-size:1.9rem; color:#0f2b2a; font-weight:800; }
.card .card-sub { font-size:0.85rem; color:#98a7a6; } 

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 6px 18px rgba(40, 80, 120, 0.08);
}

/* variations for KPI icons remain but sized to match circle */
.card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.card:nth-child(4) .card-icon {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.card:nth-child(4) .card-icon {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.85rem;
    color: #999;
    margin: 0;
    font-weight: 500;
}

.card-value {
    font-size: 2rem;
    color: #1f4037;
    margin: 5px 0 0 0;
    font-weight: 700;
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* ============ QUICK ACTIONS ============ */
.quick-actions {
    display: flex;
    gap: 15px;
    margin: 18px 0 28px 0;
}

/* ============ DASHBOARD PREVIEWS ============ */
.dashboard-previews {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    margin-bottom: 20px;
}

/* three-column dashboard panels (bookings | pie | daily) */
.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 0.9fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
    align-items: start;
}
.bookings-panel .panel-body, .pie-panel .panel-body, .daily-panel .panel-body { background: white; border-radius:8px; padding:12px; box-shadow:0 2px 8px rgba(0,0,0,0.06); }

@media (max-width: 1024px) {
    .dashboard-panels { grid-template-columns: 1fr 1fr; }
    .dashboard-panels .pie-panel { order: 3; grid-column: span 2; }
}

@media (max-width: 768px) {
    .dashboard-panels { grid-template-columns: 1fr; }
    .dashboard-panels .pie-panel { order: 2; }
}
.panel { background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }
.panel-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid #f2f2f2; }
.panel-header h3 { margin:0; font-size:1rem; color:#1f4037; }
.panel-body { padding:12px 16px; }
.preview-table { width:100%; border-collapse: collapse; }
.preview-table th, .preview-table td { padding:8px; text-align:left; font-size:0.9rem; border-bottom:1px solid #f8f8f8; }
.reports-mini-body { display:flex; align-items:center; gap:12px; }
.mini-stats { display:flex; gap:12px; margin-left:auto; }
.mini-stats div { text-align:right; }
.mini-stats small { color:#888; display:block; }
.mini-stats strong { font-size:1rem; color:#1f4037; }
.action-card {
    background: white;
    border-radius: 8px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 700;
}

.action-card i {
    font-size: 1.1rem;
    color: #3498db;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #e9eef8;
}

/* ============ ACTIVITY FEED ============ */
.activity-feed {
    background: white;
    margin-top: 18px;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.activity-feed h3 {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    color: #1f4037;
}

.feed-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.feed-item:last-child { border-bottom: none; }
.feed-item .time {
    color: #999;
    font-size: 0.8rem;
    min-width: 48px;
}
.feed-item p { margin: 0; color: #444; }

/* ============ TOP DRIVERS ============ */
.top-drivers {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.top-drivers h3 { margin: 0 0 8px 0; font-size: 1.05rem; color: #1f4037; }
.top-drivers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top-drivers li { display: flex; gap: 12px; align-items: center; }
.driver-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.driver-info strong { display: block; }
.driver-info small { color: #888; }

/* ============ BOOKING SECTION ============ */
.booking-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.booking-section h2 {
    color: #1f4037;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* ============ MODAL ============ */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); z-index: 9998; }
.modal#confirmModal,
.modal#infoModal { z-index: 10001; }
.modal#confirmModal .modal-content,
.modal#infoModal .modal-content { z-index: 10002; }
.modal[aria-hidden="false"] { display: flex; }
.modal-content { background: white; width: min(680px, calc(100vw - 40px)); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal-content.small { width: 420px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; background: linear-gradient(135deg,#405d73,#2d4a63); color: #fff; }
.modal-header h3 { margin:0; font-size:1.05rem; }
.modal-body { padding: 18px; color: #333; max-height: 60vh; overflow-y: auto; }
.modal-footer { display:flex; gap:10px; padding: 12px 18px; justify-content:flex-end; background:#fafafa; }
.close-btn { background:transparent; border:none; color:#fff; font-size:1.4rem; cursor:pointer; }

/* ============ SCHEDULE PASSENGER MANIFEST ============ */
.schedule-manifest-modal-content {
    width: min(960px, calc(100vw - 28px));
}

.schedule-manifest-modal-body {
    max-height: 72vh;
    padding: 20px;
    overflow: auto;
    background: #e9eef2;
}

.schedule-manifest-loading,
.schedule-manifest-error {
    padding: 44px 20px;
    text-align: center;
    color: #52606d;
    font-weight: 600;
}

.schedule-manifest-error {
    color: #b42318;
}

.schedule-manifest-sheet {
    width: 760px;
    min-height: 1040px;
    margin: 0 auto;
    padding: 40px 42px 34px;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.completed-trip-download-btn {
    color: #0b6bcb;
}

.completed-trip-download-btn:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.55;
}

.schedule-manifest-brand {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.schedule-manifest-logo {
    width: 88px;
    height: 72px;
    object-fit: contain;
}

.schedule-manifest-company h2 {
    margin: 0 0 3px;
    color: #315b82;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    letter-spacing: 0.04em;
}

.schedule-manifest-company p {
    margin: 2px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    font-weight: 700;
}

.schedule-manifest-title {
    margin: 12px 0 22px;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 27px;
    letter-spacing: 0.06em;
}

.schedule-manifest-trip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 42px;
    margin-bottom: 22px;
}

.schedule-manifest-field {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: end;
    gap: 7px;
    min-width: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    font-weight: 700;
}

.schedule-manifest-field-value {
    min-height: 17px;
    padding: 0 3px 2px;
    overflow: hidden;
    border-bottom: 1px solid #111;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-manifest-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
}

.schedule-manifest-table th,
.schedule-manifest-table td {
    height: 28px;
    padding: 4px 7px;
    border: 1px solid #111;
    box-sizing: border-box;
    vertical-align: middle;
}

.schedule-manifest-table th {
    background: #f3f4f6;
    text-align: center;
    font-size: 12px;
}

.schedule-manifest-table .manifest-number {
    width: 48px;
    text-align: center;
}

.schedule-manifest-table .manifest-gender {
    width: 118px;
    text-align: center;
}

.schedule-manifest-table .manifest-contact {
    width: 135px;
    text-align: center;
}

.schedule-manifest-table .manifest-pickup {
    width: 150px;
    overflow-wrap: anywhere;
}

.schedule-manifest-note {
    margin: 5px 0 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 10px;
    font-weight: 700;
}

.schedule-manifest-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-top: 92px;
}

.schedule-manifest-signature {
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11px;
    font-weight: 700;
}

.schedule-manifest-signature-line {
    display: block;
    margin-bottom: 5px;
    border-top: 1px solid #111;
}

.schedule-manifest-signature-name {
    min-height: 20px;
    padding-bottom: 5px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.schedule-manifest-signature-contact {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px;
    margin-top: 24px;
    text-align: left;
}

.schedule-manifest-signature-contact span:last-child {
    border-bottom: 1px solid #111;
}

@media (max-width: 768px) {
    .schedule-manifest-modal-body {
        padding: 12px;
    }

    .schedule-manifest-sheet {
        margin: 0;
    }
}

.modal .form-row { display:flex; gap:12px; align-items:center; margin-bottom:10px; }
.modal label { font-weight:600; color:#555; display:block; margin-bottom:6px; }

/* ============ CHART PANELS ============ */
.chart-panel { background: white; padding: 12px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

@media (max-width: 768px) {
    .modal-content { width: 92%; }
    .modal-content.small { width: 90%; }
}

/* ============ TABLE CONTROLS ============ */
.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.search-bar {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.3s ease;
}

.search-bar:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

.search-bar::placeholder {
    color: #999;
}

.filter-btn {
    background: linear-gradient(135deg, #2f80ed 0%, #56ccf2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    justify-content: center;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #1c6dcc 0%, #38a4e5 100%);
    transform: translateY(-2px);
}

.search-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.export-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bookings-table thead {
    background: linear-gradient(135deg, #1f4037 0%, #132c1a 100%);
    color: white;
    border-bottom: 2px solid #0d1a14;
}

.bookings-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.bookings-table td {
    padding: 15px;
    border-bottom: 1px solid #e8eaf6;
    border-right: 1px solid #e8eaf6;
    color: #333;
}

.bookings-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.bookings-table td:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

/* ============ ACTION BUTTONS ============ */
.btn-assign,
.btn-approve,
.btn-reject {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-assign {
    background: #3498db;
    color: white;
}

.btn-assign:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-approve {
    background: #2ecc71;
    color: white;
}

.btn-approve:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.btn-reject {
    background: #ff4d4d;
    color: white;
}

.btn-reject:hover {
    background: #e63946;
    transform: translateY(-2px);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.page-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.page-info {
    color: #666;
    font-weight: 600;
}

/* ============ CHART SECTION ============ */
.chart-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.chart-section h2 {
    color: #1f4037;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.chart-date {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

.pie-chart-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.total-income {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.total-income p {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

.total-income h3 {
    font-size: 1.8rem;
    color: #2ecc71;
    margin: 5px 0 0 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .overview-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
    }

    .menu {
        display: flex;
        width: 100%;
        overflow-x: auto;
    }

    .menu-item {
        flex-shrink: 0;
        border-left: none;
        border-bottom: 4px solid transparent;
    }

    .content {
        padding: 15px;
    }

    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .bookings-table {
        font-size: 0.8rem;
    }

    .bookings-table td:last-child {
        flex-direction: column;
    }

    .btn-assign,
    .btn-approve,
    .btn-reject {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-right {
        gap: 10px;
    }

    .logout-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .section-header h1 {
        font-size: 1.5rem;
    }
}

/* ============ MANAGEMENT PAGES STYLES ============ */

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-section {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.schedule-filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 10px;
}

.schedule-filter-panel[hidden] { display: none; }
.schedule-filter-panel label { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-weight: 600; }
.schedule-filter-panel input, .schedule-filter-panel select { width: 100%; min-width: 0; box-sizing: border-box; }
.schedule-filter-panel button { align-self: end; }
#scheduleFilterSummary { margin: 0 0 12px; }

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

.search-input,
.filter-select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}


.add-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.confirm-ok {
    background: linear-gradient(135deg, #09d23c 0%, #132c1a 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-ok:hover {
    background: linear-gradient(135deg, #0abf38 0%, #1f3e16 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 64, 55, 0.3);
}

.confirm-cancel {
    background: linear-gradient(135deg, #ff4d4d 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-cancel:hover {
    background: linear-gradient(135deg, #e63946 0%, #96281b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.table-container {
    background: white;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: auto;
    max-height: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin: 22px 0; /* provide top and bottom spacing from surrounding sections */
    clear: both; /* ensure tables start below floated/grid chart elements */
    position: relative; /* create stacking context so z-index works */
    z-index: 1; /* keep tables above background but below any modals */
    padding: 8px 12px; /* small inner padding to separate header from table */
}

.management-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.management-table thead {
    background: linear-gradient(135deg, #1f4037 0%, #132c1a 100%);
    color: white;
    border-bottom: 2px solid #0d1a14;
}

.management-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.management-table tbody tr {
    border-bottom: 1px solid #e8eaf6;
    border-right: 1px solid #e8eaf6;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.management-table tbody tr:hover {
    background: rgba(46, 204, 113, 0.08);
    transform: translateX(1px);
}

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

.management-table td {
    padding: 15px;
    color: #333;
    font-size: 0.95rem;
}

.status-badge,
.license-badge,
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active,
.license-badge.valid,
.user-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.maintenance {
    background: #fff3cd;
    color: #856404;
}

.status-badge.inactive,
.user-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.license-badge.expiring {
    background: #fff3cd;
    color: #856404;
}

.license-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

.user-badge.suspended {
    background: #f8d7da;
    color: #721c24;
}

.action-btn {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 0;
        line-height: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .action-btn i {
        font-size: 0.95rem;
        line-height: normal;
    }

    .action-btn.icon-only {
        width: 36px;
        min-width: 36px;
        padding: 0;
        font-size: 0;
    }
    .action-btn.icon-only i {
        font-size: 1rem;
    }
.action-btn.edit-btn {
    background: #1e88e5;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.action-btn.edit-btn:hover {
    background: #1976d2;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-btn.view-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.action-btn.view-btn:hover {
    background: linear-gradient(135deg, #27ae60, #219a52);
}

.action-btn.delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.action-btn.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* Table action container */
.management-table td:last-child {
    padding: 10px 15px !important;
    gap: 6px !important;
    min-height: 56px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    /* Make tables scrollable when dataset grows */
}

.table-container,
.management-table-container {
    /* Keep a usable scroll area on short screens and prevent flex shrinking. */
    max-height: max(240px, calc(100vh - 340px));
    max-height: max(240px, calc(100dvh - 340px));
    flex-shrink: 0;
    min-width: 0;
    overflow: auto;
}

.management-table {
    width: 100%;
    border-collapse: collapse;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.prev-btn, .next-btn, .page-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prev-btn:hover, .next-btn:hover, .page-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.page-info { color: #666; font-weight: 600; }

@media (max-width: 768px) {
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .management-table td:last-child {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
}

.edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-btn:hover {
    background: #bbdefb;
    color: #1565c0;
}

.view-btn {
    background: #f0f4ff;
    color: #2ecc71;
}

.view-btn:hover {
    background: #e0e8ff;
    color: #27ae60;
}

.delete-btn {
    background: linear-gradient(135deg, #09d23c 0%, #132c1a 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 64, 55, 0.3);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.prev-btn,
.next-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prev-btn:hover,
.next-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.page-info {
    color: #666;
    font-size: 0.95rem;
}

.page-info strong {
    color: #2ecc71;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .management-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-section {
        width: 100%;
    }

    .management-table {
        font-size: 0.9rem;
    }

    .management-table th,
    .management-table td {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .management-header {
        flex-direction: column;
    }

    .filter-section {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
    }

    .management-table {
        font-size: 0.85rem;
    }

    .management-table th,
    .management-table td {
        padding: 10px;
    }

    .action-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        margin-right: 3px;
    }
}

@media (max-width: 480px) {
    .management-table {
        font-size: 0.75rem;
    }

    .management-table th,
    .management-table td {
        padding: 8px 5px;
    }


    .add-btn {
        width: 100%;
        justify-content: center;
    }

    .action-btn {
        padding: 5px 6px;
        font-size: 0.7rem;
        margin-right: 2px;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .prev-btn,
    .next-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============ PROFILE SECTION ============ */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.profile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #405d73 0%, #2d4a63 100%);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    color: white;
}

.profile-header .profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-title h2 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    color: #fff;
}

.profile-title p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    color: #b0d4b0;
}

.profile-info {
    padding: 25px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.info-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.info-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #1f4037;
    padding-bottom: 10px;
    border-bottom: 2px solid #2ecc71;
}

.info-item {
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
    font-weight: 600;
}

.info-item p {
    margin: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.profile-actions {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.profile-actions .action-btn {
    padding: 12px 24px;
    font-size: 1rem;
    min-width: 140px;
    justify-content: center;
}

.profile-actions .action-btn.edit-btn {
    background: #1e88e5 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3) !important;
    border-radius: 8px !important;  /* Rectangle */
}

.profile-actions .action-btn.edit-btn:hover {
    background: #1976d2 !important;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4) !important;
    border-radius: 8px !important;
}

.profile-actions .action-btn:not(.edit-btn) {
    border-radius: 8px !important;
    min-height: 48px !important;
}

.profile-actions .action-btn.secondary-btn {
    background: linear-gradient(135deg, #757575, #616161) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.profile-actions .action-btn.secondary-btn:hover {
    background: linear-gradient(135deg, #616161, #424242) !important;
}

.secondary-btn {
    background: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background: #5a6268;
}

/* Responsive profile */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}

/* Normalize profile avatar size across dashboards */
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #5e35b1;
    object-fit: cover;
}

.profile-container {
    max-width: 980px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 14px 46px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.profile-title h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #1f4037;
}

.profile-title p {
    margin: 6px 0 0;
    color: #777;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.info-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 18px;
}

.info-section h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: #1f4037;
}

.info-item {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.info-item label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.info-item p {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-actions .action-btn {
    flex: 1;
    min-width: 180px;
}

/* ============ NOTIFICATION SYSTEM ============ */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 360px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #405d73 0%, #2d4a63 100%);
    color: white;
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
}

.notification-header { flex-wrap: wrap; gap: 10px; }
.notification-header-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.notification-header-actions .delete-read-btn { background: #b42318; }
.notification-header-actions .delete-read-btn:hover { background: #912018; }
.notification-header-actions button:disabled { opacity: .6; cursor: wait; }

.mark-read-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mark-read-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e3f2fd;
}

.notification-item.unread:hover {
    background: #bbdefb;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-icon.booking {
    background: #e3f2fd;
    color: #1976d2;
}

.notification-icon.user {
    background: #e8f5e9;
    color: #2e7d32;
}

.notification-icon.system {
    background: #fff3e0;
    color: #ef6c00;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-delete-btn {
    align-self: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.notification-delete-btn:hover,
.notification-delete-btn:focus-visible {
    background: #fee2e2;
    color: #dc2626;
    outline: none;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

.notification-content p strong {
    color: #1f4037;
}

.notification-time {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-empty i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

/* Dropdown arrow */
.notification-wrapper::after {
    content: '';
    position: absolute;
    top: 45px;
    right: 15px;
    border: 6px solid transparent;
    border-bottom-color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-wrapper.show-arrow::after {
    opacity: 1;
}

/* Keep these shell overrides last so older responsive rules cannot turn the
   mobile sidebar back into a horizontal strip. */
@media (max-width: 1024px) {
    body.mobile-nav-open { overflow: hidden; }

    .top-nav {
        min-height: 68px;
        padding: 9px 12px;
        gap: 8px;
    }

    .top-nav .logo { gap: 7px; min-width: 0; }
    .top-nav .logo img { width: 42px; height: 42px; flex: 0 0 42px; }
    .top-nav .logo-text { min-width: 0; }
    .top-nav .logo-text h2 { font-size: 1.05rem; }
    .top-nav .logo-text p,
    .top-nav .user-info .greeting,
    .top-nav .user-info .logout-top-btn { display: none; }
    .top-nav .nav-right { margin-left: auto; gap: 6px; min-width: 0; }
    .top-nav .user-info { gap: 0; }
    .top-nav .avatar { width: 36px; height: 36px; }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 3201;
    }

    .container {
        display: block;
        width: 100%;
        height: auto;
        min-height: calc(100dvh - 68px);
        overflow: visible;
    }

    .sidebar {
        display: block;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 310px);
        height: 100dvh;
        padding: 82px 0 20px;
        z-index: 3200;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.28);
    }

    .sidebar.mobile-menu-open { transform: translateX(0); }
    .sidebar .menu { display: flex; flex-direction: column; width: 100%; overflow: visible; }
    .sidebar .menu-item {
        width: 100%;
        min-height: 52px;
        flex-shrink: 0;
        border-left: 4px solid transparent;
        border-bottom: 0;
    }
    .sidebar .menu-item.active { border-left-color: #87ceeb; }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 3190;
        cursor: pointer;
    }
    .mobile-menu-overlay.mobile-menu-open { display: block; }

    main.content,
    .content {
        width: 100%;
        min-width: 0;
        max-height: none !important;
        overflow-x: hidden;
        overflow-y: visible !important;
        padding: 14px 12px 32px;
    }

    .notification-dropdown {
        position: fixed;
        top: 66px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: min(70vh, 520px);
    }

    .table-container,
    .management-table-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .bookings-table,
    .management-table { min-width: 680px; }

    .modal { padding: 12px; align-items: flex-start; overflow-y: auto; }
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 24px);
        margin: 0;
        overflow-y: auto;
    }
}

.schedule-manifest-table .manifest-code { width:110px; overflow-wrap:anywhere; font-family:monospace; }

#bookingsTable tbody tr.discount-refund-row > td { background:#fff4cc; color:#422006; }
#bookingsTable tbody tr.discount-refund-row > td:first-child { border-left:4px solid #b45309; }

/* Schedule status colors persist through filtering and table refreshes. */
#scheduleFilterStatus:has(option:is([value="scheduled"], [value="full"]):checked),
#scheduleFilterStatus option:is([value="scheduled"], [value="full"]),
#schedulesTable tr:has(.status-badge:is(.scheduled, .full)) {
    --schedule-status-bg: #fff7ed;
    --schedule-status-color: #9a3412;
    --schedule-status-accent: #ea580c;
}
#scheduleFilterStatus:has(option:is([value="ongoing"], [value="ready"]):checked),
#scheduleFilterStatus option:is([value="ongoing"], [value="ready"]),
#schedulesTable tr:has(.status-badge.ready) {
    --schedule-status-bg: #f0fdf4;
    --schedule-status-color: #166534;
    --schedule-status-accent: #16a34a;
}
#scheduleFilterStatus:has(option[value="on_way"]:checked),
#scheduleFilterStatus option[value="on_way"],
#schedulesTable tr:has(.status-badge.on_way) {
    --schedule-status-bg: #faf5ff;
    --schedule-status-color: #6b21a8;
    --schedule-status-accent: #9333ea;
}
#scheduleFilterStatus:has(option[value="completed"]:checked),
#scheduleFilterStatus option[value="completed"],
#schedulesTable tr:has(.status-badge.completed) {
    --schedule-status-bg: #eff6ff;
    --schedule-status-color: #1e40af;
    --schedule-status-accent: #2563eb;
}
#scheduleFilterStatus:has(option[value="cancelled"]:checked),
#scheduleFilterStatus option[value="cancelled"],
#schedulesTable tr:has(.status-badge.cancelled) {
    --schedule-status-bg: #fef2f2;
    --schedule-status-color: #991b1b;
    --schedule-status-accent: #dc2626;
}
#scheduleFilterStatus,
#scheduleFilterStatus option {
    background-color: var(--schedule-status-bg, #fff);
    color: var(--schedule-status-color, #374151);
    border-color: var(--schedule-status-accent, #ddd);
}
#scheduleFilterStatus:has(option:checked:not([value=""])) { font-weight: 700; }
#scheduleFilterStatus option[value=""] {
    --schedule-status-bg: #fff;
    --schedule-status-color: #374151;
}
#schedulesTable tbody tr:has(.status-badge:is(.scheduled, .full, .ready, .on_way, .completed, .cancelled)) > td {
    background-color: var(--schedule-status-bg);
    color: #1f2937;
}
#schedulesTable tbody tr:has(.status-badge:is(.scheduled, .full, .ready, .on_way, .completed, .cancelled)) > td:first-child {
    border-left: 4px solid var(--schedule-status-accent);
}
#schedulesTable .status-badge:is(.scheduled, .full, .ready, .on_way, .completed, .cancelled) {
    background-color: var(--schedule-status-bg);
    color: var(--schedule-status-color);
    border: 1px solid var(--schedule-status-accent);
    font-weight: 700;
}

/* Booking status colors apply to the filter, badges, and every table render. */
#bookingStatusFilter:has(option[value="pending"]:checked),
#bookingStatusFilter option[value="pending"],
#bookingsTable tr:has(.status-badge.pending) {
    --booking-status-bg: #fff7ed;
    --booking-status-color: #9a3412;
    --booking-status-accent: #ea580c;
}
#bookingStatusFilter:has(option[value="completed"]:checked),
#bookingStatusFilter option[value="completed"],
#bookingsTable tr:has(.status-badge.completed) {
    --booking-status-bg: #eff6ff;
    --booking-status-color: #1e40af;
    --booking-status-accent: #2563eb;
}
#bookingStatusFilter:has(option[value="cancelled"]:checked),
#bookingStatusFilter option[value="cancelled"],
#bookingsTable tr:has(.status-badge.cancelled) {
    --booking-status-bg: #fef2f2;
    --booking-status-color: #991b1b;
    --booking-status-accent: #dc2626;
}
#bookingStatusFilter:has(option[value="approved"]:checked),
#bookingStatusFilter option[value="approved"],
#bookingsTable tr:has(.status-badge.approved) {
    --booking-status-bg: #f0fdf4;
    --booking-status-color: #166534;
    --booking-status-accent: #16a34a;
}
#bookingStatusFilter,
#bookingStatusFilter option {
    background-color: var(--booking-status-bg, #fff);
    color: var(--booking-status-color, #374151);
    border-color: var(--booking-status-accent, #ddd);
}
#bookingStatusFilter:has(option:checked:not([value=""])) { font-weight: 700; }
#bookingStatusFilter option[value=""] {
    --booking-status-bg: #fff;
    --booking-status-color: #374151;
}
#bookingsTable tbody tr:has(.status-badge:is(.pending, .completed, .cancelled, .approved)) > td {
    background-color: var(--booking-status-bg);
    color: #1f2937;
}
#bookingsTable tbody tr:has(.status-badge:is(.pending, .completed, .cancelled, .approved)) > td:first-child {
    border-left: 4px solid var(--booking-status-accent);
}
#bookingsTable .status-badge:is(.pending, .completed, .cancelled, .approved) {
    background-color: var(--booking-status-bg);
    color: var(--booking-status-color);
    border: 1px solid var(--booking-status-accent);
    font-weight: 700;
}
.discount-refund-badge { display:block; width:fit-content; margin-top:5px; padding:3px 7px; border-radius:5px; background:#92400e; color:white; font-size:12px; font-weight:700; }
.discount-refund-notice { margin:16px 0; padding:14px; border:1px solid #d97706; border-left:5px solid #b45309; border-radius:8px; background:#fff4cc; color:#422006; overflow-wrap:anywhere; }
.discount-refund-notice p { margin:8px 0 0; line-height:1.5; }

.schedule-manifest-table .manifest-refund { width:115px; overflow-wrap:anywhere; }
.refund-returned-btn { margin-top:6px; padding:8px; border:0; border-radius:6px; background:#15803d; color:white; cursor:pointer; }
.refund-returned-btn:disabled { opacity:.6; cursor:wait; }

/* Keep all seven manifest columns inside the printable sheet. On phones the
   modal body scrolls horizontally instead of squeezing names to zero width. */
.schedule-manifest-table th, .schedule-manifest-table td { white-space: normal; overflow-wrap: anywhere; }
.schedule-manifest-table .manifest-number { width: 11%; }
.schedule-manifest-table th { height: 44px; line-height: 1.3; }
.schedule-manifest-table th.manifest-number {
    padding: 8px 4px;
    overflow-wrap: normal;
    word-break: normal;
    text-align: center;
}
.schedule-manifest-table .manifest-name { width: 16%; }
.schedule-manifest-table .manifest-code { width: 16%; }
.schedule-manifest-table .manifest-gender { width: 11%; }
.schedule-manifest-table .manifest-contact { width: 16%; }
.schedule-manifest-table .manifest-pickup { width: 15%; }
.schedule-manifest-table .manifest-refund { width: 15%; }
.schedule-manifest-table .manifest-refund button { width: 100%; white-space: normal; padding: 6px 3px; }

#reports .export-dropdown { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#reports .export-dropdown .filter-select { width: 90px; min-width: 0; }
#reports .report-charts-grid > div > div:first-child { flex-wrap: wrap; gap: 12px; }
.report-export-settings { margin-top:20px; padding:20px; border-radius:12px; background:white; }
.report-annual-export { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.report-export-settings h3 { margin:0 0 6px; }
.report-export-settings p { margin:0 0 14px; color:#64748b; font-size:14px; }
.report-signatories { margin-top:20px; border:1px solid #d6deda; border-radius:8px; padding:16px; }
.report-signatories legend { padding:0 8px; font-weight:700; }
.report-signatory-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.report-signatory-fields label { display:flex; flex-direction:column; gap:8px; }
.report-signatory-fields input { width:100%; min-width:0; }
