/* ═══════════════════════════════════════════════════════════════════════
   Gordian1729Pulse — Premium HRM Design System
   "Cut the Workforce Knot. Feel the Pulse."
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fonts & Root Variables ─────────────────────────────────────────── */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Shared Constants */
    --color-success: #859900; /* Solarized Green */
    --color-warning: #b58900; /* Solarized Yellow */
    --color-danger: #dc322f;  /* Solarized Red */
    --color-info: #268bd2;    /* Solarized Blue */
    
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 72px;
    --header-height: 42px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── Default / Solarized Light Theme (Default fallback) ───────────────── */
:root, [data-theme='solarized-light'] {
    --color-primary: #268bd2;       /* Blue */
    --color-primary-light: #2aa198; /* Cyan */
    --color-secondary: #d33682;     /* Magenta */
    --surface-app: #fdf6e3;         /* Base3 (Background) */
    --surface-base: #eee8d5;        /* Base2 (Surface) */
    --surface-card: #eee8d5;        /* Base2 */
    --surface-card-hover: #e4ddc3;  /* Slightly darker Base2 */
    --surface-elevated: #ffffff;    /* Base3 variant */
    --surface-border: rgba(101,123,131,0.12); /* Base00 with alpha */
    --text-primary: #657b83;        /* Base00 */
    --text-secondary: #586e75;      /* Base01 */
    --text-muted: #93a1a1;          /* Base1 */
    --glow-primary: 0 0 20px rgba(38,139,210,0.15);
    --shadow-card: 0 4px 12px rgba(0,0,0,0.06);
}

