@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ChatGPT Dark Theme Colors */
    --bg-primary: #0f1015;
    --bg-secondary: rgba(24, 26, 33, 0.85);
    --bg-tertiary: #1c1e26;
    --text-primary: #F9F9F9;
    --text-secondary: #C9CBD4;
    --text-muted: #7C7F88;
    --accent-color: #10A37F;
    --accent-hover: #15B293;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.35);
    --focus-outline: 2px solid var(--accent-color);
    --bg-gradient-start: #11121a;
    --bg-gradient-end: #08090f;
    --neon-green: rgba(16, 163, 127, 0.4);
    --glass-border: rgba(255, 255, 255, 0.09);
    
    --border-radius-sm: 4px;
    --border-radius-md: 14px;
    --border-radius-lg: 12px;
    --transition-fast: 0.2s ease-in-out;
}

/* Base styles for the entire dashboard */
.dashboard-page {
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at top, rgba(16, 163, 127, 0.08), transparent 45%),
        radial-gradient(circle at 20% 20%, rgba(147, 112, 219, 0.12), transparent 35%),
        linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

.dashboard-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 10% 20%, rgba(16, 163, 127, 0.08), transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(147, 112, 219, 0.12), transparent 55%);
    z-index: 0;
    pointer-events: none;
}

.ambient-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.ambient-orbs .orb {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    background: radial-gradient(circle, rgba(16, 163, 127, 0.5), transparent 70%);
}

.ambient-orbs .orb-one {
    top: -80px;
    left: -60px;
}

.ambient-orbs .orb-two {
    bottom: 10%;
    right: -120px;
    background: radial-gradient(circle, rgba(180, 132, 255, 0.45), transparent 70%);
}

.ambient-orbs .orb-three {
    top: 30%;
    right: 15%;
    background: radial-gradient(circle, rgba(100, 181, 246, 0.4), transparent 70%);
}

.dashboard-page a {
    color: var(--text-primary);
    text-decoration: none;
}

.dashboard-page a:hover {
    color: var(--text-primary); /* Keep text color for hover, background changes */
}

.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Visually hidden for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Top Navigation --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-tertiary); /* Lighter than main bg, distinct */
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav .logo a {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.top-nav .logo a:hover {
    color: var(--accent-color);
}

.user-menu {
    position: relative;
}

.profile-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-md); /* Rounded corners */
    transition: background-color var(--transition-fast);
    position: relative; /* For dropdown positioning */
    gap: 0.75rem; /* Space between image and name */
}

.profile-header:hover,
.profile-header:focus {
    background-color: var(--bg-secondary);
    outline: none; /* Remove default outline */
}

.profile-header:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

.profile-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1; /* Adjust for vertical alignment */
}

/* General dropdown menu styles (used for top-nav dropdown) */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--bg-tertiary); /* Lighter dark background */
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 250px;
    padding: 0.5rem 0;
    z-index: 101; /* Above top-nav */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

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

.dropdown-profile {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.dropdown-profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.dropdown-profile-info .dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-profile-info .dropdown-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropdown-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown-menu a:hover {
    background-color: #3a3a3a; /* Match composer hover tone */
    color: var(--text-primary);
}

.dropdown-menu a:focus-visible {
    outline: var(--focus-outline);
    outline-offset: -2px;
}

.dropdown-menu.glass-panel {
    background: rgba(18, 20, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    padding: 1rem;
    min-width: 280px;
}

.dropdown-profile {
    position: relative;
    gap: 0.75rem;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.profile-badge {
    font-size: 0.75rem;
    color: var(--accent-color);
    border: 1px solid rgba(16, 163, 127, 0.4);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin-left: auto;
    white-space: nowrap;
    align-self: flex-start;
}

.dropdown-profile-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
}

.dropdown-profile-info {
    flex: 1;
}

.profile-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.profile-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.dropdown-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.quick-action {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    justify-content: center;
    text-align: center;
}

.quick-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.75rem 0;
    margin-bottom: 0.75rem;
}

.dropdown-links a {
    border-radius: 10px;
}

.dropdown-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.dropdown-section {
    margin-top: 0.5rem;
}

.dropdown-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.logout-button {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .dropdown-quick-actions {
        flex-direction: column;
    }
    .quick-action {
        width: 100%;
    }
}


/* --- Main Dashboard Content --- */
.dashboard-main {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(30, 33, 43, 0.95), rgba(15, 17, 25, 0.9));
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(16, 163, 127, 0.18), transparent 60%);
    opacity: 0.9;
    pointer-events: none;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.hero-content,
