:root {
  --ink: #101417;
  --ink-2: #182127;
  --panel-dark: #121a20;
  --panel-darker: #0a1116;
  --paper: #ffffff;
  --paper-soft: #f6f7f7;
  --line: #dce0e2;
  --line-dark: #2b373e;
  --muted: #657078;
  --copper: #b65d2e;
  --copper-strong: #d5753e;
  --copper-soft: #fff0e8;
  --blue: #1f72bd;
  --blue-soft: #eaf3fc;
  --green: #18794e;
  --green-soft: #eaf8f1;
  --amber: #a15c00;
  --amber-soft: #fff4dd;
  --shadow: 0 18px 55px rgba(10, 17, 22, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef1f2;
  font-size: 15px;
  line-height: 1.5;
}

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

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

svg {
  width: 20px;
  height: 20px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(140deg, rgba(182, 93, 46, 0.12), transparent 38%),
    radial-gradient(circle at 80% 10%, rgba(35, 48, 56, 0.18), transparent 30%),
    #0c1318;
}

.auth-shell {
  width: min(1080px, calc(100vw - 32px));
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.auth-panel,
.auth-side {
  padding: clamp(28px, 5vw, 54px);
}

.auth-panel {
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.auth-side {
  color: #f4f7f8;
  background:
    linear-gradient(150deg, rgba(182, 93, 46, 0.34), rgba(16, 20, 23, 0.2)),
    linear-gradient(180deg, #172128, #0a1116);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.brand-lockup,
.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, var(--copper), #8d3f21);
  font-weight: 800;
}

.brand-title,
.portal-brand span {
  margin: 0;
  color: var(--copper-strong);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle,
.portal-brand small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-panel h1,
.auth-side h2 {
  margin: 76px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy,
.auth-side p {
  margin: 0 0 34px;
  color: #5f6b73;
  max-width: 520px;
}

.auth-side p {
  color: #c6cdd1;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: auto;
}

label {
  display: grid;
  gap: 8px;
  color: #20282e;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(182, 93, 46, 0.12);
}

.primary-action,
.ghost-button,
.ghost-link,
.copy-field button,
.owner-status-form button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: linear-gradient(180deg, var(--copper-strong), #a84f25);
  box-shadow: 0 12px 28px rgba(182, 93, 46, 0.24);
  padding: 0 18px;
}

.primary-action.compact {
  min-height: 38px;
}

.primary-action.full {
  width: 100%;
}

.ghost-button,
.ghost-link {
  color: var(--ink-2);
  background: #fff;
  border-color: var(--line);
  padding: 0 14px;
}

.auth-meta {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.signal-line {
  width: 64px;
  height: 3px;
  background: var(--copper-strong);
  border-radius: 999px;
}

.auth-stat {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.auth-stat span,
.auth-stat strong {
  display: block;
}

.auth-stat span {
  color: #c6cdd1;
  font-size: 13px;
}

.auth-stat strong {
  margin-top: 8px;
  color: #ff9a5e;
  font-size: 28px;
}

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

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  padding: 34px 22px;
  color: #e9eef0;
  background: linear-gradient(180deg, #121b22, #081015);
}

.portal-brand {
  display: block;
  margin-bottom: 38px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a,
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: #cbd3d7;
  font-weight: 700;
}

.side-nav a.active {
  color: white;
  background: linear-gradient(180deg, #bd6534, #9c4924);
}

.privacy-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 34px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.privacy-note strong {
  display: block;
  color: #ff9a5e;
  margin: 8px 0;
}

.privacy-note p {
  margin: 0;
  color: #c6cdd1;
  font-size: 13px;
}

.main-stage {
  padding: 30px clamp(20px, 4vw, 42px) 56px;
  background: linear-gradient(180deg, #fbfbfb, #eef1f2);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.welcome {
  margin: 0 0 8px;
  color: var(--muted);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secure-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #283137;
  font-size: 13px;
  font-weight: 800;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}

.content-column,
.side-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.stat-item {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item svg {
  color: var(--copper);
}

.stat-item strong {
  font-size: 28px;
}

.stat-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel,
.request-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head.tight {
  margin-bottom: 20px;
}

.panel h2,
.request-form h2,
.value-panel h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.panel p,
.request-form p,
.value-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.request-list {
  display: grid;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.request-row:first-child {
  border-top: 0;
}

.request-main h3 {
  margin: 3px 0 3px;
  font-size: 16px;
  line-height: 1.35;
}

.request-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.deliverable-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.deliverable-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(182, 93, 46, 0.24);
  border-radius: 8px;
  color: var(--copper-dark);
  background: rgba(182, 93, 46, 0.08);
}

.deliverable-file strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.deliverable-file span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.deliverable-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.deliverable-actions a,
.pending-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(182, 93, 46, 0.32);
  border-radius: 999px;
  color: var(--copper);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.pending-file {
  color: var(--muted);
  border-color: var(--line);
}

.request-id {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.request-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.status-chip,
.approval-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-chip.green {
  color: var(--green);
  background: var(--green-soft);
}

.status-chip.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-chip.neutral {
  color: #55626a;
  background: #eef1f2;
}

.approval-chip {
  color: var(--copper);
  background: var(--copper-soft);
}

.gateway-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid rgba(182, 93, 46, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(182, 93, 46, 0.10), rgba(255, 255, 255, 0.78));
}

.gateway-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--copper-dark);
  font-size: 12px;
  text-transform: uppercase;
}

.gateway-note p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.gateway-note span {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revision-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.revision-summary span,
.revision-rules {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revision-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 238, 231, 0.55);
}

.revision-head,
.revision-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.revision-head h4,
.revision-form-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.revision-head p,
.revision-form-head p,
.revision-empty {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.revision-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(182, 93, 46, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.revision-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.revision-item p {
  margin-top: 4px;
}

.revision-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.revision-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revision-owner-form {
  padding-top: 2px;
}

.revision-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(182, 93, 46, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.revision-form textarea {
  min-height: 94px;
}

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

.revision-form .primary-action {
  justify-self: start;
}

.value-label {
  max-width: 220px;
  text-align: right;
}

.owner-status-form {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.owner-status-form select {
  max-width: 260px;
  min-height: 38px;
  padding: 8px 10px;
}

.owner-status-form button,
.copy-field button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--copper);
  background: #fff;
  border-color: rgba(182, 93, 46, 0.36);
}

.value-panel {
  padding: 24px;
  border-radius: var(--radius);
  color: #f6f8f9;
  background:
    linear-gradient(145deg, rgba(182, 93, 46, 0.18), transparent 42%),
    linear-gradient(180deg, #141e25, #080f14);
  box-shadow: var(--shadow);
}

.value-panel h2 {
  color: #ff9a5e;
}

.value-panel p {
  color: #dce2e5;
}

.value-panel strong {
  display: block;
  margin: 8px 0 8px;
  color: #ff9a5e;
  font-size: 29px;
  line-height: 1.12;
}

.value-panel small {
  color: #b5c0c6;
}

.value-panel hr {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.compact-panel {
  box-shadow: none;
}

.copy-field {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.copy-field input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 10px;
  font-size: 12px;
}

.approval-band {
  display: flex;
  gap: 20px;
  padding: 28px;
  color: #f4f7f8;
  background: linear-gradient(180deg, #172128, #0b1217);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.approval-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #ff9a5e;
  flex: 0 0 auto;
}

.approval-icon svg {
  width: 54px;
  height: 54px;
}

.approval-band h2 {
  margin: 0 0 8px;
  color: #ff9a5e;
}

.approval-band p {
  margin: 0;
  color: #d3dcdf;
}

.empty-state {
  padding: 36px 0;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin-bottom: 18px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.request-form {
  padding: 28px;
}

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

.field-grid .wide {
  grid-column: 1 / -1;
}

.file-field input {
  padding: 12px;
  background: #f8fafb;
}

.approval-preview {
  margin-top: 20px;
  padding: 16px;
  display: grid;
  gap: 4px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #f1d8a4;
  border-radius: var(--radius);
}

.approval-preview span {
  color: #6a4b16;
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.form-value {
  align-self: start;
}

.account-panel {
  max-width: 820px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.account-card h2 {
  margin: 0;
}

.account-card p,
.account-card span {
  margin: 2px 0 0;
  color: var(--muted);
}

.governance-list {
  padding-top: 22px;
  max-width: 680px;
}

.flash {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: var(--radius);
  font-weight: 800;
}

.flash.success {
  color: var(--green);
  background: var(--green-soft);
}

.flash.error {
  color: #9f1d1d;
  background: #fdeaea;
}

.mobile-nav {
  display: none;
}

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

  .sidebar {
    display: none;
  }

  .main-stage {
    padding-bottom: 96px;
  }

  .portal-grid,
  .form-layout {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-nav a {
    min-height: 54px;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-nav a.active {
    color: var(--copper);
  }
}

@media (max-width: 760px) {
  body {
    background: #0b1217;
  }

  .auth-shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .auth-side {
    display: none;
  }

  .auth-panel h1 {
    margin-top: 58px;
  }

  .main-stage {
    padding: 22px 14px 92px;
    background: #0b1217;
    color: #f4f7f8;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    display: none;
  }

  .welcome,
  .panel p,
  .request-form p {
    color: #aeb8bd;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
    background: #121b22;
    border-color: var(--line-dark);
  }

  .stat-item {
    border-color: var(--line-dark);
  }

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

  .stat-item strong,
  .panel h2,
  .request-form h2,
  .request-main h3,
  .empty-state h3,
  .account-card h2 {
    color: #f6f8f9;
  }

  .panel,
  .request-form {
    color: #f6f8f9;
    background: #121b22;
    border-color: var(--line-dark);
    box-shadow: none;
  }

  .request-row {
    grid-template-columns: 1fr;
    border-color: var(--line-dark);
  }

  .request-meta {
    justify-items: start;
  }

  .gateway-note {
    border-color: rgba(220, 116, 55, 0.38);
    background: rgba(220, 116, 55, 0.10);
  }

  .gateway-note strong {
    color: #ff9b66;
  }

  .gateway-note p {
    color: #edf3f5;
  }

  .gateway-note span {
    color: #9fb0b8;
  }

  .deliverable-file {
    border-color: rgba(220, 116, 55, 0.38);
    color: #ffb084;
    background: rgba(220, 116, 55, 0.12);
    grid-template-columns: 1fr;
  }

  .deliverable-file span {
    color: #aeb8bd;
  }

  .deliverable-actions {
    justify-content: stretch;
  }

  .deliverable-actions a,
  .pending-file {
    flex: 1 1 auto;
    color: #ffb084;
    background: #0e171d;
    border-color: rgba(220, 116, 55, 0.38);
  }

  .revision-block,
  .revision-form,
  .revision-item {
    background: #0e171d;
    border-color: #26343d;
  }

  .revision-head h4,
  .revision-form-head h4,
  .revision-item strong {
    color: #f6f8f9;
  }

  .revision-head p,
  .revision-form-head p,
  .revision-empty,
  .revision-summary span,
  .revision-rules,
  .revision-item small,
  .revision-meta {
    color: #aeb8bd;
  }

  .revision-item,
  .revision-field-row {
    grid-template-columns: 1fr;
  }

  .revision-meta {
    justify-items: start;
  }

  .revision-form .primary-action {
    width: 100%;
  }

  .value-label {
    text-align: left;
  }

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

  label {
    color: #e8edef;
  }

  input,
  select,
  textarea {
    color: #f6f8f9;
    background: #0e171d;
    border-color: #2d3941;
  }

  .copy-field {
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .primary-action,
  .ghost-link {
    width: 100%;
  }
}
