:root {
  --blue: #0877d1;
  --blue-dark: #0068ba;
  --cyan: #16a9dd;
  --ink: #0a1c33;
  --navy: #051a33;
  --navy-2: #08294f;
  --text: #37475b;
  --muted: #68778a;
  --soft: #f3f7fb;
  --soft-blue: #eaf5fd;
  --white: #ffffff;
  --line: #dce5ef;
  --line-strong: #cbd8e5;
  --success: #16865f;
  --success-soft: #ecf9f4;
  --danger: #b94052;
  --danger-soft: #fff1f3;
  --warn: #b7791f;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(5, 26, 51, .11);
  --shadow-soft: 0 10px 35px rgba(5, 26, 51, .06);
  --max: 1440px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--soft); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 94% 0%, rgba(22, 169, 221, .1), transparent 28rem),
    var(--soft);
  font-size: 16px;
  line-height: 1.65;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 119, 209, .28);
  outline-offset: 2px;
}

.shell {
  width: min(100%, var(--max));
  margin: auto;
  padding: 0 28px 48px;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  margin: 0 -28px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
}

.brand-area,
.account-area,
.brand-lockup {
  display: flex;
  align-items: center;
}

.brand-area { gap: 24px; min-width: 0; }
.account-area { gap: 16px; flex: 0 0 auto; }
.brand-lockup { gap: 10px; flex: 0 0 auto; }

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--white);
}

.brand-mark img {
  display: block;
  position: absolute;
  width: 434.286%;
  max-width: none;
  height: auto;
  left: -25.714%;
  top: -51.905%;
}

.brand-name { display: flex; flex-direction: column; }

.brand-name strong {
  display: block;
  color: var(--ink);
  font-size: 21.6px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}

.brand-name strong span { color: var(--blue); }

.brand-name small {
  margin-top: 5px;
  color: var(--ink);
  font-size: 9.25px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .28em;
}

.portal-label {
  padding-left: 24px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.account-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.account-copy strong { color: var(--ink); font-size: 13px; }
.account-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover {
  border-color: #99b4ca;
  box-shadow: 0 6px 18px rgba(5, 26, 51, .09);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 9px 24px rgba(8, 119, 209, .2);
}

.btn.primary:hover { box-shadow: 0 12px 30px rgba(8, 119, 209, .28); }
.btn.danger { border-color: #efc2c9; background: #fff9fa; color: var(--danger); }

.btn:disabled,
.field input:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
  box-shadow: none;
}

.login-wrap {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.16fr) minmax(420px, .84fr);
  overflow: hidden;
}

.hero-login {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 126px);
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 84% 48%, rgba(22, 169, 221, .18), transparent 19rem),
    linear-gradient(135deg, var(--navy), var(--navy-2));
}

.hero-login::before,
.hero-login::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(78, 183, 226, .16);
  border-radius: 50%;
  content: "";
}

.hero-login::before { width: 430px; height: 430px; right: -70px; top: 20%; }
.hero-login::after { width: 260px; height: 260px; right: 16px; top: calc(20% + 85px); }

