:root {
    /* Modern OKLCH Color System */
    --background: oklch(0.9940 0 0);
    --foreground: oklch(0 0 0);
    --card: oklch(0.9940 0 0);
    --card-foreground: oklch(0 0 0);
    --popover: oklch(0.9911 0 0);
    --popover-foreground: oklch(0 0 0);
    --primary: oklch(0.5393 0.2713 286.7462);
    --primary-foreground: oklch(1.0000 0 0);
    --secondary: oklch(0.9540 0.0063 255.4755);
    --secondary-foreground: oklch(0.1344 0 0);
    --muted: oklch(0.9702 0 0);
    --muted-foreground: oklch(0.4386 0 0);
    --accent: oklch(0.9393 0.0288 266.3680);
    --accent-foreground: oklch(0.5445 0.1903 259.4848);
    --destructive: oklch(0.6290 0.1902 23.0704);
    --destructive-foreground: oklch(1.0000 0 0);
    --border: oklch(0.9300 0.0094 286.2156);
    --border-color: var(--border);
    --input: oklch(0.9401 0 0);
    --ring: oklch(0 0 0);
    --text-muted: var(--muted-foreground);
    --text-main: var(--foreground);
    --bg-card: var(--card);

    /* Charts */
    --chart-1: oklch(0.7459 0.1483 156.4499);
    --chart-2: oklch(0.5393 0.2713 286.7462);
    --chart-3: oklch(0.7336 0.1758 50.5517);
    --chart-4: oklch(0.5828 0.1809 259.7276);
    --chart-5: oklch(0.5590 0 0);

    /* Sidebar */
    --sidebar: oklch(0.9777 0.0051 247.8763);
    --sidebar-foreground: oklch(0 0 0);
    --sidebar-primary: oklch(0 0 0);
    --sidebar-primary-foreground: oklch(1.0000 0 0);
    --sidebar-accent: oklch(0.9401 0 0);
    --sidebar-accent-foreground: oklch(0 0 0);
    --sidebar-border: oklch(0.9401 0 0);
    --sidebar-ring: oklch(0 0 0);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-serif: 'Lora', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing: 0.27rem;

    /* Radius - Larger, more modern */
    --radius: 1.4rem;
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
    --radius-full: 9999px;

    /* Shadows - Refined & Deep */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Letter Spacing - Tighter for modern look */
    --tracking-normal: -0.025em;
    --tracking-tighter: calc(var(--tracking-normal) - 0.05em);
    --tracking-tight: calc(var(--tracking-normal) - 0.025em);
    --tracking-wide: calc(var(--tracking-normal) + 0.025em);
    --tracking-wider: calc(var(--tracking-normal) + 0.05em);
    --tracking-widest: calc(var(--tracking-normal) + 0.1em);

    /* Functional Colors */
    --success: oklch(0.7459 0.1483 156.4499);
    --warning: oklch(0.7336 0.1758 50.5517);
    --danger: oklch(0.6290 0.1902 23.0704);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Responsive Breakpoints */
    --mobile: 480px;
    --tablet: 1024px;
    --laptop: 1440px;
    --desktop: 1920px;
}

