:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d9e2f0;
    --accent: #0f62fe;
    --accent-dark: #0b4fd1;
    --accent-soft: #eaf1ff;
    --success: #067647;
    --success-bg: #ecfdf3;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --radius: 18px;
    --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 98, 254, .08), transparent 25%),
        var(--bg);
}

a {
    color: inherit;
}

.container {
    max-width: 780px;
    margin: 42px auto;
    padding: 0 18px;
}

.card,
.panel,
.stat,
.driver-card {
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header {
    padding: 30px 30px 18px;
    background: linear-gradient(180deg, rgba(15, 98, 254, .06), rgba(15, 98, 254, 0));
    border-bottom: 1px solid var(--line);
}

.header h1,
.topbar h1 {
    margin: 0 0 8px;
}

.header p,
.topbar p,
.small,
.muted {
    color: var(--muted);
}

form {
    padding: 26px 30px 30px;
    display: grid;
    gap: 18px;
}

.user-form {
    padding: 0;
}

.grid-2,
.detail-grid,
.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: .96rem;
    font-weight: 600;
}

.required {
    color: #d92d20;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 1rem;
    outline: none;
    background: #fff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 98, 254, .7);
    box-shadow: 0 0 0 4px rgba(15, 98, 254, .12);
}

.actions,
.topbar,
.panel-header,
.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.actions {
    margin-top: 6px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.btns,
.top-actions,
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button,
.button-link,
.secondary-link {
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.secondary,
.secondary-link {
    background: #eef3ff;
    color: #12336b;
}

.primary {
    background: var(--accent);
    color: #fff;
}

.primary:hover {
    background: var(--accent-dark);
}

.notice {
    display: none;
    margin: 0 30px 30px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
    font-weight: 600;
}

.error-notice {
    background: var(--danger-bg);
    border-color: #fecaca;
    color: #991b1b;
}

.layout {
    display: grid;
    grid-template-columns: minmax(250px, 280px) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0f172a;
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 18px;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 28px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-bottom {
    margin-top: 28px;
    padding-top: 16px;
}

.nav-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .92);
    font-weight: 600;
    text-decoration: none;
}

.nav-item.active {
    background: rgba(255, 255, 255, .12);
}

.menu-count {
    margin-left: 6px;
    opacity: .9;
    font-weight: 700;
}

.main {
    padding: 28px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.topbar {
    align-items: flex-start;
}

.topbar h1 {
    font-size: 1.55rem;
}

.top-actions,
.top-actions-wide {
    justify-content: flex-end;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat {
    padding: 20px;
}

.stat .label {
    color: var(--muted);
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 10px;
}

.stat .value {
    font-size: 2rem;
    font-weight: 800;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 24px;
}

.dashboard-content {
    gap: 18px;
}

.dashboard-content .panel-body {
    padding: 16px 18px;
}

.dashboard-content .detail-grid,
.dashboard-content .two {
    gap: 12px;
}

.dashboard-content .quote-box,
.dashboard-content .notes,
.dashboard-content .detail {
    padding: 12px 14px;
}

.panel {
    overflow: hidden;
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.panel-body {
    padding: 18px 22px 22px;
}

.booking-list {
    display: grid;
    gap: 12px;
    max-height: 1300px;
    overflow: auto;
    padding-right: 4px;
}

.booking-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    cursor: pointer;
    background: #fff;
    display: grid;
    gap: 8px;
}

.booking-item:hover,
.booking-item.active {
    border-color: rgba(15, 98, 254, .45);
    box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
    background: #fbfdff;
}

.booking-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.booking-card-top .route {
    font-size: .93rem;
    margin-bottom: 2px;
}

.booking-reference {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 700;
}

.booking-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .82rem;
    color: var(--muted);
}

.booking-card-finance {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.booking-card-finance div {
    background: #f8fbff;
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: 14px;
    padding: 10px 12px;
}

.booking-card-label {
    display: block;
    font-size: .7rem;
    color: var(--muted);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.booking-card-sub {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.3;
    word-break: break-word;
}

.booking-reference {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 700;
}

.badge.new {
    background: var(--accent-soft);
    color: #1849a9;
}

.badge.quoted {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.accepted,
.badge.completed {
    background: var(--success-bg);
    color: var(--success);
}

.badge.cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

.detail-empty {
    color: var(--muted);
    text-align: center;
    padding: 36px 18px;
}

.detail {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.detail .k {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail .v {
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.notes {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
    background: #fff;
    min-height: 90px;
    line-height: 1.6;
}

.quote-box {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: #fbfcff;
}

.quote-box h3 {
    margin: 0 0 10px;
}

.activity {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.activity-item {
    border-left: 3px solid var(--line);
    padding-left: 12px;
    color: var(--muted);
    font-size: .93rem;
    line-height: 1.45;
}

.jobs-grid,
.driver-schedule-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width:1100px) {
    .content {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-home {
        gap: 18px;
    }

    .home-highlights {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .highlight-card {
        width: 100%;
    }

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

    .top-actions,
    .top-actions-wide {
        justify-content: stretch;
        width: 100%;
    }

    .booking-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .booking-card-finance {
        grid-template-columns: 1fr;
    }
}

@media (max-width:680px) {

    .grid-2,
    .detail-grid,
    .two {
        grid-template-columns: 1fr;
    }

    .header,
    form {
        padding-left: 20px;
        padding-right: 20px;
    }

    .notice {
        margin-left: 20px;
        margin-right: 20px;
    }
}

@media (max-width:640px) {
    .main {
        padding: 18px;
    }

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

.active-filter {
    background: #0f62fe;
    color: #fff;
}

.top-actions-wide {
    align-items: center;
}

.top-search {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.top-search input {
    min-width: 260px;
}

.dashboard-home {
    display: grid;
    gap: 24px;
}

.dashboard-home-intro {
    display: grid;
    gap: 18px;
}

.home-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.highlight-card {
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.highlight-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.highlight-card strong {
    display: block;
    font-size: 2.35rem;
    margin-bottom: 10px;
    color: var(--text);
}

.highlight-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.highlight-primary {
    background: linear-gradient(180deg, rgba(15, 98, 254, .09), #fff);
}

.highlight-warning {
    background: linear-gradient(180deg, rgba(255, 181, 50, .12), #fff);
}

.highlight-success {
    background: linear-gradient(180deg, rgba(16, 185, 129, .1), #fff);
}

a.highlight-card {
    text-decoration: none;
    color: inherit;
}

a.stat {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.analytics-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.stat-description {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5;
}

.value-small {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
}

@media (max-width: 900px) {
    .top-search {
        width: 100%;
    }

    .top-search input {
        min-width: 0;
        width: 100%;
    }
}

.nav-group-title {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .55);
    margin: 18px 0 8px;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-bottom {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.driver-job {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    line-height: 1.5;
}

.driver-job strong {
    display: block;
    margin-bottom: 6px;
}

.driver-card {
    padding: 18px;
}

.driver-card h3 {
    margin: 0 0 12px;
}

.driver-schedule-grid {
    display: grid;
    gap: 16px;
}

.job-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

textarea[readonly]{
  background:#f9fafb;
}

textarea[readonly],
input[readonly]{
  background:#f9fafb;
}

.wizard-card{
  overflow:hidden;
}

.wizard-progress{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
}

.wizard-step{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--muted);
  font-weight:700;
}

.wizard-step span{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#eef2f7;
  color:var(--text);
  font-size:.9rem;
}

.wizard-step.active{
  border-color:rgba(15,98,254,.45);
  background:#fbfdff;
  color:var(--text);
}

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

.wizard-step.done span{
  background:#dbeafe;
  color:#1849a9;
}

.wizard-step label{
  margin:0;
  font-weight:700;
  cursor:default;
}

.wizard-panel{
  display:none;
}

.wizard-panel.active{
  display:block;
}

.wizard-panel h2{
  margin:0 0 18px;
  font-size:1.15rem;
}

.wizard-actions{
  margin-top:0;
}

.review-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
}

.detail-wide{
  grid-column:1 / -1;
}

@media (max-width:680px){
  .wizard-progress-wrap{
    padding-left:20px;
    padding-right:20px;
  }

  .wizard-progress{
    grid-template-columns:1fr 1fr;
  }

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

.wizard-progress-wrap{
  padding:22px 30px 0;
}

.wizard-progress-bar{
  width:100%;
  height:10px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin-bottom:18px;
}

.wizard-progress-fill{
  height:100%;
  width:0%;
  background:var(--accent);
  border-radius:999px;
  transition:width .25s ease;
}

.field-hint {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.4;
}

.field-error,
.wizard-inline-error {
    color: var(--danger);
    font-size: .9rem;
    font-weight: 600;
}

.wizard-inline-error {
    display: none;
    margin-top: -2px;
}

.is-invalid {
    border-color: rgba(180, 35, 24, .6) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .08) !important;
}

.wizard-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.wizard-step-copy {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.wizard-step-tip {
    max-width: 260px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5;
}

.wizard-btns {
    align-items: stretch;
}

.booking-card {
    display: grid;
    gap: 12px;
}

.booking-card-top {
    align-items: flex-start;
}

.booking-reference {
    margin-top: 4px;
}

.booking-card-meta,
.booking-card-finance {
    display: grid;
    gap: 10px;
}

.booking-card-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.booking-card-finance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 2px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
    padding: 8px 10px;
    background: #f4f7fb;
    color: var(--text);
    font-size: .83rem;
    font-weight: 600;
}

.booking-card-label {
    display: block;
    color: var(--muted);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .main {
        padding-bottom: 92px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1000;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        background: rgba(15, 23, 42, .96);
        padding: 10px;
        border-radius: 20px;
        box-shadow: 0 18px 40px rgba(15, 23, 42, .24);
        backdrop-filter: blur(10px);
    }

    .mobile-bottom-link {
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-decoration: none;
        color: rgba(255, 255, 255, .78);
        border-radius: 14px;
        padding: 6px 4px;
        font-size: .78rem;
        font-weight: 700;
    }

    .mobile-bottom-link.active {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

    .mobile-bottom-count {
        font-size: .72rem;
        opacity: .9;
    }

    .dashboard-content {
        gap: 14px;
    }

    .booking-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .dashboard-content .panel-body {
        padding: 16px;
    }

    .dashboard-content .detail-grid,
    .dashboard-content .two {
        gap: 12px;
    }

    .dashboard-content .quote-box {
        padding: 14px;
    }

    .dashboard-content .detail {
        padding: 12px 14px;
    }

    .dashboard-content .notes {
        padding: 12px 14px;
    }
}

@media (max-width: 680px) {
    .wizard-panel-head {
        flex-direction: column;
    }

    .wizard-step-tip {
        max-width: none;
    }

    .actions.wizard-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 5;
    }

    .booking-card-meta,
    .booking-card-finance {
        grid-template-columns: 1fr;
    }

    .booking-card-finance > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 10px 12px;
    }

    .meta-pill {
        justify-content: flex-start;
    }
}


.booking-confirmation {
    margin: 0 30px 30px;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    background: linear-gradient(180deg, #f8fffb 0%, #ffffff 100%);
}

.booking-confirmation-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--success-bg);
    color: var(--success);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.booking-confirmation h2 {
    margin-bottom: 10px;
}

.confirmation-grid {
    margin: 22px 0;
}

.confirmation-actions {
    padding-top: 0;
    border-top: none;
}

.confirmation-notice {
    margin-bottom: 18px !important;
}

@media (max-width: 768px) {
    .booking-confirmation {
        margin: 0 18px 18px;
        padding: 20px;
    }

    .booking-confirmation-icon {
        width: 56px;
        height: 56px;
        font-size: 1.7rem;
    }
}


.editable-detail-grid .detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-editable input,
.detail-editable textarea,
.detail-editable select {
    width: 100%;
}

.detail-wide {
    grid-column: span 2;
}

.detail-readonly .v {
    font-weight: 700;
}

.request-edit-form {
    display: grid;
    gap: 18px;
}

.form-actions-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .detail-wide {
        grid-column: span 1;
    }

    .form-actions-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions-inline .primary {
        width: 100%;
    }
}


/* Mobile drawer */
.mobile-menu-btn,
.mobile-drawer-close,
.mobile-drawer-overlay {
    display: none;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-search {
    margin: 18px 0 14px;
}

.sidebar-search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.sidebar-search-form input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.sidebar-search-form button {
    width: 100%;
    align-self: stretch;
    border-radius: 14px;
}

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

.sidebar-logout-form {
    display: flex;
}

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

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1200;
        width: 48px;
        height: 48px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
        box-shadow: var(--shadow);
        font-size: 24px;
        cursor: pointer;
        transition: transform .2s ease, background .2s ease;
    }

    .mobile-menu-btn:hover,
    .mobile-menu-btn:focus-visible {
        transform: scale(1.02);
        background: #f8fbff;
    }

    .mobile-menu-btn::after {
        content: "Menu";
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        font-size: .75rem;
        color: var(--muted);
        letter-spacing: .04em;
    }

    .mobile-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 1190;
    }

    .mobile-drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        max-width: 320px;
        overflow-y: auto;
        z-index: 1201;
        transform: translateX(-105%);
        transition: transform .24s ease;
        border-radius: 0 18px 18px 0;
        padding-bottom: 24px;
    }

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

    #sidebarDrawer .nav-item {
        display: block;
        padding: 14px 16px;
        border-radius: 14px;
        margin-bottom: 6px;
        background: #f8fafc;
        color: #1f2937;
    }

    #sidebarDrawer .nav-item.active {
        background: #eaf1ff;
        color: #0f62fe;
        border-color: rgba(15, 98, 254, .18);
    }

    #sidebarDrawer .menu-count {
        margin-left: 8px;
        color: var(--muted);
        opacity: .85;
    }

    .mobile-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--card);
        cursor: pointer;
        font-size: 20px;
    }

    .main {
        padding-top: 56px;
    }

    .topbar {
        padding-left: 50px;
    }

    .top-search {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .top-search input[type="text"] {
        min-width: 0;
        flex: 1;
    }

    .booking-card,
    .job-card,
    .mobile-friendly-card,
    .mobile-job-card {
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .booking-card .meta,
    .job-card .meta,
    .booking-card .booking-meta,
    .job-card .job-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .booking-card.is-clickable,
    .job-card.is-clickable {
        cursor: pointer;
    }

    .booking-card.is-clickable::after,
    .job-card.is-clickable::after {
        content: "Tap to open and edit";
        display: block;
        margin-top: 10px;
        color: var(--accent);
        font-size: .88rem;
        font-weight: 600;
    }

    .detail-panel,
    #detailPanel {
        scroll-margin-top: 84px;
    }
}


body.drawer-open {
    overflow: hidden;
}

.mobile-menu-btn,
.mobile-drawer-close,
.mobile-drawer-overlay {
    display: none;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 3000;
        width: 48px;
        height: 48px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
        box-shadow: var(--shadow);
        font-size: 24px;
        cursor: pointer;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-btn:hover,
    .mobile-menu-btn:focus-visible {
        transform: scale(1.02);
        background: #f8fbff;
    }

    .mobile-menu-btn::after {
        content: "Menu";
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        font-size: .75rem;
        color: var(--muted);
        letter-spacing: .04em;
    }

    .mobile-drawer-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 2990;
    }

    .mobile-drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        max-width: 320px;
        overflow-y: auto;
        z-index: 3001;
        transform: translateX(-105%);
        transition: transform .24s ease;
        border-radius: 0 18px 18px 0;
        padding-bottom: 24px;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .mobile-drawer-close {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--card);
        cursor: pointer;
        font-size: 20px;
        pointer-events: auto;
    }

    .main {
        padding-top: 64px;
    }

    .topbar {
        padding-left: 0;
    }
}


/* Final mobile drawer visibility fix */
@media (max-width: 900px) {
    #sidebarDrawer.sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 86vw !important;
        max-width: 320px !important;
        min-width: 280px !important;
        height: 100vh !important;
        background: #ffffff !important;
        color: var(--text) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 4001 !important;
        transform: translateX(-110%) !important;
        transition: transform .24s ease !important;
        padding: 16px 14px 28px !important;
        box-shadow: 0 18px 40px rgba(15, 23, 42, .24) !important;
        border-right: 1px solid var(--line) !important;
        border-radius: 0 18px 18px 0 !important;
        display: block !important;
        visibility: visible !important;
    }

    #sidebarDrawer.sidebar.open {
        transform: translateX(0) !important;
    }

    #sidebarDrawer .nav {
        display: grid !important;
        gap: 8px !important;
    }

    #sidebarDrawer .nav-item {
        display: block !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        background: transparent !important;
        text-decoration: none !important;
    }

    #sidebarDrawer .nav-item.active {
        background: var(--accent-soft) !important;
    }

    #sidebarDrawer .nav-group-title {
        margin: 16px 6px 10px !important;
        font-size: .85rem !important;
        text-transform: uppercase !important;
        letter-spacing: .04em !important;
        color: var(--muted) !important;
    }

    #mobileDrawerOverlay.mobile-drawer-overlay {
        z-index: 3990 !important;
    }

    .layout {
        overflow-x: hidden !important;
    }

    #sidebarDrawer .sidebar-search {
        margin-bottom: 20px !important;
    }

    #sidebarDrawer .sidebar-search-form {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #sidebarDrawer .sidebar-search-form input {
        width: 100% !important;
        border-color: rgba(15, 23, 42, .12) !important;
        background: #ffffff !important;
        color: #111827 !important;
    }

    #sidebarDrawer .sidebar-search-form button {
        width: 100% !important;
        border-radius: 14px !important;
    }
}


/* Drawer menu text visibility fix */
@media (max-width: 900px) {
    #sidebarDrawer.sidebar,
    #sidebarDrawer.sidebar * {
        color: #1f2937 !important;
    }

    #sidebarDrawer .brand {
        color: #111827 !important;
    }

    #sidebarDrawer .nav-item {
        color: #1f2937 !important;
        background: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, .08) !important;
        font-weight: 600 !important;
    }

    #sidebarDrawer .nav-item:hover,
    #sidebarDrawer .nav-item:focus {
        background: #f8fafc !important;
        color: #111827 !important;
    }

    #sidebarDrawer .nav-item.active {
        background: #eaf1ff !important;
        color: #0f62fe !important;
        border-color: rgba(15, 98, 254, .18) !important;
    }

    #sidebarDrawer .menu-count {
        color: inherit !important;
        opacity: .85;
    }
}
