:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #627085;
  --line: #d9e0ea;
  --navy: #12233f;
  --navy-2: #1a2f52;
  --gold: #c59a3d;
  --cyan: #0e8ba8;
  --green: #16805f;
  --red: #b63c3c;
  --shadow: 0 1px 2px rgba(16, 32, 51, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.portal-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #eef4fb;
  height: 100vh;
  padding: 20px 14px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 58px;
  padding: 4px 8px 24px;
}

.brand-mark {
  background: var(--gold);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  font-weight: 900;
  height: 38px;
  min-width: 38px;
  place-items: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #aebed1;
}

.nav-list {
  display: grid;
  gap: 3px;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #ced9e8;
  min-height: 38px;
  padding: 10px 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.topbar,
.session-actions,
.section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

p,
li,
.record-meta,
.project-card p,
label {
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  background: #fff6df;
  border: 1px solid #e5d197;
  border-radius: 999px;
  color: #876715;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.ghost-button,
.primary-button,
.secondary-button {
  border-radius: 7px;
  min-height: 38px;
  padding: 9px 12px;
  white-space: nowrap;
}

.primary-button {
  background: var(--navy-2);
  border: 1px solid var(--navy-2);
  color: #ffffff;
  font-weight: 800;
}

.secondary-button,
.ghost-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.auth-panel {
  display: grid;
  min-height: 62vh;
  place-items: center;
}

.login-card,
.panel,
.project-card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 14px;
  max-width: 440px;
  padding: 26px;
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stat-grid,
.split-grid,
.work-grid,
.project-grid,
.form-stack {
  display: grid;
  gap: 14px;
}

.stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.split-grid,
.work-grid {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  margin-top: 14px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.panel,
.project-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  min-height: 38px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.compact-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

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

label {
  display: grid;
  font-weight: 800;
  gap: 6px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cfd8e5;
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.form-status {
  margin-bottom: 0;
  min-height: 22px;
}

.form-status.success {
  color: var(--green);
}

.form-status.error {
  color: var(--red);
}

.record-list {
  display: grid;
  gap: 10px;
}

.record,
.project-card,
.comment-thread {
  display: grid;
  gap: 6px;
}

.record {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.record:first-child {
  border-top: 0;
  padding-top: 0;
}

.badge {
  background: #eef6f7;
  border: 1px solid #c8e3e8;
  border-radius: 999px;
  color: var(--cyan);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  width: fit-content;
}

.comment-thread {
  border-left: 3px solid #c8e3e8;
  margin-top: 8px;
  padding-left: 10px;
}

.comment-card {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
}

.comment-card span {
  color: var(--cyan);
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.comment-card p {
  margin-bottom: 0;
}

.meter {
  background: #edf2f7;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

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

@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-panel {
    padding: 18px;
  }

  .topbar,
  .section-head {
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
