/* ============================================
   SHELL CSS v2.0 - Dashboard switcher with categories
   Each dashboard loads its own full CSS file.
   ============================================ */

/* Dashboard Drawer (left slide-out) */
.dashboard-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.dashboard-drawer-overlay.open { opacity: 1; visibility: visible; }

.dashboard-drawer {
    position: fixed;
    top: 0; left: -340px; bottom: 0;
    width: 320px;
    background: var(--bg-card, #fff);
    border-right: 1px solid var(--border, #E2E8F0);
    z-index: 2001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}
.dashboard-drawer.open { left: 0; }

.dashboard-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #E2E8F0);
}
.dashboard-drawer-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1A202C);
    margin: 0;
}
.dashboard-drawer-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary, #64748B);
}
.dashboard-drawer-close:hover { border-color: var(--primary, #E63946); color: var(--primary, #E63946); }

.dashboard-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Category groups */
.dd-category {
    margin-bottom: 4px;
}
.dd-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
    user-select: none;
}
.dd-category-header:hover { background: var(--bg-input, #F7F9FC); }
.dd-cat-icon { font-size: 1rem; }
.dd-cat-name {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #64748B);
}
.dd-cat-count {
    font-size: 0.625rem;
    font-weight: 600;
    background: var(--bg-input, #F7F9FC);
    color: var(--text-muted, #94A3B8);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.dd-cat-chevron {
    font-size: 0.75rem;
    color: var(--text-muted, #94A3B8);
    transition: transform 0.2s ease;
}
.dd-cat-chevron.collapsed {
    transform: rotate(-90deg);
}

.dd-category-items {
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
    padding-left: 8px;
}
.dd-category-items.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Dashboard items */
.dashboard-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-bottom: 2px;
}
.dashboard-drawer-item:hover { background: var(--bg-input, #F7F9FC); }
.dashboard-drawer-item.active {
    background: var(--primary-light, rgba(230,57,70,0.1));
    border: 1px solid var(--primary, #E63946);
}
.dashboard-drawer-item .dd-icon { font-size: 1.125rem; }
.dashboard-drawer-item .dd-info { flex: 1; min-width: 0; }
.dashboard-drawer-item .dd-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary, #1A202C);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-drawer-item .dd-desc {
    font-size: 0.6875rem;
    color: var(--text-muted, #94A3B8);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard switcher button in header */
.dashboard-switch-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input, #F7F9FC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary, #64748B);
    transition: all 0.15s ease;
    font-size: 16px;
    flex-shrink: 0;
}
.dashboard-switch-btn:hover { border-color: var(--primary, #E63946); color: var(--primary, #E63946); }

/* Hide inactive dashboard CSS elements */
.dashboard-hidden { display: none !important; }

/* ============================================
   PROFILE MODAL
   ============================================ */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.profile-modal-overlay.open { opacity: 1; visibility: visible; }

.profile-modal {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.profile-modal-overlay.open .profile-modal { transform: scale(1); }

.profile-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border, #E2E8F0);
}
.profile-modal .modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1A202C);
    margin: 0;
}
.profile-modal .modal-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input, #F7F9FC);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary, #64748B);
}
.profile-modal .modal-close:hover { background: var(--danger-light, rgba(239,68,68,0.1)); color: var(--danger, #EF4444); }

.profile-modal .modal-body { padding: 20px; }

.profile-modal .form-group { margin-bottom: 16px; }
.profile-modal .form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.profile-modal .form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 10px;
    background: var(--bg-input, #F7F9FC);
    color: var(--text-primary, #1A202C);
    outline: none;
    transition: border-color 150ms ease;
    font-family: inherit;
}
.profile-modal .form-input:focus { border-color: var(--primary, #E63946); }

.profile-modal .form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #94A3B8);
    margin-top: 4px;
}

.profile-modal .section-divider {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94A3B8);
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light, #F1F5F9);
}

.profile-modal .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border, #E2E8F0);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.profile-modal .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 150ms ease;
    font-family: inherit;
}
.profile-modal .btn-primary { background: var(--primary, #E63946); color: #fff; }
.profile-modal .btn-primary:hover { background: var(--primary-hover, #D62839); }
.profile-modal .btn-secondary { background: var(--bg-input, #F7F9FC); color: var(--text-secondary, #64748B); border: 1px solid var(--border, #E2E8F0); }
.profile-modal .btn-secondary:hover { border-color: var(--primary, #E63946); color: var(--primary, #E63946); }

/* ============================================
   USER MENU PANEL (right slide-out)
   ============================================ */
.user-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2800;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.user-panel-overlay.open { opacity: 1; visibility: visible; }

.user-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    background: var(--bg-card, #fff);
    z-index: 2801;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
}
.user-panel.open { transform: translateX(0); }

.user-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #E2E8F0);
}
.user-panel-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #1A202C);
    margin: 0;
}
.user-panel-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted, #94A3B8);
    border-radius: 6px;
    font-family: inherit;
}
.user-panel-close:hover { background: var(--bg-input, #F7F9FC); color: var(--text-primary, #1A202C); }

.user-panel-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

/* Identity card */
.user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-input, #F7F9FC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
    margin-bottom: 12px;
}
.user-avatar {
    width: 42px; height: 42px;
    background: var(--primary, #E63946);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0;
}
.user-identity-info { flex: 1; min-width: 0; }
.user-identity-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #1A202C);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-identity-role {
    font-size: 0.75rem;
    color: var(--text-muted, #94A3B8);
    margin-top: 2px;
}

/* Section label */
.user-menu-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94A3B8);
    padding: 4px 4px 2px;
}

/* Menu items */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    color: var(--text-primary, #1A202C);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}
.user-menu-item:hover {
    background: var(--bg-input, #F7F9FC);
    border-color: var(--border, #E2E8F0);
}
.user-menu-item .menu-item-icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input, #F7F9FC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 8px;
    color: var(--text-secondary, #64748B);
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.user-menu-item:hover .menu-item-icon {
    background: var(--primary-light, rgba(230,57,70,0.1));
    border-color: var(--primary, #E63946);
    color: var(--primary, #E63946);
}
.user-menu-item .menu-item-label { flex: 1; }

.user-menu-item.danger { color: var(--danger, #EF4444); }
.user-menu-item.danger .menu-item-icon {
    background: var(--danger-light, rgba(239,68,68,0.1));
    border-color: transparent;
    color: var(--danger, #EF4444);
}
.user-menu-item.danger:hover {
    background: var(--danger-light, rgba(239,68,68,0.1));
    border-color: var(--danger, #EF4444);
}
.user-menu-item.danger:hover .menu-item-icon {
    background: var(--danger-light, rgba(239,68,68,0.1));
    border-color: var(--danger, #EF4444);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-light, #F1F5F9);
    margin: 6px 0;
}

/* User chip button in header */
.user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-input, #F7F9FC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-primary, #1A202C);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: border-color 0.15s ease;
    font-family: inherit;
    max-width: 160px;
}
.user-chip:hover { border-color: var(--primary, #E63946); }
.user-chip-avatar {
    width: 26px; height: 26px;
    background: var(--primary, #E63946);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}
.user-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
