/* 
  admin.kaywat SPA Shell Layout - Nuclear Build
  Forcing robust sidebar collapse and color consistency.
*/

:root {
    --bg: #121212;
    --surface: #1e1e1e;
    --card: #1a1a1a;
    --card-hover: #252525;
    --elevated: #2a2a2a;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #FE2C55; /* Red */
    --purple: #FE2C55;
    --green: #FE2C55;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --text-faint: #555f6e;
    --sidebar-w: 240px;
    --sidebar-collapsed-w: 68px;
    --header-h: 56px;
    --transition: 0.2s ease-in-out;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    height: 100vh; 
    width: 100vw; 
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

#app-wrapper { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* --- HEADER --- */
.top-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title::before {
    content: "|";
    color: var(--border);
    font-weight: 300;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--elevated);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.header-avatar, .sidebar-user-avatar {
    width: 28px !important;
    height: 28px !important;
    background: linear-gradient(135deg, var(--accent), #e62548);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* --- BODY --- */
.dashboard-body { display: flex; flex: 1; overflow: hidden; }

#mainSidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    transition: width var(--transition), padding var(--transition);
    overflow: hidden !important; /* Force hide all scrollbars during transition */
    flex-shrink: 0;
    white-space: nowrap; /* Prevent content from wrapping and causing overflow */
}

/* Hide scrollbar for Chrome, Safari and Opera */
#mainSidebar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
#mainSidebar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* --- COLLAPSE LOGIC --- */
#mainSidebar.collapsed {
    width: var(--sidebar-collapsed-w) !important;
    padding: 1.25rem 0.25rem !important;
}

#mainSidebar.collapsed .sidebar-user,
#mainSidebar.collapsed .nav-label,
#mainSidebar.collapsed .nav-item-text {
    display: none !important;
}

/* --- SIDEBAR COMPONENTS --- */
.sidebar-top { display: flex; align-items: center; margin-bottom: 1.5rem; }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.sidebar-user-name { font-weight: 700; font-size: 0.85rem; }
.sidebar-user-email { font-size: 0.7rem; color: var(--text-faint); }

.sidebar-collapse-btn {
    width: 28px; height: 28px;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-faint);
}

.nav-items-container { 
    flex: 1; 
    overflow-y: auto; 
    overflow-x: hidden; 
    margin: 0 -0.5rem; 
    padding: 0 0.5rem; 
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-items-container::-webkit-scrollbar { display: none; }
.nav-label { font-size: 0.65rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; margin: 1.5rem 0 0.75rem 0.75rem; }

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.75rem; border-radius: 8px;
    color: var(--text-dim); text-decoration: none; font-size: 0.85rem;
    transition: 0.2s;
}

.nav-item:hover { background: var(--elevated); color: var(--text); }
.nav-item.active { background: rgba(254, 44, 85, 0.1); color: var(--accent); }

#mainSidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem 0; }

/* Business Selection specific */
.business-selection-nav {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.business-item {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 2px;
}

.business-item.active {
    background: rgba(254, 44, 85, 0.08) !important;
    color: var(--accent) !important;
}

.add-business-btn {
    margin-top: 0.5rem;
    font-weight: 500;
}

.sidebar-footer { 
    margin-top: auto; 
    padding-top: 1rem; 
    border-top: 1px solid var(--border); 
}

.logout-btn {
    color: #ff4d4d !important;
}

#mainSidebar.collapsed .business-selection-nav {
    border-top: none;
    margin-top: 0;
}

/* --- MAIN AREA --- */
.main-area { flex: 1; overflow: hidden; background: var(--bg); }
#viewport { width: 100%; height: 100%; border: none; }