.footer-label {
    font-size: 8px;
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
    padding: 20px 10px 10px;
    text-align: center;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark {
    --background: oklch(0.2223 0.0060 271.1393);
    --foreground: oklch(0.9551 0 0);
    --card: oklch(0.2568 0.0076 274.6528);
    --card-foreground: oklch(0.9551 0 0);
    --popover: oklch(0.2568 0.0076 274.6528);
    --popover-foreground: oklch(0.9551 0 0);
    --primary: oklch(0.6132 0.2294 291.7437);
    --primary-foreground: oklch(1.0000 0 0);
    --secondary: oklch(0.2940 0.0130 272.9312);
    --secondary-foreground: oklch(0.9551 0 0);
    --muted: oklch(0.2940 0.0130 272.9312);
    --muted-foreground: oklch(0.7058 0 0);
    --accent: oklch(0.2795 0.0368 260.0310);
    --accent-foreground: oklch(0.7857 0.1153 246.6596);
    --destructive: oklch(0.7106 0.1661 22.2162);
    --destructive-foreground: oklch(1.0000 0 0);
    --border: oklch(0.3289 0.0092 268.3843);
    --input: oklch(0.3289 0.0092 268.3843);
    --ring: oklch(0.6132 0.2294 291.7437);

    --chart-1: oklch(0.8003 0.1821 151.7110);
    --chart-2: oklch(0.6132 0.2294 291.7437);
    --chart-3: oklch(0.8077 0.1035 19.5706);
    --chart-4: oklch(0.6691 0.1569 260.1063);
    --chart-5: oklch(0.7058 0 0);

    --sidebar: oklch(0.2011 0.0039 286.0396);
    --sidebar-foreground: oklch(0.9551 0 0);
    --sidebar-primary: oklch(0.6132 0.2294 291.7437);
    --sidebar-primary-foreground: oklch(1.0000 0 0);
    --sidebar-accent: oklch(0.2940 0.0130 272.9312);
    --sidebar-accent-foreground: oklch(0.6132 0.2294 291.7437);
    --sidebar-border: oklch(0.3289 0.0092 268.3843);
    --sidebar-ring: oklch(0.6132 0.2294 291.7437);
}

/* Color Themes - Override primary colors only */
.theme-red {
    --primary: oklch(0.55 0.22 28.5);
    /* Vibrant Red */
    --primary-foreground: oklch(1 0 0);
    --ring: oklch(0.55 0.22 28.5);

    --sidebar-primary: oklch(0.55 0.22 28.5);
    --sidebar-primary-foreground: oklch(1 0 0);

    /* Charts matching the red theme */
    --chart-1: oklch(0.55 0.22 28.5);
    --chart-2: oklch(0.65 0.18 35);
    --chart-3: oklch(0.45 0.20 25);
    --chart-4: oklch(0.75 0.15 40);
    --chart-5: oklch(0.85 0.10 45);
}

.theme-green {
    --primary: oklch(0.65 0.18 150);
    /* Uber Green */
    --primary-foreground: oklch(1 0 0);
    --ring: oklch(0.65 0.18 150);

    --sidebar-primary: oklch(0.65 0.18 150);
    --sidebar-primary-foreground: oklch(1 0 0);

    /* Charts matching the green theme */
    --chart-1: oklch(0.65 0.18 150);
    --chart-2: oklch(0.70 0.15 160);
    --chart-3: oklch(0.55 0.20 145);
    --chart-4: oklch(0.75 0.12 155);
    --chart-5: oklch(0.80 0.10 165);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: var(--tracking-normal);
    font-size: 16px;
    /* Base for rem */
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    /* Start hidden on mobile */
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg,
            hsl(var(--sidebar)) 0%,
            oklch(from var(--sidebar) calc(l * 0.98) c h) 100%);
    border-right: 1px solid hsl(var(--sidebar-border));
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
    z-index: 1000;
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1025px) {
    .sidebar {
        position: relative;
        left: 0;
    }

    .sidebar-overlay {
        display: none;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.logo-icon {
    font-size: 1.5rem;
    color: hsl(var(--primary));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--primary) 0%, oklch(0.6 0.2 300) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 1rem 1.25rem;
    /* Increased for better touch targets */
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    margin-bottom: 6px;
    position: relative;
    min-height: 48px;
    /* Standard accessible touch target */
}

@media (min-width: 1025px) {
    .nav-item {
        padding: 0.75rem 1rem;
        margin-bottom: 4px;
    }
}

.nav-item:hover {
    background: linear-gradient(135deg,
            hsl(var(--primary) / 0.12) 0%,
            hsl(var(--primary) / 0.08) 100%);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.15);
}

