/* ─── RESET & ROOT ─────────────────────────────────────────────── */
:root {
    --bg:        #0d1117;
    --bg-2:      #161b22;
    --bg-3:      #1c2330;
    --surface:   #1e2636;
    --border:    #2d3748;
    --border-2:  #3d4f63;
    --text:      #e8edf3;
    --text-1:    #e8edf3;
    --text-2:    #a0aec0;
    --text-3:    #64748b;
    --primary:   #3b82f6;
    --primary-h: #2563eb;
    --primary-s: rgba(59,130,246,0.12);
    --green:     #10b981;
    --green-s:   rgba(16,185,129,0.12);
    --red:       #f43f5e;
    --red-s:     rgba(244,63,94,0.12);
    --orange:    #f59e0b;
    --orange-s:  rgba(245,158,11,0.12);
    --blue:      #38bdf8;
    --blue-s:    rgba(56,189,248,0.12);
    --indigo:    #818cf8;
    --indigo-s:  rgba(129,140,248,0.12);
    --teal:      #2dd4bf;
    --teal-s:    rgba(45,212,191,0.12);
    --purple:    #a78bfa;
    --yellow:    #fbbf24;
    --sidebar-w: 240px;
    --radius:    10px;
    --radius-sm: 6px;
}

/* ─── LIGHT MODE THEME OVERRIDES ─── */
body.light-mode {
    --bg-1: #f8fafc;          /* Background utama jadi putih abu-abu terang */
    --bg-2: #ffffff;          /* Card & Sidebar jadi putih bersih */
    --bg-3: #f1f5f9;          /* Dropdown & tombol ghost */
    --border: #e2e8f0;        /* Garis pembatas menjadi abu-abu terang */
    --text: #0f172a;           /* ← TAMBAH INI: teks default jadi hitam pekat */
    --text-1: #0f172a;        /* Judul utama jadi hitam pekat */
    --text-2: #334155;        /* Teks menu jadi abu-abu gelap */
    --text-3: #64748b;        /* Teks muted */
}

/* Jaga agar area scrollbar dan tabel di light mode tetap estetik */
body.light-mode .table-scroll,
body.light-mode .tracker-header-bar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .tracker-header-bar div {
    color: #3b82f6 !important; /* Memaksa judul header produk tetap biru figma terang */
}

body.light-mode tr {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .tracker-ticket {
    background: #f1f5f9 !important;
    color: #4f46e5 !important;
    border: 1px solid #cbd5e1 !important;
}
*,*::before,*::after { box-sizing: border-box; margin:0; padding:0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    display: flex;
    min-height: 100vh;
    line-height: 1.5;
}
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border-2); border-radius:99px; }

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    padding: 0 0.25rem;
}
.logo-mark {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.logo-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.role-box {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem;
    margin-bottom: 1.5rem;
}
.role-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}
.role-box select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
}
.profile-meta {
    font-size: 0.73rem;
    color: var(--text-3);
    margin-top: 0.6rem;
    line-height: 1.6;
}
.nav-section { flex: 1; }
.nav-section-title {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-3);
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex;
    align-items: center;      /* Kunci posisi ikon & teks sejajar di tengah */
    gap: 0.65rem;             /* Jarak spasi ideal antara ikon dan teks menu */
    padding: 0.55rem 0.75rem;
    color: var(--text-2);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--primary-s); color: var(--primary); font-weight: 600; }
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;              /* Mengunci lebar kolom ikon agar teks teks di kanannya lurus seragam */
    height: 20px;
    flex-shrink: 0;
}
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 1rem;
}
.sidebar-footer-text {
    font-size: 0.65rem;
    color: var(--text-3);
    text-align: center;
    font-family: 'DM Mono', monospace;
}

/* ─── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.25rem;
    max-width: calc(100vw - var(--sidebar-w));
    overflow-x: hidden;
}
.app-view { display: none; animation: fadeIn 0.2s ease; }
.app-view.active-view { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ─── PAGE HEADER ───────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text);
    line-height: 1.2;
}
.page-sub {
    font-size: 0.8rem;
    color: var(--text-3);
    margin-top: 0.2rem;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.week-range-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    padding: 0 0.5rem;
    font-family: 'DM Mono', monospace;
}

/* ─── SURFACE CARDS ─────────────────────────────────────────── */
.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.accent-card {
    background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(129,140,248,0.06) 100%);
    border-color: rgba(59,130,246,0.25);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* ─── FORM ELEMENTS ─────────────────────────────────────────── */
