/* ==========================================================================
   CUSTOMER PORTAL STYLES - NXB CÔNG AN NHÂN DÂN
   Theme: Bright Cool Palette (Azure Blue, Sky Cyan, Slate, Emerald)
   ========================================================================== */

:root {
    /* Brand Cool Colors (No Warm Tones) */
    --cand-primary: #1e40af;
    --cand-primary-rgb: 30, 64, 175;
    --cand-blue: #2563eb;
    --cand-blue-rgb: 37, 99, 235;
    --cand-blue-hover: #1d4ed8;
    --cand-cyan: #0284c7;
    --cand-sky: #0ea5e9;
    --cand-sky-light: #e0f2fe;
    --cand-emerald: #059669;
    --cand-emerald-light: #d1fae5;
    --cand-slate: #0f172a;
    --cand-navy: #1e293b;
    --cand-dark-gradient: linear-gradient(135deg, #1e3a8a 0%, #0284c7 50%, #0ea5e9 100%);
    --cand-header-gradient: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);

    /* Layout Metrics */
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 78px;
    --topbar-height: 68px;
    --border-color: #e2e8f0;
    --body-bg: #f8fafc;
    --surface-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Elevation */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-dropdown: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Base */
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   PORTAL MAIN LAYOUT GRID
   ========================================================================== */

.portal-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Left Sidebar */
.portal-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.portal-sidebar-header {
    height: var(--topbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.4) 0%, rgba(15, 23, 42, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    transition: opacity 0.2s ease;
}

.sidebar-brand-text .title {
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.sidebar-brand-text .subtitle {
    font-size: 0.68rem;
    color: #38bdf8;
    font-weight: 500;
}

/* Sidebar Menu Content */
.portal-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.portal-sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.portal-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
    margin-top: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-item .sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.2s ease;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar-nav-link:hover i {
    color: #38bdf8;
}

.sidebar-nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(2, 132, 199, 0.15) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid #38bdf8;
}

.sidebar-nav-link.active i {
    color: #38bdf8;
}

.sidebar-nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

/* Sidebar Footer / User Status Card */
.portal-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .role {
    font-size: 0.68rem;
    color: #38bdf8;
}

/* ==========================================================================
   PORTAL MAIN CONTENT CONTAINER
   ========================================================================== */

.portal-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar Header */
.portal-topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle-btn {
    background: transparent;
    border: none;
    color: #475569;
    font-size: 1.25rem;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-toggle-btn:hover {
    background: #f1f5f9;
    color: var(--cand-blue);
}

.topbar-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.topbar-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.topbar-breadcrumbs a:hover {
    color: var(--cand-blue);
}

.topbar-breadcrumbs .current {
    color: #0f172a;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Topbar Action Icons (Help, Notifications) */
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: #f0f9ff;
    color: var(--cand-blue);
    border-color: #bae6fd;
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #0284c7;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.notification-badge.pulse {
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(2, 132, 199, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

/* Topbar Notification Dropdown Menu */
.dropdown-menu-notifications {
    width: 360px;
    max-width: 90vw;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-dropdown);
    padding: 0;
    overflow: hidden;
}

.notification-header {
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.85rem 1.25rem;
    display: flex;
    gap: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content .title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.notification-content .text {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
}

.notification-content .time {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Topbar User Profile Pill & Dropdown */
.topbar-user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.topbar-user-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-menu-profile {
    width: 270px;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-dropdown);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
}

.profile-dropdown-header {
    padding: 0.85rem;
    background: #f8fafc;
    border-radius: 0.65rem;
    margin-bottom: 0.5rem;
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-item-custom i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    color: #64748b;
    transition: color 0.15s ease;
}

.dropdown-item-custom:hover {
    background: #f0f9ff;
    color: var(--cand-blue);
}

.dropdown-item-custom:hover i {
    color: var(--cand-blue);
}

.dropdown-item-custom.danger:hover {
    background: #f1f5f9;
    color: #64748b;
}
.dropdown-item-custom.danger:hover i {
    color: #0f172a;
}

/* ==========================================================================
   DESKTOP COLLAPSED STATE & RESPONSIVE DRAWER
   ========================================================================== */

/* Collapsed Sidebar on Desktop */
body.sidebar-collapsed .portal-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .portal-sidebar .sidebar-brand-text,
body.sidebar-collapsed .portal-sidebar .sidebar-section-label,
body.sidebar-collapsed .portal-sidebar .sidebar-nav-link span,
body.sidebar-collapsed .portal-sidebar .sidebar-nav-badge,
body.sidebar-collapsed .portal-sidebar .sidebar-user-info {
    display: none !important;
}

body.sidebar-collapsed .portal-sidebar .sidebar-nav-link {
    justify-content: center;
    padding: 0.75rem;
}

body.sidebar-collapsed .portal-sidebar .sidebar-nav-link i {
    margin: 0;
    font-size: 1.15rem;
}

body.sidebar-collapsed .portal-sidebar-footer {
    padding: 0.75rem 0.5rem;
}

body.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 0.4rem;
}

body.sidebar-collapsed .portal-main {
    margin-left: var(--sidebar-collapsed-width);
}

/* Mobile Sidebar Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .portal-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .portal-main {
        margin-left: 0 !important;
    }

    .topbar-breadcrumbs {
        display: none;
    }
}

/* ==========================================================================
   COMMON CARDS, BUTTONS & BADGES
   ========================================================================== */

.card-custom {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.btn-cand {
    background: linear-gradient(135deg, var(--cand-blue) 0%, var(--cand-primary) 100%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 0.6rem;
    padding: 0.55rem 1.25rem;
    transition: all 0.2s ease-in-out;
}

.btn-cand:hover, .btn-cand:focus {
    background: linear-gradient(135deg, var(--cand-blue-hover) 0%, #172554 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.btn-cand-outline {
    background: transparent;
    color: var(--cand-blue);
    border: 1.5px solid var(--cand-blue);
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.2s ease;
}

.btn-cand-outline:hover {
    background: var(--cand-blue);
    color: #ffffff;
}

.badge-cand-sky {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    border: 1px solid #bae6fd;
}

.badge-cand-blue {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.badge-cand-emerald {
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
    border: 1px solid #a7f3d0;
}

/* Auth Pages (Login/Register) Container Styling */
.auth-page-wrapper {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 400px),
                radial-gradient(circle at bottom left, rgba(2, 132, 199, 0.06), transparent 400px),
                #f8fafc;
    display: flex;
    flex-direction: column;
}

.auth-header-nav {
    height: 70px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}