.nav-item i {
    transition: transform 0.25s ease;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.pin-icon:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.nav-item.active {
    background: linear-gradient(135deg,
            var(--primary) 0%,
            oklch(from var(--primary) calc(l * 1.05) c h) 100%);
    color: white;
    box-shadow:
        0 4px 12px oklch(from var(--primary) l c h / 0.35),
        0 2px 6px oklch(from var(--primary) l c h / 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: white;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.nav-separator {
    margin: 1.5rem 0 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: hsl(var(--muted-foreground) / 0.6);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: hsl(var(--border) / 0.5);
    margin-right: 1.5rem;
}

.admin-nav-item i {
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-footer {
    margin-top: auto;
    border-top: 1px solid hsl(var(--border));
    padding-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background-color: transparent;
    border: none;
    width: 100%;
}

.user-profile-mini img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: hsl(var(--background));
}

.top-bar {
    height: 72px;
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid hsl(var(--border) / 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    /* Reduced padding for mobile */
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (min-width: 481px) {
    .top-bar {
        padding: 0 var(--spacing-xl);
    }
}

@media (max-width: 768px) {

    .breadcrumbs #firm-name-crumb,
    .breadcrumbs .fa-chevron-right:first-of-type {
        display: none;
    }
}

.breadcrumbs .crumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

@media (max-width: 480px) {
    .breadcrumbs .crumb {
        max-width: 100px;
    }
}

.top-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.breadcrumbs .active {
    color: hsl(var(--foreground));
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    /* Tighter gap for mobile */
}

@media (min-width: 768px) {
    .top-actions {
        gap: var(--spacing-md);
    }
}

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: oklch(from var(--muted) l c h / 0.5);
    padding: 0.6rem 1.2rem;
    border-radius: 14px;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: var(--background);
    box-shadow:
        0 0 0 4px oklch(from var(--primary) l c h / 0.12),
        0 4px 12px oklch(from var(--primary) l c h / 0.15),
        0 0 20px oklch(from var(--primary) l c h / 0.1);
    width: auto;
    flex: 1;
}

@media (min-width: 768px) {
    .search-bar:focus-within {
        width: 300px;
        flex: none;
    }
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    width: 60px;
    /* Small default for mobile */
    transition: width 0.3s ease;
}

@media (min-width: 481px) {
    .search-bar input {
        width: 150px;
    }
}

@media (min-width: 768px) {
    .search-bar input {
        width: 200px;
    }
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem;
    position: relative;
    border-radius: 8px;
    /* Changed from var(--radius-full) to remove circle */
}

.icon-btn:hover {
    background: linear-gradient(135deg,
            hsl(var(--accent)) 0%,
            oklch(from var(--accent) calc(l * 0.98) c h) 100%);
    color: hsl(var(--accent-foreground));
    transform: scale(1.05);
    box-shadow: 0 2px 8px hsl(var(--accent) / 0.2);
}

.btn-primary {
    background: linear-gradient(135deg,
            var(--primary) 0%,
            oklch(from var(--primary) calc(l * 1.08) c h) 100%);
    color: white;
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px oklch(from var(--primary) l c h / 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px oklch(from var(--primary) l c h / 0.35),
        0 4px 12px oklch(from var(--primary) l c h / 0.25),
        0 0 30px oklch(from var(--primary) l c h / 0.2);
    filter: brightness(1.1);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px oklch(from var(--primary) l c h / 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

@media (min-width: 768px) {
    .page-content {
        padding: var(--spacing-xl);
    }
}

@media (min-width: 1921px) {
    .page-content {
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: var(--spacing-xl);
    }
}

.card {
    background: var(--card);
    border-radius: 20px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 10px 25px -5px rgba(0, 0, 0, 0.08),
        0 8px 10px -6px rgba(0, 0, 0, 0.05),
        0 0 0 1px oklch(from var(--border) l c h / 0.3);
    padding: var(--spacing-xl);
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg,
            oklch(from var(--primary) l c h / 0.03) 0%,
            transparent 50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 16px 32px -8px rgba(0, 0, 0, 0.12),
        0 12px 20px -8px rgba(0, 0, 0, 0.08),
        0 0 0 1px oklch(from var(--primary) l c h / 0.2),
        0 0 30px oklch(from var(--primary) l c h / 0.08);
    border-color: oklch(from var(--primary) l c h / 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.job-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.job-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

.job-card.urgent::before {
    background: var(--warning);
}

.job-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.tag-blue {
    background-color: oklch(from var(--primary) l c h / 0.1);
    color: var(--primary);
}

.tag-green {
    background-color: oklch(from var(--success) l c h / 0.1);
    color: var(--success);
}

.tag-orange {
    background-color: oklch(from var(--warning) l c h / 0.1);
    color: var(--warning);
}

.progress-bar {
    height: 8px;
    background-color: var(--muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    display: flex;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-full);
}

.progress-fill.success {
    background-color: var(--success);
}

.progress-fill.warning {
    background-color: var(--warning);
}

.progress-fill.danger {
    background-color: var(--destructive);
}

/* Kanban Board Styles */
.kanban-column {
    background: linear-gradient(180deg, oklch(from var(--muted) l c h / 0.3) 0%, oklch(from var(--muted) l c h / 0.1) 100%);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 1.25rem;
    min-height: 600px;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    transition: all 0.3s ease;
}

.kanban-column:hover {
    box-shadow: var(--shadow-md);
}

.kanban-column h3 {
    padding-bottom: 0.75rem;
    border-bottom: 2px solid oklch(from var(--border) l c h / 0.3);
    margin-bottom: 1.25rem !important;
}

.kanban-drop-zone {
    min-height: 400px;
}



/* Client List */
.client-table {
    width: 100%;
    border-collapse: collapse;
}

.client-table th,
.client-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.client-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background-color: oklch(from var(--success) l c h / 0.2);
    color: var(--success);
}

.status-pending {
    background-color: oklch(from var(--warning) l c h / 0.2);
    color: var(--warning);
}

.status-due {
    background-color: oklch(from var(--destructive) l c h / 0.2);
    color: var(--destructive);
}

.status-submitted {
    background-color: oklch(from var(--primary) l c h / 0.2);
    color: var(--primary);
}

/* Premium Table Styles */
.table-container,
.data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.client-table,
.data-table {
    width: 100%;
    min-width: 700px;
    /* Ensure content doesn't squish too much */
    border-collapse: collapse;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.client-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

.client-table th {
    background-color: oklch(from var(--secondary) l c h / 0.5);
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.client-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--foreground);
    transition: var(--transition);
}

.client-table th:first-child,
.client-table td:first-child {
    padding-left: var(--spacing-xl);
}

.client-table th:last-child,
.client-table td:last-child {
    padding-right: var(--spacing-xl);
}

.td-checkbox,
.th-checkbox {
    width: 40px !important;
    padding: 0 var(--spacing-sm) !important;
    text-align: center !important;
}

.client-table tr:last-child td {
    border-bottom: none;
}

.client-table tbody tr:hover td {
    background-color: oklch(from var(--muted) l c h / 0.5);
}

/* Glassmorphism & Modern Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
}

.dark .glass-effect {
    background: rgba(31, 31, 31, 0.6) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Custom Scrollbar for the table */
.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.link-icon {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.link-icon:hover {
    color: var(--primary-dark);
}

/* --- Jobs Dashboard Styles --- */

/* Sub Navigation Tabs */
.sub-nav-header {
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid oklch(from var(--border) l c h / 0.3);
}

.sub-nav-tabs {
    display: flex;
    gap: 2rem;
}

.sub-nav-tab {
    padding: 1rem 0;
    color: var(--muted-foreground);
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sub-nav-tab:hover {
    color: hsl(var(--foreground));
}

/* Filter Toolbar */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.5rem 0.75rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    /* Changed to visible border for better contrast */
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.filter-chip.action-chip {
    background-color: hsl(var(--secondary));
    font-weight: 500;
    border-color: hsl(var(--border));
}

.filter-select {
    padding: 0.5rem 0.75rem;
    background-color: var(--card);
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.filter-select:hover {
    border-color: var(--primary);
}

.batch-actions-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--card);
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 200px;
    display: none;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: hsl(var(--muted) / 0.5);
    color: var(--primary);
}

.dropdown-menu a.danger:hover {
    background: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

#batch-actions-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.view-toggles {
    margin-left: auto;
    display: flex;
    gap: var(--spacing-xs);
    border: 1px solid hsl(var(--border));
    padding: 2px;
    border-radius: var(--radius-md);
    background: hsl(var(--card));
}

.toggle-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.toggle-btn.active {
    background-color: var(--muted);
    color: var(--primary);
}

/* Jobs Table Specifics */
.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.status-block {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    color: white;
    /* Default text color */
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 90px;
    height: 100%;
}

.status-block-full {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.td-status {
    height: 1px;
}

.status-badge-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    outline: none;
    width: 120px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.status-badge-select:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.status-cell-not-started {
    background-color: oklch(from var(--muted) l c h / 0.2);
    color: var(--muted-foreground);
    border: 1px solid oklch(from var(--muted) l c h / 0.3);
}

.status-cell-in-progress {
    background-color: oklch(from var(--primary) l c h / 0.1);
    color: var(--primary);
    border: 1px solid oklch(from var(--primary) l c h / 0.2);
}

.status-cell-on-hold {
    background-color: oklch(from var(--warning) l c h / 0.1);
    color: var(--warning);
    border: 1px solid oklch(from var(--warning) l c h / 0.2);
}

.status-cell-completed {
    background-color: oklch(from var(--success) l c h / 0.1);
    color: var(--success);
    border: 1px solid oklch(from var(--success) l c h / 0.2);
}

.status-cell-archived {
    background-color: var(--muted);
    color: var(--muted-foreground);
    opacity: 0.6;
    border: 1px solid var(--border);
}

.smart-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 0;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.smart-select-wrapper:hover {
    background-color: oklch(from var(--primary) l c h / 0.05);
}

.smart-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    padding: 2px 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    color: inherit;
    font-family: inherit;
}

.task-progress-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.mini-progress {
    width: 60px;
}

/* --- Global Styles --- */
.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.btn-outline {
    background-color: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background-color: var(--muted);
    border-color: var(--muted-foreground);
}

.btn-danger {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px oklch(from var(--destructive) l c h / 0.3);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    /* Darker overlay for better modal prominence */
    z-index: 100;
    backdrop-filter: blur(8px);
    /* Increased blur for better focus */
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card);
    border-radius: 20px;
    /* Reduced for mobile */
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4),
        0 10px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 101;
    width: 95%;
    /* Mobile default */
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

@media (min-width: 768px) {
    .modal {
        border-radius: 24px;
        width: 800px;
        border: 2px solid var(--border);
    }
}

.modal.hidden,
.modal-overlay.hidden {
    display: none;
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid oklch(from var(--border) l c h / 0.5);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;

    /* Custom Scrollbar for Premium Look */
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--primary) / 0.3) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: oklch(from var(--primary) l c h / 0.3);
    border-radius: var(--radius-full);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: 1.25rem 2rem;
    border-top: 1px solid oklch(from var(--border) l c h / 0.5);
    background: oklch(from var(--muted) l c h / 0.2);
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--foreground);
}

/* Drag and Drop Styles */
.draggable {
    cursor: grab;
}

.draggable:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.5;
    border: 2px dashed hsl(var(--primary));
    transform: scale(0.95);
}

/* Notification Panel */
.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.notification-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.notification-header {
    padding: 1rem;
    background: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.notification-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--accent);
}

.notification-item.unread {
    background: oklch(from var(--primary) l c h / 0.05);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-desc {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}

.notification-time {
    font-size: 0.7rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: oklch(from var(--primary) l c h / 0.08);
    color: var(--primary);
    padding-left: 1.25rem;
}

/* Premium Card Effects (Super Admin) */
.premium-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--card) 0%, var(--muted) 100%);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.premium-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.premium-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, oklch(from var(--primary) l c h / 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.premium-card:hover::after {
    opacity: 1;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item.danger:hover {
    background: oklch(from var(--destructive) l c h / 0.08);
    color: var(--destructive);
}

.dropdown-item.danger:hover i {
    color: var(--destructive);
}

/* Custom Scrollbar for Main Content */
.page-content::-webkit-scrollbar {
    width: 10px;
}

.page-content::-webkit-scrollbar-track {
    background: var(--background);
}

.page-content::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: var(--radius-full);
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: oklch(from var(--muted-foreground) l c h / 0.5);
}

/* Profile Page Styles */
.profile-container {
    max-width: 100%;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 3rem;
    background: linear-gradient(135deg, oklch(from var(--primary) l c h / 0.1), oklch(from var(--primary) l c h / 0.02));
    border-radius: 32px;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    margin-bottom: 2rem;
}

.profile-avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 40px;
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    border: 4px solid white;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: var(--card);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    box-shadow: var(--shadow-sm);
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid oklch(from var(--border) l c h / 0.3);
}

.profile-detail-item:last-child {
    border-bottom: none;
}

.profile-detail-label {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
}

.profile-detail-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Chat / Messages Interface */
.chat-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background-color: oklch(from var(--muted) l c h / 0.5);
}

.chat-item.active {
    background-color: oklch(from var(--primary) l c h / 0.1);
}

.chat-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    color: var(--foreground);
}

