/* Tasks Management App - Premium Style System */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Theme colors */
    --background: 210 40% 98%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    /* Status Colors */
    --completed: 142.1 76.2% 36.3%; /* Green */
    --in-progress: 221.2 83.2% 53.3%; /* Blue */
    --pending: 35 91.5% 50%; /* Orange */
    --overdue: 0 84.2% 60.2%; /* Red */
    --cfo-review: 271.5 81.3% 55.9%; /* Purple */
    --warning: 47.9 95.8% 51.2%; /* Yellow */

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;

    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    
    /* Layout Sizes */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Custom Sidebar specific */
    --sidebar-bg: 224 71.4% 4.1%; /* Deep rich navy */
    --sidebar-item-active: 217.2 91.2% 59.8%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.9375rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.25;
}

a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: hsl(var(--primary) / 0.8);
}

/* =====================================================================
     LAYOUT STRUCTURE
     ===================================================================== */

#app-container {
    min-height: 100vh;
    display: flex;
}

.view-panel {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    background-color: hsl(var(--sidebar-bg));
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid hsl(var(--border) / 0.1);
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--cfo-review)));
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.brand-text h3 {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
}
.brand-text span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #94a3b8;
    display: block;
    margin-top: -2px;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.menu-link i {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-link:hover i {
    color: white;
    transform: translateX(2px);
}

.menu-link.active {
    background-color: hsl(var(--primary));
    color: white;
}

.menu-link.active i {
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 170px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: hsl(var(--primary) / 0.15);
    border: 2px solid hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

#sidebar .user-avatar {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.user-details h4 {
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-details span {
    color: #94a3b8;
    font-size: 0.75rem;
    display: block;
}

.btn-logout {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ef4444;
}

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

/* Header styling */
#header {
    height: var(--header-height);
    background-color: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border));
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header-left h2 {
    font-size: 1.5rem;
    color: hsl(var(--foreground));
}
.header-left .breadcrumb {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    display: block;
    margin-top: -2px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.branding-header {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--cfo-review)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    animation: brandingGlow 3s ease-in-out infinite alternate;
}

@keyframes brandingGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.1));
    }
    to {
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.3));
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Dev Role Switcher Panel */
.dev-role-switcher {
    background-color: hsl(var(--secondary));
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px dashed hsl(var(--border));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dev-role-switcher label {
    font-size: 0.8rem;
    font-weight: 600;
    color: hsl(var(--secondary-foreground));
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dev-role-switcher select {
    background-color: white;
    border: 1px solid hsl(var(--border));
    border-radius: 4px;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    outline: none;
    cursor: pointer;
    font-weight: 500;
}

/* Content Viewport Padding */
#content-viewport {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}


/* =====================================================================
     LOGIN VIEW STYLE
     ===================================================================== */

#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgb(18, 28, 59) 0%, rgb(10, 15, 30) 100%);
    padding: 1.5rem;
}

.login-card-container {
    width: 100%;
    max-width: 440px;
}

.login-branding {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.logo-icon-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--cfo-review)));
    color: white;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    margin-bottom: 1rem;
}
.logo-icon-large i {
    width: 32px;
    height: 32px;
}

