/* 
   ORIGIN HOLIDAYS - ADMIN PANEL STYLESHEET
   Aesthetics: Logo Blue (#0F75BD) + Sky Blue (#1FA4DD) + Deep Navy (#083256) + Milky White (#F8FAFC)
*/

:root {
    --admin-sidebar-bg: #083256;
    --admin-sidebar-hover: #0a4373;
    --admin-sidebar-active: #1FA4DD;
    --admin-topbar-bg: #ffffff;
    --admin-body-bg: #f7f9fc;
    --admin-card-bg: #ffffff;
    --admin-primary: #0F75BD;
    --admin-primary-dark: #083256;
    --admin-text-main: #0f172a;
    --admin-text-muted: #64748b;
    --admin-border: #e2e8f0;
}

body.admin-body {
    background-color: var(--admin-body-bg);
    font-family: 'Outfit', sans-serif;
    color: var(--admin-text-main);
    display: flex;
    min-height: 100vh;
    margin: 0;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: #e0f2fe;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.admin-brand {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-brand .admin-logo-img {
    height: 42px;
    width: auto;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    object-fit: contain;
}

.admin-brand .brand-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--admin-sidebar-hover);
    color: #ffffff;
}

.sidebar-nav li.active a {
    background: var(--admin-sidebar-hover);
    color: var(--admin-sidebar-active);
    border-left-color: var(--admin-sidebar-active);
    font-weight: 600;
}

.sidebar-nav li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.admin-main {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.admin-topbar {
    height: 70px;
    background: var(--admin-topbar-bg);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--admin-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Content Container */
.admin-content {
    padding: 30px;
    flex-grow: 1;
}

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

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--admin-primary);
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--admin-card-bg);
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-info h6 {
    font-size: 13px;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
}

.metric-info .metric-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--admin-primary);
    margin: 0;
}

.odometer, .odometer.odometer-auto-theme, .odometer.odometer-theme-minimal {
    font-family: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    line-height: 1 !important;
    display: inline-block;
}

.odometer .odometer-digit, 
.odometer .odometer-digit-spacer, 
.odometer .odometer-digit-inner {
    font-family: inherit !important;
    font-weight: inherit !important;
}

.metric-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.metric-icon-blue { background: #eff6ff; color: #2563eb; }
.metric-icon-green { background: #f0fdf4; color: #16a34a; }
.metric-icon-yellow { background: #fefce8; color: #ca8a04; }
.metric-icon-purple { background: #faf5ff; color: #9333ea; }

/* Admin Data Card / Tables */
.admin-card {
    background: var(--admin-card-bg);
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

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

.admin-card-header h5 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--admin-primary);
}

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

.admin-table th {
    background: #f8fafc;
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--admin-text-muted);
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
    padding: 14px 20px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-new { background: #dbeafe; color: #1e40af; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-contacted { background: #e0e7ff; color: #3730a3; }
.status-closed { background: #dcfce7; color: #166534; }
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* Admin Forms */
.form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--admin-border);
}

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

.form-label {
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 6px;
    display: block;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(26, 43, 72, 0.1);
}

/* ==========================================================================
   MOBILE & RESPONSIVE SUITE FOR ADMIN PANEL
   ========================================================================== */

/* Mobile Backdrop Overlay */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 30, 56, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 991.98px) {
    /* Off-canvas mobile sidebar */
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -280px;
        width: 270px;
        z-index: 1050;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-sidebar.open {
        left: 0;
    }

    /* Main wrapper occupies full width */
    .admin-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Topbar adjustments */
    .admin-topbar {
        height: 62px;
        padding: 0 16px;
    }

    .admin-page-title {
        font-size: 16px;
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Content container */
    .admin-content {
        padding: 16px;
    }

    /* Page headers */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .page-header h2 {
        font-size: 20px;
    }

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

    /* Metric cards 2 cols on tablet */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-bottom: 20px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-info .metric-value {
        font-size: 22px;
    }

    .metric-icon-box {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    /* Forms */
    .form-card {
        padding: 20px 16px;
    }
}

@media (max-width: 576px) {
    /* Metric cards 1 col on mobile */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .admin-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .admin-card-header .btn {
        width: 100%;
        text-align: center;
    }

    /* Modal dialog full width */
    .modal-dialog {
        margin: 12px auto;
        max-width: calc(100% - 24px);
    }

    .modal-body {
        padding: 16px;
    }

    /* Table responsive adjustments */
    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    /* Quick action buttons flex wrap full width */
    .d-flex.flex-wrap.gap-2.mb-4 .btn {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   LUXURY MOBILE CARD TRANSFORMATION (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .table-responsive {
        border: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .admin-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
    }

    .admin-card-header {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        margin-bottom: 16px !important;
        padding: 14px 18px !important;
        box-shadow: 0 2px 8px rgba(15, 117, 189, 0.04) !important;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .admin-table thead {
        display: none !important;
    }

    .admin-table tr {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
        padding: 16px 18px !important;
        box-shadow: 0 4px 16px rgba(15, 117, 189, 0.07) !important;
        position: relative !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }

    .admin-table tr:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(15, 117, 189, 0.12) !important;
    }

    .admin-table tr:hover td {
        background: transparent !important;
    }

    /* ── Card Header: Thumbnail + Title ── */
    .admin-table td:first-child {
        display: block !important;
        padding: 0 0 12px 0 !important;
        border-bottom: 2px solid #f1f5f9 !important;
        margin-bottom: 8px !important;
        text-align: left !important;
    }

    .admin-table td:first-child::before {
        display: none !important;
    }

    .admin-table td:first-child .d-flex {
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .admin-table td:first-child img {
        width: 52px !important;
        height: 48px !important;
        border-radius: 10px !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid #e2e8f0 !important;
    }

    .admin-table td:first-child strong,
    .admin-table td:first-child .text-truncate {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: #083256 !important;
        max-width: 100% !important;
        white-space: normal !important;
        line-height: 1.35 !important;
        display: block !important;
    }

    /* ── Middle Rows: Clean Key-Value Pairs ── */
    .admin-table td:not(:first-child):not(:last-child) {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f8fafc !important;
        font-size: 13.5px !important;
        text-align: right !important;
    }

    .admin-table td:not(:first-child):not(:last-child)::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        font-size: 12px !important;
        text-transform: capitalize !important;
        letter-spacing: 0.2px !important;
        color: #64748b !important;
        text-align: left !important;
        margin-right: 12px !important;
        flex-shrink: 0 !important;
    }

    .admin-table td strong {
        font-size: 13.5px !important;
        color: #0f172a !important;
    }

    .admin-table td select.form-select-sm {
        max-width: 140px !important;
        text-align: left !important;
        font-size: 12px !important;
    }

    /* ── Card Footer: Clean Action Buttons ── */
    .admin-table td:last-child {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 12px 0 0 0 !important;
        margin-top: 6px !important;
        border-top: 1px dashed #e2e8f0 !important;
        border-bottom: none !important;
    }

    .admin-table td:last-child::before {
        display: none !important;
    }

    .admin-table td:last-child .d-flex {
        width: 100% !important;
        justify-content: flex-end !important;
        gap: 8px !important;
    }

    .admin-table td:last-child .btn {
        padding: 7px 14px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 600 !important;
    }
}
