:root {
    /* Horizon UI / Modern Professional Palette */
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1B2559;
    --text-muted: #A3AED0;
    --primary: #4318FF;
    --primary-light: #F4F7FE;
    --primary-hover: #3311DB;
    --success: #05CD99;
    --success-light: #E6FAF5;
    --warning: #FFB547;
    --warning-light: #FFF8ED;
    --danger: #EE5D50;
    --danger-light: #FEEEEE;
    --border: #E0E5F2;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
    --sidebar-width: 280px;
}

/* DARK MODE THEME */
[data-theme="dark"] {
    --bg-color: #0B1437;
    --card-bg: #111C44;
    --text-main: #FFFFFF;
    --text-muted: #8F9BBA;
    --primary-light: rgba(67, 24, 255, 0.15);
    --border: #1B2559;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --bg-color-alt: #0B0F29;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
}

[data-theme="dark"] .sidebar {
    background: #111C44;
    box-shadow: 14px 0px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .app-header {
    background: rgba(11, 20, 55, 0.8) !important;
}

[data-theme="dark"] .header-right {
    background: #1B2559 !important;
}

[data-theme="dark"] .kanban-col {
    background: #1B2559;
}

[data-theme="dark"] .custom-table th,
[data-theme="dark"] .metrics-table th {
    background: #1B2559 !important;
    color: #8F9BBA !important;
}

[data-theme="dark"] .custom-table tr:hover,
[data-theme="dark"] .metrics-table tr:hover {
    background: #111C44 !important;
}

[data-theme="dark"] input, 
[data-theme="dark"] select, 
[data-theme="dark"] textarea {
    background: #111C44 !important;
    border-color: #1B2559 !important;
    color: white !important;
}

[data-theme="dark"] .form-group input, 
[data-theme="dark"] .form-group select, 
[data-theme="dark"] .form-group textarea {
    background: #111C44;
    border-color: #1B2559;
    color: white;
}

[data-theme="dark"] .user-avatar {
    border-color: #111C44;
}

[data-theme="dark"] .modal-content {
    background: #111C44;
    border-color: #1B2559;
}

[data-theme="dark"] .close-btn {
    background: #1B2559 !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .mobile-toggle {
    background: #1B2559 !important;
    color: white !important;
}

[data-theme="dark"] .btn-move {
    background: #1B2559 !important;
    color: white !important;
    border-color: #1B2559 !important;
}

[data-theme="dark"] .nav-parent-dot {
    border-color: #111C44 !important;
}

[data-theme="dark"] .header-notif-badge, 
[data-theme="dark"] .nav-badge {
    border-color: #1B2559 !important;
}

[data-theme="dark"] .user-dropdown {
    background: #111C44;
    border-color: #1B2559;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

[data-theme="dark"] .user-dropdown div {
    border-color: #1B2559 !important;
}

[data-theme="dark"] .user-dropdown a:hover {
    background: #1B2559;
}


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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem;
}

/* Global Components */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* LAYOUT SYSTEM */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    box-shadow: 14px 0px 40px rgba(112, 144, 176, 0.08);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    max-width: calc(100vw - var(--sidebar-width));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 0 1rem;
    margin-bottom: 3rem;
}

.sidebar-logo img {
    height: 35px;
}

.sidebar-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo .logo-text span {
    color: var(--primary);
}

/* Sidebar Navigation */
.sidebar h1.app-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 3.5rem;
    padding-left: 1rem;
    color: var(--text-main);
}

.sidebar h1.app-title span {
    color: var(--primary);
}

.sidebar .nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar .nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 14px 18px;
    border-radius: 10px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.sidebar .nav-links a svg {
    width: 20px;
    height: 20px;
    transition: 0.2s;
}

.sidebar .nav-links a:hover {
    color: var(--text-main);
}

.sidebar .nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
}

.sidebar .nav-links a.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}

.sidebar .nav-group {
    margin-bottom: 4px;
    position: relative;
}

.sidebar .nav-group > a .arrow {
    margin-left: auto;
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .nav-group > a.active .arrow {
    opacity: 1;
}

.nav-parent-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: 14px;
    right: 35px;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.sidebar .sub-nav {
    padding-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.sidebar .sub-nav a {
    padding: 10px 18px 10px 52px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.sidebar .sub-nav a.active {
    background: transparent;
    color: var(--primary);
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 2rem 1.25rem 0.75rem;
}

/* App Header */
/* App Header Sticky */
.app-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(12px);
    z-index: 900;
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.header-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0px 10px 30px rgba(112, 144, 176, 0.06);
}

.header-icon {
    position: relative;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    border-radius: 50%;
}

.header-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.role-badge {
    background: var(--success-light);
    color: var(--success);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 3px solid #FFF;
    box-shadow: 0px 10px 20px rgba(0,0,0,0.05);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    width: 200px;
    display: none;
    z-index: 1000;
    padding: 10px;
}

.user-dropdown.show { display: block; }

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

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

/* Page Content Padding */
.page-content {
    padding: 0 2.5rem 2.5rem;
}


.sidebar hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border);
    opacity: 0.5;
}

