/* ===== SIGMA DASHBOARD - Palm Oil Plantation Theme ===== */
:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --accent: #d4a373;
    --accent-light: #e9c46a;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --success: #2d6a4f;
    --warning: #e76f51;
    --danger: #e63946;
    --info: #457b9d;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 16px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .toggle-icon { transform: rotate(180deg); }

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--primary-dark);
    border: 2px solid var(--bg);
    border-radius: 50%;
    color: white;
    font-size: 0.6em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    z-index: 101;
}
.sidebar-toggle:hover { background: var(--primary-light); }
.toggle-icon { transition: transform 0.3s; }

.sidebar-logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon { font-size: 2em; }
.logo-text h1 { font-size: 1.4em; font-weight: 800; letter-spacing: 1px; }
.logo-text span { font-size: 0.75em; opacity: 0.7; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.15); color: white; font-weight: 600; }
.nav-icon { font-size: 1.1em; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.project-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.75em; opacity: 0.7; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .main-content { margin-left: 70px; }

.topbar {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    z-index: 50;
}

.topbar h2 { font-size: 1.3em; font-weight: 700; color: var(--primary-dark); }
.last-update { font-size: 0.8em; color: var(--text-muted); }

.tab-content { display: none; padding: 24px 32px; }
.tab-content.active { display: block; }

/* ===== CARDS ===== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-label { font-size: 0.8em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-icon-sm { font-size: 1.2em; }
.card h3 { font-size: 2em; font-weight: 800; }
.card-sub { font-size: 0.8em; color: var(--text-muted); margin-top: 4px; }

.card-total { border-left-color: var(--primary); }
.card-total h3 { color: var(--primary); }
.card-done { border-left-color: var(--success); }
.card-done h3 { color: var(--success); }
.card-backlog { border-left-color: var(--warning); }
.card-backlog h3 { color: var(--warning); }
.card-new { border-left-color: var(--info); }
.card-new h3 { color: var(--info); }

/* ===== CHARTS ===== */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
}