.log-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.875rem;
    align-items: end;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-group.span-2 { grid-column: span 2; }
.form-group.span-full { grid-column: 1 / -1; }
label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.52rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-h); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); background: var(--bg-3); }
.form-feedback {
    font-size: 0.78rem;
    color: var(--green);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
}
.form-feedback.show { opacity: 1; }

/* ─── TABLES ────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
thead th {
    background: var(--bg-3);
    color: var(--text-3);
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.65rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 0.7rem 0.875rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-3); }
code {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--indigo);
}

/* ─── BADGES ────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-critical  { background: var(--red-s);    color: var(--red); }
.badge-medium    { background: var(--orange-s);  color: var(--orange); }
.badge-low       { background: var(--green-s);   color: var(--green); }
.badge-product   { background: var(--blue-s);    color: var(--blue); }
.badge-project   { background: var(--indigo-s);  color: var(--indigo); }
.badge-inprogress { background: var(--blue-s);   color: var(--blue); }
.badge-done       { background: var(--green-s);  color: var(--green); }
.badge-delayed    { background: var(--red-s);    color: var(--red); }
.badge-planning   { background: var(--orange-s); color: var(--orange); }

/* ─── WEEKLY TABLE ──────────────────────────────────────────── */
.weekly-table th { text-align: center; min-width: 90px; }
.weekly-table th:first-child { text-align: left; min-width: 200px; }
.weekly-table td { text-align: center; }
.weekly-table td:first-child { text-align: left; font-weight: 500; color: var(--text); }
.weekly-cell {
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0.3rem 0.4rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-2);
}
.weekly-cell:hover { border-color: var(--primary); background: var(--primary-s); }
.weekly-cell.has-hours { background: var(--primary-s); border-color: rgba(59,130,246,0.3); color: var(--primary); font-weight: 600; }
.weekly-cell.today-col { background: rgba(16,185,129,0.06); }
.weekly-total-row td {
    background: var(--bg-3) !important;
    font-weight: 700;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    border-top: 2px solid var(--border-2) !important;
}
tfoot .weekly-total-row td { border-bottom: none !important; }

/* ─── PROJECT TRACKER (NEW DESIGN) ──────────────────────────── */
.tracker-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.tracker-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}
.tracker-category-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}
.tracker-category-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.tracker-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* 100% Match Table Styling for Rowspan */
.tracker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.tracker-table td {
    padding: 0.85rem 0.875rem;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: top; /* Important for rowspan */
    color: var(--text-2);
}
.tracker-table th {
    background: var(--bg-3);
    color: var(--text-3);
    font-weight: 700;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}
.tracker-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.tracker-epic-cell {
    font-weight: 700;
    color: var(--text);
    font-size: 0.85rem;
}
.tracker-epic-owner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    flex-shrink: 0;
}
.owner-name {
    font-size: 0.78rem;
    color: var(--text-2);
}
.tracker-ticket {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--indigo);
    display: inline-block;
}

/* ─── MASTERSHEET ───────────────────────────────────────────── */
.mastersheet-section { margin-bottom: 2rem; }
.mastersheet-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 0.6rem;
    margin-bottom: 0.875rem;
}

/* ─── NEW ANALYTICS TOP ROW (100% Match layout) ────────────── */
.analytics-top-row {
    display: grid;
    grid-template-columns: 350px 1fr; /* KPI kiri, Chart Kanan */
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}
.analytics-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
}
.analytics-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}
.analytics-kpi-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-family: 'DM Mono', monospace;
}
.analytics-kpi-sub {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 0.4rem;
}
.analytics-kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
}
.delta-positive { background: var(--green-s); color: var(--green); }
.delta-negative { background: var(--red-s); color: var(--red); }

/* Project Performance Chart Card */
.analytics-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.analytics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.analytics-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.analytics-chart-filters {
    display: flex;
    gap: 0.5rem;
}
.analytics-filter-btn {
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
body.light-mode .analytics-filter-btn option {
    background-color: var(--bg-2) !important;
    color: var(--text-1) !important;
}
.analytics-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.analytics-filter-btn, .btn-ghost {
    height: 34px; /* Kunci tinggi seragam untuk semua elemen filter di samping */
    padding: 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}
.analytics-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 250px;
}