/* ── Dark Theme ─────────────────────────────────────────────────── */
[data-theme='dark'] {
    --color-primary: #6366f1;
    --color-primary-light: #818cf8;
    --color-secondary: #8b5cf6;
    --surface-app: #0f1117;
    --surface-base: #161b27;
    --surface-card: #1e2535;
    --surface-card-hover: #252d3f;
    --surface-elevated: #2a3347;
    --surface-border: rgba(255,255,255,0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glow-primary: 0 0 20px rgba(99,102,241,0.25);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
}

/* ── Light Theme ─────────────────────────────────────────────────── */
[data-theme='light'] {
    --color-primary: #4f46e5;
    --color-primary-light: #6366f1;
    --color-secondary: #7c3aed;
    --surface-app: #f1f5f9;
    --surface-base: #ffffff;
    --surface-card: #f8fafc;
    --surface-card-hover: #f1f5f9;
    --surface-elevated: #ffffff;
    --surface-border: rgba(0,0,0,0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --glow-primary: 0 0 20px rgba(79,70,229,0.15);
    --shadow-card: 0 4px 12px rgba(0,0,0,0.05);
}

/* ── Solarized Dark Theme (Synced with MudBlazor) ─────────────────── */
[data-theme='solarized-dark'] {
    --color-primary: #268bd2;
    --color-primary-light: #2aa198;
    --color-secondary: #d33682;
    --surface-app: #002b36;
    --surface-base: #073642;
    --surface-card: #073642;
    --surface-card-hover: #0a4b5a;
    --surface-elevated: #0a4b5a;
    --surface-border: rgba(147,161,161,0.1);
    --text-primary: #93a1a1;
    --text-secondary: #839496;
    --text-muted: #586e75;
    --glow-primary: 0 0 20px rgba(38,139,210,0.2);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
}

/* ── Nord Theme (Premium Frost) ────────────────────────────────── */
[data-theme='nord'] {
    --color-primary: #88C0D0;
    --color-primary-light: #8FBCBB;
    --color-secondary: #81A1C1;
    --surface-app: #2E3440;
    --surface-base: #3B4252;
    --surface-card: #434C5E;
    --surface-card-hover: #4C566A;
    --surface-elevated: #4C566A;
    --surface-border: rgba(229,233,240,0.1);
    --text-primary: #ECEFF4;
    --text-secondary: #D8DEE9;
    --text-muted: #81A1C1;
    --glow-primary: 0 0 20px rgba(136,192,208,0.2);
    --shadow-card: 0 8px 30px rgba(0,0,0,0.3);
}

/* ── Deep Sea Theme (Premium Nautical) ────────────────────────── */
[data-theme='deep-sea'] {
    --color-primary: #20B2AA;
    --color-primary-light: #4DB6AC;
    --color-secondary: #008B8B;
    --surface-app: #001B2E;
    --surface-base: #002A45;
    --surface-card: #003554;
    --surface-card-hover: #004B75;
    --surface-elevated: #004B75;
    --surface-border: rgba(0,150,136,0.15);
    --text-primary: #E0F2F1;
    --text-secondary: #B2DFDB;
    --text-muted: #4DB6AC;
    --glow-primary: 0 0 20px rgba(32,178,170,0.2);
    --shadow-card: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── Base Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-primary);
    background-color: var(--surface-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
}

/* ── Typography Scale ─────────────────────────────────────────────── */
h1, .mud-typography-h1 { font-size: 2.5rem;   font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2, .mud-typography-h2 { font-size: 2rem;     font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3, .mud-typography-h3 { font-size: 1.5rem;   font-weight: 700; line-height: 1.3; }
h4, .mud-typography-h4 { font-size: 1.25rem;  font-weight: 600; line-height: 1.4; }
h5, .mud-typography-h5 { font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
h6, .mud-typography-h6 { font-size: 1rem;     font-weight: 600; line-height: 1.5; }

.fw-bold { font-weight: 700 !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ensure consistent body text */
.mud-typography-body1 { font-size: 0.9375rem; line-height: 1.6; }
.mud-typography-body2 { font-size: 0.875rem; line-height: 1.6; }
.mud-typography-caption { font-size: 0.75rem; line-height: 1.6; color: var(--text-muted); }

/* ── Page Headers Standardization ──────────────────────────────────── */
.page-header {
    margin-bottom: 8px;
    padding: 0px 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.page-header-title-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
    flex: 1;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -0.03em;
    color: var(--color-primary) !important;
    margin: 0;
    text-transform: none; /* Keep natural case */
}

.page-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-info) !important; /* Teal/Blue Secondary Accent */
    margin: 1px 0 0 0;
    opacity: 0.85;
}

/* ── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── App Layout ─────────────────────────────────────────────────────── */
.app-layout {
    min-height: 100vh;
    background: var(--surface-app);
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--surface-base);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    backdrop-filter: blur(20px);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
}

.sidebar-hidden .sidebar {
    width: 0;
    border-right: none;
    visibility: hidden;
}

.sidebar.sidebar-overlay {
    width: var(--sidebar-width) !important;
    visibility: visible !important;
    z-index: 1000;
    box-shadow: 10px 0 50px rgba(0,0,0,0.4);
    border-right: 1px solid var(--surface-border);
}

/* Text visibility handling */
.brand-text, 
.nav-section-label,
.nav-item span,
.nav-section-header span {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    font-size:0.8rem;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-item {
    justify-content: center;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-item::after {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    width: 0;
}

.sidebar-collapsed .nav-section-header {
    display: flex !important;
    justify-content: center !important;
    padding: 16px 0 !important;
}

.sidebar-collapsed .nav-section-header .section-text,
.sidebar-collapsed .nav-section-header .arrow-icon {
    display: none !important;
}

.sidebar-collapsed .nav-section-group {
    position: relative;
}

.sidebar-collapsed .nav-section-content {
    display: none;
    position: absolute;
    left: calc(var(--sidebar-width-collapsed) - 4px);
    top: 0;
    width: 230px;
    background: var(--surface-elevated);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    box-shadow: 12px 8px 40px rgba(0,0,0,0.35);
    z-index: 9999;
    overflow: visible;
    max-height: 90vh;
    overflow-y: auto;
    flex-direction: column;
    padding: 8px 0;
    animation: popIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}

.sidebar-collapsed .nav-section-content.expanded {
    display: flex !important;
}

@keyframes popIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.sidebar-collapsed .nav-section-content .nav-item span {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    width: auto !important;
    pointer-events: auto !important;
}

.sidebar-collapsed .nav-section-content .nav-item {
    justify-content: flex-start !important;
    padding: 10px 16px !important;
    gap: 12px !important;
    width: auto !important;
    margin: 2px 8px !important;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px; /* Reduced side padding */
    border-bottom: 1px solid var(--surface-border);
    gap: 4px; /* Reduced gap since logo is gone in expanded view */
    overflow: hidden;
    transition: all var(--transition);
}

.brand-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--glow-primary);
}

.brand-text {
    flex: 1;
    overflow: hidden;
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-overflow: ellipsis;
}

.brand-tagline {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ── Nav Items ──────────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-section-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-section-header span {
    text-transform: uppercase;
}

.nav-section-header:hover {
    color: var(--text-primary);
}

.nav-section-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 8px var(--color-success);
}

.nav-section-header.section-active .nav-section-dot {
    opacity: 1;
}

.nav-section-header .mud-icon-root {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-section-header.expanded .mud-icon-root {
    transform: rotate(90deg);
}

.nav-section-content {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    max-height: 0;
}

.nav-section-content.expanded {
    max-height: 2000px;
    transition: max-height 0.8s cubic-bezier(1, 0, 1, 0);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    margin: 4px 0;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    overflow: hidden;
}

.sidebar-collapsed .nav-item {
    padding: 10px 0;
    justify-content: center;
    gap: 0;
}

.nav-item:hover, .mud-nav-link:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--surface-elevated);
    color: var(--color-success) !important; /* Changed from Cyan to Green for active state */
    border: 1px solid var(--surface-border);
}

.nav-item .nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

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

.sidebar-hidden .main-content {
    margin-left: 0;
}

/* ── Top Header ─────────────────────────────────────────────────────── */
.top-header {
    height: var(--header-height);
    background: var(--surface-base);
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    padding: 0 16px; /* Adjusted to align with sidebar contents */
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    transition: padding var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px; /* Reduced to allow more space for search/actions */
}

@media (max-width: 600px) {
    .header-left {
        min-width: auto;
    }
}

.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 16px; /* Reduced from 24px */
}

@media (max-width: 960px) {
    .header-search {
        margin: 0 8px;
    }
}

.sidebar-collapsed .top-header {
    padding-left: 18px; /* Fine-tuned for collapsed centering */
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-brand-logo {
    height: 32px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

.mobile-brand-initials {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--glow-primary);
    border: 2px solid rgba(255,255,255,0.2);
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.quick-action-btn {
    height: 32px !important;
    border-radius: var(--border-radius-sm) !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background: var(--surface-elevated) !important;
    border-color: var(--color-primary-light) !important;
}

.icon-btn {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--color-primary-light);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 4px 2px 12px;
    border-radius: 20px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.user-profile-btn:hover {
    background: var(--surface-card-hover);
    border-color: var(--surface-border);
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: IndianRed;
    line-height: 1.2;
}

.avatar-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.2);
    transition: all var(--transition);
    flex-shrink: 0;
}

.avatar-btn:hover { transform: scale(1.05); }

/* ── Page Content ───────────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 8px 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Handled by global .page-header definition */

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: all var(--transition);
}

