:root {
  --ink: #10232e;
  --navy: #071e30;
  --navy-soft: #0d3046;
  --paper: #f4f7f7;
  --white: #ffffff;
  --line: #d8e2e4;
  --muted: #62737c;
  --teal: #087665;
  --teal-soft: #e4f4f0;
  --amber: #f4b63a;
  --danger: #a63838;
  --shadow: 0 22px 60px rgba(7, 31, 46, 0.12);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 Inter, Aptos, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.portal-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(22px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(13, 48, 70, 0.1);
  background: rgba(255, 255, 255, 0.96);
}

.portal-brand { display: inline-flex; align-items: center; }
.portal-brand img { display: block; width: 178px; height: auto; }

.portal-nav { display: flex; align-items: center; gap: 22px; color: #39505b; font-size: 14px; font-weight: 750; }
.portal-nav a:hover, .link-button:hover, .text-action:hover { color: var(--teal); }
.portal-nav form { margin: 0; }
.link-button { padding: 0; border: 0; color: inherit; background: transparent; font-weight: 750; }

.portal-shell { width: min(calc(100% - 44px), 1200px); min-height: calc(100vh - 203px); margin: 0 auto; padding: 54px 0 76px; }
.portal-footer { padding: 28px 22px; border-top: 1px solid rgba(13, 48, 70, 0.1); color: #68808a; background: #fff; font-size: 13px; text-align: center; }

.notice { margin: 0 0 28px; padding: 15px 18px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.notice-success { border-color: #b9dfd5; color: #075d50; background: #e9f7f2; }
.notice-error { border-color: #ecc9c9; color: #8e2929; background: #fff0f0; }

.eyebrow { display: inline-block; color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: 1.6px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -1.4px; }

.auth-intro { max-width: 700px; padding-top: 34px; text-align: center; margin: 0 auto 38px; }
.auth-intro h1, .auth-copy h1 { margin: 13px 0 16px; font-size: clamp(42px, 5vw, 62px); line-height: 1.04; }
.auth-intro p, .auth-copy p, .page-heading p { margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.68; }

.role-cards { display: grid; max-width: 930px; margin: 0 auto; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow); }
.role-card { display: block; min-height: 340px; padding: 38px; border: 1px solid var(--line); background: var(--white); transition: transform 180ms ease, box-shadow 180ms ease; }
.role-card:hover { position: relative; z-index: 1; box-shadow: var(--shadow); transform: translateY(-5px); }
.role-card-dark { border-color: var(--navy); color: #fff; background: linear-gradient(145deg, #0c3d50, var(--navy)); }
.role-icon { display: grid; width: 48px; height: 48px; margin-bottom: 48px; place-items: center; border-radius: 14px; color: var(--teal); background: var(--teal-soft); font-size: 24px; }
.role-card-dark .role-icon { color: var(--navy); background: var(--amber); }
.role-card small { display: block; margin-bottom: 10px; color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: 1.3px; }
.role-card-dark small { color: #98d8c9; }
.role-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -0.8px; }
.role-card p { max-width: 320px; margin: 13px 0 27px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.role-card-dark p { color: #b4cad1; }
.role-card > span:last-child { color: var(--teal); font-size: 14px; font-weight: 850; }
.role-card-dark > span:last-child { color: var(--amber); }

.auth-layout { display: grid; max-width: 1000px; margin: 34px auto 0; grid-template-columns: 1fr 0.9fr; align-items: center; gap: 88px; }
.back-link { display: inline-block; margin-bottom: 42px; color: var(--teal); font-size: 14px; font-weight: 800; }
.auth-card, .panel-card { border: 1px solid var(--line); background: #fff; box-shadow: 0 14px 42px rgba(7, 31, 46, 0.07); }
.auth-card { padding: 34px; }
.auth-card h2 { margin-bottom: 8px; font-size: 29px; }
.auth-card > p { margin-bottom: 27px; color: var(--muted); font-size: 14px; line-height: 1.6; }

label { display: grid; margin-bottom: 18px; gap: 8px; }
label > span { color: #3b515b; font-size: 13px; font-weight: 800; }
label > span em { color: #7f9198; font-style: normal; font-weight: 500; }
input, select, textarea { min-height: 49px; width: 100%; padding: 11px 13px; border: 1px solid #c9d6d9; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; }
textarea { min-height: 104px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 118, 101, 0.13); }

.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 850; transition: transform 180ms ease, box-shadow 180ms ease; }
.button:hover { box-shadow: 0 10px 25px rgba(7, 31, 46, 0.14); transform: translateY(-2px); }
.button-primary { color: var(--navy); background: var(--amber); }
.button-dark { color: #fff; background: var(--navy); }
.button-soft { color: var(--navy); border-color: #cbd8db; background: #f6f9f9; }
.auth-card .button { width: 100%; margin-top: 6px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 36px; }
.page-heading > div { max-width: 750px; }
.page-heading h1 { margin: 10px 0 12px; font-size: clamp(39px, 4.4vw, 55px); line-height: 1.05; }
.page-heading .button { flex: 0 0 auto; }

.metric-grid { display: grid; margin-bottom: 24px; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.metric { min-height: 168px; padding: 25px; border: 1px solid #d5e2e4; background: #fff; }
.metric small { display: block; margin-bottom: 20px; color: #5e737b; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.metric strong { display: block; margin-bottom: 7px; color: var(--teal); font-family: Georgia, "Times New Roman", serif; font-size: 42px; font-weight: 500; }
.metric span { color: #70828a; font-size: 13px; }

.panel-card { margin-top: 24px; padding: 30px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.panel-head h2 { margin: 0 0 6px; font-size: 28px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 14px; }
.text-action { flex: 0 0 auto; color: var(--teal); font-size: 14px; font-weight: 850; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.form-full { grid-column: 1 / -1; }
.form-note { margin: 3px 0 4px; padding: 13px 15px; border-left: 3px solid var(--amber); color: #526a73; background: #f7f9f9; font-size: 13px; line-height: 1.55; }

.table-wrap { overflow-x: auto; border: 1px solid #e0e8e9; }
table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
th { padding: 13px 15px; color: #58717a; background: #f6f9f9; font-size: 11px; font-weight: 900; letter-spacing: 0.7px; }
td { padding: 15px; border-top: 1px solid #e4ebed; color: #3b535c; font-size: 14px; vertical-align: top; }
td strong, td small { display: block; }
td strong { color: var(--ink); font-size: 14px; }
td small { margin-top: 3px; color: #71838a; font-size: 12px; }
.status { display: inline-block; padding: 5px 8px; border-radius: 99px; font-size: 11px; font-weight: 850; }
.status-active { color: #086b5c; background: #ddf4ed; }
.status-inactive { color: #6c7172; background: #edf0f0; }
.status-draft { color: #8a5a07; background: #fff0cf; }

.reset-details { min-width: 220px; }
.reset-details summary { color: var(--teal); cursor: pointer; font-size: 13px; font-weight: 850; }
.reset-form { display: grid; margin-top: 12px; gap: 8px; }
.reset-form input { min-height: 40px; font-size: 13px; }
.reset-form .button { min-height: 40px; padding: 8px 11px; font-size: 12px; }

.empty-state { display: grid; min-height: 240px; place-items: center; align-content: center; gap: 10px; text-align: center; }
.empty-state strong, .empty-state h2 { margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.empty-state span, .empty-state p { max-width: 570px; margin: 0; color: var(--muted); line-height: 1.65; }
.empty-state .button { margin-top: 10px; }

.supplier-heading { align-items: center; }
.account-badge { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #b8dfd4; border-radius: 99px; color: #076757; background: #e6f7f1; font-size: 13px; font-weight: 800; }
.supplier-summary { display: grid; margin-bottom: 24px; grid-template-columns: 1.4fr 1fr 1fr; border: 1px solid #d6e2e4; background: #fff; }
.supplier-summary article { min-height: 109px; padding: 21px 24px; border-right: 1px solid #dfe8ea; }
.supplier-summary article:last-child { border: 0; }
.supplier-summary small { display: block; margin-bottom: 9px; color: #5b747d; font-size: 11px; font-weight: 900; letter-spacing: 0.8px; }
.supplier-summary strong { color: var(--ink); font-size: 16px; }
.supplier-empty { min-height: 350px; }
.empty-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 18px; color: var(--teal); background: var(--teal-soft); font-size: 29px; }
.info-note { display: grid; margin-top: 20px; padding: 18px 20px; border-left: 3px solid var(--amber); background: #fff; gap: 4px; }
.info-note strong { color: var(--ink); font-size: 14px; }
.info-note span { color: var(--muted); font-size: 13px; line-height: 1.6; }

.statement-create { scroll-margin-top: 20px; }
.statement-form { display: grid; gap: 28px; }
.field-help { display: block; margin-top: -2px; color: #71838a; font-size: 11px; font-weight: 500; line-height: 1.45; }
.periodic-board { overflow: hidden; border: 1px solid #d8e3e6; border-radius: 15px; background: #f7faf9; }
.periodic-board[aria-busy="true"] { opacity: 0.75; }
.periodic-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 27px 20px; border-bottom: 1px solid #dce6e8; background: #fff; }
.periodic-board-head .eyebrow { margin-bottom: 5px; }
.periodic-board-head h3 { margin: 0 0 5px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; letter-spacing: -0.7px; }
.periodic-board-head p { max-width: 620px; margin: 0; color: #63777f; font-size: 13px; line-height: 1.55; }
.periodic-board-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.periodic-board-actions button { min-height: 37px; padding: 8px 11px; border: 1px solid #cedbdd; border-radius: 8px; color: #254651; background: #fff; font: inherit; font-size: 12px; font-weight: 800; transition: 160ms ease; }
.periodic-board-actions button:hover { border-color: var(--teal); color: var(--teal); background: #edf8f5; }
.workday-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 13px 27px; border-bottom: 1px solid #e0e8ea; background: #f3f7f7; }
.workday-summary > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.workday-summary > span strong { font-size: 13px; }
.workday-summary .worked-summary { color: #076454; background: #dcf3eb; }
.workday-summary .trip-summary { color: #1f5063; background: #e1eff3; }
.workday-summary .off-summary { color: #865117; background: #fff0da; }
.workday-summary .holiday-summary { color: #982e32; background: #fde4e4; }
.workday-summary > small { margin-left: auto; color: #62777f; font-size: 12px; }
.periodic-scroll { overflow-x: auto; padding: 18px 20px 12px; -webkit-overflow-scrolling: touch; }
.periodic-grid { display: grid !important; grid-template-columns: none !important; grid-template-rows: 98px; grid-auto-flow: column; grid-auto-columns: 64px; align-items: start; gap: 8px; width: max-content; min-width: 100%; }
label.period-day { position: relative; display: block !important; width: 64px !important; margin-bottom: 0; gap: 0; user-select: none; }
.period-day-box { position: relative; display: grid; width: 64px; height: 67px; place-content: center; border: 1px solid #b9d8ca; border-bottom: 0; border-radius: 10px 10px 0 0; background: #e5f5ed; text-align: center; transition: transform .16s ease, box-shadow .16s ease; }
.period-day:hover .period-day-box { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(10, 48, 53, .13); }
.period-day-box b { color: #075f50; font-size: 21px; font-weight: 850; line-height: 1; }
.period-day-box small { display: block; margin-top: 4px; color: #3b796b; font-size: 10px; font-weight: 750; line-height: 1; }
.period-day select { min-height: 31px; width: 64px !important; padding: 0 4px; border: 1px solid #b9d8ca; border-radius: 0 0 10px 10px; color: #075f50; background: #f8fffb; text-align: center; font-size: 13px; font-weight: 850; }
.period-day.is-off .period-day-box { border-color: #efd095; background: #fff2de; }
.period-day.is-off .period-day-box b, .period-day.is-off .period-day-box small { color: #925414; }
.period-day.is-off select { border-color: #efd095; color: #87511a; background: #fffaf1; }
.period-day.is-holiday .period-day-box { border-color: #dd8787; background: #fde8e8; }
.period-day.is-holiday .period-day-box b, .period-day.is-holiday .period-day-box small { color: #a32d33; }
.period-day.is-holiday select { border-color: #dd8787; color: #a32d33; background: #fff7f7; }
.period-day select:disabled { cursor: not-allowed; opacity: 1; }
.period-day-box i { position: absolute; top: 5px; right: 5px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #fff; background: #bd373c; font-size: 12px; font-style: normal; font-weight: 900; }
.periodic-legend { display: flex; flex-wrap: wrap; gap: 12px 19px; padding: 0 27px 21px; color: #62767e; font-size: 12px; }
.periodic-legend span { display: inline-flex; align-items: center; gap: 6px; }
.periodic-legend span::before { width: 10px; height: 10px; border-radius: 3px; background: #2f9665; content: ""; }
.periodic-legend .legend-off::before { background: #e2a04a; }
.periodic-legend .legend-holiday::before { background: #d45555; }
.statement-settings { margin-top: 0; }
.statement-editor { display: grid; gap: 24px; }
.statement-editor .panel-card { margin-top: 0; }
.statement-heading { align-items: flex-end; }
.statement-heading .back-link { margin-bottom: 17px; }
.ledger-card { padding: 0; overflow: hidden; }
.ledger-card .panel-head { padding: 29px 30px 0; }
.ledger-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.ledger-table { min-width: 1100px; border-collapse: separate; border-spacing: 0; }
.ledger-table th, .ledger-table td { min-width: 34px; padding: 9px 5px; border-right: 1px solid #e1e8ea; border-bottom: 1px solid #e1e8ea; vertical-align: middle; text-align: center; white-space: nowrap; }
.ledger-table th { position: relative; color: #fff; background: #254e71; font-size: 10px; letter-spacing: 0; }
.ledger-table th:first-child, .ledger-table td:first-child { position: sticky; z-index: 2; left: 0; min-width: 160px; max-width: 205px; padding-right: 14px; padding-left: 14px; text-align: left; }
.ledger-table th:first-child { z-index: 4; background: #254e71; }
.ledger-table th:nth-child(2), .ledger-table td:nth-child(2) { min-width: 82px; text-align: left; }
.ledger-table th:nth-child(3), .ledger-table td:nth-child(3) { min-width: 42px; }
.ledger-table td { color: #253c48; background: #fff; font-size: 12px; }
.ledger-table td:first-child { background: #fff; font-weight: 800; }
.ledger-table th b, .ledger-table th small { display: block; line-height: 1.1; }
.ledger-table th b { font-size: 12px; }
.ledger-table th small { margin-top: 3px; color: #b9d1df; font-size: 9px; font-weight: 700; }
.ledger-table th i { position: absolute; top: 3px; right: 5px; display: grid; width: 12px; height: 12px; place-items: center; border-radius: 50%; color: #fff; background: #bd3a3a; font-size: 9px; font-style: normal; }
.ledger-table td select { min-height: 30px; min-width: 28px; width: 29px; padding: 1px; border: 0; border-radius: 4px; color: #075b50; background: #e6f5f1; text-align: center; font-size: 12px; font-weight: 850; }
.ledger-table td select:focus { box-shadow: 0 0 0 2px rgba(8, 118, 101, 0.25); }
.ledger-table .holiday-head { color: #fff5f5; background: #a8393d; }
.ledger-table .holiday-cell { color: #a92f34; background: #fff0f0; font-weight: 900; }
.ledger-table .holiday-cell select { color: #a92f34; background: #ffe0e0; }
.ledger-readonly td { min-width: 32px; padding: 11px 5px; font-weight: 800; }
.ledger-readonly td:not(:first-child):not(:nth-child(2)) { color: #087665; }
.ledger-readonly .holiday-cell { color: #a92f34 !important; }
.ledger-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 15px 30px 18px; border-top: 1px solid #e3eaec; color: #60747c; font-size: 12px; }
.ledger-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ledger-legend i { display: inline-grid; width: 20px; height: 20px; place-items: center; border-radius: 4px; font-size: 11px; font-style: normal; font-weight: 900; }
.legend-work { color: #076556; background: #e3f4ee; }
.legend-empty { color: #65777e; background: #edf1f1; }
.legend-holiday { color: #fff; background: #ad3439; }
.calculation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.calculation-grid article { min-height: 132px; padding: 22px; border: 1px solid #d8e4e6; background: #fff; }
.calculation-grid small { display: block; margin-bottom: 12px; color: #5b737c; font-size: 11px; font-weight: 900; letter-spacing: 0.8px; }
.calculation-grid strong { display: block; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 500; letter-spacing: -1px; }
.calculation-grid span { color: #708087; font-size: 12px; }
.calculation-grid .calculation-featured { border-color: #113e52; color: #fff; background: linear-gradient(135deg, #123e53, #092334); }
.calculation-grid .calculation-featured small, .calculation-grid .calculation-featured span { color: #b8d0d7; }
.calculation-grid .calculation-featured strong { color: #fff; }
.statement-actions { display: flex; justify-content: flex-end; gap: 12px; }
.statement-document { border: 1px solid #d8e2e4; background: #fff; box-shadow: var(--shadow); }
.statement-document-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding: 31px 32px 25px; border-bottom: 1px solid #e0e7e9; }
.statement-document-head h2 { margin: 7px 0; font-size: 31px; }
.statement-document-head p { margin: 3px 0; color: #5d727a; font-size: 13px; }
.statement-document-head > div:last-child { display: grid; min-width: 135px; grid-template-columns: 1fr; gap: 3px; text-align: right; }
.statement-document-head small { margin-top: 8px; color: #667d85; font-size: 10px; font-weight: 900; letter-spacing: 0.7px; }
.statement-document-head strong { font-size: 14px; }
.statement-document .ledger-legend { padding-right: 32px; padding-left: 32px; }
.document-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #dbe4e6; border-bottom: 1px solid #dbe4e6; }
.document-meta div { min-height: 78px; padding: 16px 21px; border-right: 1px solid #dbe4e6; }
.document-meta div:last-child { border-right: 0; }
.document-meta span { display: block; margin-bottom: 5px; color: #687f86; font-size: 10px; font-weight: 900; letter-spacing: 0.6px; }
.document-meta strong { color: var(--ink); font-size: 14px; }
.invoice-summary { display: grid; margin: 28px 32px; margin-left: auto; width: min(100% - 64px, 490px); border: 1px solid #d4e0e2; }
.invoice-summary div { display: flex; min-height: 47px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 15px; border-bottom: 1px solid #dbe4e6; }
.invoice-summary div:last-child { border-bottom: 0; }
.invoice-summary span { color: #46606a; font-size: 13px; }
.invoice-summary strong { color: #182f3a; font-size: 14px; }
.invoice-summary .invoice-total { color: #fff; background: #1c5871; }
.invoice-summary .invoice-total span, .invoice-summary .invoice-total strong { color: #fff; font-weight: 900; }
.invoice-guidance { display: grid; margin: 0 32px 32px; padding: 17px 18px; border-left: 3px solid var(--amber); background: #f8faf9; gap: 4px; }
.invoice-guidance strong { font-size: 14px; }
.invoice-guidance span { color: #63747b; font-size: 13px; line-height: 1.6; }

.supplier-sheet { box-shadow: 0 18px 42px rgba(21, 49, 60, 0.1); break-inside: avoid-page; }
.supplier-sheet-head { display: grid; grid-template-columns: minmax(145px, .8fr) minmax(170px, 1fr) minmax(220px, 1.35fr); align-items: center; gap: 24px; padding: 27px 32px 23px; border-bottom: 1px solid #dbe5e8; }
.sheet-brand { display: grid; justify-items: start; gap: 7px; color: #1a4565; font-size: 10px; font-weight: 900; letter-spacing: 1.2px; }
.sheet-brand img { width: 146px; height: auto; max-height: 45px; object-fit: contain; object-position: left center; }
.sheet-title { display: grid; justify-items: center; gap: 5px; text-align: center; }
.sheet-title span, .supplier-breakdown-head span { color: #1c3f5a; font-size: 12px; font-weight: 900; letter-spacing: .7px; }
.sheet-title strong { color: #132e42; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 600; }
.sheet-supplier { display: grid; justify-items: end; gap: 3px; text-align: right; }
.sheet-supplier strong { color: #162d3d; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.08; text-transform: uppercase; }
.sheet-supplier span { color: #516c77; font-size: 12px; }
.sheet-invoice-party { display: grid; grid-template-columns: 2.2fr 1.35fr 1.15fr .75fr; border-bottom: 1px solid #dbe5e8; background: #f7fafb; }
.sheet-invoice-party > div { min-width: 0; padding: 13px 16px; border-right: 1px solid #dbe5e8; }
.sheet-invoice-party > div:last-child { border-right: 0; }
.sheet-invoice-party small { display: block; margin-bottom: 4px; color: #587582; font-size: 9px; font-weight: 900; letter-spacing: .65px; text-transform: uppercase; }
.sheet-invoice-party strong { display: block; color: #18374b; font-size: 12px; line-height: 1.45; }
.sheet-invoice-party .invoice-party-company strong { color: #123b58; font-size: 13px; font-weight: 900; }
.supplier-sheet-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-bottom: 1px solid #dbe5e8; }
.supplier-sheet-meta > div { min-width: 0; padding: 12px 16px; border-right: 1px solid #dbe5e8; }
.supplier-sheet-meta > div:last-child { border-right: 0; }
.supplier-sheet-meta small { display: block; margin-bottom: 3px; color: #617983; font-size: 9px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; }
.supplier-sheet-meta strong { display: block; overflow-wrap: anywhere; color: #1d394b; font-size: 12px; }
.supplier-ledger .ledger-band th { position: static; min-width: 0; max-width: none; padding: 8px 5px; color: #fff; background: #5a91d5; text-align: center; font-size: 10px; letter-spacing: .8px; }
.supplier-ledger .ledger-band th:first-child { position: static; min-width: 0; max-width: none; padding-right: 5px; padding-left: 5px; text-align: center; }
.supplier-sheet .ledger-readonly td.worked-cell { color: #087665 !important; background: #edf8f4; }
.supplier-sheet .ledger-readonly td.holiday-cell { background: #fff0f0; }
.supplier-financial-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .82fr); gap: 26px; align-items: start; padding: 28px 32px; }
.supplier-breakdown { border: 1px solid #d5e0e3; }
.supplier-breakdown-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 15px; color: #fff; background: #5a91d5; }
.supplier-breakdown-head span, .supplier-breakdown-head strong { color: #fff; }
.supplier-breakdown-head strong { font-size: 12px; }
.supplier-breakdown dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.supplier-breakdown dl > div { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 13px; padding: 9px 14px; border-right: 1px solid #dce6e8; border-bottom: 1px solid #dce6e8; }
.supplier-breakdown dl > div:nth-child(even) { border-right: 0; }
.supplier-breakdown dl > div:nth-last-child(-n + 2) { border-bottom: 0; }
.supplier-breakdown dt { color: #546e78; font-size: 12px; }
.supplier-breakdown dd { margin: 0; color: #1a3445; font-size: 12px; font-weight: 900; white-space: nowrap; }
.supplier-breakdown .breakdown-total { color: #fff; background: #254e71; }
.supplier-breakdown .breakdown-total dt, .supplier-breakdown .breakdown-total dd { color: #fff; }
.supplier-sheet .invoice-summary { width: 100%; margin: 0; align-self: stretch; }
.supplier-sheet .invoice-summary-sheet { border-color: #cfdde1; }
.invoice-notices { display: grid; gap: 7px; margin: 0 32px 32px; color: #425d69; }
.invoice-notices p { margin: 0; font-size: 12px; line-height: 1.55; }
.invoice-notices b { margin-right: 4px; color: #1a4565; }
.invoice-notices a { color: #0b5875; font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.pdf-action-row { margin: 0 0 20px; }

@media (max-width: 850px) {
  .auth-layout { grid-template-columns: 1fr; gap: 38px; }
  .auth-copy { max-width: 640px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: 1 / -1; }
  .supplier-summary { grid-template-columns: 1fr 1fr; }
  .supplier-summary article:last-child { grid-column: 1 / -1; border-top: 1px solid #dfe8ea; }
  .calculation-grid { grid-template-columns: 1fr 1fr; }
  .calculation-grid .calculation-featured { grid-column: 1 / -1; }
  .document-meta { grid-template-columns: 1fr 1fr; }
  .document-meta div:nth-child(2) { border-right: 0; }
  .document-meta div:nth-child(n + 3) { border-top: 1px solid #dbe4e6; }
  .periodic-board-head { align-items: flex-start; flex-direction: column; }
  .periodic-board-actions { justify-content: flex-start; }
  .supplier-sheet-head { grid-template-columns: 1fr 1fr; }
  .sheet-title { order: 3; grid-column: 1 / -1; padding-top: 2px; }
  .sheet-invoice-party { grid-template-columns: 1.4fr 1fr; }
  .sheet-invoice-party > div:nth-child(2) { border-right: 0; }
  .sheet-invoice-party > div:nth-child(n + 3) { border-top: 1px solid #dbe5e8; }
  .supplier-sheet-meta { grid-template-columns: repeat(3, 1fr); }
  .supplier-sheet-meta > div:nth-child(3) { border-right: 0; }
  .supplier-sheet-meta > div:nth-child(n + 4) { border-top: 1px solid #dbe5e8; }
  .supplier-financial-layout { grid-template-columns: 1fr; }
}

@media (min-width: 621px) and (max-width: 980px) {
  .portal-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .portal-nav { flex-wrap: wrap; gap: 10px 18px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .portal-header { min-height: 72px; padding: 12px 14px; }
  .portal-brand img { width: 145px; }
  .portal-nav { gap: 13px; font-size: 12px; }
  .portal-nav a { display: none; }
  .portal-shell { width: min(calc(100% - 28px), 1200px); padding: 34px 0 48px; }
  .auth-intro { padding-top: 12px; margin-bottom: 28px; }
  .auth-intro h1, .auth-copy h1 { font-size: 39px; }
  .auth-intro p, .auth-copy p, .page-heading p { font-size: 16px; }
  .role-cards { grid-template-columns: 1fr; }
  .role-card { min-height: 270px; padding: 28px; }
  .role-icon { margin-bottom: 31px; }
  .auth-layout { margin-top: 12px; }
  .back-link { margin-bottom: 28px; }
  .auth-card, .panel-card { padding: 22px; }
  .auth-card h2 { font-size: 27px; }
  input, select, textarea { min-height: 50px; font-size: 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .page-heading h1 { font-size: 39px; }
  .metric-grid { grid-template-columns: 1fr; gap: 12px; }
  .metric:last-child { grid-column: auto; }
  .metric { min-height: 133px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: auto; }
  .supplier-summary { grid-template-columns: 1fr; }
  .supplier-summary article, .supplier-summary article:last-child { min-height: auto; border-right: 0; border-bottom: 1px solid #dfe8ea; }
  .supplier-summary article:last-child { border-bottom: 0; }
  .account-badge { margin-top: -8px; }
  .statement-heading .back-link { margin-bottom: 15px; }
  .periodic-board-head { padding: 21px 22px 17px; }
  .periodic-board-head h3 { font-size: 23px; }
  .periodic-board-actions { width: 100%; }
  .periodic-board-actions button { flex: 1 1 130px; }
  .workday-summary { padding: 12px 22px; }
  .workday-summary > small { width: 100%; margin-left: 0; }
  .periodic-scroll { padding: 16px 16px 10px; }
  .periodic-legend { padding: 0 22px 19px; }
  .ledger-card .panel-head { padding: 22px 22px 0; }
  .ledger-legend { padding: 14px 22px; }
  .calculation-grid { grid-template-columns: 1fr; gap: 12px; }
  .calculation-grid .calculation-featured { grid-column: auto; }
  .statement-actions { align-items: stretch; flex-direction: column; }
  .statement-actions .button { width: 100%; }
  .statement-document-head { align-items: flex-start; flex-direction: column; padding: 24px 22px; gap: 12px; }
  .statement-document-head > div:last-child { width: 100%; grid-template-columns: auto auto; text-align: left; }
  .statement-document-head > div:last-child small { margin-top: 0; }
  .document-meta { grid-template-columns: 1fr; }
  .document-meta div, .document-meta div:nth-child(2) { border-right: 0; border-top: 1px solid #dbe4e6; }
  .document-meta div:first-child { border-top: 0; }
  .invoice-summary { width: calc(100% - 44px); margin: 22px; }
  .invoice-guidance { margin: 0 22px 22px; }
  .supplier-sheet-head { grid-template-columns: 1fr; padding: 22px; gap: 16px; }
  .sheet-brand, .sheet-title, .sheet-supplier { justify-items: start; text-align: left; }
  .sheet-title { grid-column: auto; order: initial; }
  .sheet-invoice-party { grid-template-columns: 1fr; }
  .sheet-invoice-party > div, .sheet-invoice-party > div:nth-child(2) { border-right: 0; border-top: 1px solid #dbe5e8; }
  .sheet-invoice-party > div:first-child { border-top: 0; }
  .supplier-sheet-meta { grid-template-columns: 1fr; }
  .supplier-sheet-meta > div, .supplier-sheet-meta > div:nth-child(3) { border-right: 0; border-top: 1px solid #dbe5e8; }
  .supplier-sheet-meta > div:first-child { border-top: 0; }
  .supplier-financial-layout { padding: 22px; gap: 18px; }
  .supplier-breakdown dl { grid-template-columns: 1fr; }
  .supplier-breakdown dl > div, .supplier-breakdown dl > div:nth-child(even) { border-right: 0; border-bottom: 1px solid #dce6e8; }
  .supplier-breakdown dl > div:last-child { border-bottom: 0; }
  .supplier-sheet .invoice-summary { width: 100%; margin: 0; }
  .invoice-notices { margin: 0 22px 22px; }
}

.iban-feedback { display: block; min-height: 18px; margin-top: 6px; color: #62777f; font-size: 11px; line-height: 1.35; }
input.iban-valid { border-color: #18816d; background: #f3fbf8; }
input.iban-invalid { border-color: #bc3e43; background: #fff7f6; }
.iban-feedback.is-valid { color: #08735f; }
.iban-feedback.is-invalid { color: #a32d33; }

.document-heading { align-items: center; }
.page-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.document-count-badge { flex: 0 0 auto; padding: 10px 13px; border: 1px solid #b8dfd4; border-radius: 99px; color: #076757; background: #e6f7f1; font-size: 13px; font-weight: 850; }
.document-upload-panel { overflow: hidden; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.document-card { display: flex; min-height: 267px; flex-direction: column; padding: 17px; border: 1px solid #dbe5e7; border-radius: 12px; background: #fff; }
.document-card.has-document { border-color: #beded4; background: #fcfffe; }
.document-card.is-missing { border-color: #ebd6a8; background: #fffdf9; }
.document-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.document-card-head > div { display: flex; min-width: 0; align-items: center; gap: 9px; }
.document-card h2 { margin: 0; color: var(--ink); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; font-size: 15px; font-weight: 850; letter-spacing: 0; line-height: 1.35; }
.document-index { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #0d6659; background: #e3f5ee; font-size: 11px; font-weight: 900; }
.status-pending { color: #8b5c0c; background: #fff0cf; }
.status-approved { color: #086b5c; background: #ddf4ed; }
.status-reupload { color: #a82d34; background: #ffe4e4; }
.status-missing { color: #925414; background: #fff0da; }
.document-current { display: grid; margin: 16px 0 10px; gap: 3px; color: #56707a; font-size: 12px; line-height: 1.45; }
.document-current strong { overflow-wrap: anywhere; color: #263e4a; font-size: 12px; }
.document-current .text-action { margin-top: 4px; font-size: 12px; }
.document-missing-copy { color: #8a6d3e; }
.document-note { margin: 0 0 10px; padding: 9px 10px; border-left: 3px solid #d45555; color: #7d3a3e; background: #fff3f3; font-size: 12px; line-height: 1.45; }
.document-file-field { margin-top: auto; margin-bottom: 0; }
.document-file-field input[type="file"] { min-height: auto; padding: 9px 8px; border-style: dashed; font-size: 12px; }
.document-file-field input[type="file"]::file-selector-button { margin-right: 9px; padding: 6px 8px; border: 0; border-radius: 5px; color: #174c5b; background: #e7f1f2; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.supplier-document-summary .panel-head { margin-bottom: 15px; }
.supplier-document-summary .panel-head h2 { margin-top: 4px; }
.document-progress { height: 8px; overflow: hidden; border-radius: 99px; background: #e6eeef; }
.document-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b7665, #3ea58f); }
.document-progress .progress-0 { width: 0; }.document-progress .progress-1 { width: 11.11%; }.document-progress .progress-2 { width: 22.22%; }.document-progress .progress-3 { width: 33.33%; }.document-progress .progress-4 { width: 44.44%; }.document-progress .progress-5 { width: 55.55%; }.document-progress .progress-6 { width: 66.66%; }.document-progress .progress-7 { width: 77.77%; }.document-progress .progress-8 { width: 88.88%; }.document-progress .progress-9 { width: 100%; }
.document-metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.document-metric-grid article { min-height: 142px; padding: 22px 24px; border: 1px solid #d7e3e5; background: #fff; }
.document-metric-grid small { display: block; margin-bottom: 15px; color: #5e747c; font-size: 11px; font-weight: 900; letter-spacing: .9px; }
.document-metric-grid strong { display: block; margin-bottom: 5px; color: var(--teal); font-family: Georgia, "Times New Roman", serif; font-size: 35px; font-weight: 500; }
.document-metric-grid span { color: #70828a; font-size: 13px; }
.document-admin-table { min-width: 1070px; }
.document-admin-table td:nth-child(1) { width: 17%; }.document-admin-table td:nth-child(2) { width: 12%; }.document-admin-table td:nth-child(3) { width: 25%; }.document-admin-table td:nth-child(4) { width: 20%; }.document-admin-table td:nth-child(5) { width: 26%; }
.document-admin-table .text-action { display: inline-block; margin-top: 7px; font-size: 12px; }
.document-review { min-width: 216px; }
.document-review summary { color: var(--teal); cursor: pointer; font-size: 13px; font-weight: 850; }
.document-review-form { display: grid; margin-top: 12px; gap: 8px; }
.document-review-form label { margin: 0; }
.document-review-form select, .document-review-form textarea { min-height: 39px; font-size: 13px; }
.document-review-form textarea { min-height: 72px; }
.document-review-form .button { min-height: 40px; padding: 8px 11px; font-size: 12px; }

@media (max-width: 850px) {
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .document-metric-grid, .document-grid { grid-template-columns: 1fr; gap: 12px; }
  .document-card { min-height: 0; }
  .document-count-badge { margin-top: -8px; }
  .page-heading-actions { width: 100%; align-items: flex-start; flex-direction: column; }
}

@media print {
  @page { size: A3 landscape; margin: 8mm; }
  body { background: #fff; }
  .portal-header, .portal-footer, .page-heading, .ledger-legend, .info-note, .no-print { display: none !important; }
  .portal-shell { width: 100%; padding: 0; }
  .statement-document { border: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ledger-scroll { overflow: visible; }
  .ledger-table { min-width: 0; font-size: 8px; }
  .ledger-table th, .ledger-table td { min-width: 20px; padding: 4px 2px; }
  .ledger-table th:first-child, .ledger-table td:first-child { position: static; min-width: 90px; }
  .supplier-sheet-head { padding: 12px 0 10px; gap: 14px; }
  .sheet-brand img { width: 118px; max-height: 34px; }
  .sheet-title strong { font-size: 15px; }
  .sheet-supplier strong { font-size: 13px; }
  .sheet-invoice-party > div, .supplier-sheet-meta > div { padding: 7px 9px; }
  .sheet-invoice-party strong, .supplier-sheet-meta strong { font-size: 9px; }
  .supplier-financial-layout { gap: 14px; padding: 14px 0; break-inside: avoid; }
  .supplier-breakdown dl > div { min-height: 31px; padding: 5px 8px; }
  .supplier-breakdown dt, .supplier-breakdown dd, .invoice-summary span, .invoice-summary strong { font-size: 10px; }
  .invoice-guidance, .invoice-notices { margin-right: 0; margin-left: 0; }
  .invoice-guidance { margin-bottom: 12px; padding: 10px 12px; }
  .invoice-notices { margin-bottom: 0; gap: 4px; }
  .invoice-notices p { font-size: 9px; }
  .supplier-sheet-head, .sheet-invoice-party, .supplier-sheet-meta, .ledger-scroll, .invoice-guidance, .invoice-notices { break-inside: avoid; }
}
