@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Premium Cream & Modern */
    --cream-25: #fdfcfa;
    --cream-50: #f9f8f6;
    --cream-100: #f5f2ed;
    --cream-200: #e8e2d8;
    --cream-300: #d9d0c1;
    --cream-400: #cfc4b0;
    --cream-500: #b8ab94;
    --cream-600: #9c8f7a;
    --cream-700: #7a7164;
    --cream-800: #5a5343;
    --cream-900: #3a362e;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    /* Glass Effect Variables */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Layout Variables */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --topbar-height: 70px;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Primary Variables */
    --primary: var(--cream-600);
    --primary-hover: var(--cream-700);
    --bg: var(--cream-25);
    --text: var(--cream-900);
    --text-light: var(--cream-700);
    --text-muted: var(--cream-500);
    --border: var(--cream-200);
    --surface: white;
    --surface-elevated: var(--cream-50);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f0f;
        --surface: #1a1a1a;
        --surface-elevated: #262626;
        --text: #f5f5f5;
        --text-light: #a3a3a3;
        --text-muted: #737373;
        --border: #2d2d2d;
    }
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Improved Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--cream-100);
}

::-webkit-scrollbar-thumb {
    background: var(--cream-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cream-500);
}

/* Enhanced Sidebar */
.sidebar {
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--cream-600) 0%, var(--cream-700) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl), inset 1px 0 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    z-index: 1000;
    color: white;
    transform: translateX(-100%);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.02)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.logo {
    padding: 32px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 16px;
    position: relative;
}

