/**
 * CTV Portal - Layout
 * Sidebar, Header, Content Area
 * Modern Glassmorphism Design
 * 
 * Updated: January 24, 2026 - Collapsible Sidebar with Animations
 */

/* ═══════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES FOR SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --sidebar-width-expanded: 250px;
    --sidebar-width-collapsed: 72px;
    --sidebar-transition: 300ms ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════════
   PORTAL LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.portal {
    display: none;
}

.portal.active {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE BACKDROP OVERLAY
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 640px) {
    .sidebar-backdrop {
        display: block;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR - With Collapsible Functionality
   ═══════════════════════════════════════════════════════════════════ */

.sidebar {
    width: var(--sidebar-width-expanded);
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    padding: 24px 16px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
    transition: width var(--sidebar-transition), padding var(--sidebar-transition), transform var(--sidebar-transition);
    overflow: visible;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    padding: 24px 14px;
    /* Symmetrical padding when collapsed */
}

/* Mobile: Hidden when collapsed */
@media (max-width: 640px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width-expanded);
    }
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
}

/* Mobile menu popup - hidden on desktop */
.mobile-menu-popup {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR HEADER
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-header {
    padding: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
    transition: justify-content var(--sidebar-transition);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    flex-shrink: 0;
}

.sidebar-logo .sidebar-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    transition: opacity var(--sidebar-transition), width var(--sidebar-transition);
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0 0 24px 0;
}

.sidebar-logo svg {
    width: 100%;
    height: 100%;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR MENU
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    transition: align-items var(--sidebar-transition);
}