.hero-visual {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.25rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.dashboard-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.dashboard-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    max-width: 520px;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pill {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    display: inline-flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    align-items: center;
}

.pill i {
    color: var(--accent-color);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-btn {
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn.primary {
    background: var(--accent-color);
    color: #0b131f;
    box-shadow: 0 10px 30px rgba(16, 163, 127, 0.35);
}

.hero-btn.primary:hover {
    transform: translateY(-2px);
    background: var(--accent-hover);
}

.hero-btn.ghost {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    background: transparent;
}

.hero-btn.ghost:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-visual {
    background: rgba(12, 14, 21, 0.65);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.model-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.model-chip strong {
    color: var(--accent-color);
}

.hero-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.highlight-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.highlight-card strong {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.highlight-card span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.hero-sparkline {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.35rem;
}

.spark-dot {
    width: 32px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16, 163, 127, 0.9), rgba(16, 163, 127, 0.3));
    opacity: 0.6;
}

.spark-dot:nth-child(odd) {
    opacity: 0.9;
    transform: scaleX(1.1);
}

/* Quick actions */
.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
    margin: 1.5rem 0;
}

.quick-card {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transition: transform 0.2s ease, background 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    color: var(--accent-color);
}

.quick-title {
    margin: 0;
    font-weight: 600;
}

.quick-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Metrics */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.metric-value {
    margin: 0.35rem 0 0;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Panels */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-main-grid .panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.panel-header a {
    font-size: 0.8rem;
    color: var(--accent-color);
}

.recent-sessions ul,
.files-feed ul,
.notifications-feed ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-sessions li,
.files-feed li,
.notifications-feed li {
    padding: 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.recent-sessions .session-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recent-sessions .session-meta h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
}

.files-feed .file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notifications-feed li {
    display: flex;
    gap: 0.6rem;
}

.notifications-feed i {
    color: var(--accent-color);
}

.notifications-feed span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.panel .empty {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
}
/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card { /* General card styling */
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(22px);
    overflow: hidden;
}

.card:hover {
    background-color: rgba(39, 42, 53, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.45);
}

.card .card-icon {
    font-size: 2rem;
    color: var(--text-secondary); /* Default icon color */
}

.card .card-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.card .card-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Stat card specific styling */
.stat-card .stat-icon {
    color: var(--text-secondary); /* Muted icon color for regular stats */
}

.stat-card .stat-info h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.25rem 0;
}

.stat-card .stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* Specific styling for the Go to Chat card (ChatGPT style) */
.chat-action-card {
    background-color: var(--accent-color); /* ChatGPT green background */
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.4); /* Greenish shadow */
}

.chat-action-card:hover {
    background-color: var(--accent-hover); /* Lighter green on hover */
    transform: translateY(-2px); /* Subtle lift */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); /* Enhanced shadow */
}

.chat-action-card .card-icon {
    color: var(--text-primary); /* White icon for chat card */
}

.chat-action-card .card-body h3 {
    color: var(--text-primary);
}

.chat-action-card .card-body p {
    color: rgba(255, 255, 255, 0.8); /* Slightly muted white for description */
}


/* --- Main Content Grid --- */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Default for desktop */
    gap: 1.5rem;
}

/* --- Containers for Chart, Activity, Notifications --- */
.chart-container,
.recent-activity-container,
.notifications-widget {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(22px);
    position: relative;
    overflow: hidden;
}

.chart-container {
    height: 350px; /* Fixed height for chart area */
}

.chart-container h3,
.recent-activity-container h3,
.notifications-widget h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

/* --- Recent Activity Feed --- */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-fast);
}