.logo h2 {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

.logo .logo-icon {
    display: block;
    font-size: 2rem;
    color: rgba(255,255,255,0.9);
    margin: 0 auto 6px auto;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.logo .tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Enhanced Navigation */
.nav-menu {
    padding: 8px 16px;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    padding: 0 20px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    margin: 4px 0;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--transition);
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item i {
    margin-right: 16px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 3px 0 0 white, 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item.active i {
    color: white;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* Enhanced Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
    background: var(--bg);
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 100vh;
    background: radial-gradient(ellipse at top, var(--cream-50) 0%, var(--bg) 50%);
    pointer-events: none;
    z-index: -1;
    transition: var(--transition);
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content::before {
        left: 0;
    }
}

/* Desktop collapse/expand support */
.sidebar.is-hidden { /* deprecated: keep for backward compatibility */
    transform: translateX(-100%);
}

.main-content.expanded { /* when sidebar fully hidden */
    margin-left: 0;
}

.main-content.collapsed { /* when sidebar shows only icons */
    margin-left: var(--sidebar-collapsed);
}

/* Hide texts and compress paddings in collapsed sidebar */
.sidebar.collapsed .logo h2,
.sidebar.collapsed .logo .tagline,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .badge {
    display: none !important;
}

.sidebar.collapsed .logo { padding: 24px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .nav-item i { margin: 0; font-size: 1.25rem; }
.sidebar.collapsed .nav-menu { padding: 8px 8px; }
.sidebar.collapsed .logo::after { display: none; }

/* Premium Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
}

.menu-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
    font-family: 'Playfair Display', serif;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 4px;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Logout button in top bar */
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    margin-right: 12px;
}

.logout-btn:hover { background: rgba(255,255,255,0.16); }
.logout-btn i { opacity: 0.9; }
.logout-text { font-weight: 600; font-size: 0.9rem; }

/* Enhanced Menu Toggle */
.menu-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: var(--transition);
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

.menu-toggle:hover::before {
    width: 100%;
    height: 100%;
}

.menu-toggle:hover {
    color: var(--accent-primary);
    transform: scale(1.05);
}

.menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    border-radius: 12px;
}

/* Premium User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: var(--transition);
}

.user-avatar:hover::before {
    transform: translateX(100%);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -2px;
}

/* Enhanced User Dropdown */
.user-dropdown {
    display: none;
    position: fixed;
    right: 20px;
    top: 70px;
    background: #cfc4b0 !important;
    min-width: 280px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    z-index: 99999;
    animation: dropdownFadeIn 0.3s ease-out;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    background: #cfc4b0;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-header {
    padding: 20px;
    background: #5e3f06;
    border-bottom: 1px solid var(--border);
}

.dropdown-user-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 1rem;
}

.dropdown-user-email {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dropdown-section {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.dropdown-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.dropdown-item:hover {
    background:#5e3f06;
    color: var(--accent-primary);
}

.dropdown-item:hover i {
    opacity: 1;
}

.dropdown-divider {
    height: 1px;
    background: #5e3f06;
    margin: 8px 0;
}

.dropdown-item.logout {
    color:      #5e3f06;
    border-top: 1px solid var(--border);
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Premium Dashboard Cards */
.content-wrapper {
    padding: 32px;
}

.cream-theme .content-wrapper {
    background: #ffffff;
    border: 1px solid var(--cream-300);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: var(--shadow-md);
    animation: float 3s ease-in-out infinite;
}

.card-icon.success {
    background: linear-gradient(135deg, var(--accent-success), #059669);
}

.card-icon.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.card-icon.warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
}

.card-icon.error {
    background: linear-gradient(135deg, var(--accent-error), #dc2626);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.card-menu {
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.card-menu:hover {
    background: var(--surface-elevated);
    color: var(--text);
}

.card-content {
    text-align: left;
}

.card-title {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1;
}

.card-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.card-change.positive {
    color: var(--accent-success);
}

.card-change.negative {
    color: var(--accent-error);
}

/* Enhanced Activity Section */
.recent-activity {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.activity-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.cream-theme .activity-header h2 {
    color: var(--cream-700) !important;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    border-bottom: 1px solid var(--cream-100);
    transition: var(--transition);
    border-radius: 12px;
    margin: 0 -16px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--cream-50);
    transform: translateX(4px);
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 1.2rem;
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: var(--shadow-sm);
}

.activity-details {
    flex: 1;
}

.activity-text {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-badge {
    background: var(--cream-100);
    color: var(--cream-700);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.activity-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.activity-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

/* Enhanced Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px 16px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-value {
        font-size: 2rem;
    }
    
    .top-bar {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .user-info {
        display: none;
    }
    
    .card-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .activity-item {
        padding: 16px 12px;
    }
    
    .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible enhancements */
.nav-item:focus-visible,
.dropdown-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Loading States */
.card.loading {
    pointer-events: none;
    position: relative;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-bar,
    .overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* THEME: Cream background with white text */
.cream-theme {
    /* Variable overrides */
    --bg: var(--cream-600);
    --surface: rgba(255, 255, 255, 0.08);
    --surface-elevated: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-light: rgba(255, 255, 255, 0.92);
    --text-muted: rgba(255, 255, 255, 0.72);
    --border: rgba(255, 255, 255, 0.18);
}

.cream-theme .main-content {
    background: var(--bg);
}

.cream-theme .main-content::before {
    /* Remove dark band; keep subtle light vignette over cream */
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.12) 0%, transparent 55%);
}

.cream-theme .top-bar {
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.cream-theme .page-title,
.cream-theme .breadcrumb,
.cream-theme .breadcrumb a,
.cream-theme .breadcrumb-separator {
    color: var(--text-light);
}

.cream-theme .breadcrumb a:hover { color: #ffffff; }

.cream-theme .card,
.cream-theme .recent-activity {
    background: var(--cream-50); /* superficies crema para contraste sobre fondo blanco */
    border: 1px solid var(--cream-300);
    color: var(--cream-900);
}

.cream-theme .card-title { color: var(--cream-700); }
.cream-theme .card-value { color: var(--cream-900); }
.cream-theme .card-menu { color: var(--text-muted); }
.cream-theme .card-menu:hover { color: var(--cream-900); background: var(--cream-100); }

.cream-theme .activity-header { border-bottom: 1px solid var(--cream-800); }
.cream-theme .activity-item { border-bottom: 1px solid var(--cream-100); }
.cream-theme .activity-item:hover { background: var(--cream-100); }
.cream-theme .activity-text { color: var(--cream-900); }
.cream-theme .activity-time { color: var(--cream-600); }

.cream-theme .dropdown-item { color: var(--text); }
.cream-theme .dropdown-item:hover { background: rgba(255,255,255,0.08); }
.cream-theme .dropdown-divider { background: var(--border); }

.cream-theme .user-dropdown { background: rgba(255,255,255,0.08); }
.cream-theme .dropdown-header { background: rgba(255,255,255,0.06); border-bottom: 1px solid var(--border); }
.cream-theme .dropdown-user-name { color: var(--text); }
.cream-theme .dropdown-user-email { color: var(--text-muted); }

.cream-theme .nav-item { color: rgba(255,255,255,0.9); }
.cream-theme .nav-item i { color: rgba(255,255,255,0.8); }
.cream-theme .nav-item .badge { background: rgba(255,255,255,0.18); color: #fff; }

.cream-theme .overlay { background: rgba(0, 0, 0, 0.45); }

/* Ensure inputs/links readable in cream theme */
.cream-theme a { color: #ffffff; }
.cream-theme a:hover { color: var(--text-light); }

/* Remove purple accents inside cream theme */
.cream-theme {
    --accent-primary: #e7d8be;   /* warm cream */
    --accent-secondary: #cfb891; /* soft sand */
}

/* Icon blocks and avatars use warm cream gradients instead of purple */
.cream-theme .card-icon,
.cream-theme .card-icon.primary,
.cream-theme .activity-icon,
.cream-theme .user-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

/* Hover/focus states avoid purple tint */

/* Safety: si por algun motivo la clase .show queda activa en escritorio, no bloqueará el contenido */
@media (min-width: 1025px) {
    .overlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}
.cream-theme .menu-toggle:hover { color: #ffffff; }
.cream-theme .nav-item:hover,
.cream-theme .nav-item.active { box-shadow: 0 4px 12px rgba(0,0,0,0.15); background: rgba(255,255,255,0.18); }
.cream-theme .card-menu:hover { background: rgba(255,255,255,0.12); }
.cream-theme .breadcrumb a:hover { color: #ffffff; }

/* Badges in nav keep neutral cream */
.cream-theme .nav-item .badge { background: rgba(255,255,255,0.22); color: #fff; }

/* Ripple/overlay already neutral; keep stronger contrast on dropdown logout */
.cream-theme .dropdown-item.logout { color: #ffe6e3; }

/* ===== PROFILE PAGE STYLES ===== */

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.profile-avatar-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: var(--transition);
}

.profile-avatar-large:hover::before {
    transform: translateX(100%);
}

.profile-header-info h2.profile-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 600;
    color:black;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.profile-role {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0 0 4px 0;
    font-weight: 500;
}

.profile-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-elevated);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Profile Content */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.profile-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.profile-section:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.section-title i {
    color: var(--accent-primary);
    font-size: 1.25rem;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: black;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-value {
    font-size: 1rem;
    color: var(--cream-900);
    line-height: 1.6;
    /*word-break: break-word;*/
    background: var(--cream-900); /*Fondo oscuro */
    border-radius: 10px;
    padding: 12px 16px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.field-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.field-value:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.field-value:hover::before {
    transform: translateX(100%);
}

/* Estilos para los campos de edición */
#profileEditForm .field-value-edit {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cream-900);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--cream-300);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    margin-top: 0.25rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#profileEditForm .field-value-edit:focus {
    color: var(--cream-900);
    background-color: white;
    border-color: var(--accent-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#profileEditForm .field-value-edit::placeholder {
    color: var(--cream-400);
    opacity: 1;
}

#profileEditForm .field-value-edit[readonly] {
    background-color: var(--cream-50);
    cursor: not-allowed;
}

#profileEditForm .field-value-edit[disabled] {
    background-color: var(--cream-100);
    color: var(--cream-500);
    cursor: not-allowed;
    opacity: 1;
}

#profileEditForm textarea.field-value-edit {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Estilo para el campo de fecha */
#profileEditForm input[type="date"].field-value-edit {
    padding: 0.7rem 1rem;
}

/* Estilo para los botones dentro del formulario */
#profileEditForm .profile-actions .btn {
    padding: 0.65rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#profileEditForm .profile-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
}

#profileEditForm .profile-actions .btn-secondary {
    background: white;
    border: 1px solid var(--cream-300);
    color: var(--cream-700);
}

#profileEditForm .profile-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

#profileEditForm .profile-actions .btn-secondary:hover {
    background: var(--cream-50);
    border-color: var(--cream-400);
}

/* Estilos para las etiquetas en el formulario de edición */
#profileEditForm .field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cream-700);
    margin-bottom: 0.35rem;
    display: block;
}

/* Estilo para campos requeridos en el formulario */
#profileEditForm .field-label.required:after {
    content: ' *';
    color: var(--accent-error);
}

/* Ajustes para el tema claro/oscuro */
.dark-theme #profileEditForm .field-value-edit {
    background-color: var(--cream-800);
    border-color: var(--cream-700);
    color: white;
}

.dark-theme #profileEditForm .field-value-edit:focus {
    background-color: var(--cream-800);
    border-color: var(--accent-primary);
}

.dark-theme #profileEditForm .field-value-edit[readonly] {
    background-color: var(--cream-900);
}

.dark-theme #profileEditForm .field-value-edit[disabled] {
    background-color: var(--cream-900);
    color: var(--cream-500);
}

/* Badges */
.role-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-badge.admin {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-muted);
}

/* Security Information */
.security-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--surface-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.security-item:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: var(--accent-primary);
}

.security-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.security-details h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.security-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* Activity Stats */
.activity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.5);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--accent-success), #059669);
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
}