/* Buttons Styling */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0px 4px 14px rgba(67, 24, 255, 0.25);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0px 7px 18px rgba(67, 24, 255, 0.35);
}

.btn:active {
    transform: translateY(0);
}

/* KANBAN BOARD DESIGN */
.kanban-board {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    align-items: flex-start;
}

.kanban-col {
    flex: 1;
    min-width: 320px;
    background: var(--border);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 80vh;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem; /* JARAK ANTAR KARTU AGAR TIDAK TUMPANG TINDIH */
    min-height: 100px;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(163, 174, 208, 0.1);
}

.kanban-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.kanban-header .count {
    background: var(--card-bg);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0px 4px 8px rgba(0,0,0,0.05);
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.table-responsive .custom-table {
    box-shadow: none;
    min-width: 800px;
}

/* KANBAN CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: 0px 25px 50px rgba(112, 144, 176, 0.2);
}

.card-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.4;
}

.card-role {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 15px;
}

/* Role Colors */
.card-role.dev { background: var(--primary-light); color: var(--primary); }
.card-role.design { background: var(--warning-light); color: var(--warning); }
.card-role.it-support { background: var(--success-light); color: var(--success); }
.card-role.staff { background: #E2E8F0; color: #4A5568; }
.card-role.manager { background: #FEF3C7; color: #D97706; }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--bg-color);
}

.card-assignee {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 800;
}
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: var(--bg-color); color: var(--text-muted); }

/* EVALUATION & REPORT CARDS */
.eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem; /* Gap dipersempit */
}

.eval-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0px 10px 30px rgba(112, 144, 176, 0.08);
    border: 1px solid var(--border);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.eval-card::before {
    display: none;
}

.eval-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 30px 60px rgba(112, 144, 176, 0.15);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 8px 0;
}

.score-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.score-value {
    font-weight: 800;
    color: var(--text-main);
}