/* EMPLOYEE SUMMARY METRICS (One-Look Summary) */
.employee-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--border);
}
.summary-card.alert-card { border-left-color: var(--red); }
.summary-card.warning-card { border-left-color: var(--orange); }
.summary-card.info-card { border-left-color: var(--primary); }
.summary-title { 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: var(--text-3); 
    text-transform: uppercase; 
    margin-bottom: 0.5rem; 
}
.summary-val { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--text); 
    font-family: 'DM Mono', monospace; 
}

/* Project Overview Cards */
.project-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.project-overview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.project-overview-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.project-overview-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.project-overview-desc {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.5;
    margin-bottom: 1rem;
}
.project-overview-progress {
    margin-bottom: 0.75rem;
}
.project-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.project-progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.project-progress-text {
    font-size: 0.72rem;
    color: var(--text-3);
    text-align: right;
}
.project-avatars {
    display: flex;
    gap: -0.25rem;
}
.project-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid var(--surface);
    margin-left: -6px;
}
.project-avatar:first-child { margin-left: 0; }

/* High Priority Tasks */
.priority-tasks-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.priority-tasks-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}
.priority-task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.priority-task-item:last-child { border-bottom: none; }
.priority-task-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
}
.priority-task-assignee {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-2);
}
.priority-task-progress {
    width: 100px;
}
.priority-task-due {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.due-soon { background: var(--orange-s); color: var(--orange); }
.due-today { background: var(--red-s); color: var(--red); }
.due-later { background: var(--green-s); color: var(--green); }

/* Resource Allocation */
.resource-allocation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.resource-allocation-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}
.resource-team-row {
    margin-bottom: 1.25rem;
}
.resource-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.resource-team-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}
.resource-team-hours {
    font-size: 0.72rem;
    color: var(--text-3);
    font-family: 'DM Mono', monospace;
}
.resource-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
    display: flex;
}
.resource-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}
.resource-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.resource-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-3);
}
.resource-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Critical Individual Load */
.individual-load-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.individual-load-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}
.load-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.load-row:last-child { border-bottom: none; }
.load-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.load-info {
    flex: 1;
}
.load-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.load-role {
    font-size: 0.72rem;
    color: var(--text-3);
}
.load-rate {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    width: 50px;
    text-align: right;
}
.load-rate-high { color: var(--red); }
.load-rate-normal { color: var(--green); }
.load-rate-medium { color: var(--orange); }
.load-bar-bg {
    width: 200px;
    height: 8px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}
.load-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.load-bar-fill.high { background: var(--red); }
.load-bar-fill.medium { background: var(--orange); }

/* Project Tasks Table */
.project-tasks-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.project-tasks-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.project-tasks-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.project-tasks-tab:hover { color: var(--text-2); }
.project-tasks-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.task-progress-mini {
    width: 80px;
    height: 6px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
}
.task-progress-mini-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
}

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 1.75rem;
    min-width: 300px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 0.75rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 9999;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 320px;
}
.toast.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .analytics-top-row { grid-template-columns: 1fr; }
    .analytics-kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .project-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .analytics-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .project-overview-grid { grid-template-columns: 1fr; }
    .employee-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 200px; }
    .main-content { padding: 1.25rem; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-group.span-2 { grid-column: span 2; }
    .analytics-kpi-grid { grid-template-columns: 1fr; }
}

.nav-text {
    line-height: 1;           /* Membuang sisa ruang kosong font bawaan agar tidak melayang */
    display: inline-block;
}

/* ─── UTILITY & SIDEBAR COLLAPSE ────────────────────────────── */
.hidden { display: none !important; }

/* Transisi sidebar */
.sidebar { transition: width 0.3s ease; }
.sidebar.collapsed { width: 72px; padding: 1.5rem 0.5rem; }
/* Sembunyikan teks, panah dropdown, dan sub-menu saat sidebar mengecil */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .sub-nav-list {
    display: none !important;
}

/* Sembunyikan elemen teks saat sidebar kecil */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .role-box,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .sidebar-footer { 
    display: none; 
}