.sidebar.collapsed .sidebar-menu {
    align-items: center;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 4px;
    margin-top: 16px;
    transition: opacity var(--sidebar-transition);
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR NAV ITEMS
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-icon {
    width: 100%;
    height: 44px;
    /* Fixed height for consistent sizing */
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    background: transparent;
    box-shadow: none;
    margin-bottom: 0;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar-icon:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-icon.active {
    background: #ffffff;
    color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    opacity: 0.7;
    stroke-width: 2;
    stroke: currentColor;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-icon.active svg {
    opacity: 1;
    color: var(--primary-blue);
    stroke: currentColor;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.sidebar-icon span:not(.lang-current) {
    transition: opacity var(--sidebar-transition), width var(--sidebar-transition);
    white-space: nowrap;
    overflow: hidden;
}

/* Collapsed state: center icons, fixed 44x44 size */
.sidebar.collapsed .sidebar-icon {
    width: 44px;
    min-width: 44px;
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-icon span:not(.lang-current) {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR TOOLTIPS (COLLAPSED STATE)
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: #ffffff;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: none;
}

.sidebar-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #ffffff;
}

/* Show tooltips only when sidebar is collapsed */
.sidebar.collapsed .sidebar-icon:hover .sidebar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    display: block;
}

.sidebar.collapsed .sidebar-tooltip {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR LOGOUT - Bottom Position with EXIT Label
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-logout-bottom {
    margin-top: 8px;
    margin-bottom: 0;
    width: 100%;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.sidebar-logout:hover svg {
    stroke: var(--danger);
    color: var(--danger);
}

/* EXIT label - hidden by default, shown when collapsed */
.logout-exit-label {
    display: none;
    font-size: 10px;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* When collapsed, show EXIT label and hide logout text */
.sidebar.collapsed .sidebar-logout-bottom {
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logout-bottom .logout-exit-label {
    display: block;
}

.sidebar.collapsed .sidebar-logout-bottom span[data-i18n="logout"] {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   COLLAPSE TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar.collapsed .sidebar-collapse-btn {
    width: 44px;
    min-width: 44px;
}

.sidebar-collapse-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.sidebar-collapse-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.sidebar-collapse-btn .expand-icon {
    display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .collapse-icon {
    display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .expand-icon {
    display: block;
}

/* Hide collapse button on mobile */
@media (max-width: 640px) {
    .sidebar-collapse-btn {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   LANGUAGE TOGGLE
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-lang {
    position: relative;
    z-index: 500;
}

.sidebar-lang .sidebar-icon {
    position: relative;
    overflow: visible;
}

.sidebar-lang .lang-current {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: auto;
    line-height: 1.4;
    position: static;
    transform: none;
    bottom: auto;
    left: auto;
    pointer-events: auto;
    flex-shrink: 0;
}

/* Collapsed: badge centered below icon */
.sidebar.collapsed .sidebar-lang .lang-current {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 9px;
    padding: 1px 5px;
    right: auto;
}

.sidebar-lang.active .sidebar-icon {
    background-color: #ebebeb;
}

.sidebar-lang .sidebar-icon svg {
    margin-bottom: 0;
}

.lang-popup {
    position: absolute;
    left: 100%;
    bottom: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.2s ease;
    z-index: 1100;
    margin-left: 8px;
}

.lang-popup::before {
    content: '';
    position: absolute;
    right: 100%;
    bottom: 16px;
    border: 6px solid transparent;
    border-right-color: #ffffff;
    left: auto;
}

.sidebar-lang.active .lang-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.lang-popup-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 6px;
    margin-bottom: 4px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background-color: #f8fafc;
}

.lang-option.active {
    background-color: #f1f5f9;
}

.lang-flag {
    font-size: 10px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border-radius: 50%;
    color: #64748b;
}

.lang-name {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.lang-check {
    margin-left: auto;
    opacity: 0;
    stroke: #10b981;
    transition: opacity 0.15s;
}

.lang-option.active .lang-check {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM SIDEBAR BUTTONS (Catalogue, Pricing, Referral)
   ═══════════════════════════════════════════════════════════════════ */

/* Catalogue Button - Vibrant Pink/Red */
.sidebar-icon.sidebar-catalogue {
    background: linear-gradient(135deg, #F43F5E 0%, #FB7185 100%);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.4);
    color: white !important;
    border: none;
}

.sidebar-icon.sidebar-catalogue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.5);
}

.sidebar-icon.sidebar-catalogue svg {
    color: white !important;
    stroke: white !important;
    opacity: 1;
}

.sidebar-icon.sidebar-catalogue span {
    color: white !important;
}

/* Pricing Button - Radiant Green (Emerald) */
.sidebar-icon.sidebar-pricing {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    color: white !important;
    border: none;
}

.sidebar-icon.sidebar-pricing:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

.sidebar-icon.sidebar-pricing svg {
    color: white !important;
    stroke: white !important;
    opacity: 1;
}

.sidebar-icon.sidebar-pricing span {
    color: white !important;
}

/* Referral Button - Gradient Blue/Purple */
.sidebar-icon.sidebar-referral {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: white !important;
    border: none;
}

.sidebar-icon.sidebar-referral:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

.sidebar-icon.sidebar-referral svg {
    color: white !important;
    stroke: white !important;
    opacity: 1;
}

.sidebar-icon.sidebar-referral span {
    color: white !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT WRAPPER
   ═══════════════════════════════════════════════════════════════════ */

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width-expanded);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 90px 32px 24px 32px;
    transition: margin-left var(--sidebar-transition);
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

/* Mobile: Full width when sidebar collapsed */
@media (max-width: 640px) {
    .main-wrapper {
        margin-left: 0;
    }

    .main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FLOATING HEADER - Modern Glass Design
   ═══════════════════════════════════════════════════════════════════ */

.floating-header {
    position: fixed;
    top: 16px;
    left: calc(var(--sidebar-width-expanded) + 16px);
    right: 16px;
    z-index: 1001;
    padding: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrapper.sidebar-collapsed~.floating-header,
.floating-header.sidebar-collapsed {
    left: calc(var(--sidebar-width-collapsed) + 16px);
}

@media (max-width: 640px) {
    .floating-header {
        left: 16px;
    }
}

.floating-header:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.floating-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 16px;
}

/* Header Left - Menu & Logo */
.floating-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(79, 125, 243, 0.08);
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-menu-btn:hover {
    background: rgba(79, 125, 243, 0.15);
    transform: scale(1.05);
}

.header-menu-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

@media (max-width: 640px) {
    .header-menu-btn {
        display: flex;
    }
}

.floating-header .header-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.floating-header .header-logo .logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.header-brand {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Header Center - Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.header-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Sign Up / Share Link Button - Primary Orange Gradient */
.action-signup {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 50%, #e85d26 100%);
    color: #ffffff;
    box-shadow:
        0 4px 16px rgba(255, 107, 53, 0.35),
        0 2px 4px rgba(255, 107, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.action-signup:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(255, 107, 53, 0.4),
        0 4px 8px rgba(255, 107, 53, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-signup:active {
    transform: translateY(0) scale(0.98);
}

.action-signup svg {
    stroke: #ffffff;
}

/* Book Appointment Button - Soft Glass */
.action-booking {
    background: rgba(79, 125, 243, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(79, 125, 243, 0.2);
}

.action-booking:hover {
    background: linear-gradient(135deg, #4f7df3 0%, #6366f1 100%);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(79, 125, 243, 0.35),
        0 4px 8px rgba(79, 125, 243, 0.2);
}

.action-booking:hover svg {
    stroke: #ffffff;
}

.action-booking svg {
    stroke: var(--primary-blue);
}

/* Header Right - User Info & Language */
.floating-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.floating-header .user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: -0.2px;
}

.floating-header .user-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Language Button */
.header-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-lang-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.header-lang-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.header-lang-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Language Dropdown */
.header-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1100;
}

.header-lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-lang-dropdown .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-lang-dropdown .lang-option:hover {
    background: #f1f5f9;
}

.header-lang-dropdown .lang-option.active {
    background: #e0f2fe;
}

.header-lang-dropdown .lang-flag {
    font-size: 10px;
    font-weight: 700;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border-radius: 50%;
    color: #64748b;
}

.header-lang-dropdown .lang-name {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    flex: 1;
}

.header-lang-dropdown .lang-check {
    opacity: 0;
    color: var(--primary-blue);
}

.header-lang-dropdown .lang-option.active .lang-check {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   LEGACY HEADER (Hidden)
   ═══════════════════════════════════════════════════════════════════ */

.header {
    height: auto;
    background: transparent;
    border-bottom: none;
    padding: 0 0 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    position: relative;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

/* Replaced header title with search bar for this design */
.search-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar svg {
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

/* Header Logo Styling */
.header-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-logo .logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.header-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 18px;
    letter-spacing: -0.3px;
}

.header-page-title {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: -0.3px;
    margin-right: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════════ */

.content {
    flex: 1;
    padding: 0;
    overflow-y: visible;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE - TABLET
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .sidebar-header {
        padding: 0;
        margin-bottom: 16px;
        justify-content: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding-bottom: 16px;
    }

    .sidebar-logo {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .sidebar-brand {
        display: block;
        /* Keep visible on mobile when sidebar is open */
    }

    .sidebar-menu {
        gap: 6px;
    }

    .main-wrapper {
        margin-left: 0;
        padding: 80px 16px 24px 16px;
    }

    .header {
        padding: 14px 20px;
    }

    .content {
        padding: 20px 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .sidebar-header {
        padding: 0 0 12px 0;
        margin-bottom: 12px;
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .main-wrapper {
        padding: 80px 12px 24px 12px;
    }

    .header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

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

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

    .header-title {
        font-size: 16px;
    }

    .content {
        padding: 16px 0;
    }
}