.login-branding h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.1rem;
}
.branding-login-sub {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0.1rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--cfo-review)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.login-branding p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.login-card {
    background-color: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.login-card .subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.dev-quick-logins {
    margin-top: 2rem;
    border-top: 1px solid hsl(var(--border));
    padding-top: 1.5rem;
}
.dev-quick-logins h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}
.quick-login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.quick-login-btn {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quick-login-btn:hover {
    background-color: hsl(var(--primary));
    color: white;
    border-color: hsl(var(--primary));
}


/* =====================================================================
     UI COMPONENTS & FORM CONTROLS
     ===================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}
.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.btn-outline:hover {
    background-color: hsl(var(--secondary));
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-text {
    background: none;
    border: none;
    color: hsl(var(--primary));
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
}
.btn-text:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-priority-low { background-color: #f1f5f9; color: #475569; }
.badge-priority-medium { background-color: #eff6ff; color: #2563eb; }
.badge-priority-high { background-color: #fff7ed; color: #ea580c; }
.badge-priority-critical { background-color: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }

/* Status Specific Badges */
.badge-status-completed { background-color: hsl(var(--completed) / 0.12); color: hsl(var(--completed)); }
.badge-status-assigned { background-color: #f1f5f9; color: #475569; }
.badge-status-acknowledged { background-color: #e0f2fe; color: #0369a1; }
.badge-status-inprogress { background-color: hsl(var(--in-progress) / 0.12); color: hsl(var(--in-progress)); }
.badge-status-submitted { background-color: #fef3c7; color: #d97706; }
.badge-status-correction { background-color: #ffedd5; color: #ea580c; }
.badge-status-cforeview { background-color: hsl(var(--cfo-review) / 0.12); color: hsl(var(--cfo-review)); }
.badge-status-overdue { background-color: hsl(var(--overdue) / 0.12); color: hsl(var(--overdue)); }
.badge-status-escalated { background-color: #fef2f2; color: #dc2626; animation: pulse 2s infinite; }
.badge-status-cancelled { background-color: #f1f5f9; color: #94a3b8; }
.badge-status-exception { background-color: #fae8ff; color: #c084fc; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: hsl(var(--muted-foreground));
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-icon i {
    position: absolute;
    left: 0.75rem;
    width: 18px;
    height: 18px;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
}
.input-with-icon input {
    padding-left: 2.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background-color: white;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: hsl(var(--foreground));
    transition: all 0.2s ease;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15);
}

.input-readonly {
    background-color: hsl(var(--secondary)) !important;
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 1rem;
}
.col-6 {
    flex: 1;
}

.checkbox-group-container {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500 !important;
    color: hsl(var(--foreground)) !important;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: hsl(var(--primary));
}


/* =====================================================================
     CARDS & DASHBOARD GRIDS
     ===================================================================== */

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

.stat-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
}

.stat-info h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}
.stat-number {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: hsl(var(--foreground));
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-icon.primary { background-color: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); }
.stat-icon.warning { background-color: hsl(var(--pending) / 0.1); color: hsl(var(--pending)); }
.stat-icon.danger { background-color: hsl(var(--overdue) / 0.1); color: hsl(var(--overdue)); }
.stat-icon.purple { background-color: hsl(var(--cfo-review) / 0.1); color: hsl(var(--cfo-review)); }
.stat-icon.completed { background-color: hsl(var(--completed) / 0.1); color: hsl(var(--completed)); }

/* Dashboard Chart Row */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.section-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.section-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.section-header-row h3 {
    margin-bottom: 0;
}

/* =====================================================================
     TABLES & LISTS
     ===================================================================== */

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

td {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    vertical-align: middle;
}

tr:hover td {
    background-color: hsl(var(--secondary) / 0.4);
}

tr.overdue-row td {
    border-left: 3px solid hsl(var(--overdue));
}

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.table-user-cell .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.empty-state {
    padding: 2.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.empty-state i {
    width: 48px;
    height: 48px;
    color: hsl(var(--muted) / 0.8);
}


/* =====================================================================
     NOTIFICATIONS DROPDOWN
     ===================================================================== */

.notification-dropdown-container {
    position: relative;
}

.notification-bell-btn {
    background: none;
    border: none;
    color: hsl(var(--foreground));
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}
.notification-bell-btn:hover {
    background-color: hsl(var(--secondary));
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: hsl(var(--overdue));
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    border: 2px solid white;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background-color: white;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow: hidden;
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.notif-header h3 {
    font-size: 0.95rem;
}

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

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.notif-item:hover {
    background-color: hsl(var(--secondary) / 0.5);
}
.notif-item.unread {
    background-color: hsl(var(--primary) / 0.03);
}
.notif-item.unread::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: hsl(var(--primary));
    border-radius: 50%;
    display: inline-block;
    align-self: center;
    margin-left: auto;
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: hsl(var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-item-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
}
.notif-item-content p {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.15rem;
}
.notif-item-time {
    font-size: 0.65rem;
    color: hsl(var(--muted-foreground));
    display: block;
    margin-top: 0.25rem;
}


/* =====================================================================
     MODALS FRAMEWORK
     ===================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 2rem;
    transition: opacity 0.2s ease;
}

.modal-card {
    background-color: white;
    width: 100%;
    max-width: 580px;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-large {
    max-width: 960px;
}
.modal-small {
    max-width: 440px;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}
.modal-close:hover {
    background-color: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}


/* =====================================================================
     TASK DETAIL MODAL SPECIFICS
     ===================================================================== */

.modal-grid-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .modal-grid-layout {
        grid-template-columns: 1fr;
    }
}

.modal-detail-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stepper Indicator */
.visual-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background-color: hsl(var(--secondary));
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid hsl(var(--border));
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: hsl(var(--border));
    z-index: 1;
}
.step-item:last-child::after {
    display: none;
}

.step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    z-index: 2;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: hsl(var(--muted-foreground));
    text-align: center;
}

/* Stepper Active States */
.step-item.completed-step .step-circle {
    background-color: hsl(var(--completed));
    border-color: hsl(var(--completed));
    color: white;
}
.step-item.completed-step .step-label {
    color: hsl(var(--completed));
}
.step-item.completed-step::after {
    background-color: hsl(var(--completed));
}

.step-item.active-step .step-circle {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.15);
    background-color: white;
}
.step-item.active-step .step-label {
    color: hsl(var(--primary));
    font-weight: 700;
}

/* Metadata lists */
.modal-detail-right {
    background-color: hsl(var(--secondary) / 0.5);
    border: 1px solid hsl(var(--border));
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metadata-block label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}
.metadata-block span {
    font-size: 0.95rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

.mini-meta-actions {
    margin-top: 0.25rem;
}
.btn-link-action {
    background: none;
    border: none;
    color: hsl(var(--primary));
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-link-action:hover {
    text-decoration: underline;
}

.flex-gap {
    display: flex;
    gap: 0.75rem;
}

/* Action stacks */
.task-action-panel {
    border-top: 1px solid hsl(var(--border));
    padding-top: 1.25rem;
    margin-top: 0.75rem;
}
.task-action-panel h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}
.action-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Attachments inside details */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background-color: hsl(var(--secondary) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
}
.attachment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.attachment-info i {
    color: hsl(var(--muted-foreground));
}
.attachment-name {
    font-size: 0.85rem;
    font-weight: 500;
}
.attachment-size {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-left: 0.5rem;
}

/* Comments feed */
.comments-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    padding-bottom: 1rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
}
.comment-bubble {
    background-color: hsl(var(--secondary) / 0.4);
    padding: 0.75rem 1rem;
    border-radius: 0 12px 12px 12px;
    flex: 1;
}

.comment-item.cfo-visibility .comment-bubble {
    background-color: #fae8ff; /* purple background */
    border: 1px solid #f5d0fe;
}
.comment-item.finance-visibility .comment-bubble {
    background-color: #eff6ff; /* blue background */
    border: 1px solid #dbeafe;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}
.comment-author {
    font-weight: 700;
    color: hsl(var(--foreground));
}
.comment-time {
    color: hsl(var(--muted-foreground));
}
.comment-badge {
    display: inline-block;
    padding: 0.05rem 0.3rem;
    font-size: 0.65rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}
.comment-badge.cfo { background-color: #d8b4fe; color: #6b21a8; }
.comment-badge.finance { background-color: #93c5fd; color: #1e40af; }

.comment-text {
    font-size: 0.85rem;
    color: hsl(var(--foreground));
}

.comment-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.comment-input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.comment-input-controls select {
    width: auto;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}


/* =====================================================================
     REPORTS INTERFACE
     ===================================================================== */

.reports-filter-bar {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.reports-filter-bar h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    align-items: flex-end;
}
.filter-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}
.filter-item select, .filter-item input {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
}

.report-export-controls {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}


/* =====================================================================
     USER MANAGER STYLING
     ===================================================================== */

.section-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header-actions h2 {
    font-size: 1.5rem;
}


/* =====================================================================
     UTILITIES
     ===================================================================== */

.text-green { color: hsl(var(--completed)); }
.text-red { color: hsl(var(--overdue)); }
.text-orange { color: hsl(var(--pending)); }
.text-blue { color: hsl(var(--primary)); }

.w-full { width: 100%; }

.loading-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid hsl(var(--primary) / 0.15);
    border-radius: 50%;
    border-top-color: hsl(var(--primary));
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid hsl(var(--border));
    margin-bottom: 1.5rem;
}
.tab-btn {
    background: none;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    color: hsl(var(--foreground));
}
.tab-btn.active {
    color: hsl(var(--primary));
    border-bottom-color: hsl(var(--primary));
}

/* SUBTASK CHECKLIST & AI SUGGESTION STYLES */
.subtask-creation-container {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: hsl(var(--muted) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}
.subtask-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.subtask-header-row label {
    font-weight: 600;
    color: hsl(var(--foreground));
}
.btn-ai-suggest {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.15), hsl(var(--cfo-review) / 0.15));
    border: 1px solid hsl(var(--primary) / 0.4);
    color: hsl(var(--primary));
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px hsl(var(--primary) / 0.05);
}
.btn-ai-suggest:hover {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.25), hsl(var(--cfo-review) / 0.25));
    border-color: hsl(var(--primary) / 0.6);
    box-shadow: 0 0 15px hsl(var(--primary) / 0.15);
    transform: translateY(-1px);
}
.create-task-subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.create-task-subtasks-list::-webkit-scrollbar {
    width: 6px;
}
.create-task-subtasks-list::-webkit-scrollbar-thumb {
    background-color: hsl(var(--border));
    border-radius: 3px;
}
.subtask-creation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}
.subtask-creation-item input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}
.subtask-creation-item input[type="text"]:focus {
    border-color: hsl(var(--primary));
    outline: none;
}
.btn-remove-subtask {
    background: none;
    border: none;
    color: hsl(var(--destructive));
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.btn-remove-subtask:hover {
    background-color: hsl(var(--destructive) / 0.1);
}
.btn-add-subtask-manual {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    background-color: hsl(var(--card));
    border: 1px dashed hsl(var(--border));
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-add-subtask-manual:hover {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.02);
}

/* Checklist Details Section */
.checklist-progress-text {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    font-weight: 600;
}
.checklist-progress-bar-container {
    height: 8px;
    background-color: hsl(var(--muted));
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.checklist-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--cfo-review)));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.checklist-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}
.checklist-item:hover {
    background-color: hsl(var(--muted) / 0.15);
}
.checklist-item.completed span.checklist-item-title {
    text-decoration: line-through;
    color: hsl(var(--muted-foreground));
}
.checklist-item-checkbox {
    margin-top: 0.25rem;
    cursor: pointer;
}
.checklist-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.checklist-item-title {
    font-size: 0.925rem;
    font-weight: 550;
    color: hsl(var(--foreground));
    transition: color 0.2s;
}
.checklist-item-meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}
.btn-delete-subtask-detail {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.checklist-item:hover .btn-delete-subtask-detail {
    opacity: 1;
}
.btn-delete-subtask-detail:hover {
    color: hsl(var(--destructive));
}
.subtask-add-inline {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.subtask-add-inline input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}
.subtask-add-inline input:focus {
    border-color: hsl(var(--primary));
    outline: none;
}

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


/* =====================================================================
     MOBILE RESPONSIVENESS STYLES
     ===================================================================== */

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: hsl(var(--foreground));
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}
.btn-sidebar-toggle:hover {
    background-color: hsl(var(--secondary));
}
.btn-sidebar-toggle i {
    width: 22px;
    height: 22px;
}

@media (max-width: 768px) {
    .btn-sidebar-toggle {
        display: flex;
    }
    
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        max-width: 85%;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    }
    
    #sidebar.active {
        transform: translateX(0);
    }
    
    #main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    #header {
        padding: 0 1rem;
    }
    
    .header-center {
        display: none;
    }
    
    .dev-role-switcher {
        display: none;
    }
    
    #content-viewport {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .col-6 {
        width: 100%;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(2px);
        z-index: 95;
    }
    #sidebar-overlay.active {
        display: block;
    }
}