/* Pusatkan icon saat sidebar kecil */
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem; }
.sidebar.collapsed .nav-icon { font-size: 1.2rem; margin: 0; }

/* Transisi main content agar menyesuaikan lebar sidebar */
.main-content { transition: margin-left 0.3s ease, max-width 0.3s ease; }
.sidebar.collapsed ~ .main-content { 
    margin-left: 72px; 
    max-width: calc(100vw - 72px); 
}

/* Tombol hamburger */
.collapse-btn {
    background: transparent; border: none; color: var(--text-2);
    cursor: pointer; font-size: 1.5rem; padding: 0; margin-left: auto;
    transition: color 0.2s; line-height: 1;
}
.collapse-btn:hover { color: var(--text); }

.nav-img-icon {
    width: 18px;              /* Proporsi ukuran ikon PNG terbaik sesuai Figma */
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Gaya dasar icon PNG */
.nav-item .nav-img-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    
    /* WARNA DEFAULT: Dipaksa jadi abu-abu 100% & agak transparan */
    filter: grayscale(100%) opacity(50%);
    transition: filter 0.2s ease;
}

/* WARNA AKTIF: Saat menu aktif, matikan efek filternya (Kembali jadi BIRU murni) */
.nav-item.active .nav-img-icon {
    filter: none; /* Menghapus grayscale, warna biru aslinya keluar */
}
/* ─── COLLAPSIBLE PRODUCT CARD ─── */
/* Putar panah chevron menjadi ke kanan saat collapse */
.surface-card.feature-collapsed .chevron-toggle {
    transform: rotate(-90deg);
}

/* Sembunyikan tabel secara mutlak saat kelas .feature-collapsed aktif */
.surface-card.feature-collapsed .table-scroll {
    display: none !important;
}

/* Efek transisi halus untuk icon chevron */
.chevron-toggle {
    transition: transform 0.2s ease;
    display: inline-block;
    cursor: pointer;
}

/* ─── FIX GLOBAL WEEKLY TIMESHEET LIGHT MODE ─── */
body.light-mode {
    background-color: var(--bg-1) !important;
}

/* Memaksa kontainer halaman utama kamu ikut berubah terang */
body.light-mode .main-content,
body.light-mode #main-content,
body.light-mode .content-wrapper,
body.light-mode main {
    background-color: var(--bg-1) !important;
}

/* Memperbaiki teks judul (seperti tanggal "25 May — 31 May") agar menjadi hitam pekat */
body.light-mode h1, 
body.light-mode h2, 
body.light-mode #weekRangeLabel,
body.light-mode .view-header h2 {
    color: var(--text-1) !important;
}

/* Memperbaiki teks hari (MON, TUE, WED) di dalam tabel agar kontras dan terbaca */
body.light-mode th {
    color: var(--text-2) !important;
}

/* Memperbaiki kotak input/cell tempat karyawan mengisi jam kerja */
body.light-mode .timesheet-input,
body.light-mode .weekly-cell input,
body.light-mode td input {
    background-color: var(--bg-3) !important;
    color: var(--text-1) !important;
    border: 1px solid var(--border) !important;
}

/* Memperbaiki tombol ghost di barisan atas (seperti Prev/Next) */
body.light-mode .btn-ghost {
    background-color: var(--bg-2) !important;
    color: var(--text-2) !important;
    border: 1px solid var(--border) !important;
}
/* ─── FIX SIDEBAR BRAND & MODAL TABS IN LIGHT MODE ─── */

/* 1. Paksa Teks Nama Aplikasi KinetixPro agar Berwarna Gelap di Light Mode */
body.light-mode .sidebar-brand,
body.light-mode .brand-text,
body.light-mode .sidebar-header h2,
body.light-mode .sidebar h3,
body.light-mode .logo-text {
    color: var(--text-1) !important;
}

/* 2. Bereskan Warna Garis dan Teks Tab di Dalam Modal */
body.light-mode .modal-box {
    background-color: var(--bg-2) !important;
    border-color: var(--border) !important;
}

body.light-mode .modal-tab {
    color: var(--text-3) !important;
}

body.light-mode .modal-tab.active {
    color: #3b82f6 !important;
    border-bottom-color: #3b82f6 !important;
}

/* ─── FIX SIDEBAR HOVER & SECURITY PROFILE IN LIGHT MODE ─── */

