:root {
  --navy-950: #041129;
  --navy-900: #071a38;
  --navy-700: #0e3170;
  --blue-600: #1552c4;
  --orange-500: #f04e23;
  --ink: #0b1220;
  --muted: #5b6b85;
  --line: #dce4ef;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --success: #087a55;
  --danger: #b42318;
  --shadow: 0 28px 80px -40px rgba(4, 17, 41, .55);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-soft); }
body { margin: 0; font-family: "Inter Tight", "Segoe UI", sans-serif; color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: var(--blue-600); }
[hidden] { display: none !important; }

.platform-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 15% 15%, rgba(21, 82, 196, .12), transparent 30rem),
    linear-gradient(135deg, #f8fbff, #edf2f8);
}

.platform-header, .platform-footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.platform-header { padding-block: 1.25rem; }
.platform-footer { padding-block: 1.5rem; color: var(--muted); font-size: .9rem; }

.platform-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.platform-brand img { width: 46px; height: 46px; object-fit: contain; }
.platform-brand strong, .platform-brand small { display: block; }
.platform-brand strong { font-size: 1.02rem; }
.platform-brand small { margin-top: .15rem; color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.security-chip { border: 1px solid #b8decf; border-radius: 999px; padding: .5rem .8rem; background: #effaf6; color: var(--success); font-size: .82rem; font-weight: 700; }

.auth-shell { width: min(1050px, calc(100% - 2rem)); margin: auto; display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: 3rem; }
.auth-intro { max-width: 35rem; }
.platform-eyebrow { margin: 0 0 .8rem; color: var(--orange-500); font-weight: 800; font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; }
.auth-intro h1 { margin: 0; color: var(--navy-950); font-size: clamp(2.5rem, 7vw, 4.7rem); line-height: .98; letter-spacing: -.045em; }
.auth-intro > p { margin: 1.4rem 0 0; color: #3f4e67; font-size: 1.08rem; line-height: 1.7; }
.trust-list { display: grid; gap: .75rem; margin: 1.8rem 0 0; padding: 0; list-style: none; color: #34445d; }
.trust-list li { position: relative; padding-left: 1.7rem; }
.trust-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }

.auth-card { padding: clamp(1.4rem, 4vw, 2.25rem); border: 1px solid rgba(220, 228, 239, .9); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.auth-card h2 { margin: 1.4rem 0 .35rem; color: var(--navy-950); font-size: 1.55rem; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; }
.step-indicator { display: flex; align-items: center; width: 9rem; }
.step-indicator span { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: .78rem; font-weight: 800; }
.step-indicator span.is-active { background: var(--navy-900); border-color: var(--navy-900); color: white; }
.step-indicator i { flex: 1; height: 1px; background: var(--line); }

.platform-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.platform-form label { display: grid; gap: .45rem; color: #273750; font-size: .9rem; font-weight: 700; }
.platform-form input, .platform-form select, .platform-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .82rem .9rem; background: white; color: var(--ink); outline: none;
}
.platform-form input:focus, .platform-form select:focus, .platform-form textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(21,82,196,.13); }
.platform-button { border: 0; border-radius: 8px; padding: .9rem 1rem; background: var(--orange-500); color: white; font-weight: 800; cursor: pointer; }
.platform-button:hover { background: #d8410f; }
.platform-button:disabled, .text-button:disabled { opacity: .55; cursor: wait; }
.text-button { border: 0; padding: .35rem .1rem; background: transparent; color: var(--blue-600); font-weight: 800; cursor: pointer; text-decoration: none; }
.text-button:hover { color: var(--orange-500); }
.otp-input { font-size: 1.45rem !important; letter-spacing: .35em; font-weight: 800; text-align: center; }
.form-alert { min-height: 1.2rem; margin: 1rem 0 0; font-size: .86rem; line-height: 1.45; }
.form-alert.is-success { color: var(--success); }
.form-alert.is-error { color: var(--danger); }
.privacy-note { margin: 1.15rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }

@media (min-width: 820px) { .auth-shell { grid-template-columns: 1.1fr .9fr; } }
@media (max-width: 540px) { .security-chip { display: none; } .platform-brand small { letter-spacing: .04em; } }

.customer-workspace { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.workspace-heading, .panel-title, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.workspace-heading h1, .agent-topbar h1 { margin: 0; color: var(--navy-950); font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.035em; }
.status-pill { display: inline-flex; border-radius: 999px; padding: .48rem .8rem; background: #eaf1ff; color: var(--navy-700); font-size: .82rem; font-weight: 800; }
.summary-grid, .counter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0; }
.summary-grid article, .counter-grid article { display: grid; gap: .5rem; min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 35px -30px rgba(4,17,41,.65); }
.summary-grid small, .counter-grid small { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.summary-grid strong { overflow-wrap: anywhere; font-size: 1rem; }
.counter-grid strong { color: var(--navy-950); font-size: 2rem; }
.counter-grid .accent { border-color: #f8c9b9; background: #fff7f3; }
.counter-grid .accent strong { color: var(--orange-500); }
.workspace-grid { display: grid; gap: 1.25rem; }
.panel-card { padding: clamp(1.25rem, 3vw, 1.75rem); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px -38px rgba(4,17,41,.55); }
.panel-card h2, .sub-card h3 { margin: 0 0 .5rem; color: var(--navy-950); }
.stack { display: grid; gap: 1.25rem; align-content: start; }
.note-copy { margin: 1rem 0 0; white-space: pre-wrap; line-height: 1.7; color: #35465f; }
.timeline { display: grid; gap: 0; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; gap: .35rem; padding: 0 0 1.5rem 1.65rem; border-left: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -.34rem; top: .18rem; width: .62rem; height: .62rem; border: 3px solid white; border-radius: 50%; background: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline p { margin: 0; color: #3f4e67; white-space: pre-wrap; line-height: 1.55; }
.timeline time { color: var(--muted); font-size: .76rem; }
.message-list { display: grid; gap: .75rem; max-height: 20rem; overflow-y: auto; margin: 1rem 0; padding: .25rem; }
.message { max-width: 88%; padding: .75rem .85rem; border-radius: 10px 10px 10px 2px; background: #eef3fa; }
.message.is-own { justify-self: end; border-radius: 10px 10px 2px 10px; background: #e8f0ff; }
.message small { color: var(--muted); font-size: .7rem; }
.message p { margin: .3rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.empty-state { color: var(--muted); text-align: center; font-size: .88rem; }
.compact-form { margin-top: 1rem; }

.agent-body { display: block; background: #eef3f8; }
.agent-login { min-height: 100vh; display: grid; place-content: center; gap: 1.5rem; width: min(31rem, calc(100% - 2rem)); margin: auto; padding: 2rem 0; }
.login-brand { justify-self: center; }
.agent-login-card h1 { margin: .25rem 0 .65rem; color: var(--navy-950); font-size: 2rem; }
.agent-app { min-height: 100vh; }
.agent-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 17rem; padding: 1.25rem; background: var(--navy-950); color: white; }
.agent-sidebar .platform-brand { color: white; }
.agent-sidebar .platform-brand small { color: #9eacc2; }
.agent-nav { display: grid; gap: .3rem; margin-top: 2.5rem; }
.agent-nav button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-radius: 8px; padding: .75rem .85rem; background: transparent; color: #b9c5d8; text-align: left; font-weight: 700; cursor: pointer; }
.agent-nav button:hover, .agent-nav button.is-active { background: rgba(255,255,255,.1); color: white; }
.agent-nav b, .unread-badge { display: inline-block; border-radius: 999px; padding: .12rem .4rem; background: var(--orange-500); color: white; font-size: .69rem; }
.sidebar-account { display: grid; gap: .45rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-account small { color: #9eacc2; }
.sidebar-account strong { overflow-wrap: anywhere; font-size: .82rem; }
.text-button.light { justify-self: start; color: white; }
.agent-main { min-height: 100vh; margin-left: 17rem; padding: clamp(1.25rem, 3vw, 2.5rem); }
.agent-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.agent-topbar .platform-eyebrow { margin-bottom: .35rem; }
.session-notice { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8rem; }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #19a974; box-shadow: 0 0 0 4px rgba(25,169,116,.12); }
.global-alert:empty { display: none; }
.global-alert { position: sticky; top: .5rem; z-index: 8; min-height: 0; border-radius: 8px; padding: .75rem 1rem; background: white; box-shadow: var(--shadow); }
.counter-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.counter-grid article { padding: 1rem; }
.table-card { margin-top: 1.25rem; padding: 0; overflow: hidden; }
.table-card .panel-title { padding: 1.25rem 1.4rem; }
.table-card .panel-title h2 { margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; font-size: .86rem; }
th, td { padding: .8rem 1rem; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f8fafc; color: var(--muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.clickable-row { cursor: pointer; }
.clickable-row:hover, tbody tr:hover { background: #f7faff; }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .8rem; white-space: nowrap; }
.table-subline { display: block; margin-top: .2rem; color: var(--muted); }
.empty-cell { padding: 2rem; color: var(--muted); text-align: center; }
.filters-card { padding: 1.25rem; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(8rem, 1fr)); gap: .8rem; align-items: end; }
.filter-grid label { display: grid; gap: .35rem; color: #34445d; font-size: .76rem; font-weight: 700; }
.filter-grid input, .filter-grid select, .stage-row input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: .65rem; background: white; }
.check-label { display: flex !important; flex-direction: row !important; align-items: center; gap: .45rem !important; }
.check-label input { width: auto !important; }
.narrow-card { max-width: 52rem; }
.two-column-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-column { grid-column: 1 / -1; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); gap: 1.25rem; align-items: start; }
.stage-list { display: grid; gap: .6rem; margin-top: 1.25rem; }
.stage-row { display: grid; grid-template-columns: 2.5rem minmax(8rem, 1fr) minmax(8rem, 1fr) 4.5rem auto auto auto; gap: .5rem; align-items: center; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; }
.stage-row b { text-align: center; color: var(--muted); }
.stage-row label { font-size: .74rem; white-space: nowrap; }
.detail-list { display: grid; gap: .8rem; margin: 1.2rem 0; }
.detail-list div { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.notice-box { margin-top: 1rem; border: 1px solid #f2d293; border-radius: 8px; padding: .8rem; background: #fff9eb; color: #72520b; line-height: 1.5; }
.application-dialog { width: min(1050px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 30px 100px rgba(4,17,41,.4); }
.application-dialog::backdrop { background: rgba(4,17,41,.68); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; top: .75rem; z-index: 2; float: right; margin: .75rem .75rem 0 0; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: #edf2f7; color: var(--ink); font-size: 1.5rem; cursor: pointer; }
#application-detail { padding: 1.7rem; clear: both; }
.dialog-heading { margin-bottom: 1.25rem; }
.dialog-heading h2 { margin: 0 0 .3rem; }
.dialog-grid { display: grid; grid-template-columns: minmax(17rem, .8fr) minmax(20rem, 1.2fr); gap: 1.25rem; align-items: start; }
.sub-card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.compact-timeline { max-height: 22rem; overflow-y: auto; }

@media (min-width: 900px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .workspace-grid { grid-template-columns: minmax(0, 1.05fr) minmax(20rem, .95fr); }
}
@media (max-width: 1180px) {
  .counter-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .stage-row { grid-template-columns: 2rem 1fr 1fr 4rem; }
  .stage-row label, .stage-row button { justify-self: start; }
}
@media (max-width: 820px) {
  .agent-sidebar { position: static; width: auto; padding: 1rem; }
  .agent-nav { grid-template-columns: repeat(3, 1fr); margin-top: 1rem; }
  .sidebar-account { display: flex; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
  .agent-main { margin-left: 0; }
  .split-layout, .dialog-grid { grid-template-columns: 1fr; }
  .application-dialog { max-height: calc(100vh - 1rem); }
}
@media (max-width: 620px) {
  .agent-topbar { align-items: flex-start; }
  .session-notice { display: none; }
  .agent-nav { grid-template-columns: repeat(2, 1fr); }
  .counter-grid, .filter-grid, .two-column-form { grid-template-columns: 1fr 1fr; }
  .full-column { grid-column: auto; }
  .stage-row { grid-template-columns: 2rem 1fr; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 420px) {
  .counter-grid, .filter-grid, .two-column-form, .summary-grid { grid-template-columns: 1fr; }
}
.action-row{display:flex;align-items:center;flex-wrap:wrap;gap:1rem;margin:1rem 0}.invoice-item{display:grid;grid-template-columns:1.2fr 1.8fr .6fr .8fr .6fr;gap:.7rem;padding:1rem;border:1px solid #dce4ef;border-radius:8px;margin:.8rem 0}.invoice-item label{min-width:0;font-size:.875rem}.invoice-item button{grid-column:1/-1;justify-self:start}.invoice-editor{margin-top:1.5rem}.invoice-editor input,.invoice-editor textarea{max-width:100%}.panel-card+.panel-card{margin-top:1.25rem}#security-view>.panel-card{margin-bottom:1.5rem}[hidden]{display:none!important}@media(max-width:850px){.invoice-item{grid-template-columns:1fr 1fr}.invoice-item label:nth-child(2){grid-column:1/-1}}
.agent-nav .sidebar-mail{display:block;padding:.8rem 1rem;margin-top:.75rem;border-top:1px solid rgba(255,255,255,.18);color:#cbd8ed;font-weight:700;text-decoration:none;border-radius:8px}.agent-nav .sidebar-mail:hover,.agent-nav .sidebar-mail:focus-visible{background:rgba(255,255,255,.1);color:white}

/* Tracking numbers also serve as private portal access keys. */
#application-title, #application-number, .dialog-heading h2 { overflow-wrap: anywhere; }
.tracking-share-number { display:block; width:100%; max-width:34rem; padding:.8rem; margin:.6rem 0; font-family:monospace; font-size:1rem; }
