@font-face { font-family: Montserrat; src: url("fonts/montserrat-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/montserrat-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --brand-primary: #021d42;
  --brand-secondary: #43bb6e;
  --brand-tertiary: #279de2;
  --ink: var(--brand-primary);
  --ink-soft: #526078;
  --navy: var(--brand-primary);
  --navy-2: var(--brand-primary);
  --mint: var(--brand-secondary);
  --mint-dark: #238a49;
  --sky: var(--brand-tertiary);
  --paper: #f5f7fa;
  --white: #fff;
  --line: #dfe6eb;
  --danger: #d85b62;
  --warning: #d89532;
  --shadow: 0 12px 40px rgba(17, 30, 52, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
.shell { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }

.hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  color: white;
  background: var(--brand-primary);
}
.hero::after {
  content: "";
  position: absolute;
  width: 360px; height: 360px; right: -170px; bottom: -210px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018);
}
.nav { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand img { width: 190px; max-width: 42vw; max-height: 48px; object-fit: contain; display: block; }
.live-pill { display: inline-flex; align-items: center; gap: 9px; color: #dce6ef; font-size: .82rem; font-weight: 650; letter-spacing: .03em; }
.live-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(87,221,178,.12); }
.hero-content { min-height: 270px; padding: 48px 0 74px; display: flex; align-items: center; justify-content: space-between; gap: 48px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: var(--mint); font-size: .72rem; font-weight: 800; letter-spacing: .17em; }
.eyebrow.dark { color: var(--mint-dark); }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.45rem, 5.7vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
h1 em { color: var(--brand-secondary); font-family: Montserrat, sans-serif; font-style: normal; font-weight: 700; }
.intro { max-width: 650px; margin: 22px 0 0; color: #bcc9d9; font-size: 1.02rem; line-height: 1.6; }
.refresh-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 11px; padding: 15px 19px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; color: var(--navy); background: var(--mint); font-weight: 750; cursor: pointer; box-shadow: 0 12px 30px rgba(0,0,0,.16); transition: transform .2s, background .2s; }
.refresh-button:hover { transform: translateY(-2px); background: var(--brand-tertiary); }
.refresh-button:disabled { cursor: wait; opacity: .65; transform: none; }
.refresh-button svg, .toolbar svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.refresh-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main { position: relative; margin-top: -36px; z-index: 2; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { min-height: 105px; display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid rgba(17,30,52,.06); border-radius: 15px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.stat-primary { background: var(--mint); border-color: transparent; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--mint-dark); background: #e1faf2; font-weight: 850; }
.stat-primary .stat-icon { color: white; background: rgba(9,21,44,.16); }
.stat-card div { display: grid; }
.stat-card strong { font-size: 1.7rem; line-height: 1; letter-spacing: -.04em; }
.stat-card div span { margin-top: 8px; color: var(--ink-soft); font-size: .77rem; font-weight: 650; }
.stat-primary div span { color: #214d43; }

.workspace { padding: 62px 0 46px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.045em; }
h2 span { color: #8490a2; font-size: .9rem; letter-spacing: 0; font-weight: 650; }
.updated-at { color: #79869a; font-size: .78rem; }
.toolbar { display: grid; grid-template-columns: minmax(300px, 1fr) repeat(3, minmax(190px, 230px)); gap: 12px; margin: 26px 0; }
.search-box, .filter-box { min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.search-box { color: #758196; }
.search-box:focus-within, .filter-box:focus-within { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(18,135,104,.09); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.filter-box { justify-content: space-between; }
.filter-box span { flex: 0 0 auto; color: #8490a2; font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.filter-box select { width: 100%; min-width: 0; max-width: 135px; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 650; text-overflow: ellipsis; }
.visibility-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -10px 0 26px; padding: 0; border: 0; }
.visibility-filters legend { width: 100%; margin-bottom: 1px; color: #7b8798; font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.check-filter { position: relative; display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: #4f5d72; background: rgba(255,255,255,.82); font-size: .76rem; font-weight: 700; cursor: pointer; user-select: none; }
.check-filter:hover { border-color: #bfd1d8; background: white; }
.check-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checkmark { width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 auto; border: 1.5px solid #a8b5c2; border-radius: 5px; background: white; }
.check-filter input:checked + .checkmark { border-color: var(--mint-dark); background: var(--mint-dark); }
.check-filter input:checked + .checkmark::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg); }
.check-filter input:focus-visible + .checkmark { outline: 3px solid rgba(18,135,104,.18); outline-offset: 2px; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-grid.is-grouped { display: block; }
.group-section + .group-section { margin-top: 42px; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 15px; padding-bottom: 12px; border-bottom: 1px solid #d7e1e6; }
.group-heading h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.group-count { color: #79869a; font-size: .75rem; font-weight: 700; }
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; min-height: 282px; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: white; transition: transform .2s, box-shadow .2s, border-color .2s; }
.project-card:hover { transform: translateY(-3px); border-color: #c5d4dc; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage, .status { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border-radius: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.stage { color: #25526a; background: #e8f4f8; text-transform: uppercase; }
.status { color: #38725f; background: #e4f8f1; }
.status.at_risk, .status.off_track { color: #9b4a38; background: #ffebe6; }
.status.on_hold { color: #865d1a; background: #fff1d8; }
.project-card h3 { margin: 19px 0 7px; font-size: 1.18rem; line-height: 1.28; letter-spacing: -.025em; overflow-wrap: anywhere; }
.customer { margin: 0; min-height: 40px; color: var(--ink-soft); font-size: .83rem; line-height: 1.45; overflow-wrap: anywhere; }
.project-meta { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 22px; }
.manager { display: flex; align-items: center; gap: 9px; min-width: 0; color: #4f5b70; font-size: .78rem; font-weight: 650; }
.manager span:last-child { min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--navy); background: #dfe9ed; font-size: .67rem; font-weight: 850; }
.task-count { color: #69768a; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.progress-row { margin-top: 21px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: #6b788c; font-size: .71rem; font-weight: 750; }
.progress-label strong { color: var(--ink); }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e9eef1; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--brand-secondary); }
.card-link { margin-top: auto; padding-top: 20px; color: var(--mint-dark); font-size: .78rem; font-weight: 800; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.message { display: none; padding: 34px; border: 1px dashed #cbd6dc; border-radius: 14px; color: #687589; background: rgba(255,255,255,.6); text-align: center; }
.message.visible { display: block; }

.skeleton { pointer-events: none; }
.skeleton-line { height: 12px; margin: 12px 0; border-radius: 99px; background: #e7edf2; opacity: .72; animation: shimmer 1.3s infinite alternate; }
.skeleton-line.big { height: 22px; width: 75%; margin-top: 30px; }
@keyframes shimmer { to { opacity: .35; } }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 38px; border-top: 1px solid var(--line); color: #7e899a; font-size: .72rem; }

@media (max-width: 1120px) {
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { grid-column: 1 / -1; }
}
@media (max-width: 940px) {
  .hero-content { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 1240px); }
  .nav { height: 76px; }
  .brand img { width: 166px; }
  .hero-content { padding: 42px 0 72px; gap: 30px; }
  .refresh-button { width: 100%; justify-content: center; }
  .stats, .project-grid, .group-grid, .toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .stat-card { min-height: 88px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .workspace { padding-top: 48px; }
  .footer { flex-direction: column; }
  .visibility-filters { align-items: stretch; flex-direction: column; }
  .check-filter { width: 100%; }
}
@media (max-width: 480px) {
  .project-card { min-width: 0; padding: 20px; }
  .card-top { align-items: flex-start; flex-wrap: wrap; }
  .project-meta { grid-template-columns: 1fr; gap: 10px; }
  .task-count { padding-left: 38px; white-space: normal; }
  .filter-box select { max-width: min(58%, 190px); }
}