/* 1. Perbaiki Teks Menu Sidebar Pas Di-Hover & Pas Aktif */
body.light-mode .nav-item:hover .nav-text,
body.light-mode .nav-item.active .nav-text {
    color: #3b82f6 !important; /* Ubah teks jadi biru Figma yang kontras saat di-hover/aktif */
}

body.light-mode .nav-item:hover .nav-img-icon,
body.light-mode .nav-item.active .nav-img-icon {
    filter: brightness(0.5) sepia(1) hue-rotate(200deg) saturate(5); /* Maksa icon img ikut berwarna biru */
}

/* 2. Perbaiki Box Kontainer Security Profile */
body.light-mode [class*="security"] {
    background-color: var(--bg-1) !important;
    border-color: var(--border) !important;
}

/* Judul kecil "SECURITY PROFILE" */
body.light-mode [class*="security"] .profile-label,
body.light-mode [class*="security"] div:first-child {
    color: var(--text-3) !important;
}

/* Teks dropdown pilihan role (Employee View / Admin View) agar tidak putih gaib */
body.light-mode [class*="security"] select {
    background-color: var(--bg-2) !important;
    color: var(--text-1) !important;
    border: 1px solid var(--border) !important;
}

/* Teks keterangan paling bawah (AI/ML · Employee Space) */
body.light-mode [class*="security"] span,
body.light-mode [class*="security"] p {
    color: var(--text-2) !important;
}

/* ─── FIX DEFINITIF DROPDOWN SECURITY PROFILE LIGHT MODE ─── */

/* Mengincar langsung setiap select dropdown yang ada di area sidebar */
body.light-mode .sidebar select,
body.light-mode .sidebar-footer select,
body.light-mode [id*="security"] select,
body.light-mode [class*="profile"] select {
    background-color: var(--bg-3) !important; /* Mengubah background kotak jadi abu terang */
    color: var(--text-1) !important;        /* Memaksa teks "Employee View" jadi hitam pekat */
    border: 1px solid var(--border) !important;
}

/* Mengamankan isi teks pilihan di dalam dropdown saat di-klik */
body.light-mode .sidebar select option,
body.light-mode .sidebar-footer select option {
    background-color: var(--bg-2) !important;
    color: var(--text-1) !important;
}
/* ─── FIX TOTAL LIGHT MODE UNTUK WEEKLY LOG & ANALYTICS ─── */

/* ==========================================
   1. FIX DROPDOWN BULAN DI WEEKLY LOG
   ========================================== */
body.light-mode select.analytics-filter-btn,
body.light-mode .app-view select {
    color: var(--text-1) !important; /* Paksa semua teks di dalam dropdown filter menjadi hitam pekat */
}

/* ==========================================
   2. FIX 3 CARD PROYEK BESAR DI ANALYTICS (KIRI)
   ========================================== */
body.light-mode #projectOverviewGrid > div,
body.light-mode .project-overview-grid > div,
body.light-mode .analytics-kpi-card {
    background-color: var(--bg-2) !important; /* Ubah background card jadi putih bersih */
    border: 1px solid var(--border) !important; /* Beri border abu-abu tipis estetik */
}

/* Ubah teks judul proyek utama (e.g. AI Rules Engine, Pilot A) jadi hitam */
body.light-mode #projectOverviewGrid h3,
body.light-mode #projectOverviewGrid div[style*="color: rgb(255, 255, 255)"],
body.light-mode #projectOverviewGrid div[style*="color: #fff"] {
    color: var(--text-1) !important;
}

/* Ubah teks persentase completion (e.g. 20% Completed, 0% Completed) jadi abu-abu gelap */
body.light-mode #projectOverviewGrid div {
    color: var(--text-2);
}

body.light-mode #projectOverviewGrid span {
    color: var(--text-3) !important;
}

/* ==========================================
   3. FIX TEKS GAIB DI HIGH PRIORITY TASKS (KANAN)
   ========================================== */
/* Paksa seluruh baris nama project/epic di list priority menjadi hitam tegas tanpa terkecuali */
body.light-mode #priorityTasksList div,
body.light-mode #priorityTasksList span {
    color: var(--text-1);
}