.total-score-box {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-score-box .label {
    font-weight: 800;
    font-size: 1.1rem;
}

.total-score-box .value {
    font-size: 1.75rem;
    font-weight: 900;
}

/* TABLES OVERHAUL */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.custom-table th {
    background: var(--primary-light);
    padding: 20px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    color: var(--text-muted);
    border-bottom: 2px solid var(--bg-color);
}

.custom-table td {
    padding: 20px;
    border-bottom: 1px solid var(--bg-color);
    font-size: 0.95rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover {
    background: var(--primary-light);
}

/* MODAL MODERN */
.modal {
    display: none; /* SEMBUNYIKANSecara Default */
    position: fixed;
    z-index: 1000;
    left: var(--sidebar-width);
    top: 0;
    width: calc(100% - var(--sidebar-width));
    height: 100%;
    overflow: auto;
    background-color: rgba(11, 15, 41, 0.5);
    backdrop-filter: blur(10px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 8% auto;
    padding: 3rem;
    border-radius: 10px;
    width: 500px;
    border: 1px solid rgba(255,255,255,0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0px 40px 80px rgba(11, 15, 41, 0.15);
    position: relative;
}

/* Close Button Modern */
.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 24px;
    height: 24px;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    z-index: 10;
}

.close-btn:hover {
    background: transparent;
    color: var(--danger);
    transform: scale(1.2);
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    background: #FFFFFF;
    border: 2px solid var(--border);
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    outline: none;
    box-shadow: 0px 4px 10px rgba(112, 144, 176, 0.04);
}

.form-group input:hover, 
.form-group select:hover, 
.form-group textarea:hover {
    border-color: var(--text-muted);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0px 10px 20px rgba(67, 24, 255, 0.08);
}

.form-group textarea {
    resize: none;
    line-height: inherit;
}

.form-group select {
    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='%232B3674' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* UTILS */
.highlight-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    box-shadow: 0px 20px 40px rgba(67, 24, 255, 0.2);
}

.highlight-card h2 { font-weight: 800; font-size: 1.75rem; margin-bottom: 10px; }
.highlight-card p { opacity: 0.9; }

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

.section-header h2 {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Notification badge on bell icon in header */
.header-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
    pointer-events: none;
    line-height: 1;
}

/* Contextual count badge on sidebar nav items */
.nav-badge-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .sidebar {
        left: -100%;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }

    .modal {
        left: 0 !important;
        width: 100% !important;
    }

    .app-header {
        padding: 1rem 1.5rem;
    }

    .page-content {
        padding: 0 1.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-title {
        font-size: 1rem !important; /* Smaller title */
        font-weight: 800;
    }
    
    .header-subtitle {
        font-size: 0.65rem !important; /* Smaller date */
        margin-top: 2px;
    }
    
    .header-right {
        padding: 4px 8px !important;
        gap: 6px !important;
    }

    .header-right svg {
        width: 18px !important;
        height: 18px !important;
    }

    .user-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }
    
    .role-badge {
        display: none;
    }

    .app-header {
        padding: 0.6rem 1rem !important; /* Even tighter */
    }

    .mobile-toggle {
        width: 32px !important;
        height: 32px !important;
        margin-right: 10px;
    }

    .mobile-toggle svg {
        width: 18px !important;
        height: 18px !important;
    }

    .header-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .header-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .page-content {
        padding: 0 1rem 1rem;
    }

    .kanban-board {
        gap: 0.75rem;
        padding-bottom: 1rem;
        padding-left: 0;
        padding-right: 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem; /* Negative margin to go edge-to-edge */
        margin-right: -1rem;
        padding: 0 1rem 1.5rem;
    }

    .kanban-col {
        min-width: 82vw; 
        padding: 1rem;
        border-radius: 20px;
        scroll-snap-align: center;
        min-height: 60vh;
    }

    .kanban-board::-webkit-scrollbar {
        height: 6px;
    }
    .kanban-board::-webkit-scrollbar-thumb {
        background: var(--primary-light);
        border-radius: 10px;
    }

    .highlight-card {
        padding: 1.5rem;
    }
    
    .highlight-card h2 {
        font-size: 1.4rem;
    }

    .eval-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95% !important;
        padding: 2rem !important;
        margin: 20% auto;
    }

    /* Grid layout adjustments for mobile */
    .dashboard-grid, .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .highlight-card {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
        padding: 1rem !important;
    }

    .highlight-card h2 {
        font-size: 1.25rem !important;
    }

    .highlight-card p {
        font-size: 0.75rem !important;
    }

    .section-header {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .section-header h3 {
        font-size: 0.95rem !important;
    }

    .highlight-card div:last-child {
        width: 100%;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .highlight-card .btn {
        width: 100%;
        justify-content: center;
    }

    #kanbanSearch {
        width: 100% !important;
    }

    .section-header > div > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }

    /* Mobile Move Actions */
    .mobile-move-actions {
        display: flex !important;
        justify-content: space-between;
        margin-top: 15px;
        padding-top: 12px;
        border-top: 1px dashed rgba(0,0,0,0.05);
        gap: 10px;
    }
    .btn-move {
        flex: 1;
        padding: 8px;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: var(--card-bg);
        font-size: 0.8rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: var(--text-main);
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    .btn-move:active {
        background: var(--bg-color);
        transform: scale(0.95);
    }
}

.mobile-move-actions {
    display: none;
}

/* ========================================== */
/* TOTAL MOBILE RE-ARCHITECTURE (1024px) */
/* ========================================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
        --radius: 8px !important;
    }

    /* Global Radius Override for Mobile */
    .card, .btn, .modal-content, .form-control-premium, 
    input, select, textarea, .mobile-toggle, .user-avatar,
    .nav-badge, .header-icon, .highlight-card {
        border-radius: 8px !important;
    }

    html { font-size: 14px !important; scroll-padding-top: 80px; overflow-x: visible !important; }
    body { 
        width: 100vw; 
        overflow-x: hidden; 
        -webkit-text-size-adjust: 100%; 
        background-color: var(--bg-color);
        position: relative;
    }

    .main-wrapper {
        display: block !important;
        width: 100% !important;
        min-height: 100vh;
        overflow: visible !important; /* CRITICAL for sticky header */
    }

    /* Sidebar Navigation Off-Canvas */
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        z-index: 5000 !important;
        width: var(--sidebar-width) !important;
        padding-top: 5rem !important;
        height: 100vh !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        box-shadow: none !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.2) !important;
    }

    .sidebar-overlay {
        z-index: 4500 !important;
    }

    .modal {
        z-index: 9000 !important;
    }

    .sidebar-close {
        display: flex !important;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 32px;
        height: 32px;
        background: transparent !important;
        color: var(--text-muted);
        align-items: center;
        justify-content: center;
        border: none;
        font-size: 28px;
        font-weight: 300;
        z-index: 5100;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .sidebar-close:hover {
        color: var(--danger);
        transform: scale(1.2);
    }

    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }

    .app-header {
        padding: 0 15px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 85px !important;
        z-index: 3000 !important;
        width: 100% !important;
        background: var(--card-bg) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: none !important;
    }

    .header-title .desktop-title, 
    .header-subtitle {
        display: none !important;
    }

    .header-title .mobile-icon {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        color: var(--primary);
    }
    
    .header-title .mobile-icon svg {
        width: 24px;
        height: 24px;
        stroke-width: 2.5;
    }

    .header-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
    }

    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        background: var(--card-bg) !important;
        padding: 8px 12px !important;
        border-radius: 50px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    }

    .mobile-toggle {
        display: flex !important;
        background: var(--card-bg) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
        padding: 10px !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Modal Scaling & Close Button - Equal Margins */
    .modal {
        padding: 0 !important; /* Remove legacy top padding */
        display: none;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        width: calc(100% - 30px) !important; /* 15px margin on left/right */
        margin: 15px auto !important; /* 15px margin on top/bottom */
        padding: 40px 20px 20px !important;
        max-height: calc(100vh - 30px) !important;
        overflow-y: auto;
        position: relative;
    }

    .close-btn {
        top: 20px !important;
        right: 20px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 24px !important;
        background: transparent !important;
        color: var(--text-muted) !important;
        box-shadow: none !important;
        border: none !important;
        font-weight: 300 !important;
    }

    /* Page Content Offset for FIXED Header */
    .page-content {
        padding: 15px !important;
        margin-top: 100px !important; /* Spacious buffer for fixed header */
        min-height: calc(100vh - 85px);
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: visible !important;
    }

    /* Responsive Buttons & Form Spacing */
    .btn, button[type="submit"] {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px !important; /* Larger touch target */
        margin-bottom: 10px !important;
    }

    /* Ensure last element in modal has breathing room */
    .modal-content form > *:last-child {
        margin-bottom: 30px !important;
    }

    /* Smartphone Specific (768px) */
    @media (max-width: 768px) {
        .header-title { font-size: 1.1rem !important; }
        
        /* Force Form Stacking */
        .highlight-card, 
        .section-header, 
        .form-row,
        .filter-bar,
        .action-bar,
        .stats-grid,
        form,
        div[style*="display: flex"]:not(.header-left):not(.header-right),
        div[style*="display: grid"]:not(.header-left):not(.header-right),
        div[style*="grid-template-columns"],
        form[style*="display: grid"],
        form[style*="display: flex"],
        .modal-content form > div,
        .modal-content .form-group {
            flex-direction: column !important;
            grid-template-columns: 1fr !important;
            display: flex !important;
            align-items: stretch !important;
            gap: 15px !important;
            padding: 5px !important;
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
        }

        form > div[style*="display: grid"] {
            grid-template-columns: 1fr !important;
        }

        .kanban-board {
            gap: 1rem !important;
        }
    }
}