.stat-icon.error {
    background: linear-gradient(135deg, var(--accent-error), #dc2626);
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Toast Notifications */
    .toast {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 16px 20px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-lg);
        animation: slideIn 0.3s ease-out;
    }

    .toast-content {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text);
        font-weight: 500;
    }

    .toast-info {
        border-left: 4px solid var(--accent-primary);
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Cream Theme Overrides for Profile */
    .cream-theme .profile-header,
    .cream-theme .profile-section {
        background: var(--cream-50);
        border: 1px solid var(--cream-300);
        color: var(--cream-900);
    }

    .cream-theme .profile-name,
    .cream-theme .section-title {
        color: var(--cream-900);
    }

    .cream-theme .profile-role {
        color: var(--cream-700);
    }

    .cream-theme .profile-email {
        color: var(--cream-600);
    }

    .cream-theme .field-label {
        color: black;
    }

    .cream-theme .field-value {
        background: rgba(255, 255, 255, 0.1);
        color: black;
        border-left-color: var(--accent-secondary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .cream-theme .field-value:hover {
        background: rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .cream-theme .security-item,
    .cream-theme .stat-item {
        background: var(--cream-100);
        border-color: var(--cream-300);
    }

    .cream-theme .security-item:hover,
    .cream-theme .stat-item:hover {
        background: var(--cream-200);
        border-color: var(--accent-primary);
    }

    .cream-theme .security-details h4,
    .cream-theme .stat-value {
        color: var(--cream-900);
    }

    .cream-theme .security-details p,
    .cream-theme .stat-label {
        color: var(--cream-600);
    }

    .cream-theme .btn-outline {
        color: var(--cream-900);
        border-color: var(--cream-400);
    }

    .cream-theme .btn-outline:hover {
        background: var(--cream-200);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
    }

    .cream-theme .toast {
        background: var(--cream-50);
        border-color: var(--cream-300);
        color: var(--cream-900);
    }

    /* Responsive Design for Profile */
    @media (max-width: 768px) {
        .profile-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 24px;
            text-align: left;
        }
        
        .profile-avatar-section {
            width: 100%;
        }
        
        .profile-actions {
            width: 100%;
            justify-content: stretch;
        }
        
        .btn {
            flex: 1;
            justify-content: center;
        }
        
        .profile-grid {
            grid-template-columns: 1fr;
        }
        
        .activity-stats {
            grid-template-columns: 1fr;
        }
        
        .security-item {
            flex-direction: column;
            text-align: center;
            gap: 16px;
        }
    }

    @media (max-width: 480px) {
        .profile-header,
        .profile-section {
            padding: 20px;
        }
        
        .profile-avatar-large {
            width: 80px;
            height: 80px;
            font-size: 1.5rem;
        }
        
        .profile-name {
            font-size: 1.5rem;
        }
        
        .section-title {
            font-size: 1.25rem;
        }
    }