:root {
    /* Proxsis Corporate Light Palette */
    --bg-color: #f4f6f9; /* Matte white / Dope background */
    --sidebar-bg: #ffffff;
    --panel-bg: #ffffff;
    
    --text-primary: #2b3440;
    --text-secondary: #6c757d;
    
    /* Proxsis Corporate Colors (Elegant Blue & Accents) */
    --accent-blue: #0D8ABC;
    --accent-blue-light: #e6f4f9;
    --accent-green: #20c997;
    --accent-yellow: #f5a623;
    --accent-red: #e63946;
    
    --border-color: #e9ecef;
    --border-radius: 12px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd2d9;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #9aa5b1;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-blue);
}

.sidebar h2 {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #f8f9fa;
    color: var(--accent-blue);
}

.nav-item.active {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.agent-status {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.agent-card {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.agent-card:hover {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(13, 138, 188, 0.08);
}

.agent-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    display: inline-block;
}

.dot.active {
    background-color: var(--accent-green);
    box-shadow: 0 0 0 rgba(32, 201, 151, 0.4);
}

.agent-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.agent-task-status {
    font-size: 11px;
    color: #137333;
    background: #e6f4ea;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    align-self: flex-start;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px 48px;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-titles h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 500;
}

/* Filter Panel */
.filter-panel {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 180px;
    min-width: 170px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.filter-group select, .filter-group input {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
}

.btn-primary:hover {
    background: #0b739e;
    box-shadow: 0 4px 12px rgba(13, 138, 188, 0.2);
}

/* Date Range Inputs */
.date-range-container {
    display: flex;
    gap: 8px;
    align-items: center;
}
.date-range-container span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Executive Summary */
.executive-summary {
    border-left: 4px solid var(--accent-blue);
}

.insight-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-content {
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
}

.text-danger { color: var(--accent-red); font-weight: 600; }
.text-success { color: var(--accent-green); font-weight: 600; }
.text-warning { color: var(--accent-yellow); font-weight: 600; }

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
}

.kpi-card.critical {
    border: 1px solid rgba(230, 57, 70, 0.3);
    background: linear-gradient(135deg, #fff 0%, rgba(230, 57, 70, 0.05) 100%);
}

.kpi-icon {
    font-size: 24px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.blue { color: var(--accent-blue); background: var(--accent-blue-light); }
.kpi-icon.green { color: var(--accent-green); background: rgba(32, 201, 151, 0.15); }
.kpi-icon.yellow { color: var(--accent-yellow); background: rgba(245, 166, 35, 0.15); }
.kpi-icon.red { color: var(--accent-red); background: rgba(230, 57, 70, 0.15); }

.kpi-data h4 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-weight: 700;
}

.kpi-data p {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-container h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.canvas-wrapper {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Table */
.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.matrix-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.badge {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
}

th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

td {
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Status & Category Badges */
.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status.done { background: #e6f4ea; color: #137333; border: 1px solid #ceead6; }
.status.inprogress { background: rgba(245, 166, 35, 0.15); color: #c48215; border: 1px solid rgba(245, 166, 35, 0.3); }
.status.hold { background: rgba(217, 119, 6, 0.15); color: #d97706; border: 1px solid rgba(217, 119, 6, 0.3); }
.status.change { background: rgba(124, 58, 237, 0.15); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.3); }

/* Target Type & Action Plan Category Badges */
.badge-target-rups {
    background: rgba(13, 138, 188, 0.12);
    color: var(--accent-blue);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-target-mgmt {
    background: rgba(32, 201, 151, 0.12);
    color: #17956f;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-action-rups {
    background: #101820;
    color: #f5a623;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge-action-tambahan {
    background: #f1f3f5;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.select-status-inline {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    outline: none;
}

.source-doc {
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-blue);
    background: var(--accent-blue-light);
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease;
}

.source-doc:hover {
    background: #d0ebf5;
    text-decoration: none;
}

.task-cell {
    max-width: 250px;
}
.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.task-target {
    font-size: 12px;
    color: var(--text-secondary);
}

/* RUPS Financial Cards */
.financial-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.fin-card {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fin-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fin-values {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fin-target {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.fin-realization {
    font-size: 13px;
    color: var(--text-secondary);
}

.fin-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

.fin-badge.positive {
    background: rgba(32, 201, 151, 0.12);
    color: #17956f;
}

.fin-badge.revised {
    background: rgba(245, 166, 35, 0.15);
    color: #c48215;
}

.origin-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.origin-badge.rups {
    background: rgba(13, 138, 188, 0.12);
    color: var(--accent-blue);
}

.origin-badge.mom {
    background: rgba(108, 117, 125, 0.12);
    color: var(--text-secondary);
}

.origin-badge.revision {
    background: rgba(245, 166, 35, 0.15);
    color: #c48215;
}

/* Custom Right-Click Context Menu */
.custom-context-menu {
    position: fixed;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 8px 0;
    min-width: 240px;
    animation: contextPop 0.15s ease-out;
}

@keyframes contextPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.context-header {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.custom-context-menu .menu-item {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-context-menu .menu-item:hover {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.custom-context-menu .menu-item.highlight {
    background: rgba(13, 138, 188, 0.08);
    color: var(--accent-blue);
    font-weight: 600;
}

.custom-context-menu .menu-item.highlight:hover {
    background: var(--accent-blue);
    color: #ffffff;
}

/* AI Copilot Drawer */
.ai-copilot-drawer {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: 24px;
    width: 400px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDrawer 0.25s ease-out;
}

@keyframes slideDrawer {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.drawer-header {
    background: #101820;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-avatar {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: 8px;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: #9aa5b1;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.btn-close-drawer:hover {
    color: #ffffff;
}

.drawer-context-bar {
    background: #f8f9fa;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f4f6f9;
}

.chat-msg {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--accent-blue);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.chat-msg.ai {
    align-self: flex-start;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.drawer-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.drawer-footer input {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.drawer-footer input:focus {
    border-color: var(--accent-blue);
}

.btn-send-chat {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-send-chat:hover {
    background: #0b739e;
}

/* Floating AI Button */
.floating-ai-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #101820;
    color: #ffffff;
    border: 1px solid var(--accent-blue);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9990;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-ai-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(13, 138, 188, 0.3);
    background: var(--accent-blue);
}

.copilot-chip {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.copilot-chip:hover {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