.chart-container {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 220px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 { font-size: 0.85em; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.chart-container canvas { max-height: 160px; }

/* ===== SECTION CARD ===== */
.section-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== INFO PANELS (Timeline) ===== */
.info-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.info-panel {
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.info-panel h3 { font-size: 0.9em; font-weight: 600; margin-bottom: 12px; color: var(--primary-dark); }

.baseline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.bl-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 0.82em;
    border: 1px solid var(--border);
}

.bl-chip strong { color: var(--primary); }

.team-chips { display: flex; flex-direction: column; gap: 6px; }
.team-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 0.82em;
    border: 1px solid var(--border);
}
.team-chip span { color: var(--text-muted); font-size: 0.9em; }
.team-chip.t3 { border-color: var(--accent); background: #fdf8f0; }

/* ===== OVERALL BOX ===== */
.overall-box {
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius);
    color: white;
}

.overall-box h3 { font-size: 1.1em; margin-bottom: 12px; }

.big-progress {
    width: 100%;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0;
}

.big-progress-fill {
    height: 100%;
    background: var(--accent-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 700;
    color: var(--primary-dark);
    transition: width 0.5s;
}

.overall-stats { display: flex; gap: 24px; font-size: 0.85em; opacity: 0.9; margin-top: 8px; }

/* ===== GANTT ===== */
.gantt-box { margin-bottom: 24px; }
.gantt-box h3 { font-size: 0.95em; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }

.gantt-row { display: flex; align-items: center; margin-bottom: 10px; gap: 12px; }
.gantt-label { min-width: 160px; font-size: 0.85em; font-weight: 600; }
.gantt-label small { font-weight: 400; color: var(--text-muted); }

.gantt-bar-bg {
    flex: 1;
    height: 28px;
    background: var(--bg);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.gantt-done {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--success);
    display: flex; align-items: center; padding-left: 8px;
    color: white; font-size: 0.72em; font-weight: 600;
    border-radius: 6px 0 0 6px;
}

.gantt-remain {
    position: absolute; top: 0; height: 100%;
    background: var(--accent);
    display: flex; align-items: center; padding-left: 8px;
    color: var(--primary-dark); font-size: 0.72em; font-weight: 600;
}

.gantt-end { min-width: 90px; font-size: 0.78em; font-weight: 600; text-align: right; }
.gantt-end.ok { color: var(--success); }
.gantt-end.over { color: var(--danger); }

/* ===== SUMMARY TABLE ===== */
.summary-table-box { margin-top: 2px; }
.summary-table-box table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.summary-table-box th { background: var(--primary-dark); color: white; padding: 10px 12px; text-align: left; font-weight: 600; }
.summary-table-box td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.summary-table-box tr:hover { background: #f0fdf4; }

/* ===== TEAM CARDS ===== */
.teams-header { margin-bottom: 20px; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    border-top: 4px solid var(--primary);
}

.team-card.overdue { border-top-color: var(--danger); }
.team-card h3 { font-size: 1.05em; color: var(--primary-dark); margin-bottom: 4px; }
.team-card .team-desc { font-size: 0.82em; color: var(--text-muted); margin-bottom: 12px; }

.team-progress { width: 100%; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 8px 0 16px; }
.team-progress-fill { height: 100%; background: var(--success); border-radius: 4px; transition: width 0.5s; }

.team-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.team-stat { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--bg); font-size: 0.85em; }
.team-stat .label { color: var(--text-muted); }
.team-stat .value { font-weight: 700; }

.team-modules { margin-top: 12px; }
.team-modules h4 { font-size: 0.82em; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.tm-item { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--bg); border-radius: 6px; margin-bottom: 4px; font-size: 0.82em; }

/* ===== TABLE ===== */
.table-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.table-info { font-size: 0.8em; color: var(--text-muted); margin-bottom: 8px; }

.search-input, .filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85em;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.search-input { flex: 1; min-width: 180px; }
.search-input:focus, .filter-select:focus { outline: none; border-color: var(--primary); }

.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; max-height: 65vh; overflow-y: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.8em; }
.data-table thead { position: sticky; top: 0; z-index: 10; }
.data-table th { background: var(--primary-dark); color: white; padding: 10px 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr:nth-child(even) { background: #fafafa; }
.data-table tbody tr:hover { background: #f0fdf4; }

.data-table td.editable { cursor: pointer; }
.data-table td.editable:hover { background: #e8f5e9; outline: 2px solid var(--primary); }
.data-table td.editable select { padding: 4px; border: 1px solid var(--primary); border-radius: 4px; font-size: 0.9em; }

/* Status chips */
.status-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
}
.status-chip.done { background: #d1fae5; color: #065f46; }
.status-chip.backlog { background: #fef3c7; color: #92400e; }
.status-chip.not-confirmed { background: #e0e7ff; color: #3730a3; }
.status-chip.not-development { background: #f3f4f6; color: #6b7280; }
.status-chip.new-item { background: #ede9fe; color: #5b21b6; }

/* ===== MODULES ===== */
.module-list { display: flex; flex-direction: column; gap: 12px; }

.module-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.module-header {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.module-header:hover { background: var(--primary-light); }
.module-header h3 { font-size: 0.95em; }
.module-stats { display: flex; gap: 12px; font-size: 0.8em; opacity: 0.9; }

.module-body { padding: 16px; display: none; }
.module-body.active { display: block; }

.progress-bar { width: 100%; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin: 8px 0 12px; }
.progress-fill { height: 100%; background: var(--success); border-radius: 3px; }

.item-list { display: flex; flex-direction: column; gap: 6px; }
.item {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}
.item.status-done { border-left-color: var(--success); }
.item.status-backlog { border-left-color: var(--warning); }
.item.status-not-confirmed { border-left-color: var(--info); }
.item.status-not-development { border-left-color: #9ca3af; }

.item-name { flex: 1; }
.item-name strong { font-size: 0.95em; }
.item-name small { color: var(--text-muted); }
.item-meta { display: flex; gap: 6px; align-items: center; }

.status-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75em; font-weight: 600; }
.status-badge.status-done { background: #d1fae5; color: #065f46; }
.status-badge.status-backlog { background: #fef3c7; color: #92400e; }
.status-badge.status-not-confirmed { background: #e0e7ff; color: #3730a3; }
.status-badge.status-not-development { background: #f3f4f6; color: #6b7280; }

.pic-badge { padding: 3px 8px; background: #fdf8f0; color: var(--accent); border-radius: 10px; font-size: 0.75em; border: 1px solid var(--accent); }

/* ===== FORM ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.8em; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9em; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-actions { display: flex; gap: 8px; }

/* ===== BUTTONS ===== */
.btn-action {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-export { background: var(--primary); color: white; }
.btn-export:hover { background: var(--primary-light); }
.btn-save { background: var(--info); color: white; }
.btn-reset { background: var(--danger); color: white; }
.btn-add { background: var(--success); color: white; padding: 10px 24px; }
.btn-add:hover { background: var(--primary-light); }
.btn-clear { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { width: 70px; }
    .sidebar .logo-text, .sidebar .nav-label, .sidebar-footer { display: none; }
    .sidebar-logo { justify-content: center; padding: 16px; }
    .nav-item { justify-content: center; padding: 12px; }
    .main-content { margin-left: 70px; }
    .info-panels { grid-template-columns: 1fr; }
    .charts-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .summary-cards { grid-template-columns: 1fr 1fr; }
    .tab-content { padding: 16px; }
}


/* ===== MODULE GANTT ===== */
.module-gantt-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.8em;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-color { width: 14px; height: 14px; border-radius: 4px; }
.legend-color.done { background: var(--success); }
.legend-color.active { background: var(--accent); }
.legend-color.overdue { background: var(--danger); }

.module-gantt-team {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.module-gantt-team:last-child { border-bottom: none; }
.module-gantt-team h4 { font-size: 0.95em; color: var(--primary-dark); margin-bottom: 6px; }

.track-label {
    font-size: 0.78em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 10px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.module-gantt-row {
    display: grid;
    grid-template-columns: 160px 1fr 200px;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.module-gantt-label {
    display: flex;
    flex-direction: column;
}
.module-gantt-label span { font-weight: 600; font-size: 0.85em; }
.module-gantt-label small { color: var(--text-muted); font-size: 0.78em; }

.module-gantt-bar-bg {
    height: 24px;
    background: var(--bg);
    border-radius: 4px;
    position: relative;
    border: 1px solid var(--border);
    overflow: visible;
}

.module-bar {
    position: absolute;
    top: 2px;
    height: calc(100% - 4px);
    background: var(--accent);
    border-radius: 3px;
    min-width: 8px;
}

.module-bar.done { background: var(--success); }
.module-bar.overdue { background: var(--danger); }

.module-gantt-dates {
    display: flex;
    gap: 4px;
    font-size: 0.8em;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

/* Deadline line in module gantt */
.gantt-deadline-line {
    position: absolute;
    top: -4px;
    height: calc(100% + 8px);
    width: 2px;
    background: var(--danger);
    z-index: 3;
    opacity: 0.6;
}


/* ===== SYNC BUTTONS ===== */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.btn-sync {
    padding: 8px 14px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sync:hover { background: var(--primary); color: white; }
.btn-sync-push { background: var(--primary); color: white; }
.btn-sync-push:hover { background: var(--primary-dark); }


/* Deadline line in module gantt */
.gantt-deadline-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--danger);
    z-index: 3;
    opacity: 0.5;
}


/* Scenario toggle */
.scenario-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.scenario-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.scenario-btn.active {
    background: var(--primary);
    color: white;
}
.scenario-btn:hover:not(.active) { background: #f0fdf4; }


/* ===== ADJUSTMENTS ===== */
.adjustment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.adj-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adj-item label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text);
}

.adj-item small {
    color: var(--text-muted);
    font-size: 0.78em;
}

.adj-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.adj-input-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.adj-input-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.adj-input-row span {
    min-width: 50px;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95em;
}

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


/* ===== PAGINATION ===== */
.table-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.8em; color: var(--text-muted); }
.pagination { display: flex; gap: 4px; align-items: center; }
.page-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* QA Fail status */
.status-chip.fail { background: #fee2e2; color: #991b1b; }


/* Full Timeline - multi-bar rows */
#tab-fulltimeline .module-gantt-bar-bg {
    height: 28px;
}


/* ===== SUB-TABS ===== */
.sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.sub-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.sub-tab:hover { color: var(--primary); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subtab-content { display: none; }
.subtab-content.active { display: block; }


/* Inline select in table */
.inline-select {
    padding: 3px 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.72em;
    font-weight: 500;
    background: var(--bg-card);
    cursor: pointer;
    width: auto;
    min-width: 80px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%236c757d' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 16px;
}
.inline-select:focus { outline: none; border-color: var(--primary); }

/* ===== ROLE BADGE ===== */
.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.role-badge:hover {
    transform: scale(1.05);
}
.role-viewer {
    background: #e5e7eb;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.role-admin {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Disabled selects for viewer mode */
.inline-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== LOGIN MODAL ===== */
.login-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.login-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}
.login-modal-content h3 {
    margin: 0 0 4px 0;
    color: var(--primary-dark);
}
.pin-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.pin-input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1em;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.2s;
}
.pin-input:focus {
    border-color: var(--primary);
}
.pin-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.pin-toggle:hover {
    opacity: 1;
}
.login-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
.btn-login {
    flex: 1;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-login:hover {
    background: var(--primary-dark);
}
.btn-cancel {
    flex: 1;
    padding: 10px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-cancel:hover {
    background: var(--border);
}

/* ===== INLINE TEXT EDIT ===== */
.inline-text-input {
    padding: 4px 8px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 0.85em;
    outline: none;
    background: white;
}
.edit-sigma {
    min-width: 100px;
}
.edit-sigma:hover {
    background: var(--bg);
}


/* ===== BA ROLE BADGE ===== */
.role-ba {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* ===== PENDING APPROVAL PANEL ===== */
.pending-panel {
    background: white;
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 16px;
}
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pending-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.pending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.pending-tim {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}
.pending-date {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85em;
}
.pending-body {
    margin-bottom: 12px;
}
.pending-module {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.pending-changes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pending-change-item {
    font-size: 0.9em;
    padding: 6px 10px;
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.change-text {
    flex: 1;
}
.btn-edit-small {
    padding: 4px 8px;
    background: #fbbf24;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-edit-small:hover {
    background: #f59e0b;
}
.old-value {
    color: var(--danger);
    text-decoration: line-through;
}
.new-value {
    color: var(--success);
    font-weight: 600;
}
.pending-actions {
    display: flex;
    gap: 8px;
}
.btn-revert, .btn-ok {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
}
.btn-revert {
    background: #ef4444;
    color: white;
}
.btn-revert:hover {
    background: #dc2626;
}
.btn-ok {
    background: var(--success);
    color: white;
}
.btn-ok:hover {
    background: #059669;
}


/* ===== ACCORDION TABLE STYLE ===== */
.data-table-accordion {
    width: 100%;
    border-collapse: collapse;
}

.table-row-main {
    cursor: pointer;
    transition: background 0.2s;
}

.table-row-main:hover {
    background: #f0fdf4;
}

.expand-cell {
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.expand-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.8em;
    color: var(--primary);
}

.module-path {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-tim {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.path-content-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.path-main {
    font-size: 0.9em;
    color: var(--text);
}

.detail-level-inline {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}

.table-row-detail-expanded {
    background: #f9fafb;
    border-top: none !important;
}

.detail-panel {
    padding: 16px;
    border-top: 2px solid var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item-wide {
    grid-column: span 2;
}

.detail-item label {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-item > div {
    font-size: 0.9em;
    padding: 6px 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    min-height: 32px;
}

/* Remove old sticky styles */
.sticky-col {
    position: static;
    background: transparent;
    z-index: auto;
    border-right: none;
}

.sticky-col-0, .sticky-col-1, .sticky-col-2, .sticky-col-3 {
    left: auto;
    min-width: auto;
    max-width: none;
}


/* Table wrapper for horizontal scroll */
.table-wrapper {
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Smooth scrollbar */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}
.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}
.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
