:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e1ec;
  --brand: #0b7285;
  --brand-dark: #075563;
  --green: #15803d;
  --amber: #b45309;
  --rose: #be123c;
  --blue: #2563eb;
  --violet: #7c3aed;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  background: #0b7285;
}

.login-art {
  position: relative;
  padding: 48px;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-art::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  top: -160px;
  border: 40px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.login-art::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: 80px;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.brand-row img {
  width: 142px;
  height: auto;
  display: block;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 6px;
  padding: 8px;
}

.login-art h1 {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 60px 0 18px;
  color: #fff;
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: 0;
}

.login-art p {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.6;
}

.login-points {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.login-points span {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 36px;
  background: var(--bg);
}

.login-card {
  width: min(100%, 430px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.field input,
.field select {
  min-height: 44px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--ink);
  background: #f1f5f9;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(11, 114, 133, 0.16);
  border-color: var(--brand);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-ghost {
  border-color: var(--line);
}

.btn-danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff5f5;
}

.btn-danger:hover {
  color: #fff;
  border-color: #b91c1c;
  background: #b91c1c;
}

.btn-small {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
}

.filter-chip.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.filter-chip.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.error {
  min-height: 22px;
  color: var(--rose);
  font-weight: 700;
  font-size: 13px;
  margin: 8px 0 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar .brand-row img {
  width: 126px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  text-align: left;
  color: #cbd5e1;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.user-card {
  display: grid;
  gap: 4px;
}

.user-card strong {
  color: #fff;
}

.user-card span {
  color: #94a3b8;
  font-size: 12px;
  word-break: break-word;
}

.content {
  min-width: 0;
  padding: 24px;
}

.portal-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.portal-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.portal-controls select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.currency-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.currency-toggle button {
  min-width: 58px;
  border: 0;
  padding: 8px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.currency-toggle button.active {
  background: var(--brand);
  color: #fff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -130px;
  width: 280px;
  height: 280px;
  border: 28px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.hero h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 30px;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 0.55fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  max-width: 760px;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  gap: 12px;
  align-content: stretch;
}

.metric-tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-tile strong {
  color: var(--brand-dark);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  min-height: 106px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.stat strong {
  font-size: 30px;
  letter-spacing: 0;
}

.tone-green { border-left-color: var(--green); }
.tone-amber { border-left-color: var(--amber); }
.tone-rose { border-left-color: var(--rose); }
.tone-blue { border-left-color: var(--blue); }
.tone-violet { border-left-color: var(--violet); }

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.55fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-layout.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.panel h3 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: 0;
}

.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stage {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stage b {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  background: #fff;
}

.stage strong {
  display: block;
  margin-top: 10px;
}

.stage span {
  color: var(--muted);
  font-size: 12px;
}

.attention-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.attention-row:last-child {
  border-bottom: 0;
}

.attention-row:hover strong {
  color: var(--brand);
}

.attention-row b {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
}

.attention-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attention-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.money-row,
.record {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.money-row:last-child,
.record:last-child {
  border-bottom: 0;
}

.record {
  text-decoration: none;
}

.record:hover strong {
  color: var(--brand);
}

.record strong {
  display: block;
  max-width: 560px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record small,
.money-row span {
  color: var(--muted);
}

.record em,
.money-row strong {
  font-style: normal;
  white-space: nowrap;
}

.actions {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.action-card {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-decoration: none;
}

.action-card:hover {
  background: #fff;
  border-color: #9fb1c7;
}

.action-card span {
  display: block;
  color: var(--brand);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.table td,
.table th {
  overflow-wrap: anywhere;
}

.table td:nth-child(3),
.table th:nth-child(3),
.table td:nth-child(5),
.table th:nth-child(5) {
  min-width: 132px;
}

.payments-table th:nth-child(3),
.payments-table td:nth-child(3) {
  min-width: 220px;
}

.payments-table th:nth-child(4),
.payments-table td:nth-child(4) {
  min-width: 170px;
}

.payment-amounts {
  display: grid;
  gap: 6px;
  min-width: 205px;
}

.payment-amounts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.payment-amounts strong {
  color: var(--ink);
  white-space: nowrap;
}

.payment-net {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.payment-net span,
.payment-net strong {
  color: var(--brand);
  font-weight: 900;
}

.tax-form {
  display: grid;
  gap: 8px;
  min-width: 152px;
}

.tax-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.tax-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.tax-request-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 320px);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.tax-request-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tax-request-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.direct-tax-preview {
  padding: 10px;
  border: 1px solid #d8e6f2;
  border-radius: 8px;
  background: #fff;
}

.budget-lines-table {
  table-layout: fixed;
}

.budget-lines-table th:nth-child(1),
.budget-lines-table td:nth-child(1) {
  width: 19%;
}

.budget-lines-table th:nth-child(2),
.budget-lines-table td:nth-child(2) {
  width: 40%;
}

.budget-lines-table th:nth-child(3),
.budget-lines-table td:nth-child(3) {
  width: 14%;
}

.budget-lines-table th:nth-child(4),
.budget-lines-table td:nth-child(4) {
  width: 170px;
}

.budget-lines-table th:nth-child(5),
.budget-lines-table td:nth-child(5) {
  width: 180px;
}

.amount-cell {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  background: #eef6f8;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
  margin-top: 18px;
}

.document-grid > * {
  min-width: 0;
}

.document-grid h4 {
  margin: 18px 0 10px;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.summary-list strong,
.summary-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-list span {
  text-align: right;
}

.ranking-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.ranking-panel h4 {
  margin-top: 0;
}

.ranking-panel .table {
  table-layout: fixed;
}

.ranking-panel .table th:first-child,
.ranking-panel .table td:first-child {
  width: 68px;
}

.ranking-panel .table th:nth-child(3),
.ranking-panel .table td:nth-child(3),
.ranking-panel .table th:nth-child(4),
.ranking-panel .table td:nth-child(4) {
  width: 140px;
}

.ranking-panel .table th:last-child,
.ranking-panel .table td:last-child {
  width: 190px;
  white-space: nowrap;
}

.winner-row {
  background: #f0f9f6;
}

.winner-row td:first-child,
.winner-row td:nth-child(3) {
  color: var(--brand-dark);
  font-weight: 800;
}

.award-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #9fd5c6;
  border-radius: 8px;
  background: #f0f9f6;
}

.award-panel h4 {
  margin-top: 0;
}

.award-winner {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #bfe3da;
}

.award-winner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.award-winner strong {
  color: var(--brand-dark);
  font-size: 24px;
}

.compact-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
}

.compact-list li {
  margin-bottom: 6px;
}

.upload-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.upload-row label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.upload-row input {
  min-width: 0;
}

.upload-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin-top: 2px;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcfce7;
}

.upload-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  animation: upload-progress-slide 1s ease-in-out infinite;
}

@keyframes upload-progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(230%);
  }
}

.document-submit-form {
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.file-field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-field input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.file-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.file-item:hover {
  border-color: var(--brand);
}

.file-item span {
  color: var(--muted);
  font-size: 12px;
}

.support-file-list {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.support-file-button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.support-file-button:hover {
  border-color: var(--brand);
  background: #f8fafc;
}

.support-file-button span {
  color: var(--muted);
  font-size: 12px;
}

.direct-payment-form {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.direct-payment-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.direct-payment-form input[type="file"] {
  width: 100%;
  min-width: 0;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.document-preview {
  margin-top: 18px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.document-preview iframe {
  width: 100%;
  height: 720px;
  border: 0;
  display: block;
}

.empty,
.loading {
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-actions {
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1360px) {
  .document-grid {
    grid-template-columns: 1fr;
  }

  .document-preview iframe {
    height: 560px;
  }
}

@media (max-width: 1280px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-tile {
    min-height: 96px;
    display: grid;
    align-content: center;
  }

  .metric-tile strong {
    text-align: left;
  }
}

@media (max-width: 1120px) {
  .stats,
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid,
  .dashboard-layout,
  .dashboard-layout.equal {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline,
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 420px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content {
    padding: 16px;
  }

  .stats,
  .dashboard-summary,
  .pipeline,
  .actions {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    padding: 18px;
  }

  .dashboard-hero h2 {
    font-size: 26px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }

  .portal-controls,
  .review-actions,
  .row-actions {
    justify-content: flex-start;
  }

  .summary-list div {
    display: grid;
    gap: 6px;
  }

  .summary-list span {
    text-align: left;
  }

  .upload-row {
    grid-template-columns: 1fr;
  }

  .attachment-grid {
    grid-template-columns: 1fr;
  }

  .file-entry {
    grid-template-columns: 1fr;
  }

  .file-entry .btn {
    width: 100%;
  }

  .tax-request-card {
    grid-template-columns: 1fr;
  }

  .record,
  .money-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 14px;
  }

  .ranking-panel {
    padding: 12px;
  }

  .ranking-panel .table,
  .ranking-panel .table thead,
  .ranking-panel .table tbody,
  .ranking-panel .table tr,
  .ranking-panel .table td {
    display: block;
    width: 100%;
  }

  .ranking-panel .table thead {
    display: none;
  }

  .ranking-panel .table tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .ranking-panel .table tr:last-child {
    margin-bottom: 0;
  }

  .ranking-panel .table td {
    display: grid;
    grid-template-columns: minmax(112px, 42%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
  }

  .ranking-panel .table td:last-child {
    border-bottom: 0;
  }

  .ranking-panel .table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .ranking-panel .table td:nth-child(1)::before { content: "Rank"; }
  .ranking-panel .table td:nth-child(2)::before { content: "Supplier"; }
  .ranking-panel .table td:nth-child(3)::before { content: "Average score"; }
  .ranking-panel .table td:nth-child(4)::before { content: "Evaluators"; }
  .ranking-panel .table td:nth-child(5)::before { content: "Average quote"; }

  .winner-row {
    border-color: #bfe3da !important;
    background: #f0f9f6 !important;
  }

  .document-preview {
    min-height: 360px;
  }

  .document-preview iframe {
    height: 460px;
  }
}
