:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #64717d;
  --line: #d9e2e9;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --blue: #1d5d82;
  --green: #25724d;
  --amber: #a35f00;
  --red: #b42318;
  --dark: #24313d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(36, 49, 61, 0.92), rgba(29, 93, 130, 0.74)),
    repeating-linear-gradient(90deg, #d9e2e9 0 22px, #edf2f5 22px 44px);
}

.login-panel {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(23, 32, 38, 0.24);
}

.login-panel h1,
.app-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0;
}

.eyebrow,
.subtitle {
  margin: 0;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subtitle,
.muted {
  color: var(--muted);
}

.preview-note {
  margin: 18px 0;
  color: var(--dark);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

button {
  min-height: 40px;
  border: 1px solid var(--dark);
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(16px, 4vw, 44px);
  background: linear-gradient(135deg, #24313d 0%, #1d5d82 100%);
  color: #fff;
}

.app-header .eyebrow,
.app-header .subtitle {
  color: #d7e6ef;
}

.session-panel {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}

.session-panel button {
  background: #fff;
  border-color: #fff;
  color: var(--dark);
}

#projects-button {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.portal-view {
  padding-bottom: 42px;
}

.notice,
.hero-grid,
.tabs,
.view {
  width: min(100% - 28px, 1240px);
  margin-inline: auto;
}

.notice {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f0cf87;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: #fff8e8;
}

.hero-grid,
.finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.panel,
.photo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  min-height: 112px;
  padding: 14px;
  border-left: 5px solid var(--blue);
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.tab {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
}

.tab.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.view {
  min-height: 280px;
}

.split,
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.projects-layout {
  display: grid;
  gap: 14px;
}

.portal-intro {
  border-left: 5px solid var(--blue);
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-card button {
  width: fit-content;
  padding: 8px 14px;
}

.panel {
  padding: 18px;
}

.emphasis {
  border-left: 5px solid var(--amber);
}

h2,
h3,
p {
  margin-top: 0;
}

.fact-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

.fact-list.compact {
  margin-top: 0;
}

.fact-list.compact div {
  grid-template-columns: 120px 1fr;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
}

.clean-list li + li {
  margin-top: 8px;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.bar {
  height: 14px;
  border-radius: 999px;
  background: #e7edf2;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill.neutral {
  background: #edf1f4;
  color: #475560;
}

.pill.watch {
  background: #fff1d3;
  color: #7a4300;
}

.pill.risk {
  background: #ffe3df;
  color: #962016;
}

.pill.good {
  background: #e3f2e8;
  color: #1b623f;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-card {
  overflow: hidden;
}

.photo-card > div:last-child {
  padding: 14px;
}

.photo-visual {
  min-height: 190px;
  background:
    linear-gradient(135deg, rgba(36, 49, 61, 0.72), rgba(29, 93, 130, 0.2)),
    repeating-linear-gradient(90deg, #cfd8df 0 20px, #e8edf1 20px 40px);
}

.visual-2 {
  background:
    linear-gradient(135deg, rgba(37, 114, 77, 0.62), rgba(255, 255, 255, 0.1)),
    repeating-linear-gradient(0deg, #d6dee4 0 18px, #edf2f5 18px 36px);
}

.visual-3 {
  background:
    linear-gradient(135deg, rgba(163, 95, 0, 0.6), rgba(255, 255, 255, 0.1)),
    repeating-linear-gradient(45deg, #d5dde3 0 18px, #eef2f5 18px 36px);
}

@media (max-width: 980px) {
  .hero-grid,
  .finance-grid,
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .weekly-grid,
  .project-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-header {
    display: block;
  }

  .session-panel {
    margin-top: 16px;
  }

  .hero-grid,
  .finance-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .progress-row,
  .fact-list div {
    grid-template-columns: 1fr;
  }
}