.sidebar-collapsed .sidebar-toggle-btn { 
    margin-right: 0;
    margin-bottom: 8px;
}

.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    padding: 12px 0;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: var(--header-height);
    gap: 12px;
}

.sidebar-close-btn {
    display: none !important;
}

.sidebar-overlay .sidebar-close-btn,
.sidebar:not(.sidebar-collapsed) .sidebar-close-btn {
    display: flex !important;
}

.sidebar-collapsed .sidebar-close-btn {
    display: none !important;
}

.card:hover { border-color: var(--color-primary-light); }

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

/* ── Stat Cards ─────────────────────────────────────────────────────── */
.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--stat-color, rgba(99,102,241,0.1));
    transform: translate(25%, -25%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--color-primary-light);
}

.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--text-primary); line-height: 1.2; margin: 4px 0; }
.stat-trend { font-size: 12px; color: var(--color-success); font-weight: 600; }
.stat-trend.negative { color: var(--color-danger); }

/* ── Badges & Status ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    gap: 4px;
}

.badge-success { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-danger  { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-primary { background: rgba(99,102,241,0.15); color: var(--color-primary-light); border: 1px solid rgba(99,102,241,0.25); }
.badge-info    { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.25); }

/* ── Tables ─────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--surface-border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table td.primary { color: var(--text-primary); font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-primary);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 2px 12px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow-primary);
}

.btn-outline {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border-color: rgba(239,68,68,0.25);
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Inputs & Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input, .form-select {
    width: 100%;
    background: var(--surface-base);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    outline: none;
    transition: all var(--transition);
}

.form-input:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Micro-interactions & Haptics ──────────────────────────────────── */
.btn-haptic, .mud-button-root {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease !important;
}

.btn-haptic:active, .mud-button-root:active {
    transform: scale(0.96) !important;
}

.btn-haptic:hover, .mud-button-root:hover {
    transform: translateY(-1px);
}

