/* =============================================
   Backoffice Admin Panel - Custom Styles
   ============================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #25282f;
    --sidebar-active: #2d3139;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --sidebar-section: #6c757d;
    --topbar-height: 60px;
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --warning-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    --border-color: #e2e8f0;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .12);
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    overflow-x: hidden;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.5px;
}

.sidebar-logo i {
    font-size: 1.5rem;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-close {
    color: var(--sidebar-text);
    font-size: 1.2rem;
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-left-color: #667eea;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    opacity: .7;
}

.sidebar-nav .nav-link.active i {
    opacity: 1;
}

.nav-section {
    padding: 18px 20px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-section);
    list-style: none;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    font-size: 0.82rem;
}

.user-mini i {
    font-size: 1.2rem;
    opacity: .6;
}

/* ===================== MAIN WRAPPER ===================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-toggle {
    color: var(--text-primary);
    font-size: 1.15rem;
    text-decoration: none;
}

.content-area {
    padding: 24px;
    animation: fadeInUp 0.35s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== CARDS ===================== */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    border-radius: var(--radius);
    padding: 20px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, .12);
    border-radius: 50%;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    opacity: .85;
    margin-top: 4px;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: .3;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.stat-primary {
    background: var(--primary-gradient);
}

.stat-success {
    background: var(--success-gradient);
}

.stat-danger {
    background: var(--danger-gradient);
}

.stat-warning {
    background: var(--warning-gradient);
}

/* ===================== TABLES ===================== */
.table-wrapper {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    font-size: 0.84rem;
}

.table thead th {
    background: #f8f9fc;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    padding: 12px 16px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: #f8f9fc;
}

/* Status Vertical Borders */
.table tbody tr td:first-child {
    border-left: 5px solid transparent;
}

.table tbody tr.status-border-pending td:first-child {
    border-left-color: #ffc107;
}

.table tbody tr.status-border-confirmed td:first-child {
    border-left-color: #28a745;
}

.table tbody tr.status-border-cancelled td:first-child {
    border-left-color: #dc3545;
}

/* ===================== BUTTONS ===================== */
.btn-gradient-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, .4);
    color: #fff;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: scale(1.08);
}

/* ===================== FILTERS ===================== */
.filter-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.84rem;
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .15);
}

/* ===================== FORM STYLES ===================== */
.form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-control,
.form-select {
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .15);
}

/* ===================== BADGES ===================== */
.badge {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 20px;
}

/* ===================== PAGINATION ===================== */
.pagination .page-link {
    font-size: 0.82rem;
    border-color: var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
}

.pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

/* ===================== LOGIN PAGE ===================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    top: -200px;
    right: -200px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    bottom: -150px;
    left: -100px;
}

.login-card {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease;
    position: relative;
    z-index: 1;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-logo i {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card .login-logo h4 {
    margin-top: 12px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--text-primary);
}

.login-card .form-control {
    padding: 12px 16px;
    border-radius: 8px;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
}

.login-card .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, .4);
}

/* ===================== PASSENGER ROWS ===================== */
.passenger-row {
    background: #f8f9fc;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.passenger-row:hover {
    border-color: #667eea;
}

/* ===================== TOAST ===================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
}

/* ===================== MOBILE ===================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .4);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }
}

/* ===================== DROPDOWNS ===================== */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    padding: 6px;
    font-size: 0.84rem;
}

.dropdown-item {
    border-radius: 4px;
    padding: 8px 12px;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: #f0f2f5;
}

/* ===================== MODAL ===================== */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    opacity: .3;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===================== LANG FLAG ===================== */
.lang-option img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

/* ===================== TOM SELECT FIXES ===================== */
.ts-control {
    min-height: 38px !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-sm) !important;
    border-color: var(--border-color) !important;
    font-size: 0.875rem !important;
}

.ts-wrapper.single .ts-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

.ts-wrapper.focus .ts-control {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .15) !important;
}

/* ===================== INTL-TEL-INPUT FIXES ===================== */
.iti {
    display: block !important;
    width: 100% !important;
}

/* ===================== AUDIT TRAIL / HISTORY ===================== */
.audit-trail-container {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.audit-trail-container::-webkit-scrollbar {
    width: 4px;
}

.audit-trail-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.audit-item {
    font-size: 0.75rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 10px;
    position: relative;
    padding-bottom: 12px;
}

.audit-item:last-child {
    padding-bottom: 0;
}

.audit-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0;
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
}

.audit-time {
    color: #a0aec0;
    font-size: 0.7rem;
    display: block;
    margin-bottom: 2px;
}

.audit-user {
    font-weight: 600;
    color: var(--text-dark);
}