@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap');

:root {
  --navy-950: #0a1730;
  --navy-900: #0f1f3d;
  --navy-800: #16294f;
  --navy-700: #1f3766;
  --teal-500: #0f9d8c;
  --teal-600: #0c8578;
  --teal-50: #e6f7f5;
  --gold-500: #c9974a;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e6e9f0;
  --text-900: #101828;
  --text-600: #475467;
  --text-400: #98a2b3;
  --danger: #d92d20;
  --warning: #b54708;
  --success: #067647;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.06);
  --shadow-md: 0 4px 16px rgba(16,24,40,0.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Manrope', 'Inter', sans-serif; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; text-decoration: none; }

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

/* Sidebar */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-500), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #052824;
  flex-shrink: 0;
}

.brand-text { line-height: 1.2; }
.brand-text .t1 { font-weight: 800; font-size: 14.5px; color: #fff; }
.brand-text .t2 { font-size: 11px; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; text-transform: uppercase; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 14px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: rgba(15,157,140,0.18); color: #fff; box-shadow: inset 3px 0 0 var(--teal-500); }
.nav-link .ic { font-size: 16px; width: 20px; text-align: center; }

.nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35); margin: 18px 12px 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: rgba(255,255,255,0.5);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal-500); color: #05261f; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.role-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 100px; text-transform: uppercase;
}
.role-badge.admin { background: rgba(201,151,74,0.22); color: #f0c98a; }
.role-badge.viewer { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }

/* Main content */
.main { flex: 1; min-width: 0; padding: 32px 40px 60px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--navy-900); }
.page-header .sub { color: var(--text-600); font-size: 14px; margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }

