/* Soar Beyond brand: navy text, main green accents, Aptos type */
:root {
  --navy: #052d46;
  --green: #198a96;
  --green-mid: #116975;
  --green-dark: #0c474e;
  --bg: #f6f9fa;
  --card: #ffffff;
  --line: #dbe5e9;
  --amber: #b97a1b;
  --red: #a63b3b;
  --grey: #6b7c86;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Aptos', 'Segoe UI', Arial, sans-serif;
  font-weight: 300;
  color: var(--navy);
  background:
    linear-gradient(rgba(246, 249, 250, .55), rgba(246, 249, 250, .55)),
    url("background.jpg") center / cover no-repeat fixed,
    var(--bg);
}

h1, h2, h3 { font-weight: 700; color: var(--navy); margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
.subtitle { font-weight: 600; color: var(--green-mid); }

a { color: var(--green-mid); }

/* Header / nav */
header.topbar {
  background: var(--navy);
  color: #fff;
  padding: .4rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
header.topbar .brand { font-weight: 700; font-size: .98rem; color: #fff; }
header.topbar .brand span { color: #9fdae1; font-weight: 300; }
nav.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
nav.tabs a {
  color: #fff; text-decoration: none; padding: .3rem .75rem;
  border-radius: 6px; font-weight: 600; font-size: .88rem;
}
nav.tabs a:hover { background: rgba(255,255,255,.12); }
nav.tabs a.active { background: var(--green); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar select {
  padding: .3rem .5rem; border-radius: 6px; border: none;
  font-family: inherit; color: var(--navy);
}
.topbar button {
  background: #5daebe; border: none; color: #fff;
  font-weight: 700; font-size: .92rem;
  padding: .45rem 1.2rem; border-radius: 999px;
  cursor: pointer; font-family: inherit;
}
.topbar button:hover { background: #4a97a7; }

main { max-width: 980px; margin: 1.5rem auto; padding: 0 1.2rem; }

/* Key message callout: navy box, white text */
.callout {
  background: var(--navy); color: #fff;
  padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.2rem;
}
.callout strong { color: #fff; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.card .meta { color: var(--grey); font-size: .85rem; margin: .3rem 0 .6rem; }
.card-title { font-weight: 700; font-size: 1.02rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.area-card {
  display: block; text-decoration: none; color: var(--navy);
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 10px; padding: 1rem 1.2rem;
}
.area-card:hover { border-color: var(--green); }
.area-card .count { font-size: 1.8rem; font-weight: 700; color: var(--green-mid); }

/* Status pills */
.pill {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: #fff;
}
.pill.not_started { background: var(--grey); }
.pill.on_track { background: var(--green); }
.pill.at_risk { background: var(--amber); }
.pill.off_track { background: var(--red); }
.pill.done { background: var(--green-dark); }

.rating-badge {
  display: inline-block; min-width: 1.6rem; text-align: center;
  background: var(--navy); color: #fff; border-radius: 6px;
  padding: .15rem .4rem; font-weight: 700; font-size: .85rem;
}

/* Segmented status bar */
.status-bar {
  display: flex; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.status-bar .seg {
  flex: 1; padding: .5rem .3rem; font-family: inherit; font-size: .78rem;
  font-weight: 600; color: var(--grey); background: #fff; border: none;
  cursor: pointer; white-space: nowrap;
}
.status-bar .seg + .seg { border-left: 1px solid var(--line); }
.status-bar .seg:hover { background: #eef4f6; }
.status-bar .seg.active { color: #fff; }
.status-bar .seg.active.not_started { background: var(--grey); }
.status-bar .seg.active.on_track { background: var(--green); }
.status-bar .seg.active.at_risk { background: var(--amber); }
.status-bar .seg.active.off_track { background: var(--red); }
.status-bar .seg.active.done { background: var(--green-dark); }

.rating-bar .seg.active.r4 { background: var(--green-dark); }
.rating-bar .seg.active.r3 { background: var(--green); }
.rating-bar .seg.active.r2 { background: var(--amber); }
.rating-bar .seg.active.r1 { background: var(--red); }

textarea:disabled { background: #f0f4f6; color: var(--grey); }

/* Overview dashboard */
.progress { height: 10px; background: #e3ecef; border-radius: 999px; overflow: hidden; margin: .5rem 0 .3rem; }
.progress .fill { height: 100%; background: var(--green); border-radius: 999px; }
.stat { font-size: 1.7rem; font-weight: 700; color: var(--green-mid); line-height: 1.1; }
.stat small { font-size: .85rem; font-weight: 300; color: var(--grey); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.mini-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .92rem;
}
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row .sub { color: var(--grey); font-size: .8rem; }
.chart-row { display: flex; align-items: center; gap: .6rem; font-size: .85rem; margin: .35rem 0; }
.chart-row .lbl { width: 10.5rem; flex-shrink: 0; }
.chart-row .track { flex: 1; background: #e3ecef; border-radius: 4px; }
.chart-row .bar { height: 14px; border-radius: 4px; min-width: 2px; }
.chart-row .n { width: 1.5rem; text-align: right; font-weight: 600; }
.attn { border-left: 5px solid var(--amber); }
.attn.bad { border-left-color: var(--red); }

/* Home landing */
.hero {
  display: flex; align-items: center; gap: 2rem;
  background:
    linear-gradient(90deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.55) 55%, rgba(255,255,255,.2) 100%),
    url("hero.jpg") center / cover no-repeat,
    #eef4f6;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 3rem 2.5rem; margin-bottom: 1.6rem;
  position: relative; overflow: hidden;
  min-height: 300px;
}
.hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-bar { width: 64px; height: 12px; background: var(--green); margin-bottom: 1rem; }
.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.02;
  letter-spacing: -.02em; margin: 0 0 1rem;
}
.hero-title span { color: var(--green); }
.hero-sub { max-width: 34rem; font-size: 1.02rem; margin: 0 0 1.4rem; }
.hero-cta {
  display: inline-block; background: var(--navy); color: #fff; text-decoration: none;
  font-weight: 700; letter-spacing: .08em; font-size: .85rem; text-transform: uppercase;
  padding: .9rem 1.6rem; border-radius: 6px;
}
.hero-cta:hover { background: var(--green-dark); }
@media (max-width: 820px) { .hero { padding: 2.2rem 1.5rem; } }

.logo-watermark {
  position: fixed; right: 2.2rem; bottom: 2rem; width: 192px;
  opacity: .75; pointer-events: none; z-index: 0;
}
@media (max-width: 900px) { .logo-watermark { display: none; } }

.return-fab {
  position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 50;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(5, 45, 70, .35);
}
.return-fab:hover { background: var(--green-dark); }

.back-link {
  color: var(--navy) !important; font-weight: 700; text-decoration: none;
  padding: .3rem .8rem .3rem 0; margin-right: .6rem; border-right: 1px solid var(--line);
  border-radius: 0;
}
.back-link:hover { color: var(--green-mid) !important; background: none !important; }

.module-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 820px) { .module-tiles { grid-template-columns: 1fr; } }
.tile {
  display: block; text-decoration: none; color: var(--navy);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.6rem 1.5rem; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tile:hover {
  transform: translateY(-4px); border-color: var(--green);
  box-shadow: 0 10px 24px rgba(12, 71, 78, .12);
}
.tile-num { font-size: 2.6rem; font-weight: 700; color: var(--green); line-height: 1; margin-bottom: .5rem; }
.tile h2 { margin: 0 0 .5rem; }
.tile p { margin: 0 0 1rem; font-size: .93rem; }
.tile-go { font-weight: 700; color: var(--green-mid); font-size: .9rem; }

/* SPA shell */
.subtabs {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: .45rem 1.2rem; display: flex; gap: .3rem; flex-wrap: wrap;
}
.subtabs a {
  color: var(--green-mid); text-decoration: none; font-weight: 600; font-size: .88rem;
  padding: .3rem .8rem; border-radius: 999px;
}
.subtabs a:hover { background: #eef4f6; }
.subtabs a.active { background: var(--green); color: #fff; }
.view { transition: opacity .18s ease, transform .18s ease; }
.view.fade { opacity: 0; transform: translateY(8px); }

/* Collapsible item cards */
.item-card { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; gap: .8rem; cursor: pointer;
  padding: .85rem 1.2rem; user-select: none;
}
.card-head:hover { background: #f2f7f8; }
.card-head .head-content { flex: 1; min-width: 0; }
.card-head .chev { color: var(--green-mid); font-size: 1rem; flex-shrink: 0; }
.item-card .card-body { padding: 0 1.2rem 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.item-card.collapsed .card-body { display: none; }

/* SMART breakdown boxes */
.smart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 700px) { .smart-grid { grid-template-columns: 1fr; } }
.smart-grid .hint, .field-hint { font-weight: 300; color: var(--grey); font-size: .78rem; }

/* Evidence attachments */
.attachments { margin-top: .4rem; }
.att-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem 0; border-top: 1px solid var(--line); font-size: .9rem;
}
.att-row a { font-weight: 600; overflow-wrap: anywhere; }
.att-row .sub { color: var(--grey); font-size: .8rem; white-space: nowrap; }
.att-del {
  margin-left: auto; background: transparent; border: none; color: var(--red);
  cursor: pointer; font-size: .9rem; padding: .1rem .4rem;
}
.att-upload { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; }
.att-upload input[type="file"] { flex: 1; border: none; padding: 0; background: transparent; }
.att-upload button { margin-top: 0; padding: .4rem .9rem; font-size: .85rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .85rem; margin: .6rem 0 .2rem; }
input, select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; font-family: inherit; font-size: .95rem; color: var(--navy);
  background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }

button.primary {
  background: var(--green); color: #fff; border: none;
  padding: .55rem 1.2rem; border-radius: 6px; font-weight: 600;
  font-family: inherit; font-size: .95rem; cursor: pointer; margin-top: .8rem;
}
button.primary:hover { background: var(--green-mid); }
button.danger {
  background: transparent; color: var(--red); border: 1px solid var(--red);
  padding: .45rem .9rem; border-radius: 6px; font-family: inherit; cursor: pointer; margin-top: .8rem;
}
.saved-flash { color: var(--green-mid); font-weight: 600; font-size: .85rem; margin-left: .8rem; }

/* Login */
.login-wrap { max-width: 400px; margin: 8vh auto; padding: 0 1.2rem; }
.login-logo { text-align: center; margin-bottom: 1.2rem; }
.login-logo .brand-name { font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.login-logo .tagline { color: var(--green); font-weight: 600; letter-spacing: .12em; font-size: .7rem; }

.page-head {
  display: inline-block; background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem 1.1rem; margin-bottom: 1rem;
}
.page-head h1 { margin: 0; }
.page-head .subtitle { margin: .15rem 0 0; }

input[type="checkbox"] { width: auto; accent-color: var(--green); }
.check-row {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .92rem; margin: .8rem 0 .2rem; cursor: pointer;
}

.error { color: var(--red); font-weight: 600; margin-top: .6rem; }
.muted { color: var(--grey); font-size: .85rem; }
.divider { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0; }

table.simple { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table.simple th { text-align: left; background: var(--navy); color: #fff; padding: .5rem .7rem; font-size: .85rem; }
table.simple td { padding: .5rem .7rem; border-top: 1px solid var(--line); font-size: .9rem; }
