/* =============================================
   FORM_ORDER_ESYATOUR — Modern Mobile-First CSS
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --success: #059669;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --error: #DC2626;
    --error-bg: #FEF2F2;
    --info: #0284C7;
    --info-bg: #EFF6FF;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --bg: #F3F4F6;
    --bg-alt: #F9FAFB;
    --card-bg: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --danger: var(--error);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* --- Dark Mode dinonaktifkan, default terang --- */

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }

/* --- Typography --- */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--error); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- Layout --- */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px;
}

.app-main {
    padding-top: 60px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 32px; }
.mb-1 { margin-bottom: 12px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 32px; }
.ml-1 { margin-left: 8px; }
.mr-1 { margin-right: 8px; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 12px; }
.p-2 { padding: 20px; }
.w-full { width: 100%; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; color: white; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #B45309; color: white; }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #B91C1C; color: white; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-control::placeholder { color: var(--text-muted); }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 80px; }
.form-control[readonly] { background: var(--bg); cursor: default; }

.form-control-sm { padding: 8px 10px; font-size: 0.875rem; }

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-row .form-control { flex: 1; }

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

/* Option Cards (Radio) */
.option-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.option-group-4 {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.option-card input { display: none; }
.option-card.selected { border-color: var(--primary); background: var(--primary-light); }
.option-card .option-icon { font-size: 1.5rem; }
.option-card .option-label { font-size: 0.8125rem; font-weight: 500; }

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #A7F3D0; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #FDE68A; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #BAE6FD; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-primary { background: #EEF2FF; color: #4338CA; }
.badge-secondary { background: #F3F4F6; color: #374151; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

/* =============================================
   HEADER (Mobile App Style)
   ============================================= */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    max-width: 640px;
    margin: 0 auto;
}

.app-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.user-greeting {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.hamburger {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 4px;
    cursor: pointer;
    color: var(--text);
}

.back-btn {
    font-size: 1.3rem;
    color: var(--text);
    padding: 4px;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 99;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

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

.mobile-menu a {
    display: block;
    padding: 14px 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
}

.mobile-menu a:hover,
.mobile-menu a.active { background: var(--primary-light); color: var(--primary); }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    background: white;
    border-top: 1px solid var(--border);
    padding: 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 4px);
}

/* Sembunyikan bottom nav di desktop */
@media (min-width: 1024px) {
    .bottom-nav { display: none; }
    .app-main { padding-bottom: 40px; }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .nav-icon { font-size: 1.3rem; line-height: 1; }

/* =============================================
   HERO CARD
   ============================================= */
/* =============================================
   PROFILE CARD
   ============================================= */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 700; font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-name .badge { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; padding: 2px 8px; border-radius: 99px; }
.badge-primary { background: var(--primary); color: #fff; }
.badge-outline { border: 1px solid var(--border); color: var(--text-secondary); background: transparent; }
.profile-detail { font-size: 0.85rem; color: var(--text-secondary); }
.profile-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   STATS
   ============================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-mini {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

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

.stat-mini-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.stat-mini.stat-warning .stat-mini-value { color: var(--warning); }
.stat-mini.stat-primary .stat-mini-value { color: var(--primary); }
.stat-mini.stat-success .stat-mini-value { color: var(--success); }

/* =============================================
   ORDER LIST (Client Side)
   ============================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    color: var(--text);
    transition: box-shadow 0.2s;
}

.order-card:active { box-shadow: var(--shadow-md); }

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-number {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--primary);
}

.order-card-body { margin-bottom: 8px; }
.order-staff { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Filter tabs */
.filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.filter-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.order-route {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.route-code {
    font-weight: 700;
    font-size: 1.1rem;
}

.route-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.order-info {
    display: flex;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.arrow { color: var(--text-muted); font-size: 1rem; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* =============================================
   FORM CARD (Reservasi Baru)
   ============================================= */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.form-card .passenger-section {
    overflow: visible;
}

.form-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.form-card-header h2 { margin-bottom: 4px; }
.form-card-header p { color: var(--text-muted); font-size: 0.875rem; }

.form-card form { padding: 20px; }

.form-step {
    margin-bottom: 20px;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
}

.profile-summary {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.profile-label { color: var(--text-muted); font-size: 0.875rem; }
.profile-value { font-weight: 500; }

/* =============================================
   STATUS BANNER
   ============================================= */
.status-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.status-banner-icon { font-size: 1.5rem; line-height: 1; }
.status-banner-text h3 { margin-bottom: 2px; }
.status-banner-text p { font-size: 0.8125rem; opacity: 0.85; }

.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-process { background: var(--info-bg); color: var(--info); }
.status-replied,
.status-review { background: var(--primary-light); color: var(--primary); }
.status-confirmed,
.status-completed { background: var(--success-bg); color: var(--success); }
.status-revised { background: var(--warning-bg); color: var(--warning); }
.status-cancelled { background: #F3F4F6; color: var(--text-muted); }

/* =============================================
   DETAIL CARD
   ============================================= */
.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-light);
}

.order-number-lg {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.order-date { font-size: 0.8125rem; color: var(--text-muted); }

.detail-card-body { padding: 12px 16px; }

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 0.875rem; min-width: 80px; }
.detail-value { text-align: right; font-size: 0.9375rem; }

/* =============================================
   RESPONSE CARD
   ============================================= */
.response-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.response-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.response-card-body {
    padding: 16px;
    background: #FAFAFA;
}

.response-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9375rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.response-actions {
    padding: 16px;
}

.revision-form {
    padding: 0 16px 16px;
}

/* =============================================
   TIMELINE
   ============================================= */
.timeline-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.timeline-card h3 { margin-bottom: 16px; }

.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-left: 2px solid var(--border);
    padding-left: 16px;
    margin-left: 6px;
    position: relative;
}

.timeline-item:last-child { border-left: 2px solid transparent; margin-bottom: 0; padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
}

.timeline-content { flex: 1; }

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.timeline-time { font-size: 0.75rem; color: var(--text-muted); }

.timeline-content p { font-size: 0.875rem; color: var(--text-secondary); }

.timeline-status { margin-top: 4px; }

/* =============================================
   BACKOFFICE: SIDEBAR & MAIN
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 200;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.open { left: 0; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    font-weight: 800;
    color: #fff;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-brand::before {
    content: '✈';
    font-size: 1.3rem;
}

.sidebar-close {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sidebar-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.sidebar-user {
    padding: 14px 16px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.95);
    font-size: 0.9rem;
}

.sidebar-user .badge {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 99px;
}
.sidebar-user .badge-danger {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 8px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: rgba(255,255,255,0.3);
}
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
    border-left-color: #fff;
}

/* Ikon sederhana untuk menu (via CSS) */
.sidebar-menu li a[href*="dashboard"]::before  { content: '📊'; font-size: 0.9rem; }
.sidebar-menu li a[href*="routes"]::before      { content: '🛣'; font-size: 0.9rem; }
.sidebar-menu li a[href*="providers"]::before   { content: '🏢'; font-size: 0.9rem; }
.sidebar-menu li a[href*="admins"]::before      { content: '👤'; font-size: 0.9rem; }
.sidebar-menu li a[href*="clients"]::before     { content: '👥'; font-size: 0.9rem; }
.sidebar-menu li a[href*="orders"]::before      { content: '📋'; font-size: 0.9rem; }
.sidebar-menu li a[href*="uat"]::before         { content: '🧪'; font-size: 0.9rem; }
.sidebar-menu li a[href*="reports"]::before     { content: '📈'; font-size: 0.9rem; }
.sidebar-menu li a[href*="gateways"]::before    { content: '🔌'; font-size: 0.9rem; }

.sidebar-divider {
    padding: 16px 16px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer .btn-danger {
    background: rgba(239, 68, 68, 0.3);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.15);
    font-weight: 500;
}
.sidebar-footer .btn-danger:hover {
    background: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.main-content {
    min-height: 100vh;
    padding-top: 60px;
    transition: margin-left 0.3s ease;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.topbar .hamburger {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.topbar .hamburger:hover {
    background: var(--bg);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.content {
    padding: 16px;
    max-width: 1200px;
}

/* Backoffice Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* =============================================
   BACKOFFICE: CARDS & TABLE
   ============================================= */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 { font-size: 1rem; }
.card-body { padding: 16px; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.stat-card.stat-warning .stat-value { color: var(--warning); }
.stat-card.stat-info .stat-value { color: var(--info); }
.stat-card.stat-primary .stat-value { color: var(--primary); }
.stat-card.stat-success .stat-value { color: var(--success); }

/* Table */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
}

.table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:nth-child(even) td {
    background: #FAFAFA;
}

.table tr:hover td { background: #EEF2FF; }

.table tfoot th, .table tfoot td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    font-weight: 700;
    color: var(--text);
}

.text-nowrap { white-space: nowrap; }

/* Table Detail */
.table-detail {
    width: 100%;
}

.table-detail td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.table-detail tr:last-child td { border-bottom: none; }
.table-detail td:first-child { color: var(--text-muted); min-width: 100px; }

.action-cell {
    display: flex;
    gap: 1px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}
.action-cell .btn-sm {
    padding: 2px 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.action-cell .btn-sm:hover {
    background: var(--bg);
    color: var(--text);
}
.action-cell .btn-sm.btn-danger {
    color: var(--error);
}
.action-cell .btn-sm.btn-danger:hover {
    background: var(--error-bg);
    color: var(--error);
}
.action-cell .btn-outline {
    border: none;
    background: transparent;
}
.action-cell .btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
}
.action-cell form {
    display: inline-flex;
}

/* Route select wrap — tombol tambah tujuan */
.route-select-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
}
.route-select-wrap select {
    flex: 1;
    min-width: 0;
}
.btn-add-route,
.btn-add-master {
    width: 24px;
    height: 24px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-add-route:hover,
.btn-add-master:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Region filter bar — tampilkan rute luar negeri */
.region-filter-bar {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.region-filter-bar .btn {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 99px;
}
.region-filter-bar .btn.active {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

/* Tab Navigasi */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.tab-item {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 99px;
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1.5px solid transparent;
}
.tab-item:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
}
.tab-item.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.25);
}
.tab-item .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    font-size: 0.65rem;
    padding: 0 6px;
    border-radius: 99px;
    margin-left: 5px;
    font-weight: 600;
    background: rgba(107, 114, 128, 0.12);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    line-height: 1;
}
.tab-item:hover .tab-count {
    background: rgba(79, 70, 229, 0.18);
    color: var(--primary);
}
.tab-item.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Filter */
.filter-form { margin-bottom: 16px; }

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-row .form-control {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    font-size: 0.875rem;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form .form-control { flex: 1; }

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.bg-gradient {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.login-header h1 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.password-wrapper {
    position: relative;
}
.password-wrapper .form-control {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    line-height: 1;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.login-form .form-group { margin-bottom: 16px; }
.login-form .form-control { padding: 14px; }

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-footer a { display: block; margin-top: 8px; }

/* =============================================
   ORDER DETAIL (backoffice)
   ============================================= */
.order-detail {}

.order-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.order-header-left h2 { margin-bottom: 4px; }
.order-meta { display: flex; gap: 8px; align-items: center; font-size: 0.8125rem; color: var(--text-muted); }

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

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .form-row-2 { grid-template-columns: 1fr; }
}

.response-box {
    background: #FAFAFA;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9375rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* =============================================
   MODAL
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open { display: flex; }

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-content.modal-lg { max-width: 720px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 { font-size: 1.0625rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}

.modal-content form { padding: 20px; }

/* --- Validation --- */
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.field-error { display: block; font-size: 0.8rem; color: var(--error); margin-top: 4px; }
.form-group.is-error label { color: var(--error); }

/* =============================================
   RESPONSIVE (Desktop backoffice)
   ============================================= */
@media (min-width: 1024px) {
    .sidebar {
        left: -280px; /* hidden by default on desktop too, toggle via .open */
    }
    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }
    .sidebar.open ~ .main-content,
    .main-content.sidebar-open {
        margin-left: 280px;
    }

    .topbar {
        position: static;
        display: flex;
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        height: auto;
        background: white;
    }

    .topbar .hamburger {
        display: inline-flex; /* hamburger selalu terlihat */
    }

    .content { padding: 24px; }
}

/* =============================================
   UTILITIES
   ============================================= */
@media (max-width: 480px) {
    .option-group { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .filter-row .form-control { min-width: 100px; }
}