.chat-time {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.chat-preview {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.unread .chat-preview {
    color: var(--foreground);
    font-weight: 500;
}

.chat-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 6px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    margin-bottom: 1rem;
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.message.received .message-bubble {
    background: var(--card);
    color: var(--foreground);
    border-top-left-radius: 4px;
    border: 1px solid var(--border);
}

.message.sent .message-bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

/* Files Page Styles */
.files-library-header {
    margin-bottom: 2rem;
}

.files-library-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.files-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.files-search-container {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.files-search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
}

.files-search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 12px;
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    background: var(--card);
    font-size: 0.9rem;
}

.files-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.view-mode-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--foreground);
    transition: all 0.2s;
}

.view-mode-btn.active {
    background: var(--primary);
    color: white;
}

.filter-select {
    border: none;
    background: transparent;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    padding-right: 0.5rem;
    color: var(--foreground);
}

.btn-upload,
.btn-staff-folder {
    background: linear-gradient(135deg, var(--primary) 0%, oklch(from var(--primary) l c h / 0.8) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px oklch(from var(--primary) l c h / 0.2);
}

.btn-upload:hover,
.btn-staff-folder:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px oklch(from var(--primary) l c h / 0.3);
    filter: brightness(1.1);
    color: #fff;
}

.quick-access-section {
    margin-bottom: 2.5rem;
}

