@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f5f4;
  --surface: #ffffff;
  --surface-soft: #efefed;
  --ink: #1c1917;
  --ink-75: rgba(28, 25, 23, 0.75);
  --ink-62: rgba(28, 25, 23, 0.62);
  --ink-45: rgba(28, 25, 23, 0.45);
  --line: rgba(28, 25, 23, 0.13);
  --line-strong: rgba(28, 25, 23, 0.24);
  --accent: #8a6a1e;
  --brand: #c79a34;
  --success: #2f6b4f;
  --success-bg: #e8f0eb;
  --warning: #815d1b;
  --warning-bg: #f4ecda;
  --danger: #9b3631;
  --danger-bg: #f7e7e5;
  --info: #365b78;
  --info-bg: #e7eef3;
  --sidebar-width: 252px;
  --header-height: 72px;
  --shadow: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-menu-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
h4 {
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 750;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  font-weight: 720;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.brand-lockup {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 11px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.brand-lockup img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-name {
  display: grid;
  gap: 1px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.16em;
  line-height: 1.15;
  text-transform: uppercase;
}

.brand-name small {
  color: var(--ink-62);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
}

.sidebar-nav {
  display: grid;
  gap: 2px;
  padding: 24px 14px;
}

.nav-label {
  margin: 0 10px 9px;
  color: var(--ink-45);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  color: var(--ink-75);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
}

.nav-link.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.nav-count {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  font-size: 11px;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.user-summary {
  min-width: 0;
}

.user-summary strong,
.user-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary strong {
  font-size: 13px;
}

.user-summary span {
  color: var(--ink-62);
  font-size: 12px;
}

.logout-form {
  margin: 0;
}

.sidebar-logout {
  width: 100%;
  justify-content: flex-start;
}

.page-wrap {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 244, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-62);
  font-size: 13px;
}

.mobile-menu,
.mobile-brand,
.mobile-overlay {
  display: none;
}

.page-content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px) clamp(20px, 4vw, 52px) 72px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 46px);
}

.page-heading-copy {
  max-width: 780px;
}

.page-heading-copy p {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--ink-62);
  font-size: 16px;
}

.heading-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.button:active {
  transform: translateY(1px);
}

.button.is-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button.is-secondary:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.button.is-quiet {
  min-height: 36px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-75);
}

.button.is-quiet:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.is-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button.is-danger:hover {
  border-color: #7e2925;
  background: #7e2925;
}

.button.is-small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.button[disabled],
.button.is-loading {
  opacity: 0.62;
  cursor: wait;
}