/* Base style for Sidebar Close (Hidden on Desktop) */
.sidebar-close {
    display: none;
}

/* Hamburger Menu */
.mobile-toggle {
    display: none;
    background: white;
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: var(--shadow);
    margin-right: 15px;
    z-index: 4000 !important;
}
@media (max-width: 1024px) {
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
}

/* GLOBAL FORM STYLES - DARK MODE READY */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.form-control-premium, 
input[type="text"], 
input[type="number"], 
input[type="date"], 
input[type="password"], 
input[type="email"], 
select, 
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--card-bg);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Custom Select Arrow */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23A3AED0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* Date Input Fix for Dark Mode */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: var(--theme-mode, invert(0));
    cursor: pointer;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Modal Form Specifics */
.modal-content label {
    color: var(--text-main) !important;
}
.modal-content input, 
.modal-content select, 
.modal-content textarea {
    background: var(--bg-color) !important;
    border-color: var(--border) !important;
    color: var(--text-main) !important;
}

/* Custom Distinct Style for Date Inputs across all pages */
input[type="date"], input.flatpickr-input {
    background-color: rgba(67, 24, 255, 0.05) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%234318FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border: 1.5px solid var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
    padding: 10px 40px 10px 14px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(67, 24, 255, 0.1) !important;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 10px;
    cursor: pointer;
}

@media (max-width: 768px) {
    input[type="date"], input.flatpickr-input {
        font-size: 14px;
        padding: 12px 35px 12px 12px !important;
    }
}

input[type="date"]:hover, input[type="date"]:focus,
input.flatpickr-input:hover, input.flatpickr-input:focus {
    background-color: rgba(67, 24, 255, 0.1) !important;
    box-shadow: 0 6px 15px rgba(67, 24, 255, 0.2) !important;
    outline: none !important;
}

/* For dark mode consistency */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input.flatpickr-input {
    background-color: rgba(117, 81, 255, 0.1) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23F4F7FE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') !important;
    border-color: var(--primary) !important;
    color: var(--primary-light) !important;
}

[data-theme="dark"] input[type="date"]:hover, [data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input.flatpickr-input:hover, [data-theme="dark"] input.flatpickr-input:focus {
    background-color: rgba(117, 81, 255, 0.2) !important;
}