.quick-access-section h3 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.quick-access-card {
    background: var(--card);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.quick-access-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.quick-access-icon-wrapper {
    width: 48px;
    height: 48px;
    background: oklch(from var(--primary) l c h / 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-access-icon-wrapper i {
    font-size: 1.25rem;
}

.quick-access-info {
    display: flex;
    flex-direction: column;
}

.quick-access-count {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.quick-access-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Staff Folders Modal Styles */
.staff-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.staff-folder-card {
    border: 1px solid oklch(from var(--border) l c h / 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    background: var(--card);
    transition: all 0.2s;
    cursor: pointer;
}

/* Data Table Breathing Space */
.data-table {
    width: 100%;
    border-collapse: collapse;
    padding-bottom: 5rem;
    /* Added extra breathing room at the bottom */
}

.data-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: oklch(from var(--muted) l c h / 0.1);
}

.data-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid oklch(from var(--border) l c h / 0.3);
}

.data-table tr:hover td {
    background: oklch(from var(--muted) l c h / 0.05);
}

.staff-folder-card:hover {
    border-color: var(--primary);
    background: oklch(from var(--primary) l c h / 0.02);
}

.staff-folder-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.staff-folder-card h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.staff-folder-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.staff-folder-card .drop-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem;
    border: 1px dashed hsl(var(--border));
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Action Dropdown Styles */
.actions-cell {
    position: relative;
    overflow: visible !important;
}

.action-dropdown {
    position: absolute;
    right: 0;
    top: -10px;
    /* Moves it upper, aligning better with the dots */
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95) translateY(10px);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.action-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--foreground);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    background: none;
    border: none;
    outline: none;
}

.action-item:hover {
    background: oklch(from var(--muted) l c h / 0.5);
}

.action-item.delete {
    color: var(--destructive);
}

.action-item.delete:hover {
    background: oklch(from var(--destructive) l c h / 0.1);
}

/* Sidebar Toggle & Mobile Styles */
#sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

#sidebar-toggle:hover {
    color: var(--foreground);
}

