:root {
  color-scheme: light;
  --navy: #22374d;
  --navy-deep: #192c40;
  --ink: #263442;
  --muted: #728095;
  --line: #dce4ed;
  --surface: #ffffff;
  --background: #f4f7fa;
  --blue: #3f9cfb;
  --teal: #18afa9;
  --green: #4caf3d;
  --amber: #eda52b;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.store-credentials { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #f7fafc; }
.store-credentials p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.store-credentials .secondary-button { flex: 0 0 auto; }

@media (max-width: 720px) {
  .store-credentials { align-items: stretch; flex-direction: column; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.portal-sidebar {
  grid-column: 1; grid-row: 1;
  position: sticky; top: 0; height: 100vh; padding: 26px 18px;
  display: flex; flex-direction: column; color: white;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
}
.brand-lockup { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 750; }
.sidebar-brand { padding: 0 10px 30px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px;
  color: white; background: linear-gradient(135deg, #6c6bea, #40c5bf);
  box-shadow: 0 8px 24px rgb(24 175 169 / 22%);
}
.portal-sidebar nav { display: grid; gap: 8px; }
.side-item, .logout-button {
  border: 0; border-radius: 9px; color: #d9e5ef; background: transparent;
}
.side-item { width: 100%; padding: 14px 16px; display: flex; align-items: center; gap: 11px; text-align: left; }
.side-label { min-width: 0; flex: 1; }
.side-item.active { color: white; background: rgb(63 156 251 / 18%); box-shadow: inset 3px 0 var(--blue); }
.side-icon {
  width: 22px; height: 22px; flex: 0 0 22px; color: #72b7ff;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-chevron { margin-left: auto; color: #9fc8ee; }
.company-navigation, .shareholder-navigation, .accounting-navigation, .supply-chain-navigation { display: grid; gap: 5px; padding: 0 0 5px 18px; }
.company-nav-item, .shareholder-nav-item, .accounting-nav-item, .supply-chain-nav-item {
  min-height: 42px; padding: 9px 10px 9px 14px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; border: 0; border-radius: 8px;
  color: #c6d7e5; background: transparent; text-align: left;
}
.company-nav-item:hover, .company-nav-item.active, .shareholder-nav-item:hover, .shareholder-nav-item.active, .accounting-nav-item:hover, .accounting-nav-item.active, .supply-chain-nav-item:hover, .supply-chain-nav-item.active { color: white; background: rgb(255 255 255 / 9%); }
.company-nav-item > span:first-child, .accounting-nav-item > span:first-child { min-width: 0; display: grid; gap: 2px; }
.company-nav-item small, .accounting-nav-item small { color: #91a9bd; font-size: 10px; font-weight: 600; }
.company-nav-item.active small, .company-nav-item:hover small, .accounting-nav-item.active small, .accounting-nav-item:hover small { color: #c6d7e5; }
.portal-sidebar .tab-indicator { flex: 0 0 auto; }
.logout-button { margin-top: auto; padding: 12px; border: 1px solid rgb(255 255 255 / 14%); }
.logout-button:hover { background: rgb(255 255 255 / 8%); }

.portal-workspace { grid-column: 2; grid-row: 1; min-width: 0; }
.portal-topbar {
  min-height: 86px; padding: 16px 34px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.eyebrow { margin: 0 0 5px; color: #686ee8; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
select, input {
  min-height: 42px; border: 1px solid #cfd9e4; border-radius: 7px; padding: 0 12px;
  color: var(--ink); background: white; outline: none;
}
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(24 175 169 / 12%); }
.account-chip { padding: 10px 14px; border-radius: 999px; color: #536173; background: #f0f4f8; font-size: 13px; }

.portal-main { min-width:0; padding:32px; }
.case-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.case-heading > div { display:grid; gap:7px; }
.case-heading h1 { margin: 0; font-size: 30px; }
.case-heading-description { margin:0; color:var(--muted); }
.tab-indicator { padding: 3px 7px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.tab-indicator.complete { color: #237d2c; background: #e6f6e3; }
.tab-indicator.pending { color: #946310; background: #fff1cf; }

.tab-panel {
  min-width:0; min-height:480px; padding:28px; border:1px solid var(--line);
  background: var(--surface); box-shadow: 0 14px 40px rgb(29 51 73 / 5%);
}
.tab-panel.all-companies-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.company-list { min-width:0; display:grid; gap:24px; }
.company-list .company-panel { min-width:0; max-width:100%; overflow:hidden; scroll-margin-top:24px; padding:28px; border:1px solid var(--line); background:var(--surface); box-shadow:0 14px 40px rgb(29 51 73 / 5%); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.panel-heading h2, .documents-placeholder h2 { margin: 0; }
.status-badge { padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-badge.complete { color: #288532; background: #e8f7e5; }
.status-badge.progress { color: #1e7773; background: #e3f7f6; }
.status-badge.pending { color: #8a641e; background: #fff2d7; }

.registration-timeline-scroll { width:100%; min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; margin:28px 0 36px; padding:7px 5px 12px; scrollbar-width:thin; }
.progress-track { display: grid; grid-template-columns: repeat(4, 1fr); margin:0; }
.progress-track.registration-progress-track { grid-template-columns:repeat(10,minmax(112px,1fr)); min-width:1120px; }
.progress-track.brazil-progress-track { grid-template-columns: repeat(2, 1fr); }
.progress-step { position: relative; display: grid; justify-items: center; gap: 10px; color: #9aa6b4; font-size: 13px; }
.progress-step::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: #dfe6ed; }
.progress-step:first-child::before { display: none; }
.progress-step.reached::before { background: var(--teal); }
.progress-dot { z-index: 1; width: 18px; height: 18px; border: 4px solid white; border-radius: 50%; background: #cad4df; box-shadow: 0 0 0 2px #cad4df; }
.progress-step.reached { color: var(--ink); }
.progress-step.reached .progress-dot { background: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.progress-step.current .progress-dot { box-shadow: 0 0 0 2px var(--teal), 0 0 0 7px rgb(24 175 169 / 13%); }
.registration-progress-track .progress-step { display:block; height:94px; }
.registration-progress-track .progress-step::before { top:46px; }
.registration-progress-track .progress-dot {
  position:absolute;
  top:38px;
  left:50%;
  transform:translateX(-50%);
}
.registration-progress-track .progress-step > span:last-child {
  position:absolute;
  left:50%;
  width:126px;
  transform:translateX(-50%);
  text-align:center;
  line-height:1.35;
}
.registration-progress-track .progress-step:nth-child(odd) > span:last-child { top:67px; }
.registration-progress-track .progress-step:nth-child(even) > span:last-child { bottom:67px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.summary-grid > div { min-height: 94px; padding: 20px; display: grid; align-content: center; gap: 8px; border-right: 1px solid var(--line); }
.summary-grid > div:last-child { border-right: 0; }
.summary-grid span { color: var(--muted); font-size: 13px; }
.summary-grid strong { overflow-wrap: anywhere; }
.summary-grid.brazil-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-grid.registration-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.registration-summary-grid > div:nth-child(3) { border-right:0; }
.registration-summary-grid .registration-summary-address {
  grid-column:1/-1;
  min-height:82px;
  border-top:1px solid var(--line);
  border-right:0;
}
.registration-summary-address strong { font-size:15px; font-weight:650; line-height:1.55; }
.summary-grid strong.summary-pending {
  width:max-content;
  padding:5px 10px;
  border-radius:999px;
  background:#eef2f5;
  color:#7d8996;
  font-size:13px;
  font-weight:700;
}
.documents-placeholder, .profile-placeholder { margin-top: 26px; padding: 25px; border: 1px dashed #cdd8e3; border-radius: 9px; background: #f9fbfc; }
.documents-placeholder p, .profile-placeholder p { margin-bottom: 0; color: var(--muted); }
.profile-placeholder h3 { margin-top: 0; }
.profile-form { margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 9px; background: #f9fbfc; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.profile-grid label { display: grid; gap: 8px; color: #536173; font-size: 13px; font-weight: 700; }
.profile-grid input, .profile-grid select { width: 100%; }
.form-message { display: inline-block; margin: 0 0 0 14px; color: var(--muted); font-size: 13px; }
.profile-documents { margin-top: 28px; }
.profile-documents h3 { margin: 0 0 12px; }
.document-row { min-height: 78px; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.document-row > div:first-child { display: grid; gap: 6px; }
.document-row span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.document-actions { display: flex; align-items: center; gap: 8px; }
.document-actions a { display: inline-grid; place-items: center; text-decoration: none; }
.upload-review {
  margin: -1px 0 12px; padding: 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; border: 1px solid #f0d8a8;
  border-radius: 8px; background: #fffaf0;
}
.upload-review > div:first-child { display: grid; gap: 5px; min-width: 0; }
.upload-review span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.upload-warning { margin: 3px 0 0; color: #8a4f22; font-size: 13px; }
.upload-error { margin:3px 0 0; color:#b23a48; font-size:13px; }
.accounting-upload-message { min-height:18px; margin:4px 0 0; color:var(--muted); font-size:13px; }
.accounting-uploading,.document-uploading { background:#f0fbfa; }
.accounting-uploading > div:first-child span,.document-uploading > div:first-child span { color:var(--teal); font-weight:700; }
.accounting-uploading button:disabled,.document-uploading button:disabled { cursor:wait; opacity:1; }
.upload-reason { display: grid; gap: 6px; margin-top: 8px; }
.upload-reason textarea {
  min-height: 64px;
  resize: vertical;
  width: min(520px, 100%);
}
.company-documents { margin-top: 28px; }
.company-documents h2 { margin: 0 0 12px; }
.company-documents .secondary-button { display: inline-grid; place-items: center; text-decoration: none; white-space: nowrap; }
.waiting-badge { padding: 6px 10px; border-radius: 999px; color: #8a641e; background: #fff2d7; font-size: 12px; }
.brazil-registration-result { padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.brazil-registration-identity { margin: 16px 0 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.brazil-registration-identity > div { min-height: 82px; padding: 16px; display: grid; align-content: center; gap: 6px; border-right: 1px solid var(--line); }
.brazil-registration-identity > div:last-child { border-right: 0; }
.brazil-registration-identity span { color: var(--muted); font-size: 12px; }
.brazil-registration-identity strong { overflow-wrap: anywhere; }
.brazil-document-list .document-row:last-child { border-bottom: 0; }
.missing-list { margin: 16px 0 0; padding-left: 22px; display: grid; gap: 7px; color: #8a4f22; }
.accounting-panel { display:grid; gap:18px; }
.unified-accounting-panel { padding:22px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.accounting-month-workspace { display:grid; gap:22px; }
.accounting-month-company,.accounting-month-stores { padding:18px; border:1px solid var(--line); border-radius:9px; background:#fbfcfe; }
.accounting-subsection-heading { display:grid; gap:3px; margin-bottom:4px; }
.accounting-subsection-heading span { color:var(--blue); font-size:12px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.accounting-subsection-heading h3 { margin:0; }
.accounting-month-stores .store-card-list { margin-top:12px; }
.accounting-completion-summary { padding:16px 18px; border:1px solid #cfe1f1; border-radius:9px; background:#f3f8fc; }
.accounting-completion-summary.complete { border-color:#bfe4d5; background:#edf9f4; }
.accounting-completion-summary.overdue { border-color:#efc4c4; background:#fff2f2; }
.accounting-completion-heading { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.accounting-completion-heading span { font-weight:800; color:var(--blue); }
.accounting-completion-summary.overdue .accounting-completion-heading span { color:#b23a48; }
.accounting-completion-list { margin:12px 0 0; padding-left:20px; display:grid; gap:5px; color:var(--muted); }
.accounting-overview { display:grid; gap:22px; }
.company-stores { margin-top:28px; border-top:1px solid var(--line); padding-top:24px; }
.store-card-list { display:grid; gap:20px; margin-top:16px; }
.store-card {
  padding:22px;
  border:1px solid #d4dee9;
  border-radius:10px;
  background:#fff;
  box-shadow:0 8px 24px rgb(29 51 73 / 5%);
}
.store-card-heading { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; padding-bottom:16px; border-bottom:1px solid var(--line); }
.store-card-heading > div { display:grid; gap:4px; }
.store-card-heading strong { font-size:17px; }
.store-card-heading span, .store-period-month { color:var(--muted); }
.store-stage-badge { padding:7px 11px; border-radius:999px; background:#fff1cf; color:#966100; font-weight:700; white-space:nowrap; }
.store-stage-badge.complete { background:#e6f6e3; color:#24823a; }
.store-period-month { margin:16px 0 12px; }
.store-stage-progress { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:16px 12px; border-radius:8px; background:#f7f9fc; }
.store-stage-step { display:grid; justify-items:center; gap:6px; text-align:center; color:#9aa6b5; position:relative; }
.store-stage-step span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#e8edf3; font-weight:800; }
.store-stage-step.reached { color:#287cba; }
.store-stage-step.reached span { color:#fff; background:#32a8d8; }
.store-stage-step.current span { box-shadow:0 0 0 4px #d8f3fc; }
.store-document-list { display:grid; gap:10px; margin-top:16px; }
.store-document-list > div { display:flex; justify-content:space-between; align-items:center; gap:16px; min-height:68px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#fbfcfe; }
.store-document-row > div:first-child { display:grid; gap:5px; min-width:0; }
.store-document-row span { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.store-document-row .secondary-button { text-decoration:none; white-space:nowrap; }
.store-month-select { margin-top:16px; }
.store-accounting-panel { margin-bottom:20px; }
@media (max-width:700px){.store-stage-progress{grid-template-columns:1fr 1fr}.store-card-heading{display:grid}.store-stage-badge{justify-self:start}.store-document-row{display:grid!important}.store-document-row .document-actions{justify-content:flex-start}}
@media (max-width:700px){.brazil-registration-identity{grid-template-columns:1fr}.brazil-registration-identity>div{border-right:0;border-bottom:1px solid var(--line)}.brazil-registration-identity>div:last-child{border-bottom:0}}
.accounting-inactive { color:#8a6a20; }
.accounting-company-detail { padding-top:4px; }
.accounting-filter-toolbar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.accounting-filter-toolbar label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:700; }
.accounting-filter-toolbar select { width:100%; min-height:44px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); font:inherit; }
.accounting-filter-empty { margin:0; padding:24px; border:1px dashed var(--line); border-radius:9px; color:var(--muted); text-align:center; }
.accounting-month-select { width:100%; }
@media(max-width:700px){.accounting-filter-toolbar{grid-template-columns:1fr}}
.accounting-period-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; border-bottom:1px solid var(--line); }
.accounting-period-summary p { margin:0; }
.accounting-period-documents .document-row > div:first-child { max-width:65%; }
.accounting-rejection { color:#b43a3a; font-size:12px; }
.client-tax-declaration { margin-top:20px; padding:20px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.client-tax-declaration-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0; }
.client-tax-declaration-grid>div { display:grid; gap:5px; padding:12px; border-radius:7px; background:#f7f9fc; }
.client-tax-declaration-grid small,.client-tax-declaration-file small { color:var(--muted); }
.client-tax-declaration-file { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:16px; padding:13px; border:1px solid var(--line); border-radius:7px; }
.client-tax-declaration-file::after { content:""; }
.client-tax-declaration-file span { display:grid; gap:4px; min-width:0; }
.client-tax-declaration-file strong { overflow-wrap:anywhere; }
.client-tax-declaration-file a { flex:0 0 auto; text-decoration:none; }
.simulated-tax-payment { display:grid; gap:14px; margin-top:16px; padding:16px; border:1px solid #ead7a8; border-radius:8px; background:#fffaf0; }
.simulated-payment-confirm { display:flex; align-items:center; gap:9px; font-size:13px; }
.simulated-payment-confirm input { width:18px; height:18px; }
.simulated-payment-status { min-height:20px; margin:0; color:var(--muted); }
.simulated-payment-receipt { display:grid; gap:5px; padding:14px; border-radius:7px; background:#e9f7e4; color:#287a38; }
@media(max-width:700px){.client-tax-declaration-grid{grid-template-columns:1fr 1fr}.client-tax-declaration-file{display:flex;align-items:stretch;flex-direction:column}.client-tax-declaration-file::after{display:none}.client-tax-declaration-file a{align-self:center}}

.orders-view { display:grid; gap:18px; }
.order-toolbar { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)) auto auto; align-items:end; gap:12px; padding:0 0 18px; border-bottom:1px solid var(--line); }
.order-toolbar label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:700; }
.order-toolbar input,.order-toolbar select { width:100%; min-width:0; }
.order-filter-actions { display:flex; align-items:center; gap:8px; }
.order-toolbar button,.order-toolbar a { min-height:42px; padding:0 13px; white-space:nowrap; text-decoration:none; }
.order-toolbar a { display:inline-grid; place-items:center; }
.order-download-picker { position:relative; }
.order-download-picker summary { display:inline-grid; min-width:96px; place-items:center; cursor:pointer; list-style:none; }
.order-download-picker summary::-webkit-details-marker { display:none; }
.order-download-menu { position:absolute; z-index:8; top:calc(100% + 7px); right:0; display:grid; min-width:150px; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 12px 30px rgb(29 51 73 / 14%); }
.order-download-menu a { min-height:40px; color:var(--ink); }
.order-download-menu a:hover,.order-download-menu a:focus-visible { background:#f2f7fa; color:var(--teal); outline:none; }
.order-view-heading,.order-detail-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.order-view-heading h2,.order-detail-heading h2 { margin:0; color:var(--navy-deep); font-size:28px; }
.order-view-heading p { margin:7px 0 0; color:var(--muted); }
.order-table-shell { max-width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:#fff; box-shadow:0 8px 25px rgb(29 51 73 / 5%); }
.order-table { width:100%; min-width:980px; border-collapse:collapse; color:var(--ink); }
.order-table th,.order-table td { padding:16px 18px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
.order-table th { background:#f6f8fb; color:var(--muted); font-size:12px; font-weight:750; white-space:nowrap; }
.order-table tbody tr:last-child td { border-bottom:0; }
.order-table tbody tr:hover { background:#fbfcfe; }
.order-table td:nth-child(1),.order-table td:nth-child(6) { white-space:nowrap; }
.order-table td:nth-child(3) { text-align:center; }
.order-table-action { min-height:34px; padding:0 13px; border:1px solid #cbd7e2; border-radius:6px; background:#fff; color:var(--teal); font-weight:750; cursor:pointer; }
.order-table-action:hover,.order-table-action:focus-visible { border-color:var(--teal); outline:none; box-shadow:0 0 0 3px rgb(24 175 169 / 12%); }
.order-status { padding:7px 11px; border-radius:999px; background:#edf3f7; color:#506274; font-size:12px; font-weight:800; white-space:nowrap; }
.order-status-payment_pending { color:#8a641e; background:#fff2d7; }
.order-status-received,.order-status-processing { color:#1e7773; background:#e3f7f6; }
.order-status-shipped { color:#276da8; background:#e7f2fc; }
.order-status-completed { color:#288532; background:#e8f7e5; }
.order-status-cancelled { color:#a33c3c; background:#fdeaea; }
.order-detail-summary span { color:var(--muted); font-size:12px; }
.orders-empty,.orders-loading { min-height:300px; display:grid; place-items:center; align-content:center; gap:15px; text-align:center; border:1px dashed #cdd8e3; border-radius:12px; background:#f9fbfc; }
.orders-loading p { margin:0; color:var(--muted); }
.order-catalogue-link { display:inline-grid; place-items:center; text-decoration:none; }
.order-back { justify-self:start; padding:0; border:0; background:transparent; color:var(--teal); font-weight:750; }
.order-detail-heading>div { display:grid; gap:5px; }
.order-detail-heading>div>span { color:var(--muted); font-size:12px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
.order-progress { margin:4px 0 10px; padding:0; display:grid; grid-template-columns:repeat(5,1fr); list-style:none; }
.order-progress li { position:relative; display:grid; justify-items:center; gap:9px; color:#98a5b3; text-align:center; font-size:12px; }
.order-progress li::before { content:""; position:absolute; top:8px; right:50%; width:100%; height:2px; background:#dfe6ed; }
.order-progress li:first-child::before { display:none; }
.order-progress li.reached::before { background:var(--teal); }
.order-progress-dot { z-index:1; width:18px; height:18px; border:4px solid #fff; border-radius:50%; background:#cad4df; box-shadow:0 0 0 2px #cad4df; }
.order-progress li.reached { color:var(--ink); }
.order-progress li.reached .order-progress-dot { background:var(--teal); box-shadow:0 0 0 2px var(--teal); }
.order-progress li.current .order-progress-dot { box-shadow:0 0 0 2px var(--teal),0 0 0 7px rgb(24 175 169 / 13%); }
.order-progress.cancelled { opacity:.45; }
.order-detail-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.order-detail-summary>div { min-height:88px; padding:17px; display:grid; align-content:center; gap:7px; border-right:1px solid var(--line); }
.order-detail-summary>div:last-child { border-right:0; }
.order-detail-section { padding:20px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe; }
.order-detail-section h3 { margin:0 0 14px; }
.order-detail-section>p { margin:0; color:var(--muted); line-height:1.6; }
.order-product { min-height:82px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:16px; border-top:1px solid var(--line); }
.order-product:first-of-type { border-top:0; }
.order-product img { width:62px; height:62px; object-fit:contain; border-radius:8px; background:#fff; }
.order-product>div { display:grid; gap:5px; }
.order-product span,.order-tracking-line span { color:var(--muted); font-size:12px; }
.order-product-template { display:grid; gap:12px; }
.order-product-template h3 { margin:0; }
.order-template-actions { display:flex; flex-wrap:wrap; gap:10px; }
.order-template-actions a { display:inline-grid; place-items:center; min-height:42px; text-decoration:none; }
.order-logistics-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.order-tracking-line { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 0; border-top:1px solid var(--line); }
.order-tracking-line:first-of-type { border-top:0; }
.order-tracking-line>div { display:grid; gap:4px; }
.order-tracking-line a { color:var(--teal); font-weight:700; }
@media(max-width:1200px){.order-toolbar{grid-template-columns:repeat(2,minmax(150px,1fr))}.order-filter-actions{flex-wrap:wrap}}
@media(max-width:650px){.order-toolbar{grid-template-columns:1fr}.order-filter-actions{display:grid;grid-template-columns:1fr 1fr}.order-toolbar button,.order-toolbar a,.order-download-picker summary{width:100%}.order-download-menu{left:0;right:0}}

.state-card {
  min-height: 420px; display: grid; place-items: center; align-content: center; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; background: white;
}
.state-card h1 { margin-bottom: 5px; }
.state-card p { color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #d9e2eb; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.empty-icon { font-size: 44px; color: #9badbd; }
.secondary-button, .primary-button { min-height: 44px; border-radius: 7px; padding: 0 18px; font-weight: 750; }
.secondary-button { border: 1px solid #cbd7e2; color: var(--teal); background: white; }
.primary-button { border: 0; color: white; background: var(--teal); }
.danger-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 7px; color: white; background: #b85b36; font-weight: 750; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { cursor: wait; opacity: .58; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #edf3f8, #f8fafc); }
.login-panel { position: relative; width: min(430px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 25px 70px rgb(29 51 73 / 12%); }
.login-panel .brand-lockup { margin-bottom: 34px; }
.login-panel h1 { margin: 4px 0 10px; font-size: 30px; }
.muted, .login-help { color: var(--muted); }
.login-form { display: grid; gap: 18px; margin-top: 28px; }
.login-form label { display: grid; gap: 8px; font-weight: 650; }
.login-form input { width: 100%; }
.login-form button { margin-top: 4px; }
.login-help { margin: 22px 0 0; font-size: 12px; text-align: center; }
.auth-inline-action { display:flex; justify-content:flex-end; margin-top:-10px; }
.auth-link { appearance:none; width:auto; padding:2px 0; border:0; background:transparent; color:var(--brand); font:inherit; font-size:13px; font-weight:700; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.auth-link:hover { color:var(--brand-dark); }
.auth-link:focus-visible { outline:3px solid rgb(106 90 205 / 25%); outline-offset:4px; border-radius:3px; }
.auth-link:disabled { color:var(--muted); cursor:not-allowed; }
.login-form > .auth-link { justify-self:center; margin-top:0; }
.form-status { margin:0; padding:12px 14px; border:1px solid #b7d8c4; border-radius:8px; background:#f0faf4; color:#235c3a; font-size:13px; line-height:1.55; }
.form-error { margin: 0; color: #b43a3a; font-size: 13px; }

@media (max-width: 850px) {
  .portal-shell { grid-template-columns: 86px minmax(0, 1fr); }
  .portal-sidebar { padding: 20px 10px; }
  .sidebar-brand > span:last-child, .side-label, .nav-chevron, .portal-sidebar .tab-indicator, .logout-button { font-size: 0; }
  .company-navigation, .shareholder-navigation { padding-left: 0; }
  .company-nav-item, .shareholder-nav-item { justify-content: center; padding: 9px 4px; font-size: 11px; }
  .sidebar-brand { padding-inline: 6px; }
  .brand-mark { width: 42px; }
  .portal-topbar { align-items: flex-start; padding: 16px 20px; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .account-chip { display: none; }
  .portal-main { padding: 20px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid > div:nth-child(2) { border-right: 0; }
  .progress-step span:last-child { font-size: 11px; }
  .order-detail-summary { grid-template-columns:repeat(2,1fr); }
  .order-detail-summary>div:nth-child(2) { border-right:0; }
  .order-detail-summary>div:nth-child(-n+2) { border-bottom:1px solid var(--line); }
}

@media (max-width: 560px) {
  .portal-shell { display: block; }
  .portal-sidebar { position: static; width: 100%; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; }
  .sidebar-brand { padding: 0; }
  .portal-sidebar nav { margin-left: auto; display: flex; align-items: center; }
  .company-navigation, .shareholder-navigation { position: absolute; top: 68px; right: 12px; z-index: 10; width: 210px; max-height: min(60vh, 420px); overflow-y: auto; padding: 8px; border-radius: 9px; background: var(--navy-deep); box-shadow: 0 12px 30px rgb(0 0 0 / 20%); }
  .company-nav-item, .shareholder-nav-item { justify-content: space-between; padding: 10px; font-size: 13px; }
  .side-item { padding: 10px; }
  .logout-button { display: none; }
  .portal-topbar, .case-heading { align-items: stretch; flex-direction: column; }
  .topbar-actions { align-items: stretch; }
  .portal-main { padding: 14px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid.registration-summary-grid { grid-template-columns:1fr; }
  .registration-summary-grid .registration-summary-address { grid-column:auto; }
  .summary-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-grid > div:last-child { border-bottom: 0; }
  .tab-panel { padding: 18px; }
  .company-list .company-panel { padding: 18px; }
  .profile-grid { grid-template-columns: 1fr; }
  .document-row { align-items: flex-start; flex-direction: column; }
  .upload-review { align-items: stretch; flex-direction: column; }
  .upload-review .document-actions { justify-content: flex-end; }
  .order-card-list,.order-logistics-grid { grid-template-columns:1fr; }
  .order-card-facts { grid-template-columns:1fr; gap:12px; }
  .order-progress { overflow-x:auto; grid-template-columns:repeat(5,minmax(90px,1fr)); padding:8px; }
  .order-detail-summary { grid-template-columns:1fr; }
  .order-detail-summary>div { border-right:0; border-bottom:1px solid var(--line); }
  .order-detail-summary>div:last-child { border-bottom:0; }
  .order-product { grid-template-columns:auto minmax(0,1fr); }
  .order-product>strong { grid-column:2; }
}