.stat-card {
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--accent-grad, linear-gradient(90deg, var(--teal-500), var(--teal-600)));
}
.stat-card::after {
  content: ""; position: absolute; top: -30px; right: -30px; width: 120px; height: 120px;
  border-radius: 50%; background: var(--accent-glow, radial-gradient(circle, rgba(15,157,140,0.14), transparent 70%));
  pointer-events: none;
}
.stat-card.card-teal { --accent-grad: linear-gradient(90deg, #0f9d8c, #17c4ae); --accent-glow: radial-gradient(circle, rgba(15,157,140,0.16), transparent 70%); }
.stat-card.card-indigo { --accent-grad: linear-gradient(90deg, #4338ca, #6366f1); --accent-glow: radial-gradient(circle, rgba(99,102,241,0.16), transparent 70%); }
.stat-card.card-gold { --accent-grad: linear-gradient(90deg, #b45309, #eab308); --accent-glow: radial-gradient(circle, rgba(234,179,8,0.18), transparent 70%); }
.stat-card.card-coral { --accent-grad: linear-gradient(90deg, #dc2626, #f97316); --accent-glow: radial-gradient(circle, rgba(220,38,38,0.16), transparent 70%); }
.stat-card .label { font-size: 12.5px; color: var(--text-600); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; position: relative; z-index: 1; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--navy-900); font-family: 'Manrope', sans-serif; position: relative; z-index: 1; }
.stat-card .delta { font-size: 12.5px; color: var(--text-400); position: relative; z-index: 1; }
.stat-card .icon-badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 8px; position: relative; z-index: 1;
  box-shadow: 0 4px 10px rgba(16,24,40,0.10);
}
.bg-teal { background: linear-gradient(135deg, #0f9d8c, #17c4ae); color: #fff; }
.bg-navy { background: linear-gradient(135deg, #4338ca, #6366f1); color: #fff; }
.bg-gold { background: linear-gradient(135deg, #b45309, #eab308); color: #fff; }
.bg-danger { background: linear-gradient(135deg, #dc2626, #f97316); color: #fff; }

.section-title { font-size: 15px; font-weight: 700; color: var(--navy-900); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* Progress ring / bar */
.progress-track { width: 100%; height: 8px; border-radius: 100px; background: #eef0f5; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--teal-500), #17c4ae); transition: width 0.4s ease; }
.progress-fill.low { background: linear-gradient(90deg, #d92d20, #f04438); }
.progress-fill.mid { background: linear-gradient(90deg, #b54708, #f79009); }

/* Pillar bar rows */
.pillar-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pillar-row:last-child { border-bottom: none; }
.pillar-row .name { flex: 0 0 260px; font-size: 13.5px; font-weight: 700; color: var(--navy-900); display:flex; align-items:center; gap:8px; }
.pillar-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pillar-row .bar { flex: 1; }
.pillar-row .pct { flex: 0 0 48px; text-align: right; font-weight: 800; font-size: 13.5px; }
.pillar-row.p1 .dot { background: linear-gradient(135deg, #0f9d8c, #17c4ae); }
.pillar-row.p1 .pct { color: #0c8578; }
.pillar-row.p1 .progress-fill { background: linear-gradient(90deg, #0f9d8c, #17c4ae) !important; }
.pillar-row.p2 .dot { background: linear-gradient(135deg, #4338ca, #6366f1); }
.pillar-row.p2 .pct { color: #4338ca; }
.pillar-row.p2 .progress-fill { background: linear-gradient(90deg, #4338ca, #6366f1) !important; }
.pillar-row.p3 .dot { background: linear-gradient(135deg, #b45309, #eab308); }
.pillar-row.p3 .pct { color: #b45309; }
.pillar-row.p3 .progress-fill { background: linear-gradient(90deg, #b45309, #eab308) !important; }

/* Tables */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-400); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
}
table.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fafbfd; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 100px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.not-started { background: #f2f4f7; color: var(--text-600); }
.badge.not-started .badge-dot { background: var(--text-400); }
.badge.in-progress, .badge.on-track { background: #eff8ff; color: #175cd3; }
.badge.in-progress .badge-dot, .badge.on-track .badge-dot { background: #2e90fa; }
.badge.delayed { background: #fef3f2; color: var(--danger); }
.badge.delayed .badge-dot { background: var(--danger); }
.badge.completed { background: #ecfdf3; color: var(--success); }
.badge.completed .badge-dot { background: #12b76a; }

.pillar-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #eef1f8; color: var(--navy-700); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s ease;
}
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }
.btn-teal { background: var(--teal-500); color: #fff; }
.btn-teal:hover { background: var(--teal-600); }
.btn-ghost { background: transparent; color: var(--navy-900); border-color: var(--border); }
.btn-ghost:hover { background: #f5f7fb; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #fecdca; }

input.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 10px 13px; border-radius: 9px; border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px; color: var(--text-900); background: #fff;
  transition: border-color 0.15s ease;
}
input.form-control:focus, select.form-control:focus, textarea.form-control:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(15,157,140,0.12); }
label.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-600); margin-bottom: 6px; display: block; }
.form-row { margin-bottom: 16px; }

.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-row { margin-bottom: 0; min-width: 170px; }

/* Login page */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #16305c 0%, var(--navy-950) 55%, #060d1c 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-mark { width: 52px; height: 52px; margin: 0 auto 14px; font-size: 20px; }
.login-brand h1 { font-size: 19px; color: var(--navy-900); }
.login-brand p { font-size: 12.5px; color: var(--text-600); margin-top: 6px; }
.error-msg { background: #fef3f2; color: var(--danger); font-size: 13px; padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; }

/* Phase timeline (action detail) */
.phase-list { display: flex; flex-direction: column; gap: 0; position: relative; }
.phase-item { display: flex; gap: 16px; padding-bottom: 26px; position: relative; }
.phase-item:last-child { padding-bottom: 0; }
.phase-marker { width: 30px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.phase-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-900); color: #fff; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; z-index: 1; }
.phase-line { width: 2px; flex: 1; background: var(--border); margin-top: 2px; }
.phase-body { flex: 1; padding-bottom: 4px; }
.phase-body .ph-title { font-weight: 700; font-size: 14.5px; color: var(--navy-900); }
.phase-body .ph-date { font-size: 12px; color: var(--teal-600); font-weight: 600; margin-top: 2px; }
.phase-body ul { margin: 10px 0 0; padding-left: 18px; }
.phase-body li { font-size: 13px; color: var(--text-600); margin-bottom: 5px; line-height: 1.5; }

.criteria-box { background: var(--teal-50); border: 1px solid #c7ebe6; border-radius: 12px; padding: 16px 18px; font-size: 13.5px; color: #0b5a51; line-height: 1.6; }
.overview-box { font-size: 13.5px; color: var(--text-600); line-height: 1.7; white-space: pre-line; }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0 24px; }
.info-cell { }
.info-cell .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-400); font-weight: 700; margin-bottom: 4px; }
.info-cell .v { font-size: 14px; font-weight: 700; color: var(--navy-900); }

/* Timeline gantt page */
.timeline-scroll { overflow-x: auto; }
table.gantt { border-collapse: collapse; font-size: 12.5px; min-width: 1400px; }
table.gantt th { position: sticky; top: 0; background: #fff; z-index: 2; }
table.gantt th, table.gantt td { border: 1px solid var(--border); padding: 8px 10px; text-align: center; }
table.gantt .action-col { text-align: left; min-width: 260px; max-width: 260px; position: sticky; left: 0; background: #fff; z-index: 1; }
table.gantt th.action-col { z-index: 3; }
.gantt-cell-active { background: var(--teal-50); color: var(--teal-600); font-weight: 700; }
.gantt-cell-ongoing { background: #fbf1e2; color: #a9781e; font-weight: 700; }
.gantt-cell-inactive { color: var(--text-400); }

.toast-banner { background: var(--teal-50); border: 1px solid #c7ebe6; color: #0b5a51; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 20px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chart-wrap { position: relative; height: 260px; }
.page-header.hero {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-800) 60%, #12406b);
  border-radius: 18px; padding: 26px 32px; color: #fff; margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.page-header.hero h1 { color: #fff; }
.page-header.hero .sub { color: rgba(255,255,255,0.65); }
.page-header.hero .btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }
.page-header.hero .btn-ghost:hover { background: rgba(255,255,255,0.18); }