/* Jaga agar sub-deskripsi di bawah judul tugas tetap berwarna abu-abu redup */
body.light-mode #priorityTasksList div style,
body.light-mode #priorityTasksList span[style*="color: #64748b"],
body.light-mode #priorityTasksList span[style*="color: var(--text-3)"] {
    color: var(--text-3) !important;
}

/* Pastikan badge avatar inisial nama (e.g. NA, ST, SB) teksnya tetap putih di dalam lingkaran biru */
body.light-mode #priorityTasksList span[style*="border-radius: 50%"],
body.light-mode #projectOverviewGrid span[style*="border-radius: 50%"] {
    color: #ffffff !important;
}



/* ═══════════════════════════════════════════════════════════════════
   INDIVIDUAL PROJECT VIEW STYLES
   ═══════════════════════════════════════════════════════════════════ */

/* Project Stage Card */
.project-stage-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.project-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}
.project-stage-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}
.project-stage-actions {
    display: flex;
    gap: 0.5rem;
}

/* Project Table */
.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.project-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    white-space: nowrap;
}
.project-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}
.project-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.project-table tbody tr:last-child td {
    border-bottom: none;
}

/* Phase Header Row */
.phase-header-row {
    background: var(--bg-3) !important;
}
.phase-header-row td {
    padding: 0.6rem 1rem !important;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-1);
    border-left: 3px solid var(--primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-inprogress { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-overdue { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Assignment Badges */
.assignment-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.assignment-kinetixpro { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.assignment-client { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.priority-low { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.priority-medium { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.priority-high { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Add Buttons */
.add-phase-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: transparent;
    border: 1px dashed var(--border-2);
    color: var(--text-3);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.add-phase-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-s);
}
.add-stage-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.add-stage-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Template Modal */
.template-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.template-option:hover {
    border-color: var(--primary);
    background: var(--primary-s);
}
.template-option.selected {
    border-color: var(--primary);
    background: var(--primary-s);
}
.template-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-1);
}
.template-desc {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 0.15rem;
}

/* Template Editor */
.template-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.template-editor-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-1);
}
.template-meta {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 0.25rem;
}
.editor-actions {
    display: flex;
    gap: 0.5rem;
}

/* Editable Fields */
.editable-field {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s ease;
    min-width: 60px;
}
.editable-field:hover {
    border-color: var(--border-2);
    background: var(--bg-3);
}
.editable-field:focus {
    border-color: var(--primary);
    background: var(--bg-3);
    outline: none;
    color: var(--text-1);
}

/* Delete Row Button */
.delete-row-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
}
.project-table tr:hover .delete-row-btn,
.project-stage-header:hover .delete-row-btn {
    opacity: 1;
}
.delete-row-btn:hover {
    transform: scale(1.1);
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    color: var(--text-3);
    font-size: 0.85rem;
    padding: 0.25rem;
    opacity: 0.5;
    user-select: none;
}
.drag-handle:hover {
    opacity: 1;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Light Mode Overrides for Individual Project */
body.light-mode .project-stage-card {
    background: var(--bg-2) !important;
    border-color: var(--border) !important;
}
body.light-mode .project-stage-header {
    background: var(--bg-3) !important;
    border-color: var(--border) !important;
}
body.light-mode .phase-header-row {
    background: var(--bg-3) !important;
}
body.light-mode .phase-header-row td {
    color: var(--text-1) !important;
}
body.light-mode .project-table th {
    background: var(--bg-2) !important;
    color: var(--text-3) !important;
}
body.light-mode .project-table td {
    color: var(--text-2) !important;
    border-color: var(--border) !important;
}
body.light-mode .template-option {
    background: var(--bg-3) !important;
    border-color: var(--border) !important;
}
body.light-mode .template-option:hover,
body.light-mode .template-option.selected {
    border-color: var(--primary) !important;
    background: var(--primary-s) !important;
}
body.light-mode .editable-field {
    color: var(--text-2) !important;
}
body.light-mode .editable-field:focus {
    color: var(--text-1) !important;
    background: var(--bg-3) !important;
}
body.light-mode .add-phase-btn {
    color: var(--text-3) !important;
    border-color: var(--border-2) !important;
}
body.light-mode .add-phase-btn:hover {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
body.light-mode .add-stage-btn {
    background: var(--bg-3) !important;
    color: var(--text-2) !important;
    border-color: var(--border) !important;
}
body.light-mode .add-stage-btn:hover {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}