:root {
  --ink: #141411;
  --paper: #f3f2ed;
  --white: #fff;
  --copper: #b86f47;
  --copper-dark: #8e4f31;
  --sage: #587066;
  --danger: #a94a42;
  --muted: #686862;
  --line: rgba(20,20,17,.14);
  --max: 1220px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: "Segoe UI", Tahoma, Arial, sans-serif; line-height: 1.55; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.portal-header { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); background: var(--ink); color: var(--white); border-bottom: 1px solid rgba(255,255,255,.14); }
.portal-brand { display: flex; align-items: center; gap: 15px; }
.portal-brand img { width: 122px; height: 50px; object-fit: contain; }
.portal-brand span { padding-inline-start: 15px; border-inline-start: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.55); font-size: 10px; font-weight: 900; }
.portal-header nav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 800; }
.logout-button { border: 1px solid rgba(255,255,255,.3); border-radius: 4px; background: transparent; color: var(--white); padding: 9px 13px; }
main { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.eyebrow { margin: 0 0 10px; color: var(--copper-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; }

.login-view { min-height: calc(100vh - 78px); display: grid; grid-template-columns: 1fr 460px; gap: 90px; align-items: center; padding: 70px 0; }
.login-intro h1 { margin: 0; max-width: 720px; font-size: clamp(45px, 6.3vw, 82px); line-height: 1.08; letter-spacing: 0; }
.login-intro > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 18px; }
.login-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); }
.login-features span { min-height: 100px; display: flex; align-items: flex-end; padding: 18px; background: var(--paper); font-size: 13px; font-weight: 800; }
.login-form { display: grid; gap: 18px; padding: 34px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 60px rgba(20,20,17,.1); }
.form-heading span, .dialog-heading span { color: var(--copper-dark); font-size: 11px; font-weight: 900; }
.form-heading h2, .dialog-heading h2 { margin: 4px 0; font-size: 27px; }
.form-heading p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.login-form label, .request-dialog label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.login-form input, .request-dialog input, .request-dialog select, .request-dialog textarea, .toolbar input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: #fbfbf8; padding: 13px 14px; outline: none; }
.login-form input:focus, .request-dialog input:focus, .request-dialog select:focus, .request-dialog textarea:focus, .toolbar input:focus { border-color: var(--copper); box-shadow: 0 0 0 2px rgba(184,111,71,.13); }
.login-form > button, .submit-request { min-height: 50px; border: 0; border-radius: 4px; background: var(--copper); color: var(--white); font-weight: 900; }
.login-form > button:hover, .submit-request:hover { background: var(--copper-dark); }
.login-form > button:disabled, .submit-request:disabled { opacity: .55; cursor: wait; }
.form-status { min-height: 20px; margin: 0; color: var(--sage); font-size: 13px; font-weight: 800; }
.form-status.error { color: var(--danger); }
.support-note { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.support-note a { color: var(--copper-dark); font-weight: 800; }

.dashboard-view { padding: 65px 0 100px; }
.dashboard-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 38px; }
.dashboard-title h1 { margin: 0; font-size: clamp(36px, 5vw, 60px); letter-spacing: 0; }
.dashboard-title p:last-child { margin: 8px 0 0; color: var(--muted); }
.request-button { min-height: 48px; padding: 0 22px; border: 0; border-radius: 4px; background: var(--ink); color: var(--white); font-weight: 900; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.metrics article { min-height: 128px; padding: 23px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.3); }
.metrics span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.metrics strong { font-size: 42px; line-height: 1.3; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 42px 0 22px; }
.toolbar label { flex: 1; max-width: 420px; display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filters button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); font-weight: 800; }
.filters button.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.shipment-list { display: grid; gap: 14px; }
.shipment-card { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px 50px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.shipment-primary { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.shipment-label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.shipment-primary h2 { margin: 3px 0 0; font-size: 26px; }
.status-badge { max-width: 220px; padding: 8px 11px; border-radius: 4px; background: #edf1ef; color: #365348; font-size: 12px; font-weight: 800; text-align: center; }
.status-badge.attention { background: #f7eae7; color: var(--danger); }
.progress-block > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-block strong { color: var(--ink); }
.progress-track { height: 7px; background: #e2e1dc; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--sage); transition: width 300ms ease; }
.shipment-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shipment-facts div { padding: 18px; border-inline-end: 1px solid var(--line); }
.shipment-facts div:last-child { border-inline-end: 0; }
.shipment-facts dt { color: var(--muted); font-size: 11px; font-weight: 800; }
.shipment-facts dd { margin: 6px 0 0; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.shipment-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 9px; }
.shipment-actions a, .shipment-actions button { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 900; }
.shipment-actions a:first-child { background: var(--copper); color: var(--white); border-color: var(--copper); }
.empty-state { padding: 50px; text-align: center; border: 1px dashed var(--line); color: var(--muted); }

.request-dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.request-dialog::backdrop { background: rgba(10,10,9,.66); }
.request-dialog form { display: grid; gap: 17px; padding: 30px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.close-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 4px; background: transparent; font-size: 25px; line-height: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

@media (max-width: 950px) {
  .login-view { grid-template-columns: 1fr; gap: 45px; }
  .login-form { width: min(520px, 100%); }
  .metrics { grid-template-columns: 1fr 1fr; }
  .shipment-card { grid-template-columns: 1fr; gap: 22px; }
  .shipment-facts, .shipment-actions { grid-column: 1; }
  .shipment-facts { grid-template-columns: 1fr 1fr; }
  .shipment-facts div:nth-child(2) { border-inline-end: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label { max-width: none; }
}

@media (max-width: 640px) {
  .portal-header { height: auto; min-height: 72px; padding: 10px 16px; }
  .portal-brand img { width: 105px; }
  .portal-brand span, .portal-header nav a { display: none; }
  main { width: calc(100% - 28px); }
  .login-view { min-height: calc(100vh - 72px); padding: 48px 0; }
  .login-intro h1 { font-size: 45px; }
  .login-features { grid-template-columns: 1fr; }
  .login-features span { min-height: 70px; }
  .login-form { padding: 23px; }
  .dashboard-view { padding: 44px 0 80px; }
  .dashboard-title { align-items: stretch; flex-direction: column; }
  .metrics article { min-height: 105px; padding: 18px; }
  .metrics strong { font-size: 34px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .shipment-card { padding: 20px; }
  .shipment-primary { flex-direction: column; }
  .status-badge { max-width: none; }
  .shipment-facts { grid-template-columns: 1fr; }
  .shipment-facts div { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .shipment-facts div:last-child { border-bottom: 0; }
  .shipment-actions { display: grid; }
  .form-row { grid-template-columns: 1fr; }
  .request-dialog form { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