.brand-inverse { position: absolute; top: 46px; left: clamp(48px, 8vw, 126px); }
.brand-inverse .brand-mark { padding: 3px; border-radius: 11px; background: var(--white); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.brand-inverse .brand-name strong { color: var(--white); }
.brand-inverse .brand-name strong span { color: #51c8ee; }
.brand-inverse .brand-name small { color: #c3d9e7; }

.hero-kicker {
  margin-bottom: 18px;
  color: #62cdf1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.hero-login h1 {
  max-width: 820px;
  margin: 0 0 24px;
  color: var(--white);
  font-size: clamp(44px, 5.3vw, 74px);
  font-weight: 750;
  line-height: 1.01;
  letter-spacing: -.05em;
}

.hero-login > p {
  max-width: 690px;
  margin: 0;
  color: #c2d2e1;
  font-size: 18px;
  line-height: 1.72;
}

.hero-capabilities { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 38px; }
.hero-capabilities span { color: #d7e7f1; font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }

.login-side {
  display: grid;
  min-height: 100vh;
  padding: 48px;
  place-items: center;
  background: var(--soft);
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card h2 { margin: 6px 0 8px; color: var(--ink); font-size: 34px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 18px; color: var(--muted); }
.login-help { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }

.layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 32px;
  margin-top: 32px;
}

.sidebar {
  position: sticky;
  top: 116px;
  height: max-content;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.sidebar-label {
  padding: 8px 12px 9px;
  color: #8897a8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sidebar-section { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }

.navbutton {
  width: 100%;
  margin: 2px 0;
  padding: 11px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #56677b;
  font-weight: 700;
  text-align: left;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.navbutton:hover { background: var(--soft); color: var(--ink); transform: translateX(2px); }
.navbutton.active { background: var(--soft-blue); color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }

.content { min-width: 0; padding-bottom: 36px; }
.content > .eyebrow { margin-top: 4px; }

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.content h1 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 45px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.content h2 { color: var(--ink); letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.card,
.form-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.card { position: relative; overflow: hidden; }
.card::after { position: absolute; right: -34px; bottom: -50px; width: 130px; height: 130px; border-radius: 50%; background: rgba(22, 169, 221, .07); content: ""; }
.metric { position: relative; z-index: 1; margin-top: 4px; color: var(--ink); font-size: 32px; font-weight: 850; letter-spacing: -.04em; }

.progress { height: 8px; margin-top: 13px; overflow: hidden; border-radius: 20px; background: #e7eef5; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

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

.section-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdff;
}

.section-row strong { color: var(--ink); }

.badge {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--white);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
}

.badge.done { border-color: #a9dfca; background: var(--success-soft); color: var(--success); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; }

.field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .015em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: #fbfdff;
  color: var(--ink);
  font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 3px rgba(8, 119, 209, .12); }

.actions { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; margin-top: 22px; }

.error,
.success {
  margin: 13px 0;
  padding: 12px 14px;
  border-radius: 10px;
}

.error { border: 1px solid #efc2c9; background: var(--danger-soft); color: #8e3040; }
.success { border: 1px solid #b7e3d4; background: var(--success-soft); color: #116d4e; }

.docrow,
.customer-row {
  display: grid;
  grid-template-columns: 1.35fr .72fr .52fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.customer-row { grid-template-columns: 1.45fr .75fr .62fr auto; }
.docrow:last-child,
.customer-row:last-child { border-bottom: 0; }
.docrow strong,
.customer-row strong { color: var(--ink); }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #27b987; box-shadow: 0 0 0 4px rgba(39, 185, 135, .12); }

.uploadbox {
  padding: 25px;
  border: 1px dashed #a9bed0;
  border-radius: 14px;
  background: #f7fbfe;
  text-align: center;
}

.storage { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.pill { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 800; }
.divider { height: 1px; margin: 24px 0; background: var(--line); }
.hidden { display: none !important; }

.toast {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  max-width: min(430px, calc(100vw - 48px));
  padding: 13px 17px;
  border: 1px solid #234d6b;
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 18px 45px rgba(5, 26, 51, .28);
}

.table-head {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .portal-label { display: none; }
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .hero-login { min-height: 660px; padding: 130px 34px 70px; }
  .brand-inverse { top: 38px; left: 34px; }
  .login-side { min-height: auto; padding: 52px 24px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: flex; padding: 10px; overflow-x: auto; border-radius: 14px; }
  .sidebar-label { display: none; }
  .navbutton { width: auto; min-width: max-content; text-align: center; }
  .navbutton:hover { transform: none; }
  .navbutton.active { box-shadow: inset 0 -3px 0 var(--blue); }
  .cards { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { padding: 0 16px 32px; }
  .topbar { min-height: 74px; margin: 0 -16px; padding: 13px 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark img { width: 434.286%; height: auto; }
  .brand-name strong { font-size: 18px; }
  .brand-name small { font-size: 7.8px; }
  .account-copy { display: none; }
  .topbar .btn { min-height: 38px; padding: 8px 11px; font-size: 12px; }
  .layout { margin-top: 20px; }
  .content h1 { font-size: 32px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .docrow,
  .customer-row { grid-template-columns: 1fr; gap: 8px; }
  .row-actions { justify-content: flex-start; }
  .storage { align-items: flex-start; flex-direction: column; }
  .hero-login h1 { font-size: 44px; }
  .hero-login > p { font-size: 16px; }
}
