:root {
  --ink: #253746;
  --muted: #647a8b;
  --paper: #ffffff;
  --canvas: #f3f6f8;
  --line: #d6dfe5;
  --brand: #00659d;
  --brand-dark: #004f7c;
  --brand-soft: #e6f2f8;
  --success: #007a5a;
  --success-soft: #e3f3ee;
  --warning: #8a5a00;
  --warning-soft: #fff3d6;
  --danger: #b13a3a;
  --danger-soft: #f9e8e8;
  --radius: 8px;
  --shadow-soft: 0 8px 24px rgba(37, 55, 70, 0.09);
  --shadow: 0 18px 48px rgba(17, 30, 39, 0.18);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Aptos", "Trebuchet MS", sans-serif; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Aptos Display", "Franklin Gothic Medium", sans-serif; letter-spacing: 0; line-height: 1.15; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 2.5rem, 2.5rem); }
h2 { margin-bottom: 6px; font-size: 1.25rem; }
small, .muted { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; padding: 18px; background: linear-gradient(rgba(243, 246, 248, 0.9), rgba(243, 246, 248, 0.96)), url("../img/auth-background.ec45beb1b1c3.jpg") center / cover fixed no-repeat; }
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden; color: white; background: rgba(0, 79, 124, 0.97); border: 1px solid rgba(255, 255, 255, 0.32); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.sidebar-brand { min-height: 108px; display: grid; justify-items: center; gap: 8px; padding: 16px 20px; text-align: center; background: white; border-bottom: 4px solid var(--brand); }
.sidebar-brand span { width: 100%; color: var(--muted); font-size: 0.78rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.brand-logo { display: block; width: min(270px, 100%); height: auto; object-fit: contain; }
.brand-logo-small { width: 190px; margin-inline: auto; }
.supplier-summary { display: grid; gap: 2px; margin: 18px 14px 8px; padding: 14px; background: rgba(0, 101, 157, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius); }
.supplier-summary span, .supplier-summary small { color: #d5e5ee; font-size: 0.75rem; }
.main-nav { display: grid; gap: 2px; padding: 10px 12px; overflow-y: auto; }
.main-nav a { padding: 9px 12px; color: #e6f2f8; text-decoration: none; border: 1px solid transparent; border-radius: 6px; transition: color 150ms ease, background 150ms ease, transform 150ms ease; }
.main-nav a:hover, .main-nav a:focus-visible { background: rgba(0, 101, 157, 0.78); transform: translateX(2px); }
.main-nav a[aria-current="page"] { color: var(--brand-dark); background: white; border-color: rgba(255, 255, 255, 0.72); box-shadow: 0 4px 14px rgba(17, 30, 39, 0.16); font-weight: 700; }
.nav-section { margin: 18px 12px 4px; color: #b9d3e1; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.sidebar-footer { margin: auto 14px 14px; padding: 16px; background: rgba(0, 63, 99, 0.45); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius); }
.sidebar-footer > span { display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-button { padding: 0; color: white; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - 36px); overflow: hidden; background: rgba(243, 246, 248, 0.92); border: 1px solid rgba(255, 255, 255, 0.8); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 16px; padding: 12px 32px; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--line); }
.supplier-switcher { display: flex; align-items: center; gap: 8px; }
.supplier-switcher label { color: var(--muted); font-size: 0.82rem; }
.supplier-switcher select { height: 34px; min-height: 34px; padding: 4px 9px; font-size: 0.82rem; }
.language-switcher { height: 34px; display: inline-flex; overflow: hidden; border: 1px solid #91a2ae; border-radius: 6px; }
.language-switcher button { min-width: 38px; height: 32px; padding: 4px 8px; color: var(--muted); background: var(--paper); border: 0; cursor: pointer; font-size: 0.76rem; font-weight: 800; }
.language-switcher button + button { border-left: 1px solid #91a2ae; }
.language-switcher button[aria-current="true"] { color: white; background: var(--brand-dark); }
.button.help-button { height: 34px; min-height: 34px; gap: 6px; padding: 4px 10px; font-size: 0.78rem; }
.help-button > span { width: 18px; height: 18px; display: inline-grid; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: 0.72rem; font-weight: 800; }
.help-button[aria-current="page"] { color: white; background: var(--brand-dark); border-color: var(--brand-dark); }
.menu-button { display: none; }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 38px 42px 56px; flex: 1; }
.app-footer { padding: 18px 42px; color: var(--muted); background: rgba(255, 255, 255, 0.72); border-top: 1px solid var(--line); font-size: 0.78rem; }
.eyebrow { margin-bottom: 5px; color: var(--brand); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-bottom: 24px; padding: 24px 26px; background: rgba(255, 255, 255, 0.78); border: 1px solid rgba(214, 223, 229, 0.88); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.page-header > div:first-child { max-width: 760px; }
.page-header p:last-child { color: var(--muted); margin-bottom: 0; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px; font-weight: 750; text-decoration: none; cursor: pointer; transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.button-primary { color: white; background: var(--brand); border-color: var(--brand); }
.button-primary:hover, .button-primary:focus-visible { background: var(--brand-dark); box-shadow: 0 6px 16px rgba(0, 79, 124, 0.22); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: var(--paper); border-color: #91a2ae; }
.button-secondary:hover, .button-secondary:focus-visible { border-color: var(--brand); color: var(--brand-dark); }
.button-wide { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.chatbot-launcher { position: fixed; right: 26px; bottom: 24px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 14px 8px 9px; color: white; background: var(--brand-dark); border: 2px solid white; border-radius: 24px; box-shadow: var(--shadow); cursor: pointer; }
.chatbot-launcher span { width: 27px; height: 27px; display: grid; place-items: center; color: var(--brand-dark); background: white; border-radius: 50%; font-weight: 900; }
.chatbot-panel { position: fixed; right: 26px; bottom: 82px; z-index: 29; width: min(410px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 110px)); display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto auto; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chatbot-panel[hidden] { display: none; }
.chatbot-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px; color: white; background: var(--brand-dark); }
.chatbot-header .eyebrow { color: #b9dff3; }
.chatbot-header h2 { margin-bottom: 4px; font-size: 1.1rem; }
.chatbot-header small { color: #d7e7ef; }
.chatbot-close { color: white; background: transparent; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.chatbot-context { padding: 9px 18px; color: var(--muted); background: var(--brand-soft); border-bottom: 1px solid var(--line); font-size: .78rem; }
.chatbot-messages { display: flex; flex-direction: column; gap: 10px; min-height: 200px; padding: 16px; overflow-y: auto; background: #f8fbfd; }
.chatbot-message { max-width: 88%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; white-space: pre-line; }
.chatbot-message-assistant { align-self: flex-start; background: white; }
.chatbot-message-user { align-self: flex-end; color: white; background: var(--brand); border-color: var(--brand); }
.chatbot-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.chatbot-actions .button { min-height: 32px; padding: 5px 9px; font-size: .78rem; }
.chatbot-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); }
.chatbot-suggestions button { padding: 6px 9px; color: var(--brand-dark); background: white; border: 1px solid #9bc8df; border-radius: 5px; font-size: .76rem; cursor: pointer; }
.chatbot-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px 16px; background: white; border-top: 1px solid var(--line); }
.chatbot-form input { min-height: 40px; }
.chatbot-form button { min-width: 70px; color: white; background: var(--brand); border: 1px solid var(--brand); border-radius: 6px; cursor: pointer; }
.button-compact { min-height: 34px; padding: 5px 12px; font-size: 0.84rem; }
:focus-visible { outline: 3px solid #68b3dc; outline-offset: 2px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { position: relative; min-height: 130px; display: grid; align-content: space-between; overflow: hidden; padding: 20px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.metric::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--brand); }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-family: "Aptos Display", sans-serif; font-size: 1.7rem; }
.action-band, .submit-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 26px 0; padding: 28px; color: white; background: var(--brand-dark); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.action-band h2, .action-band p, .submit-band h2 { margin-bottom: 4px; }
.action-band .eyebrow, .submit-band .eyebrow { color: #b9dff3; }
.action-band-neutral { color: var(--ink); background: var(--brand-soft); border-color: #b9d9e9; }
.action-band-neutral .eyebrow { color: var(--brand); }
.section-block { margin: 22px 0; padding: 24px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.personal-header { background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(230,242,248,.92)); }
.personal-overview-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: 22px; align-items: stretch; }
.personal-overview-grid .section-block { margin-top: 0; }
.personal-overview-grid .section-block { display: flex; flex-direction: column; }
.personal-form .form-grid { grid-template-columns: 1fr; }
.active-company-card .section-heading { margin-bottom: 16px; }
.active-company-data { margin-bottom: auto; }
.section-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.edit-contact-button { min-height: 32px; padding: 5px 12px; color: var(--brand-dark); background: var(--brand-soft); border-color: #9bc8df; font-size: .78rem; }
.edit-contact-button:hover, .edit-contact-button:focus-visible { color: white; background: var(--brand); border-color: var(--brand); }
.company-access-table-wrap, .supplier-users-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.company-access-table, .supplier-users-table { min-width: 780px; background: white; }
.company-access-table th, .supplier-users-table th { background: #f1f7fa; }
.company-access-table td, .supplier-users-table td { vertical-align: middle; }
.active-company-row { background: #f7fbfd; box-shadow: inset 4px 0 0 var(--brand); }
.permission-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-chips span { min-height: 24px; display: inline-flex; align-items: center; padding: 3px 8px; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #b9d9e9; border-radius: 999px; font-size: .74rem; font-weight: 800; }
.supplier-users-table td:first-child, .company-access-table td:first-child { min-width: 220px; }
.supplier-users-table small, .company-access-table small { display: block; margin-top: 2px; color: var(--muted); }
.portal-dialog { width: min(720px, calc(100% - 32px)); max-width: none; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 22px 70px rgba(17, 30, 39, .28); }
.portal-dialog::backdrop { background: rgba(37, 55, 70, .42); }
.portal-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #f8fbfd; }
.portal-dialog-header strong { display: block; font-family: "Aptos Display", "Franklin Gothic Medium", sans-serif; font-size: 1.2rem; }
.dialog-close-button { width: 34px; height: 34px; min-height: 34px; display: inline-grid; place-items: center; padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 6px; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.dialog-close-button:hover, .dialog-close-button:focus-visible { color: white; background: var(--brand-dark); border-color: var(--brand-dark); }
.portal-dialog-body { padding: 22px; }
.portal-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.company-access-list, .supplier-user-list { display: grid; gap: 12px; }
.company-access-card, .supplier-user-card { display: grid; gap: 14px; padding: 18px; background: linear-gradient(180deg, #fff, #f8fbfd); border: 1px solid var(--line); border-radius: 8px; }
.company-access-card-active { border-color: #86bfdc; box-shadow: inset 4px 0 0 var(--brand); }
.company-access-main, .supplier-user-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.company-access-main h3 { margin-bottom: 4px; font-size: 1rem; }
.company-access-main p, .supplier-user-main span { margin: 0; color: var(--muted); font-size: .86rem; }
.company-access-badges { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.active-label { color: var(--brand-dark); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.permission-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.permission-list div { min-width: 0; padding: 9px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.permission-list dt { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.permission-list dd { margin: 2px 0 0; font-weight: 750; }
.help-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.help-topics details { padding: 16px 0; border-bottom: 1px solid var(--line); }
.help-topics details p { margin: 10px 0 0; color: var(--muted); }
.capture-actions { display: flex; align-items: center; gap: 12px; }
.capture-preview { max-width: 760px; padding: 10px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.capture-preview img { display: block; width: 100%; height: auto; }
.two-column { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px; }
.issue-thread { display: grid; gap: 12px; margin-bottom: 20px; max-height: 360px; overflow-y: auto; }
.issue-message { padding: 12px 14px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.issue-message p:last-child { margin-bottom: 0; }
.issue-message-staff { background: var(--brand-soft); border-color: #9bc8df; }

.status-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; color: #35443c; background: #e9eeeb; border: 1px solid #c5d0ca; border-radius: 999px; font-size: 0.75rem; font-weight: 800; white-space: nowrap; }
.status-approved, .status-valid, .status-paid { color: var(--success); background: var(--success-soft); border-color: #94c9b9; }
.status-inProgress, .status-submitted, .status-underReview, .status-pending { color: var(--warning); background: var(--warning-soft); border-color: #d8b66c; }
.status-correctionsRequested, .status-rejected, .status-expired, .status-suspended { color: var(--danger); background: var(--danger-soft); border-color: #dfa7a7; }
.status-expiringSoon { color: var(--brand-dark); background: var(--brand-soft); border-color: #9bc8df; }

.progress-summary { min-width: 260px; text-align: right; }
.progress-summary strong { font-size: 1.4rem; }
.progress-track { width: 100%; height: 8px; margin-top: 8px; overflow: hidden; appearance: none; background: #dfe6e2; border: 0; border-radius: 4px; }
.progress-track::-webkit-progress-bar { background: #dfe6e2; }
.progress-track::-webkit-progress-value { background: var(--brand); }
.progress-track::-moz-progress-bar { background: var(--brand); }
.requirement-list { display: grid; gap: 14px; }
.requirement-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 20px; padding: 24px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.requirement-index { color: #92a299; font-family: "Aptos Display", sans-serif; font-size: 1.3rem; font-weight: 800; }
.requirement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.requirement-heading p { color: var(--muted); margin-bottom: 0; font-size: 0.85rem; }
.legal-text { max-height: 230px; padding: 18px; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.legal-text p { white-space: pre-line; }
.inline-confirm { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; }
.inline-confirm label { display: flex; align-items: flex-start; gap: 8px; }
.document-form { display: grid; grid-template-columns: minmax(140px, 0.6fr) minmax(140px, 0.6fr) minmax(220px, 1.4fr) auto; align-items: end; gap: 12px; margin-top: 16px; }
.document-upload-row { display: flex; align-items: end; gap: 12px; margin-top: 16px; }
.document-upload-row .document-form { flex: 1; margin-top: 0; }
.document-not-applicable { margin-top: 14px; color: var(--muted); font-size: 0.86rem; }
.document-not-applicable label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.document-not-applicable input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.document-not-applicable-inline { flex: 0 0 auto; margin: 0; padding-bottom: 10px; white-space: nowrap; }
.registration-document-field { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.registration-document-field > label:first-child, .registration-document-field > .muted, .registration-document-field > .error-text { grid-column: 1 / -1; }
.registration-document-field > .document-not-applicable { margin: 0 0 10px; white-space: nowrap; }
.document-request-submit { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cae-subsection { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.draft-status { min-height: 1.3em; margin: 0; color: var(--muted); font-size: .82rem; text-align: right; }
.cae-people { display: grid; gap: 12px; }
.cae-person-row { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)) auto; align-items: center; gap: 8px; padding: 12px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 6px; }
.cae-person-row input { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 4px; }
@media (max-width: 900px) { .cae-person-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cae-person-row strong, .cae-person-row button { grid-column: 1 / -1; } }
.document-current { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; background: var(--brand-soft); border: 1px solid #b9d9e9; border-radius: 6px; }
.document-current div { display: grid; }
.document-current span { color: var(--muted); font-size: 0.8rem; }

.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .field:last-of-type, .form-actions { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; }
.field label { font-size: 0.84rem; font-weight: 750; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.field-checkbox { display: block; margin-top: 8px; }
.field-checkbox-label { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; }
.field-checkbox-label input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.field-checklist { margin-top: 22px; padding-top: 14px; }
.field-checklist > label { display: block; margin-bottom: 8px; }
.field-checklist > div { display: grid; gap: 8px; }
.field-checklist > div > div { min-height: 30px; }
.field-checklist > div label { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; }
.field-checklist input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.cae-final-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.phone-group { display: flex; gap: 8px; }
.phone-group select { flex: 0 0 130px; }
.phone-group input { flex: 1 1 auto; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: var(--paper); border: 1px solid #9baaa2; border-radius: 6px; transition: border-color 150ms ease, box-shadow 150ms ease; }
input:hover, select:hover, textarea:hover { border-color: var(--brand); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 101, 157, 0.12); }
input:disabled, select:disabled, textarea:disabled { color: #65737d; background: #dfe5e8; border-color: #aebbc2; cursor: not-allowed; opacity: 1; }
input[type="file"]:disabled { color: #697780; background: #cfd8dd; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 18px; min-height: 18px; margin-top: 3px; accent-color: var(--brand); }
input[type="file"] { padding: 7px; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger); }
.error-text, .form-errors { margin: 0; color: var(--danger); font-size: 0.82rem; }
.form-notice { margin: 0 0 16px; padding: 11px 14px; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #b9d9e9; border-radius: 6px; font-size: 0.9rem; }
.errorlist { margin: 0; padding-left: 18px; }

.data-list { margin: 0; }
.data-list div { display: grid; grid-template-columns: minmax(100px, 0.4fr) minmax(0, 1fr); gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 700; }
.table-wrap { overflow-x: auto; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: var(--brand-soft); font-size: 0.74rem; text-transform: uppercase; }
.table-wrap td { vertical-align: middle; }
.table-wrap td:last-child { width: 1%; white-space: nowrap; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: #f7fbfd; }
td small { display: block; }
.table-empty { padding: 32px; color: var(--muted); text-align: center; }
details summary { color: var(--brand-dark); cursor: pointer; font-weight: 700; }
.line-list { min-width: 260px; margin: 10px 0 0; padding: 0; list-style: none; }
.line-list li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.line-list span { color: var(--muted); font-size: 0.8rem; }
.master-table > tbody > tr:not(.detail-row) > td:last-child { width: 1%; white-space: nowrap; }
.detail-toggle { min-height: 34px; padding: 5px 11px; color: var(--brand-dark); background: var(--paper); border: 1px solid #91a2ae; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 750; white-space: nowrap; }
.detail-toggle::before { display: inline-block; margin-right: 7px; content: ">"; transform: rotate(90deg); transition: transform 150ms ease; }
.detail-toggle[aria-expanded="true"]::before { transform: rotate(-90deg); }
.detail-toggle:hover, .detail-toggle:focus-visible { color: var(--brand-dark); border-color: var(--brand); background: var(--brand-soft); }
.detail-row > td { padding: 12px 12px 16px; background: #f7fbfd; }
.detail-row:hover { background: transparent; }
.detail-panel { overflow: hidden; background: var(--paper); border: 1px solid #b9d9e9; border-radius: 6px; }
.detail-heading { padding: 12px 16px; color: var(--brand-dark); background: var(--brand-soft); border-bottom: 1px solid #b9d9e9; }
.detail-table-wrap { overflow-x: auto; }
.detail-table { min-width: 900px; }
.detail-table th { background: #f4f8fa; }
.detail-table tbody tr:last-child td { border-bottom: 0; }
.detail-table small { max-width: 260px; color: var(--muted); white-space: normal; }

.message-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.message { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--brand-soft); border: 1px solid #b9d9e9; border-radius: 6px; box-shadow: var(--shadow-soft); }
.message-success { background: var(--success-soft); border-left-color: var(--success); }
.message-error { background: var(--danger-soft); border-left-color: var(--danger); }
.message-warning { background: var(--warning-soft); border-left-color: var(--warning); }
.message button { padding: 0; background: none; border: 0; font-size: 1.2rem; cursor: pointer; }
.empty-state { max-width: 700px; margin: 80px auto; padding: 36px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }

.debug-drawer-toggle {
  position: fixed;
  right: 12px;
  bottom: 14px;
  z-index: 40;
  min-height: 34px;
  padding: 6px 12px;
  color: #f2f8fc;
  background: rgba(0, 43, 68, 0.72);
  border: 1px solid rgba(176, 214, 236, 0.55);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.debug-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(420px, 92vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #eaf4fb;
  background: rgba(5, 23, 38, 0.76);
  border: 1px solid rgba(167, 206, 230, 0.4);
  border-right: 0;
  border-radius: 0;
  box-shadow: 0 14px 36px rgba(8, 17, 25, 0.4);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.debug-drawer[hidden] {
  display: none !important;
}

.debug-drawer header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(167, 206, 230, 0.25);
}

.debug-drawer-body {
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 12px;
}

.debug-drawer h3 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b6d8eb;
}

.debug-drawer dl,
.debug-drawer ul {
  margin: 0;
  padding: 0;
}

.debug-drawer dl div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(167, 206, 230, 0.2);
}

.debug-drawer dt {
  color: #9fc6dc;
  font-size: 0.8rem;
}

.debug-drawer dd {
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 0.82rem;
  min-width: 0;
}

.debug-drawer ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.debug-drawer li {
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(181, 215, 235, 0.24);
  border-radius: 6px;
  min-width: 0;
}

.debug-drawer li strong {
  display: block;
  color: #9bd5f6;
  margin-bottom: 2px;
}

.debug-drawer li span,
.debug-drawer li small,
.debug-drawer li p {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  color: #ddeef8;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.debug-drawer li p {
  margin-top: 4px;
}

.debug-drawer-footer {
  padding: 12px;
  border-top: 1px solid rgba(167, 206, 230, 0.25);
  display: flex;
  justify-content: flex-end;
}

.debug-drawer-footer button {
  min-height: 34px;
  padding: 6px 10px;
  color: #eaf4fb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(167, 206, 230, 0.45);
  border-radius: 6px;
  cursor: pointer;
}

.debug-drawer-footer button:hover,
.debug-drawer-footer button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #48545c url("../img/auth-background.ec45beb1b1c3.jpg") center / cover fixed no-repeat; }
.auth-shell { width: min(920px, 100%); min-height: 570px; display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr); overflow: hidden; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.76); border-radius: 8px; box-shadow: 0 24px 64px rgba(17, 30, 39, 0.3); backdrop-filter: blur(12px); }
.auth-brand { display: flex; flex-direction: column; justify-content: flex-end; padding: 44px; color: white; background: var(--brand); border-right: 1px solid rgba(255, 255, 255, 0.3); }
.auth-brand .brand-logo { margin-bottom: auto; }
.auth-brand .eyebrow { color: #d7eef9; }
.auth-brand h1 { max-width: 360px; font-size: 2.7rem; }
.auth-brand > p:last-child { color: #e3f1f7; }
.auth-panel { display: grid; align-content: center; padding: 50px; background: rgba(255, 255, 255, 0.88); }
.auth-language-switcher { position: absolute; top: 18px; right: 18px; }
.auth-panel { position: relative; }
.registration-shell { display: block; min-height: 0; max-width: 920px; }
.registration-shell .auth-brand { min-height: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 8px 28px; padding: 28px 44px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.registration-shell .auth-brand .eyebrow { display: none; }
.registration-shell .auth-brand .brand-logo { width: 220px; grid-row: 1 / span 2; align-self: center; margin: 0; }
.registration-shell .auth-brand .eyebrow { margin: 0; align-self: end; }
.registration-shell .auth-brand h1 { margin: 0; align-self: start; font-size: 2rem; }
.registration-shell .auth-brand > p:last-child { grid-column: 2; margin: 0; }
.registration-shell .auth-panel { padding: 36px 44px 44px; }
.registration-shell .auth-heading { padding-right: 90px; }
.registration-shell fieldset { min-width: 0; margin: 0 0 24px; padding: 20px 20px 8px; border: 1px solid var(--line); border-radius: 6px; }
.registration-shell legend { padding: 0 8px; color: var(--ink); font-weight: 700; }
.registration-shell h3 { margin: 12px 0 4px; color: var(--brand-dark); font-size: 1rem; }
.registration-shell .copy-admin-button { display: block; margin: 0 0 12px; padding: 0; color: var(--brand); background: transparent; border: 0; font-size: 0.8rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.registration-shell .legal-copy { max-height: 180px; overflow-y: auto; margin: 8px 0 16px; padding: 14px 16px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.registration-shell dialog { width: min(620px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 24px; color: var(--ink); }
.registration-shell dialog::backdrop { background: rgba(37, 55, 70, 0.45); }
.registration-shell .legal-action { display: grid; gap: 10px; margin-bottom: 18px; }
.registration-shell .legal-view-button { justify-self: start; padding: 0; color: var(--brand); background: transparent; border: 0; text-decoration: underline; font-weight: 700; cursor: pointer; }
.registration-legal-dialog { width: min(720px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 70px rgba(22, 40, 52, 0.28); }
.registration-legal-dialog::backdrop { background: rgba(37, 55, 70, 0.45); }
.legal-dialog-header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.legal-dialog-header strong { margin-right: auto; }
.legal-dialog-body { max-height: min(55vh, 460px); overflow-y: auto; margin: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }
.legal-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
.legal-warning { margin: 0; color: #8a5a00; font-size: .86rem; }
.auth-heading { margin-bottom: 24px; }
.auth-heading > p:last-child { color: var(--muted); }
.auth-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; font-size: 0.85rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; padding: 0; background: var(--canvas); }
  .sidebar { position: fixed; top: 12px; bottom: 12px; left: 12px; z-index: 20; width: 260px; height: auto; transform: translateX(calc(-100% - 20px)); transition: transform 180ms ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .app-main { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .menu-button { display: inline-flex; margin-right: auto; padding: 8px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
  .topbar { padding: 12px 20px; }
  .personal-overview-grid { grid-template-columns: 1fr; }
  .content { padding: 28px 20px 44px; }
  .app-footer { padding: 16px 20px; }
  .document-form { grid-template-columns: 1fr 1fr; }
  .document-form .file-field, .document-form .button { grid-column: 1 / -1; }
  .debug-drawer-toggle,
  .debug-drawer { display: none; }
}

@media (max-width: 680px) {
  .auth-page { padding: 16px; place-items: center; background-attachment: scroll; }
  .auth-shell { min-height: calc(100vh - 32px); grid-template-columns: 1fr; }
  .auth-brand { min-height: 220px; padding: 28px; }
  .auth-brand .brand-logo { width: 240px; margin-bottom: 28px; }
  .auth-brand h1 { font-size: 2rem; }
  .auth-panel { padding: 32px 24px; }
  .registration-shell .auth-brand { display: block; padding: 28px 24px; }
  .registration-shell .auth-brand .eyebrow { display: none; }
  .registration-shell .auth-brand .brand-logo { width: 210px; margin-bottom: 20px; }
  .registration-shell .auth-brand h1 { font-size: 2rem; }
  .registration-shell .auth-brand > p:last-child { margin-top: 8px; }
  .registration-shell .auth-panel { padding: 28px 24px 36px; }
  .registration-shell .auth-heading { padding-right: 0; }
  .metrics, .two-column, .form-grid, .help-topics, .permission-list { grid-template-columns: 1fr; }
  .page-header { padding: 20px; }
  .page-header, .action-band, .submit-band, .inline-confirm { align-items: stretch; flex-direction: column; }
  .progress-summary { min-width: 0; width: 100%; text-align: left; }
  .requirement-row { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .requirement-heading, .document-current { align-items: flex-start; flex-direction: column; }
  .document-form { grid-template-columns: 1fr; }
  .document-form > * { grid-column: 1 !important; }
  .supplier-switcher label { display: none; }
  .supplier-switcher select { max-width: 150px; }
  .section-block.table-wrap { padding: 14px; }
  .chatbot-launcher { right: 16px; bottom: 16px; }
  .chatbot-panel { right: 16px; bottom: 72px; width: calc(100vw - 32px); max-height: calc(100vh - 88px); }
}