.form-focus-glow:focus-within {
    box-shadow: 0 0 0 4px var(--glow-primary) !important;
    border-color: var(--color-primary) !important;
    transition: all 0.3s ease;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-pop {
    animation: notificationPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes notificationPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Avatars ────────────────────────────────────────────────────────── */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* ── Progress Bar ───────────────────────────────────────────────────── */
.progress-bar-container {
    background: var(--surface-elevated);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.5s ease;
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.35s ease forwards; }
.pulse { animation: pulse-glow 2s infinite; }

/* ── MudBlazor Overrides ─────────────────────────────────────────────── */
.mud-theme-default {
    --mud-palette-primary: #6366f1;
    --mud-palette-secondary: #8b5cf6;
}

/* ── MudDatePicker Compact Overrides ────────────────────────────────── */
.mud-picker-toolbar, 
.mud-picker-toolbar-content,
.mud-picker-datepicker-toolbar {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 12px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
}

.mud-picker-toolbar .mud-button-year,
.mud-picker-toolbar .mud-button-date {
    margin: 0 !important;
    padding: 2px 4px !important;
    height: auto !important;
    min-width: 0 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}

.mud-picker-toolbar .mud-button-year {
    opacity: 0.8;
    order: 2 !important;
}

.mud-picker-toolbar .mud-button-year::before {
    content: ", " !important;
}

.mud-picker-toolbar .mud-button-date {
    order: 1 !important;
}

/* Reduce unnecessary space in calendar popover and fix alignment */
.mud-picker-calendar-header {
    margin-top: 0 !important;
    height: auto !important;
    min-height: 64px !important; /* Ensure space for nav + weekdays */
    padding-top: 4px !important;
}

.mud-picker-calendar-header .mud-button-root {
    padding: 4px !important;
    margin-top: -2px !important; /* Pull icons up to remove dead space */
}

/* Fix overlapping day names (Mon, Tue, etc.) with the first row of days */
.mud-picker-calendar-header-switch {
    margin-bottom: 0 !important;
}

.mud-picker-calendar-day-header {
    padding-bottom: 12px !important; /* Space between labels and grid */
}

/* Push the absolute-positioned days grid down so it doesn't cover labels */
.mud-picker-calendar {
    margin-top: 24px !important; 
}

.mud-picker-content {
    padding: 4px !important;
}

.mud-table { background: transparent !important; }
.mud-table-cell { border-bottom-color: var(--surface-border) !important; }

/* ── Leave Badges ───────────────────────────────────────────────────── */
.leave-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Empty States ───────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin: 0 0 8px; }
.empty-state-desc { font-size: 14px; color: var(--text-muted); max-width: 300px; }


/* ── Login & Account Pages ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--surface-base), var(--surface-app));
    padding: 20px;
}

.login-glass-card {
    width: 100%;
    max-width: 420px;
    background: rgba(30, 37, 53, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.login-glass-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, var(--color-primary), transparent 70%);
    opacity: 0.05;
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 18px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    box-shadow: var(--glow-primary);
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-step-enter { animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { width: 0; }
    .main-content { margin-left: 0; }
    .page-content { padding: 16px; }
}

/* ── Global Required Field Indicator ───────────────────────────────── */
.mud-input-label.mud-input-label-required::after {
    color: var(--color-danger) !important;
}@Component: MandatoryAsteriskRed { } .mud-input-label.mud-input-label-required::after { color: var(--color-danger) !important; content: " *\ !important; font-weight: bold; }

/* -- Smart Quick Actions -- */
.quick-action-btn { letter-spacing: 0.5px; transition: all 0.2s ease; }
.quick-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb), 0.3) !important; }
.quick-popover-custom { border-radius: 16px !important; overflow: hidden; border: 1px solid var(--surface-border) !important; box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important; }
.quick-popover-custom .mud-list-item:hover { background-color: var(--mud-palette-action-default-hover) !important; }
.quick-action-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }


/* Enhanced Quick Action Button Visibility */
.quick-action-btn { background: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 100%) !important; color: white !important; border: none !important; }
.quick-action-btn .mud-button-label { font-weight: 800 !important; letter-spacing: 0.5px; }
.quick-action-btn .mud-icon-root { color: white !important; }


/* FINAL FIX: Quick Action Button Visibility */
.quick-action-btn.mud-button-filled.mud-button-filled-primary { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important; color: #ffffff !important; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important; border: none !important; }
.quick-action-btn.mud-button-filled.mud-button-filled-primary .mud-button-label { color: #ffffff !important; font-weight: 800 !important; }
.quick-action-btn.mud-button-filled.mud-button-filled-primary .mud-icon-root { color: #ffffff !important; }


/* BLACK TEXT FIX: Quick Action Visibility */
.quick-action-btn.mud-button-filled { color: #000000 !important; }
.quick-action-btn.mud-button-filled .mud-button-label { color: #000000 !important; font-weight: 900 !important; }
.quick-action-btn.mud-button-filled .mud-icon-root { color: #000000 !important; }


/* THEME-ALIGNED: Quick Action Button */
.quick-action-btn.mud-button-filled { background-color: var(--surface-base) !important; color: var(--text-primary) !important; border: 1px solid var(--surface-border) !important; box-shadow: var(--shadow-card) !important; }
.quick-action-btn.mud-button-filled .mud-button-label { color: var(--text-primary) !important; font-weight: 700 !important; }
.quick-action-btn.mud-button-filled .mud-icon-root { color: var(--text-primary) !important; }
.quick-action-btn:hover { background-color: var(--surface-card-hover) !important; border-color: var(--color-primary-light) !important; }


.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1) !important;
    border-color: var(--mud-palette-primary) !important;
}

.stat-value.as-link {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.stat-card.clickable:hover .stat-value.as-link {
    text-decoration: underline;
}

