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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);

    /* Dark Theme (Default) */
    --sidebar-bg: #1e293b;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
    --input-bg: #0f172a;
    --modal-overlay: rgba(0, 0, 0, 0.82);
    --accent-high: #ef4444;
    --accent-medium: #f59e0b;
    --accent-low: #10b981;
    --navbar-bg: rgba(15, 23, 42, 0.8);
    --radius: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
    --header-height: 70px;
}

[data-theme="light"] {
    --sidebar-bg: #ffffff;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --input-bg: #f8fafc;
    --modal-overlay: rgba(15, 23, 42, 0.6);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --primary-light: rgba(99, 102, 241, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 15px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transition: var(--transition);
}

.logo-container {
    padding: 10px 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

[data-theme="dark"] .logo-for-light { display: none !important; }
[data-theme="light"] .logo-for-dark { display: none !important; }
[data-theme="dark"] .logo-for-dark { display: block; }
[data-theme="light"] .logo-for-light { display: block; }

.logo-container span {
    display: none;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
    margin: 0 -15px;
    padding: 0 15px 20px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    border: 2px solid transparent; /* Gives a padding effect */
    background-clip: padding-box;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    background-clip: border-box;
}

.menu-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    margin: 25px 0 10px 10px;
    opacity: 0.7;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-label::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--border);
    opacity: 0.5;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* --- Header --- */
.top-header {
    height: var(--header-height);
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
    z-index: 900;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 12px;
    transition: var(--transition);
}

.user-dropdown-wrapper {
    position: relative;
    padding-bottom: 5px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 10px;
    display: none;
    z-index: 1002;
    margin-top: 5px;
    animation: slideUp 0.2s ease-out;
}

.user-dropdown-wrapper:hover .user-dropdown {
    display: block;
}

.user-dropdown-wrapper:hover .header-user {
    background: var(--primary-light);
}

.dropdown-header {
    padding: 10px 15px 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.dropdown-header strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
}

.dropdown-header span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.2s;
}

.user-dropdown a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.user-dropdown a i {
    font-size: 1rem;
    width: 20px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 15px;
    }

    .user-name {
        display: none;
    }
}

.menu-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* --- Layout --- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    flex-grow: 1;
    padding: 30px;
    padding-bottom: 80px; /* Added spacing for fixed footer */
    width: calc(100% - var(--sidebar-width));
    transition: var(--transition);
}

.container {
    max-width: 1550px; /* Increased from 1200px to use more screen space */
    margin: 0 auto;
    width: 100%;
}

/* --- Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border);
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 10px;
    display: block;
}

/* --- Cards & Forms --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: 0.2s;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

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

/* --- Task List Design --- */
.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding-left: 55px !important;
    border-radius: 50px !important;
}

.task-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1300px;
}

thead th {
    background: var(--primary-light);
    padding: 16px 15px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border) !important;
    font-size: 0.9rem;
    color: var(--text-main);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* --- Status & Alerts --- */
.status-btn,
.badge {
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Badge Base Scaling */
.status-Pending,
.status-pending,
.status-In-Progress,
.status-in-progress,
.status-Review,
.status-review,
.status-Completed,
.status-completed,
.status-Approved,
.status-approved,
.status-Paid,
.status-paid,
.status-Client-Update,
.status-client-update,
.status-Client-Update-Needed,
.status-client-update-needed,
.status-Rejected,
.status-rejected,
.status-High,
.status-high,
.priority-High,
.priority-Medium,
.priority-Low {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

/* Status Gradients */
.status-Pending,
.status-pending,
.status-Rejected,
.status-rejected,
.status-High,
.status-high {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.status-In-Progress,
.status-in-progress {
    background: linear-gradient(135deg, #f59e0b88, #f59e0b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.status-Review,
.status-review {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.status-Completed,
.status-completed,
.status-Approved,
.status-approved,
.status-Paid,
.status-paid {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.status-Client-Update,
.status-client-update,
.status-Client-Update-Needed,
.status-client-update-needed {
    background: linear-gradient(135deg, #ff7e5f, #feb47b) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(255, 126, 95, 0.3) !important;
}

.status-Hold,
.status-hold {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3) !important;
}

/* Priority Outlines */
.priority-High {
    color: #ef4444;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    text-transform: uppercase;
}

.priority-Medium {
    color: #eab308;
    border: 1.5px solid rgba(234, 179, 8, 0.3);
    text-transform: uppercase;
}

.priority-Low {
    color: #0ea5e9;
    border: 1.5px solid rgba(14, 165, 233, 0.3);
    text-transform: uppercase;
}

/* Row & Column Sizing */
td[data-label="Dates"] div {
    display: flex !important;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-bottom: 2px;
}

.task-details-inline {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
    word-break: break-word;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.1);
}

/* Notification System */
.notifications-wrapper {
    position: relative;
    cursor: pointer;
}

.notif-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-high);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid var(--bg-card);
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    margin-top: 15px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown.active {
    display: block;
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.notif-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-light);
}

.notif-header span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.notif-header button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.notif-item:hover {
    background: var(--primary-light);
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--primary);
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    display: block;
}

.notif-item-msg {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.4;
}

.notif-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}

.notif-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Employee Dashboard Grid */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.emp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emp-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
}

.emp-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    position: relative;
}

.today-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-low);
    color: white;
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
    z-index: 10;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.status-dot.online {
    background: #10b981;
}

.status-dot.offline {
    background: #94a3b8;
}

.emp-status-text {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 8px 0 0;
    padding: 2px 8px;
    border-radius: 4px;
}