.activity-item:hover {
    background-color: var(--bg-tertiary);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.05); /* Muted background for icons */
}
.activity-icon.chat { color: var(--accent-color); }
.activity-icon.profile { color: #5B8DEF; } /* A blue accent */
.activity-icon.file { color: #FFD700; } /* Yellow accent */
.activity-icon.setting { color: #B0B3C0; } /* Grey accent */


.activity-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

.activity-item .activity-description .timestamp {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.activity-item .action-link { /* Styling for links within empty states */
    color: var(--accent-color);
    text-decoration: underline;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
    display: flex; /* For consistent icon/text alignment */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.empty-state i {
    font-size: 1.2rem;
}
.empty-state p {
    margin: 0;
}


/* --- Notifications Widget --- */
.notifications-widget {
    /* Inherits general container styles */
}

.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item i {
    color: var(--accent-color);
    flex-shrink: 0;
}


/* --- Left Sidebar (from sidebarContent.css, but overridden here for consistency) --- */
/* This is likely part of the main application layout and not strictly dashboard-specific anymore */
.left-sidebar {
    width: 240px; /* Assuming a default sidebar width */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    background-color: var(--bg-tertiary); /* Consistent with dropdown/hover */
    transform: none;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px var(--shadow-color); /* Shadow to the right */
    overflow: visible; /* Ensure nothing inside is clipped */
}

.left-sidebar.closed {
    transform: none;
}

/* Specific styling for sidebar footer profile */
.sidebar-footer .profile-header {
    padding: 0.5rem 0.75rem; /* Adjust padding for sidebar context */
    border-radius: var(--border-radius-md); /* Match general card radius */
    width: 100%; /* Make it take full width of footer */
    justify-content: center; /* Center content horizontally */
    box-sizing: border-box; /* Include padding in width */
    position: relative; /* Ensure it's a positioning context for the dropdown-container */
}

.sidebar-footer .profile-image {
    width: 28px; /* Slightly smaller for sidebar */
    height: 28px;
}

.sidebar-footer .profile-name {
    font-size: 0.9rem; /* Smaller font for sidebar */
}

/* Adjust dropdown position for sidebar footer */
.sidebar-footer .profile-header .dropdown-container {
    position: absolute; /* Position absolute relative to profile-header */
    bottom: calc(100% + 8px); /* Position above the profile header with breathing room */
    left: 50%; /* Center horizontally relative to profile-header */
    transform: translate(-50%, 10px); /* Adjust to truly center and slide */
    z-index: 99999; /* Ensure it's above other elements */
    width: max-content; /* Adjust width to content */
    min-width: 230px; /* larger footprint */
    max-width: 280px; /* Limit width */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    background: #303030; /* Match input area */
    border: 1px solid rgba(255, 255, 255, 0.08); /* Soft border */
    border-radius: 14px;
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

body.sidebar-collapsed .sidebar-footer .profile-header {
    overflow: visible;
}

body.sidebar-collapsed .sidebar-footer .profile-header .dropdown-container {
    left: calc(100% + 12px);
    transform: translate(0, 10px);
}

.sidebar-footer .profile-header .dropdown-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0); /* Apply active transform */
    pointer-events: auto;
}

.sidebar-footer .profile-header .dropdown-container .dropdown-menu {
    /* Reset styles that might be inherited or conflicting */
    position: static;
    top: auto;
    right: auto;
    transform: none;
    padding: 0; /* Remove padding as dropdown-container now has it */
    width: 100%; /* Fill container */
    box-shadow: none; /* Shadow handled by dropdown-container */
    border: none; /* Border handled by dropdown-container */
    background-color: transparent; /* Background handled by dropdown-container */
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transition: none;
    /* Ensure padding for menu items is applied to the 'a' tags or 'li' directly */
}

.sidebar-footer .dropdown-menu li {
    padding: 0; /* Let the anchor tags handle padding */
}

.sidebar-footer .dropdown-menu li {
    padding: 0;
}

.footer-dropdown {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-profile-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.35rem;
}

.footer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.footer-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.footer-profile-info .profile-name {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.footer-profile-info .profile-email {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.profile-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 6px rgba(16, 163, 127, 0.7);
}

.footer-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-link-list a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.4rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.footer-link-list a i {
    width: 1.1rem;
    text-align: center;
    font-size: 1rem;
}

.footer-link-list a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.footer-link-list a.highlight {
    color: var(--accent-color);
}

.logout-button.compact {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.logout-button.compact:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-grid,
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-pills {
        flex-direction: column;
    }
    .hero-actions {
        flex-direction: column;
    }
    .top-nav {
        padding: 0.75rem 1rem;
    }
    .top-nav .logo a {
        font-size: 1.4rem;
    }
    .dashboard-main {
        padding: 1rem;
    }
    .dashboard-title {
        font-size: 2rem;
    }
    .dashboard-subtitle {
        font-size: 0.9rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    .stat-card {
        padding: 1rem;
        gap: 0.5rem;
        flex-direction: column; /* Stack icon and info on small screens */
        text-align: center;
    }
    .stat-card .stat-icon {
        font-size: 1.5rem;
    }
    .stat-card .stat-info p {
        font-size: 1.25rem;
    }
    .chart-container,
    .recent-activity-container,
    .notifications-widget {
        padding: 1rem;
    }
    .chart-container {
        height: 300px;
    }
    .recent-activity-container h3,
    .notifications-widget h3 {
        font-size: 1.1rem;
    }
.activity-item p, .notification-item p {
    font-size: 0.85rem;
}
}

/* Profile customization modal */
.profile-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(5, 6, 10, 0.75);
    backdrop-filter: blur(10px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.profile-modal.open {
    opacity: 1;
    visibility: visible;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
}

.profile-modal-dialog {
    position: relative;
    background: rgba(19, 20, 29, 0.95);
    border-radius: 24px;
    padding: 2rem;
    max-width: 720px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.profile-modal-header h2 {
    margin: 0.2rem 0;
    font-size: 1.6rem;
}

.modal-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.modal-subline {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
}

.profile-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
}

.profile-summary {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    background: rgba(10, 12, 18, 0.8);
}

.profile-summary img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-summary h3 {
    margin: 0;
}

.profile-summary p {
    margin: 0.1rem 0;
    color: rgba(255, 255, 255, 0.75);
}

.profile-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.profile-status-pill i {
    font-size: 0.55rem;
    color: #10A37F;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.modal-form-grid input,
.modal-form-grid select {
    background: rgba(14, 15, 24, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.65rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.modal-toggle-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle input {
    display: none;
}

.toggle-indicator {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    position: relative;
    transition: background 0.2s ease;
}

.toggle-indicator::after {
    content: "";
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 4px;
    transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-indicator {
    background: rgba(16, 163, 127, 0.6);
}

.toggle input:checked + .toggle-indicator::after {
    transform: translateX(20px);
}

.modal-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.profile-modal-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