.logo-stacked {
    display: none;
}

/* Collapsed Sidebar (Desktop) */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-full {
    display: none;
}

.sidebar.collapsed .logo-stacked {
    display: block;
    font-size: 0.75rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-align: center;
    width: 100%;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-footer .user-profile-mini .user-info,
.sidebar.collapsed #protected-footer {
    display: none !important;
}

/* Show main footer when sidebar is collapsed */
.sidebar.collapsed+.main-content #main-footer {
    display: block !important;
}

.sidebar.collapsed .logo-container {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar.collapsed .nav-item i {
    font-size: 1.25rem;
    margin: 0;
}

.sidebar.collapsed .user-profile-mini {
    justify-content: center;
    padding: 0.75rem 1rem;
    /* Added horizontal padding */
    margin-top: 1rem;
    /* Breathing space */
}

.sidebar.collapsed .user-profile-mini img {
    margin: 0;
}

/* Mobile Sidebar & Overlay */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        width: 260px;
        /* Always full width on mobile when open */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .sidebar.collapsed {
        width: 260px;
        /* Don't collapse on mobile, just hide/show */
    }
}

/* --- Premium Auth Page Styles --- */
.split-screen-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Left Panel - Visuals */
.left-panel {
    width: 50%;
    background: linear-gradient(135deg, oklch(from var(--primary) l c h / 0.95) 0%, var(--primary) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: var(--primary-foreground);
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.brand-visuals {
    position: relative;
    width: 100%;
    max-width: 500px;
    z-index: 10;
}

/* Decorative Circles */
.decorative-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -50px;
    animation: float 8s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -20px;
    animation: float 10s ease-in-out infinite reverse;
}

/* Glass Card Mockup (Phone-ish) */
.glass-card-mockup {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 2rem;
    width: 280px;
    height: 500px;
    margin: 0 auto 4rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    transform: rotate(-5deg) translateY(0);
    transition: transform 0.3s ease;
    animation: float-card 6s ease-in-out infinite;
    display: flex;
    flex-direction: column;
}

.glass-card-mockup:hover {
    transform: rotate(0) translateY(-10px);
}

.mockup-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mockup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.mockup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mockup-graph {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.bar {
    width: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.bar.active {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.mockup-balance {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 24px;
    text-align: center;
}

.mockup-balance span {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mockup-balance h3 {
    font-size: 2rem;
    margin: 0.5rem 0 0;
    font-weight: 700;
}

.brand-text {
    text-align: center;
}

.brand-text h2 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.brand-footer {
    position: absolute;
    bottom: 2rem;
    opacity: 0.5;
    font-size: 0.8rem;
}

/* Right Panel - Form */
.right-panel {
    width: 50%;
    background: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.auth-content {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

.auth-header-mobile {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--foreground);
}

.auth-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    background: none;
    border: none;
    padding: 0 0 1rem;
    font-size: 1rem;
    color: var(--muted-foreground);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--foreground);
    border-bottom-color: var(--primary);
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.form-subtitle {
    color: var(--muted-foreground);
    margin-bottom: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--foreground);
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid oklch(from var(--border) l c h / 0.8);
    border-radius: 12px;
    background: var(--card);
    color: var(--foreground);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px oklch(from var(--primary) l c h / 0.1);
    outline: none;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.label-row label {
    margin: 0;
}

.password-toggle .input-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, oklch(from var(--primary) l c h / 0.8) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px oklch(from var(--primary) l c h / 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px oklch(from var(--primary) l c h / 0.5);
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

@keyframes float-card {

    0%,
    100% {
        transform: rotate(-5deg) translateY(0);
    }

    50% {
        transform: rotate(-5deg) translateY(-15px);
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .left-panel {
        display: none;
    }

    .right-panel {
        width: 100%;
    }

    .auth-header-mobile {
        display: block;
    }

    .auth-header-mobile h1 {
        color: var(--primary);
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .logo-area {
        display: none;
    }
}

/* --- Centralized Auth Layout (Premium Redesign) --- */
.auth-page-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Match Landing Page Background */
    background: radial-gradient(circle at top center, #E8F0F9 0%, #9CC1E7 100%);
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* Clouds from Landing Page */
.cloud {
    position: absolute;
    width: 300px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
    animation: drift 20s ease-in-out infinite alternate;
}

.cloud-left {
    top: 15%;
    left: -100px;
}

.cloud-right {
    top: 25%;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 20px);
    }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 40px;
    /* var(--landing-radius-card) */
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 20px 80px rgba(0, 0, 0, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 3.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Premium Logo Gradient */
.auth-logo .logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, oklch(0.5393 0.2713 286.7462) 0%, oklch(0.6 0.2 300) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.auth-subtitle {
    color: #5A5A5F;
    /* var(--landing-text-muted) */
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 6px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
}

.auth-tab {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    color: #1A1615;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.auth-tab.active {
    background: white;
    color: #6132D2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-form {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A1615;
    margin-bottom: 0.6rem;
    padding-left: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    font-family: inherit;
    font-size: 1rem;
    color: #1A1615;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.form-group input:focus {
    outline: none;
    background: white;
    border-color: #6132D2;
    box-shadow: 0 0 0 4px rgba(97, 50, 210, 0.1);
}

.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-20%);
    /* Adjusted for label space */
    background: none;
    border: none;
    color: #A0A0A5;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit {
    width: 100%;
    background: #1A1615;
    color: #FFFFFF !important;
    padding: 1.15rem;
    border: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
}

.btn-submit span {
    color: inherit;
    letter-spacing: 0.02em;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    background: #FFFFFF;
    color: #6132D2 !important;
}

.btn-submit:active {
    transform: translateY(0);
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: none;
    backdrop-filter: blur(8px);
}

.alert.show {
    display: block;
}

.alert-error {
    background: rgba(255, 77, 77, 0.1);
    color: #FF4D4D;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.alert-success {
    background: rgba(0, 177, 134, 0.1);
    color: #00B186;
    border: 1px solid rgba(0, 177, 134, 0.2);
}

.loading-spinner {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
    }

    .auth-card {
        padding: 2.5rem 1.75rem;
        border-radius: 30px;
    }

    .auth-logo .logo-text {
        font-size: 1.5rem;
    }
}