.text-link {
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid rgba(138, 106, 30, 0.34);
  outline-offset: 3px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.flash {
  position: relative;
  padding: 13px 44px 13px 15px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.flash.is-success {
  border-color: rgba(47, 107, 79, 0.4);
  background: var(--success-bg);
  color: #214d39;
}

.flash.is-error {
  border-color: rgba(155, 54, 49, 0.4);
  background: var(--danger-bg);
  color: #742723;
}

.flash.is-warning {
  border-color: rgba(129, 93, 27, 0.42);
  background: var(--warning-bg);
  color: #654714;
}

.flash-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  margin-bottom: clamp(36px, 5vw, 60px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-width: 0;
  padding: clamp(20px, 2.4vw, 30px);
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  margin-bottom: 16px;
  color: var(--ink-62);
  font-size: 13px;
}

.metric-value {
  display: block;
  overflow: hidden;
  font-size: clamp(2rem, 3vw, 3rem);
  font-variant-numeric: tabular-nums;
  font-weight: 730;
  letter-spacing: -0.05em;
  line-height: 1;
  text-overflow: ellipsis;
}

.metric-note {
  display: block;
  margin-top: 10px;
  color: var(--ink-45);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
  gap: clamp(28px, 4vw, 54px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 46px;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ink);
}

.section-heading h2,
.section-heading h3,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.section-heading p {
  color: var(--ink-62);
  font-size: 13px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel + .panel,
.stack > * + * {
  margin-top: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3,
.panel-header p {
  margin: 0;
}

.panel-header p {
  margin-top: 5px;
  color: var(--ink-62);
  font-size: 13px;
}

.panel-body {
  padding: clamp(20px, 3vw, 30px);
}

.panel-body.is-compact {
  padding: 0;
}

.project-list {
  border: 1px solid var(--line);
  background: var(--surface);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(115px, 0.55fr) minmax(150px, 0.9fr) 88px;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row:hover {
  background: var(--surface-soft);
}

.project-main,
.project-next {
  min-width: 0;
}

.project-main strong,
.project-main span,
.project-next strong,
.project-next span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-main strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.project-main span,
.project-next span {
  color: var(--ink-62);
  font-size: 12px;
}

.project-next strong {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 650;
}

.progress-wrap {
  min-width: 0;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-62);
  font-size: 12px;
}

.progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  background: rgba(28, 25, 23, 0.11);
}

.progress-bar {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--accent);
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink-75);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.status.is-success,
.status.is-completed,
.status.is-paid,
.status.is-signed,
.status.is-active {
  border-color: rgba(47, 107, 79, 0.33);
  background: var(--success-bg);
  color: var(--success);
}

.status.is-warning,
.status.is-waiting,
.status.is-open,
.status.is-due {
  border-color: rgba(129, 93, 27, 0.34);
  background: var(--warning-bg);
  color: var(--warning);
}

.status.is-danger,
.status.is-overdue {
  border-color: rgba(155, 54, 49, 0.34);
  background: var(--danger-bg);
  color: var(--danger);
}

.status.is-info,
.status.is-review,
.status.is-in-progress {
  border-color: rgba(54, 91, 120, 0.31);
  background: var(--info-bg);
  color: var(--info);
}

.timeline {
  position: relative;
  display: grid;
}

.timeline::before {
  position: absolute;
  top: 13px;
  bottom: 16px;
  left: 6px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  top: 7px;
  left: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  outline: 1px solid var(--accent);
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 3px;
}

.timeline-meta strong {
  font-size: 13px;
}

.timeline-meta time {
  color: var(--ink-45);
  font-size: 11px;
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--ink-62);
  font-size: 13px;
}

.deadline-list {
  display: grid;
}

.deadline-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.deadline-item:last-child {
  border-bottom: 0;
}

.deadline-date {
  display: grid;
  align-content: center;
  min-height: 54px;
  border: 1px solid var(--line-strong);
  text-align: center;
}

.deadline-date strong,
.deadline-date span {
  display: block;
}

.deadline-date strong {
  font-size: 20px;
  line-height: 1;
}

.deadline-date span {
  margin-top: 4px;
  color: var(--ink-45);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.deadline-copy {
  align-self: center;
  min-width: 0;
}

.deadline-copy strong,
.deadline-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-copy strong {
  font-size: 13px;
}

.deadline-copy span {
  margin-top: 3px;
  color: var(--ink-62);
  font-size: 12px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 190px 190px auto;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.field,
.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field label,
.form-field label,
.field-label {
  color: var(--ink-75);
  font-size: 12px;
  font-weight: 650;
}

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

textarea,
.textarea {
  min-height: 118px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(28, 25, 23, 0.48);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(28, 25, 23, 0.45);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(138, 106, 30, 0.14);
  outline: 0;
}

input[type="range"] {
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.field-hint,
.form-hint {
  margin: 0;
  color: var(--ink-62);
  font-size: 11px;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.form-field.is-wide,
.form-actions,
.form-section {
  grid-column: 1 / -1;
}

.form-section {
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.form-section h2,
.form-section h3 {
  margin-bottom: 5px;
}

.form-section > p {
  margin-bottom: 20px;
  color: var(--ink-62);
  font-size: 13px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--ink-62);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: rgba(245, 245, 244, 0.72);
}

.table-primary {
  display: block;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.table-primary:hover {
  color: var(--accent);
}

.table-secondary {
  display: block;
  margin-top: 2px;
  color: var(--ink-62);
  font-size: 11px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.select-compact {
  width: auto;
  max-width: 128px;
  min-height: 34px;
  padding: 6px 26px 6px 8px;
  font-size: 11px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  color: var(--ink-62);
  font-size: 13px;
}

.pagination-links {
  display: flex;
  gap: 5px;
}

.pagination a,
.pagination span {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  text-decoration: none;
}

.pagination .is-current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  margin-bottom: 24px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-hero h1 {
  margin-bottom: 9px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  color: var(--ink-62);
}

.detail-meta a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.detail-hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-strong);
}

.tab {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 2px solid transparent;
  color: var(--ink-62);
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover,
.tab.is-active {
  color: var(--ink);
}

.tab.is-active {
  border-bottom-color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.75fr);
  gap: clamp(24px, 4vw, 44px);
}

.key-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.key-value {
  min-width: 0;
  padding: 17px 18px;
  background: var(--surface);
}

.key-value span,
.key-value strong,
.key-value a {
  display: block;
  overflow-wrap: anywhere;
}

.key-value span {
  margin-bottom: 5px;
  color: var(--ink-45);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.key-value strong,
.key-value a {
  font-size: 13px;
  font-weight: 630;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 22px;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

.project-card:last-child {
  border-bottom: 0;
}

.project-card h3 a {
  text-decoration: none;
}

.project-card h3 a:hover {
  color: var(--accent);
}

.project-card p {
  margin-bottom: 11px;
  color: var(--ink-62);
  font-size: 13px;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card-side {
  display: grid;
  align-content: center;
}

.milestone-list {
  display: grid;
}

.milestone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.milestone:last-child {
  border-bottom: 0;
}

.milestone input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.milestone-title {
  min-width: 0;
}

.milestone-title strong,
.milestone-title span {
  display: block;
}

.milestone-title strong {
  font-size: 13px;
}

.milestone-title span {
  color: var(--ink-45);
  font-size: 11px;
}

.milestone.is-complete .milestone-title strong {
  color: var(--ink-45);
  text-decoration: line-through;
}

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

.document-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.document-type {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-copy {
  min-width: 0;
}

.document-copy strong,
.document-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-copy strong {
  font-size: 13px;
}

.document-copy span {
  margin-top: 3px;
  color: var(--ink-62);
  font-size: 11px;
}

.upload-zone {
  position: relative;
  display: grid;
  min-height: 132px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  background: var(--paper);
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--accent);
  background: #f2efe7;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone strong {
  margin-bottom: 4px;
}

.upload-zone span {
  color: var(--ink-62);
  font-size: 12px;
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  padding: 36px 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.empty-state.is-compact {
  min-height: 150px;
  border: 0;
}

.empty-state-content {
  max-width: 430px;
}

.empty-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 22px;
  font-weight: 300;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 18px;
  color: var(--ink-62);
}

.note-box {
  padding: 15px 17px;
  border-left: 3px solid var(--accent);
  background: #f2efe7;
  color: var(--ink-75);
  font-size: 13px;
}

.note-box p:last-child {
  margin-bottom: 0;
}

.danger-zone {
  border-color: rgba(155, 54, 49, 0.34);
}

.danger-zone .panel-header {
  border-bottom-color: rgba(155, 54, 49, 0.24);
  background: var(--danger-bg);
}

.auth-page {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(320px, 0.95fr) minmax(480px, 1.35fr);
}

.auth-panel {
  display: grid;
  align-content: center;
  min-height: 100dvh;
  padding: clamp(32px, 7vw, 100px);
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.auth-form-wrap {
  width: min(100%, 440px);
  margin: 0 auto;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(46px, 8vh, 82px);
  text-decoration: none;
}

.auth-brand img {
  width: 44px;
  height: 44px;
}

.auth-title {
  margin-bottom: 10px;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  letter-spacing: -0.055em;
}

.auth-intro {
  max-width: 42ch;
  margin-bottom: 32px;
  color: var(--ink-62);
  font-size: 16px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form .button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.auth-footnote {
  margin: 24px 0 0;
  color: var(--ink-45);
  font-size: 11px;
}

.auth-visual {
  position: relative;
  display: grid;
  min-height: 100dvh;
  align-content: end;
  overflow: hidden;
  padding: clamp(40px, 6vw, 90px);
  background: var(--ink);
  color: var(--paper);
}

.auth-visual::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(199, 154, 52, 0.16) 46% 47%, transparent 47% 100%),
    linear-gradient(35deg, transparent 0 58%, rgba(199, 154, 52, 0.09) 58% 59%, transparent 59% 100%);
  content: "";
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 690px;
}

.auth-visual-mark {
  width: clamp(90px, 13vw, 180px);
  margin-bottom: 42px;
  opacity: 0.94;
}

.auth-visual h2 {
  max-width: 12ch;
  margin-bottom: 20px;
  font-size: clamp(2.8rem, 6vw, 6.2rem);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.auth-visual p {
  max-width: 50ch;
  margin-bottom: 0;
  color: rgba(245, 245, 244, 0.68);
  font-size: 16px;
}

.error-page {
  display: grid;
  min-height: 62vh;
  place-items: center;
  text-align: center;
}

.error-code {
  margin-bottom: 16px;
  color: var(--brand);
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 760;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--ink-62);
}

.small {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: minmax(220px, 1fr) 170px 170px;
  }

  .filter-bar .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(86vw, 310px);
    transform: translateX(-102%);
    box-shadow: 18px 0 50px -30px rgba(28, 25, 23, 0.7);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.is-menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    visibility: hidden;
    border: 0;
    background: rgba(28, 25, 23, 0.46);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.is-menu-open .mobile-overlay {
    visibility: visible;
    opacity: 1;
  }

  .page-wrap {
    margin-left: 0;
  }

  .topbar {
    padding-inline: 18px;
  }

  .mobile-menu {
    display: grid;
    width: 42px;
    height: 42px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line-strong);
    background: transparent;
    cursor: pointer;
  }

  .mobile-menu span {
    display: block;
    width: 18px;
    height: 1px;
    background: var(--ink);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
  }

  .mobile-brand img {
    width: 29px;
    height: 29px;
  }

  .topbar-title {
    display: none;
  }

  .topbar-meta span {
    display: none;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    border-right: 0;
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  .page-content {
    padding: 28px 16px 58px;
  }

  .page-heading,
  .detail-hero {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .heading-actions,
  .detail-hero-actions {
    width: 100%;
  }

  .heading-actions .button,
  .detail-hero-actions .button {
    flex: 1;
  }

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

  .metric,
  .metric:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .project-row .progress-wrap,
  .project-row .project-next {
    grid-column: 1 / -1;
  }

  .filter-bar,
  .form-grid,
  .key-value-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar .button {
    grid-column: auto;
  }

  .form-field.is-wide,
  .form-actions,
  .form-section {
    grid-column: auto;
  }

  .form-actions {
    display: grid;
  }

  .form-actions .button {
    width: 100%;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 28px 18px;
  }

  .auth-brand {
    margin-bottom: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .heading-actions,
  .tabs,
  .button,
  .flash-stack {
    display: none !important;
  }

  .page-wrap {
    margin: 0;
  }

  .page-content {
    width: 100%;
    padding: 0;
  }

  body,
  .panel,
  .detail-hero,
  .data-table-wrap {
    background: #fff;
    box-shadow: none;
  }
}
