/* Porting Desk - Digicel colours (red #E5002B, navy #2D2D5F, pink #D76A7D). Matches the approved mockups. */
@font-face { font-family: "Hurme"; src: url("../fonts/HurmeGeometricSans1.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hurme"; src: url("../fonts/HurmeGeometricSans1-SemiBold.otf") format("opentype"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Hurme"; src: url("../fonts/HurmeGeometricSans1-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --red: #E5002B; --red-dark: #B80022; --red-tint: #FDECEF; --red-line: #F5B8C3; --red-ink: #8A0019;
  --navy: #2D2D5F; --navy-2: #3B3B72; --navy-tint: #ECECF5; --navy-line: #CFCFE3;
  --pink: #D76A7D;
  --ink: #23233F; --muted: #5E5E78; --faint: #6E6E88;
  --bg: #F6F6FA; --surface: #FFFFFF; --line: #E3E3EC; --line-2: #EBEBF2; --field: #C9C9D6; --head: #FAFAFD;
  --good: #1F7A4D; --good-ink: #1F6A43; --good-tint: #E9F5EE; --good-line: #CFE3D8;
  --warn: #B5651D; --warn-ink: #7A4A12; --warn-tint: #FFF4E5; --warn-line: #EBC9A0; --warn-bg: #FFF7EE;
  --radius: 12px;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Hurme", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.i { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.i-red { color: var(--red); }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(229, 0, 43, .35); outline-offset: 2px; }

/* ---------- header ---------- */
.top { background: var(--red); color: #fff; }
.top-bar { height: 60px; padding: 0 32px; display: flex; align-items: center; gap: 28px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: #fff; color: var(--red); display: inline-flex; align-items: center; justify-content: center; }
.brand-mark .i { width: 18px; height: 18px; }
.nav { display: flex; gap: 4px; flex-grow: 1; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.nav a { color: #FFE3E8; text-decoration: none; padding: 8px 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .2); }
.who { font-size: 13px; color: #FFE3E8; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.who a { color: #FFE3E8; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.who a:hover { color: #fff; }
.btn-header { height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 6px; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.btn-header:hover { background: rgba(255, 255, 255, .12); }
.menu-toggle { display: none; background: transparent; border: 0; color: #fff; padding: 8px; cursor: pointer; }
.menu-toggle .i { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.wrap.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .i { width: 26px; height: 26px; color: var(--red); }
.sub { margin-top: 6px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back { font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.footer { max-width: 1200px; margin: 0 auto; padding: 8px 32px 32px; font-size: 12px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.card-head h2 .i, .card h2 .i { color: var(--red); }
.card-body { padding: 20px; }
.card-body > * + * { margin-top: 14px; }
.card.pad { padding: 20px; }
.card.tinted { background: var(--navy-tint); border-color: var(--navy-line); color: var(--navy); }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.note { font-size: 13px; color: var(--muted); }

/* ---------- KPIs ---------- */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-label .i { color: var(--red); }
.kpi-value { font-family: var(--mono); font-weight: 600; font-size: 34px; margin-top: 8px; line-height: 1.1; }
.kpi-note { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi-note.good { color: var(--good); }
.kpi.attention { background: var(--warn-bg); border-color: var(--warn-line); }
.kpi.attention, .kpi.attention .kpi-label, .kpi.attention .kpi-note, .kpi.attention .kpi-label .i { color: var(--warn-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; padding: 10px 20px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; background: var(--head); white-space: nowrap; }
table.grid td { padding: 14px 20px; border-top: 1px solid var(--line-2); vertical-align: middle; }
table.grid tr:hover td { background: #FCFCFE; }
table.grid td.right, table.grid th.right { text-align: right; }
.cell-title { font-weight: 500; }
.cell-title a { color: var(--ink); text-decoration: none; }
.cell-title a:hover { color: var(--red); text-decoration: underline; }
.cell-sub { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.cell-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 28px; height: 28px; color: var(--line); display: block; margin: 0 auto 8px; }

/* ---------- pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .i { width: 13px; height: 13px; }
.pill.good { background: var(--good-tint); color: var(--good-ink); }
.pill.warn { background: var(--warn-tint); color: var(--warn-ink); }
.pill.bad { background: var(--red-tint); color: var(--red-ink); }
.pill.info { background: var(--navy-tint); color: var(--navy); }
.pill.neutral { background: #EFEFF5; color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #EFEFF5; color: var(--ink); font-size: 12px; margin: 1px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-outline { border-color: var(--red); color: var(--red); }
.btn-outline:hover { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 6px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--red); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline; display: inline-flex; align-items: center; gap: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 500; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input[type=number], .field input[type=tel], .field select, .field textarea {
  height: 44px; border: 1px solid var(--field); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; width: 100%; }
.field textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.field input[readonly] { background: var(--head); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 0, 43, .12); }
.field .hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 13px; color: #B8001F; display: flex; align-items: center; gap: 6px; }
.has-error input, .has-error select, .has-error textarea { border-color: #B8001F; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); }
.form-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 160px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; bottom: 14px; color: var(--muted); }
.search input { padding-left: 36px !important; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 2px dashed var(--red-line); border-radius: 10px; background: #FFF8F9; text-align: center; cursor: pointer; }
.dropzone .i { width: 26px; height: 26px; color: var(--red); }
.dropzone strong { color: var(--red); }
.dropzone input[type=file] { max-width: 100%; font-size: 13px; }
.sig-pad { width: 100%; height: 170px; border: 1px solid var(--field); border-radius: 10px; background: #fff; touch-action: none; display: block; }
.secret-once { font-family: var(--mono); font-size: 20px; background: var(--head); border: 1px dashed var(--field); border-radius: 8px; padding: 12px 16px; display: inline-block; user-select: all; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; border: 1px solid; }
.alert .i { margin-top: 2px; }
.alert-ok { background: var(--good-tint); border-color: var(--good-line); color: var(--good-ink); }
.alert-error { background: var(--red-tint); border-color: var(--red-line); color: var(--red-ink); }
.alert-warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn-ink); }
.alert-info { background: var(--navy-tint); border-color: var(--navy-line); color: var(--navy); }

/* ---------- wizard steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #B5B5C8; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.steps small { display: block; font-size: 12px; color: var(--muted); }
.steps strong { display: block; font-size: 15px; }
.steps li.current { border: 2px solid var(--red); background: var(--red-tint); }
.steps li.current .num { background: var(--red); border-color: var(--red); color: #fff; }
.steps li.current small { color: var(--red); }
.steps li.done .num { background: var(--good); border-color: var(--good); color: #fff; }
.step-panel[hidden] { display: none !important; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.summary-row span:first-child { color: var(--muted); }

/* ---------- timeline / definition lists ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #C9C9D6; }
.timeline .dot.good { background: var(--good); border-color: var(--good); }
.timeline .dot.warn { background: var(--warn); border-color: var(--warn); }
.timeline .dot.bad { background: #fff; border-color: var(--red); }
.timeline strong { display: block; font-size: 14px; }
.timeline .bad-text { color: var(--red-ink); }
.timeline span { display: block; font-size: 13px; color: var(--muted); }
.timeline .pending strong { color: var(--muted); font-weight: 500; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.dl dt { font-size: 12px; color: var(--muted); }
.dl dd { margin: 2px 0 0; font-size: 15px; }
.history-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 6px 0; }
.history-row span:last-child { color: var(--muted); white-space: nowrap; }
.doc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.doc-tile { height: 170px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px;
  background: repeating-linear-gradient(135deg, #F3F3F8, #F3F3F8 12px, #FAFAFD 12px, #FAFAFD 24px); }
.doc-tile:hover { border-color: var(--red); color: var(--red); }
.doc-tile .i { width: 24px; height: 24px; }

/* ---------- tiles, tabs, pager ---------- */
.tile { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--red); color: var(--ink); box-shadow: 0 2px 10px rgba(229, 0, 43, .08); }
.tile .tile-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--red-tint); color: var(--red); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile strong { display: block; font-size: 15px; }
.tile span { display: block; font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tabs a.active { color: var(--red); border-bottom-color: var(--red); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); gap: 12px; flex-wrap: wrap; }
.market-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.market-card.flag { border-color: var(--warn-line); }
.market-card .row { display: flex; justify-content: space-between; align-items: center; }
.market-card .url { font-family: var(--mono); font-size: 13px; color: var(--muted); word-break: break-all; }
.state { font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.state.ok { color: var(--good); }
.state.warn { color: var(--warn-ink); }
.state.warn .i { color: var(--warn); }
.rank { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-tint); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.rank.r1 { background: var(--red); color: #fff; }
.rank.r2, .rank.r3 { background: var(--red-tint); color: var(--red); }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--red); border-radius: 99px; }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-hero { background: var(--navy); color: #F6F6FA; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -150px; top: -150px; width: 340px; height: 340px; border-radius: 50%; background: var(--red); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; color: #fff; }
.auth-brand .mark { width: 36px; height: 36px; border-radius: 8px; background: var(--red); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.auth-hero h1 { font-size: 40px; line-height: 1.15; max-width: 460px; }
.auth-hero p { font-size: 16px; line-height: 1.6; color: #C9C9DB; max-width: 440px; margin-top: 20px; }
.auth-badges { display: flex; gap: 24px; font-size: 13px; color: #C9C9DB; flex-wrap: wrap; }
.auth-badges span { display: inline-flex; align-items: center; gap: 6px; }
.auth-badges .i { color: var(--pink); width: 15px; height: 15px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: var(--radius); padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { max-width: 560px; }
.auth-card h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.auth-card h2 .i { width: 22px; height: 22px; color: var(--red); }
.auth-links { display: flex; justify-content: space-between; font-size: 14px; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .top.compact .top-bar { padding: 0 24px; gap: 18px; }
  .top.compact .nav a { padding: 8px 9px; }
  .top.compact .who .name { display: none; }
}
@media (max-width: 1100px) {
  .who .name { display: none; }
}
@media (max-width: 1240px) {
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .top-bar { flex-wrap: wrap; height: auto; min-height: 60px; }
  .nav, .who { display: none; }
  .top.open .nav { display: flex; flex-direction: column; width: 100%; padding-bottom: 8px; }
  .top.open .who { display: flex; width: 100%; padding-bottom: 14px; justify-content: space-between; }
  .top.open .who .name { display: inline; }
}
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .split { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 32px 20px; gap: 24px; }
  .auth-hero h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  table.grid td { white-space: nowrap; }
  .wrap { padding: 20px 16px; }
  .grid-4, .grid-2, .form-grid, .dl, .doc-tiles, .steps { grid-template-columns: minmax(0, 1fr); }
  table.grid th, table.grid td { padding-left: 12px; padding-right: 12px; }
  .auth-card { padding: 28px 20px; }
  h1 { font-size: 24px; }
}
@media print {
  .top, .footer, .actions, .no-print { display: none !important; }
  body { background: #fff; }
}
