:root {
  --navy: #1b3a5c;
  --navy-dark: #12283f;
  --accent: #2f6f4f;
  --border: #d7dde5;
  --bg: #f4f6f8;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #b3261e;
  --danger-bg: #fbeaea;
  --success: #1f6d3d;
  --success-bg: #e9f5ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: #fff;
}

.topbar .brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: #c7d3e0;
}

.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: #dbe6f2; text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #fff; text-decoration: underline; }
.nav-links .user-tag { color: #9fb3c8; font-size: 12px; }

.nav-toggle {
  display: none;
  flex: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.container { max-width: 960px; margin: 0 auto; padding: 24px; }

@media (max-width: 880px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-links form { width: 100%; }
}

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}
.messages li.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.messages li.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }

h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 17px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfc; }

a.button, button, input[type="submit"] {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
a.button:hover, button:hover, input[type="submit"]:hover { background: var(--navy-dark); }
button.secondary, input[type="submit"].secondary { background: var(--accent); }

form p { margin: 10px 0; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.star-options { display: flex; gap: 16px; margin: 10px 0; }
.star-option { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 18px; color: #d4a72c; width: auto; }
.star-option input { width: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge.in_progress { background: #fff7e6; color: #92600a; }
.badge.completed { background: var(--success-bg); color: var(--success); }
.badge.rejected { background: var(--danger-bg); color: var(--danger); }

.feedback-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.feedback-badge.positive { background: var(--success-bg); color: var(--success); }
.feedback-badge.neutral { background: #fff7e6; color: #92600a; }
.feedback-badge.negative { background: var(--danger-bg); color: var(--danger); }

tr.feedback-row.positive td { background: var(--success-bg); }
tr.feedback-row.neutral td { background: #fff7e6; }
tr.feedback-row.negative td { background: var(--danger-bg); }
tr.feedback-row:hover td { filter: brightness(0.97); }

.history-item { border-left: 2px solid var(--border); padding: 6px 0 6px 14px; margin-left: 4px; font-size: 13px; }
.history-item .meta { color: var(--muted); font-size: 12px; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: -6px; margin-bottom: 12px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 700px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr; }
}
.kpi-tile { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.kpi-tile .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kpi-tile .value { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--navy); }
.kpi-tile .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.filter-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filter-row .field { display: flex; flex-direction: column; min-width: 160px; }
.filter-row .field label { margin-bottom: 4px; }

.chart-canvas-wrap { position: relative; margin-bottom: 16px; }

details.data-table summary { cursor: pointer; color: var(--navy); font-size: 13px; font-weight: 600; margin-top: 8px; }
details.data-table table { margin-top: 10px; }

td.num, th.num { text-align: right; }

/* Home page */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 44px 48px;
  margin-bottom: 28px;
}
.hero-photo {
  flex: none;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 56px;
}
.hero-body { flex: 1; min-width: 0; }
.hero-body h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 14px;
  font-weight: 800;
}
.hero-body p { color: #dbe6f2; font-size: 15px; margin: 0 0 10px; }
.hero-dc-caption {
  margin-top: 16px;
  font-size: 13px;
  color: #b9cbdf;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 12px;
}
.hero-dc-caption .name { color: #fff; font-weight: 700; margin-right: 6px; }

.section-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.feature-card.linked:hover { box-shadow: 0 8px 20px rgba(27, 58, 92, 0.12); transform: translateY(-2px); }
.feature-card .icon { font-size: 26px; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.feature-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.feature-card .feature-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.feature-card .feature-link:hover { text-decoration: underline; }
.feature-card .feature-note {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.commitment-card {
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: 10px;
  padding: 26px 30px;
}
.commitment-card h2 { color: var(--success); margin: 0 0 10px; font-size: 18px; }
.commitment-card p { margin: 0; font-size: 14.5px; color: #244f36; }

@media (max-width: 700px) {
  .hero { flex-direction: column; text-align: center; padding: 32px 24px; }
  .hero-dc-caption { text-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* Projects page */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.project-thumbs { display: flex; }
.project-thumbs img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.project-thumbs a { flex: 1; min-width: 0; line-height: 0; }
.project-body { padding: 16px; }
.project-body .badge { margin-bottom: 8px; }
.project-body h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
.project-body p { margin: 0; font-size: 13.5px; color: var(--muted); }

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* Contact page */
.contact-layout {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}
.contact-layout .card { flex: 1 1 320px; margin-bottom: 0; }
.contact-layout .card p { font-size: 14px; }
.map-frame {
  flex: 1 1 380px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* About page — team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.team-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
}
.team-photo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  border: 2px solid var(--border);
}
.team-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-size: 32px;
  color: var(--muted);
}
.team-name { font-weight: 700; font-size: 14px; color: var(--navy); }
.team-designation { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

@media (max-width: 900px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}
