/* ==========================================================================
   Smart City Portal Design System - Custom Vanilla CSS
   ========================================================================== */

/* Design Tokens & Variables */
:root {
    --bg-primary: #f4f6f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    
    --border-color: #cbd5e1;
    --border-gantt: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --color-primary: #10b981;
    --color-primary-hover: #059669;
    
    --color-green: #10b981;
    --color-green-bg: rgba(16, 185, 129, 0.1);
    
    --color-amber: #d97706;
    --color-amber-bg: rgba(217, 119, 6, 0.1);
    
    --color-red: #ef4444;
    --color-red-bg: rgba(239, 68, 68, 0.1);
    
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

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

/* Typography Utilities */
h1, h2, h3, h4, .font-outfit {
    font-family: var(--font-display);
    font-weight: 600;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-green); }
.text-warning { color: var(--color-amber); }
.text-danger { color: var(--color-red); }
.font-bold { font-weight: 700; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Authentication Page Styles */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, #e6f4ea 0%, #f4f6f9 90%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), #059669);
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.auth-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-errors {
    background: var(--color-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.auth-errors ul {
    list-style: none;
}

.auth-errors li {
    color: #b91c1c;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-demo-accounts {
    margin-top: 25px;
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
    text-align: left;
}

.auth-demo-accounts h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.credential-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credential-tag {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.credential-tag:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Master Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar Styling */
.app-sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.brand-name {
    display: flex;
    flex-direction: column;
}

.brand-name span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.brand-name small {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
}

.sidebar-nav li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.sidebar-nav li:hover a, .sidebar-nav li.active a {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-primary);
}

.sidebar-nav li:hover a i, .sidebar-nav li.active a i {
    color: var(--color-primary);
}

.sidebar-user {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #059669, var(--color-primary));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-logout:hover {
    color: var(--color-red);
    background: var(--color-red-bg);
}

/* Main Dashboard Panel */
.app-main {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - 280px);
    box-sizing: border-box;
    overflow-x: hidden;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.app-header h2 {
    font-size: 26px;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.current-date i {
    color: var(--color-primary);
}

/* Alerts System */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background-color: var(--color-green-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-danger {
    background-color: var(--color-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-close {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* Status RAG Dots */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.Green .dot, .rag-dot.Green {
    background-color: var(--color-green);
    box-shadow: 0 0 10px var(--color-green);
}
.status-indicator.Amber .dot, .rag-dot.Amber {
    background-color: var(--color-amber);
    box-shadow: 0 0 10px var(--color-amber);
}
.status-indicator.Red .dot, .rag-dot.Red {
    background-color: var(--color-red);
    box-shadow: 0 0 10px var(--color-red);
}

.rag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.rag-text.Green { color: var(--color-green); }
.rag-text.Amber { color: var(--color-amber); }
.rag-text.Red { color: var(--color-red); }

/* Dashboard Grids & Layout Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.percent { background: rgba(16, 185, 129, 0.15); color: #059669; }
.stat-icon.budget { background: rgba(16, 185, 129, 0.1); color: #059669; }
.stat-icon.spi { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.stat-icon.cpi { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }

.stat-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0;
}

.stat-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Progress Bars */
.progress-bar-sm {
    background-color: var(--bg-input);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-sm .progress {
    background-color: var(--color-primary);
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.progress-bar-sm.spent .progress {
    background-color: var(--color-green);
}

.progress-bar-sm .progress.Green { background-color: var(--color-green); }
.progress-bar-sm .progress.Amber { background-color: var(--color-amber); }
.progress-bar-sm .progress.Red { background-color: var(--color-red); }

.progress-bar-lg {
    background-color: var(--bg-input);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-lg .progress {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.progress-bar-lg .progress.Green { background-color: var(--color-green); }
.progress-bar-lg .progress.Amber { background-color: var(--color-amber); }
.progress-bar-lg .progress.Red { background-color: var(--color-red); }

/* Row Layout panels */
.content-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.col-8 { flex: 0 0 calc(66.66% - 10px); }
.col-7 { flex: 0 0 calc(58.33% - 10px); }
.col-6 { flex: 0 0 calc(50% - 10px); }
.col-5 { flex: 0 0 calc(41.66% - 10px); }
.col-4 { flex: 0 0 calc(33.33% - 10px); }

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--color-primary);
}

.badge {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
}

.badge.Green, .badge.Mitigated { background-color: var(--color-green-bg); color: var(--color-green); }
.badge.Amber { background-color: var(--color-amber-bg); color: var(--color-amber); }
.badge.Red, .badge.Open { background-color: var(--color-red-bg); color: var(--color-red); }
.badge.Closed { background-color: rgba(255,255,255,0.05); color: var(--text-muted); }
.badge.started { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge.in-progress { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge.awaiting-approval { background-color: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.badge.approved { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge.complete { background-color: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.badge-danger {
    background-color: var(--color-red-bg);
    color: var(--color-red);
}

/* Strategic Goal Item */
.goal-progress-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.goal-progress-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.goal-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 16px;
}

.goal-details {
    flex-grow: 1;
}

.goal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-title {
    font-size: 14px;
    font-weight: 600;
}

.goal-percentage {
    font-weight: 700;
}

.goal-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Lists styling */
.stats-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

.stats-list li:last-child {
    border-bottom: none;
}

.stats-list .label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-list .value {
    font-weight: 600;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-card);
}

.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.dashboard-table th, .dashboard-table td {
    padding: 10px 12px;
    font-size: 13px;
    vertical-align: middle;
}

.dashboard-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-table.text-left td, .dashboard-table.text-left th {
    text-align: left;
}

.dashboard-table th.text-right, .dashboard-table td.text-right {
    text-align: right !important;
}

.dashboard-table th.text-center, .dashboard-table td.text-center {
    text-align: center !important;
}

.table-progress {
    display: flex;
    flex-direction: column;
    width: 100px;
}

.progress-txt {
    font-size: 11px;
    font-weight: 600;
}

.category-tag {
    background: rgba(0, 0, 0, 0.04);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Inline forms */
.add-risk-box {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.add-risk-box h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.inline-form .form-row {
    display: flex;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group.flex-2 { flex: 2; }
.form-group.flex-1 { flex: 1; }

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

/* Form Inputs with Icons */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon input, .input-icon select {
    padding-left: 40px;
    width: 100%;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--text-muted);
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.text-right { text-align: right; }

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
}

/* Gantt Chart Viewport Styles */
.gantt-page-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gantt-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px 25px;
    border-radius: var(--radius-md);
}

.gantt-legend {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.legend-dot.Green { background-color: var(--color-green); }
.legend-dot.Amber { background-color: var(--color-amber); }
.legend-dot.Red { background-color: var(--color-red); }

.gantt-info-text {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.gantt-wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Left panel: Task Names list */
.gantt-tasks-panel {
    width: 280px;
    flex-shrink: 0;
    border-right: 1.5px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.gantt-panel-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1.5px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.gantt-tasks-list {
    display: flex;
    flex-direction: column;
}

.gantt-goal-row {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    background-color: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.gantt-task-row {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: var(--transition-fast);
}

.gantt-task-row.clickable {
    cursor: pointer;
}

.gantt-task-row.clickable:hover {
    background-color: rgba(16, 185, 129, 0.06);
}

.task-name {
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding-right: 10px;
}

.task-owner {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* Right panel: Timeline Scrolling Panel */
.gantt-timeline-panel {
    flex-grow: 1;
    overflow-x: auto;
    position: relative;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--bg-input);
}

.gantt-timeline-panel::-webkit-scrollbar,
.gantt-wrapper::-webkit-scrollbar {
    height: 12px;
}

.gantt-timeline-panel::-webkit-scrollbar-track,
.gantt-wrapper::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 6px;
}

.gantt-timeline-panel::-webkit-scrollbar-thumb,
.gantt-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 6px;
    border: 2px solid var(--bg-card);
}

.gantt-timeline-panel::-webkit-scrollbar-thumb:hover,
.gantt-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-hover);
}

.gantt-timeline-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1.5px solid var(--border-color);
    min-width: 1320px; /* 22 weeks * 60px */
}

.months-header-row {
    height: 40px;
    display: flex;
    background-color: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--border-color);
}

.month-col {
    flex: 0 0 264px; /* 4.4 weeks on avg */
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-col:last-child {
    border-right: none;
    flex-grow: 1;
}

.weeks-header-row {
    height: 40px;
    display: flex;
}

.week-col {
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-gantt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
}

.week-col:last-child {
    border-right: none;
}

.gantt-timeline-grid {
    position: relative;
    min-width: 1320px;
    display: flex;
    flex-direction: column;
}

.gantt-timeline-row {
    height: 48px;
    display: flex;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.gantt-timeline-row.goal-spacer {
    background-color: rgba(16, 185, 129, 0.03);
}

.grid-cell {
    width: 60px;
    height: 100%;
    flex-shrink: 0;
    border-right: 1px solid var(--border-gantt);
}

.grid-cell:last-child {
    border-right: none;
}

/* Timeline Task Bars */
.gantt-bar-container {
    position: absolute;
    top: 10px;
    height: 28px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gantt-task-bar {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition-fast);
}

.gantt-task-bar:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transform: scaleY(1.05);
}

.gantt-bar-fill {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: width 0.3s ease-in-out;
}

.gantt-task-bar.Green .gantt-bar-fill { background: linear-gradient(90deg, #059669, var(--color-green)); }
.gantt-task-bar.Amber .gantt-bar-fill { background: linear-gradient(90deg, #d97706, var(--color-amber)); }
.gantt-task-bar.Red .gantt-bar-fill { background: linear-gradient(90deg, #dc2626, var(--color-red)); }

.bar-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Bar Tooltips */
.gantt-bar-tooltip {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.gantt-bar-container:hover .gantt-bar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* KPI Scorecard registry styles */
.kpi-page-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-card {
    padding: 20px;
}

.filter-form .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    align-items: flex-end;
    gap: 15px;
}

.filter-actions-row {
    margin-bottom: 15px;
}

.goal-number-badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    white-space: nowrap;
}

.code-target {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    font-family: monospace;
}

.assignee-cell {
    display: flex;
    flex-direction: column;
}

.assignee-role {
    font-weight: 500;
}

.assignee-name {
    font-size: 11px;
    color: var(--text-muted);
}

/* Premium Modals Framework */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.info-block {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
}

.range-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

.range-slider-container input[type="range"] {
    flex-grow: 1;
    cursor: pointer;
}

.range-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    min-width: 42px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Floating Toast Notification Box */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    min-width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--color-green);
    color: #e6fcf5;
}

.toast.error {
    border-left: 4px solid var(--color-red);
    color: #fff0f0;
}

.toast i {
    font-size: 16px;
}

.toast.success i { color: var(--color-green); }
.toast.error i { color: var(--color-red); }

/* Animation Timings */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Phase Tiles Interactive Hover */
.phase-tile:hover {
    border-color: var(--color-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