.emp-status-text.online {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.emp-status-text.offline {
    color: var(--text-muted);
    background: var(--primary-light);
}

.emp-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.emp-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.emp-stat:first-child {
    border-right: 1px solid var(--border);
}

.emp-stat-val {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
}

.emp-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Modal and Task Items */
.modal {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 95%;
    max-width: 700px;
}

#emp-tasks-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.emp-task-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.emp-task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

.emp-task-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status variants are now handled globally in the Status & Alerts section */

/* Popup Notification Tuning */
/* Popup Notification Tuning */
.popup-notif {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border-left: 5px solid var(--primary);
    padding: 20px 25px;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 400px;
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.popup-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.popup-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.popup-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .top-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 15px; /* Tighter mobile spacing to fix 'side spacing' issues */
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        z-index: 1000;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

.main-content {
    padding-bottom: 100px !important;
}
.expand-row-btn {
    display: none;
}

/* --- Responsive Expandable Table --- */
@media (max-width: 992px) {
    .task-table-wrapper { border: none; background: transparent; padding-bottom: 20px; box-shadow: none; }
    .task-table-wrapper table { min-width: 100%; display: block; border: none; }
    .task-table-wrapper thead { display: none !important; }
    .task-table-wrapper tbody { display: flex; flex-direction: column; gap: 15px; width: 100%; }
    .task-table-wrapper tr {
        display: block; background: var(--bg-card); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 18px; position: relative;
        overflow: hidden; transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }
    .task-table-wrapper td { 
        display: none; border: none !important; padding: 12px 0; width: 100%; 
        border-top: 1px solid var(--border) !important;
    }
    
    /* Main Details (Always visible) */
    .task-table-wrapper td[data-label="Client"], 
    .task-table-wrapper td[data-label="Employee"], 
    .task-table-wrapper td[data-label="Type"], 
    .task-table-wrapper td[data-label="Status"] { 
        display: flex !important; 
        align-items: center; 
        justify-content: space-between !important; 
        border-top: none !important;
        padding-top: 0;
        margin-bottom: 5px;
        text-align: left;
    }
    .task-table-wrapper td[data-label="Client"] { font-size: 1.15rem; font-weight: 700; padding-right: 50px; color: var(--primary); }
    .task-table-wrapper td[data-label="Status"] { padding-bottom: 0; margin-top: 5px; min-height: 45px; }

    .expand-row-btn {
        position: absolute; top: 18px; right: 18px; width: 36px; height: 36px;
        background: var(--primary-light); color: var(--primary); border-radius: 10px;
        display: flex; align-items: center; justify-content: center; cursor: pointer;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10; font-size: 1.1rem;
    }
    
    tr.expanded { border-color: var(--primary); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15); transform: translateY(-3px); }
    tr.expanded .expand-row-btn { transform: rotate(45deg); background: var(--accent-high); color: white; }
    
    /* Layout when expanded: Show all sub-details */
    .task-table-wrapper tr.expanded td { display: flex !important; flex-direction: column; align-items: flex-start; }
    
    /* Label prefix for all expanded sub-details */
    .task-table-wrapper tr.expanded td::before {
        content: attr(data-label); font-size: 0.65rem; text-transform: uppercase;
        color: var(--text-muted); font-weight: 800; margin-bottom: 6px;
        letter-spacing: 0.5px; opacity: 0.8;
    }
    
    /* Exceptions (no label needed or custom) */
    .task-table-wrapper tr.expanded td[data-label="Client"]::before,
    .task-table-wrapper tr.expanded td[data-label="Status"]::before { content: none !important; }
    
    .task-table-wrapper tr.expanded td[data-label="Actions"], 
    .task-table-wrapper tr.expanded td[data-label="Work File"] { 
        flex-direction: row !important; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 15px;
    }
    
    .task-table-wrapper tr.expanded td[data-label="Actions"]::before, 
    .task-table-wrapper tr.expanded td[data-label="Work File"]::before { 
        width: 100%; display: block; flex: 0 0 100%; margin-bottom: 8px; 
    }
    
    .task-details-inline { max-width: 100%; font-size: 0.9rem; color: var(--text-main); }
    .badge { font-size: 0.8rem; }
}

/* --- App Footer Style --- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    padding: 12px 25px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    z-index: 800;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-footer b { color: var(--primary); }
.app-footer i { color: #ef4444; margin: 0 4px; }

@media (max-width: 1024px) {
    .app-footer {
        left: 0;
        padding: 10px 15px;
        font-size: 0.75rem;
    }
}

/* --- Sidebar Footer & Logout Style --- */
.sidebar-footer {
    padding: 20px 15px;
    border-top: 1px solid var(--border);
    background: var(--sidebar-bg);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
}

.logout-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

/* --- Drag & Drop Upload Zone --- */
.upload-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 35px 20px;
    text-align: center;
    background: rgba(99, 102, 241, 0.03);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-drop-zone:hover, .upload-drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.upload-drop-zone i {
    font-size: 3.5rem;
    color: var(--primary);
    opacity: 0.8;
}

.upload-drop-zone span {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
}

.upload-drop-zone p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-preview-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 10px;
    gap: 15px;
    animation: slideUp 0.3s ease;
}

.file-preview-card i {
    font-size: 1.8rem;
    color: var(--primary);
}

.file-info {
    flex-grow: 1;
    overflow: hidden;
    text-align: left;
}

.file-info strong {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.file-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-progress-container {
    margin-top: 20px;
    width: 100%;
}

.progress-label-wrap {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.logout-text {
    display: flex;
    flex-direction: column;
    line-height:1.2;
}


/* Toast Notifications */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg-card); color: var(--text-main); padding: 12px 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.9rem; transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); opacity: 0; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success i { color: var(--accent-low); }
.toast-error i { color: var(--accent-high); }
