:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f1f5f4;
  --ink: #17211d;
  --muted: #68736e;
  --line: #dce4e0;
  --accent: #14746f;
  --accent-strong: #0b5f59;
  --warning: #b95c20;
  --danger: #b42318;
  --success: #157f3b;
  --shadow: 0 10px 26px rgba(16, 32, 28, 0.07);
}

* {
  box-sizing: border-box;
}

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

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(20, 116, 111, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(145deg, #071512, #132b27 48%, #f5f7f8 48.2%, #f5f7f8);
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
  padding: 24px;
}

.login-brand {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.eyebrow,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.panel p,
.metric-card small,
.side-summary small {
  color: var(--muted);
}

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

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.nav-item.active {
  border-color: rgba(20, 116, 111, 0.22);
  background: rgba(20, 116, 111, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.side-summary {
  margin-top: auto;
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.side-summary strong {
  font-size: 25px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-header,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 5px;
  font-size: 28px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button,
.file-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-weight: 700;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  text-decoration: none;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 116, 111, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.file-button,
.icon-button {
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover,
.file-button:hover,
.icon-button:hover {
  border-color: rgba(20, 116, 111, 0.34);
  background: #f8fbfa;
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled,
.file-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #eef2f6;
  color: var(--muted);
  box-shadow: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 22px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-command-panel {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.upgrade-control-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid #cdded9;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.upgrade-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.upgrade-control-head h3,
.upgrade-control-head span,
.upgrade-release-badge strong,
.upgrade-release-badge span {
  margin: 0;
}

.upgrade-control-head h3 {
  color: #111827;
  font-size: 22px;
}

.upgrade-control-head > div:first-child {
  display: grid;
  gap: 5px;
}

.upgrade-control-head > div:first-child > span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.upgrade-release-badge {
  display: grid;
  min-width: 132px;
  justify-items: end;
  gap: 4px;
  border: 1px solid rgba(20, 116, 111, 0.18);
  border-radius: 8px;
  background: #ecfdf5;
  padding: 12px 14px;
}

.upgrade-release-badge strong {
  color: var(--accent-strong);
  font-size: 26px;
  line-height: 1;
}

.upgrade-release-badge span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.upgrade-control-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.upgrade-control-card i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 20px;
}

.upgrade-control-card.ok i {
  background: #ecfdf3;
  color: var(--success);
}

.upgrade-control-card.active i {
  background: #ecfeff;
  color: var(--accent);
}

.upgrade-control-card.neutral i {
  background: #f1f5f9;
  color: #475569;
}

.upgrade-control-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upgrade-control-card span,
.upgrade-control-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upgrade-control-card strong {
  color: #111827;
  font-size: 16px;
}

.compact-upgrade-panel {
  gap: 10px;
  border-color: #d9e6e2;
  background: #f8fbfa;
}

.compact-upgrade-head {
  align-items: center;
}

.compact-upgrade-head h3 {
  font-size: 18px;
}

.compact-upgrade-head > div:first-child {
  gap: 4px;
}

.compact-upgrade-head > div:first-child > span {
  font-size: 13px;
  font-weight: 700;
}

.compact-upgrade-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-release-badge {
  min-width: 104px;
  padding: 10px 12px;
  background: #fff;
}

.compact-release-badge strong {
  font-size: 20px;
}

.compact-release-badge span {
  font-size: 11px;
}

.compact-upgrade-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.compact-upgrade-grid .upgrade-control-card {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.compact-upgrade-grid .upgrade-control-card i {
  width: 32px;
  height: 32px;
  font-size: 17px;
}

.compact-upgrade-grid .upgrade-control-card strong {
  font-size: 13px;
}

.compact-upgrade-grid .upgrade-control-card span,
.compact-upgrade-grid .upgrade-control-card small {
  font-size: 11px;
}

.command-priority,
.command-summary,
.dashboard-action-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.command-priority {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.command-priority h3 {
  margin: 0;
  font-size: 22px;
}

.priority-kicker {
  display: inline-flex;
  width: max-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: #ecfeff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.command-priority > span {
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-create-order {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  border: 1px solid rgba(214, 180, 107, 0.42);
  border-radius: 8px;
  background: #0f6f68;
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(15, 111, 104, 0.18);
}

.dashboard-create-order i {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
}

.dashboard-create-order span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-create-order strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.dashboard-create-order small {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
  line-height: 1.35;
}

.dashboard-create-order:hover {
  border-color: rgba(214, 180, 107, 0.7);
  background: #0b5f59;
  transform: translateY(-1px);
}

.dashboard-priority-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.dashboard-priority-item,
.dashboard-priority-empty {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.dashboard-priority-item {
  cursor: pointer;
  text-align: left;
}

.dashboard-priority-item i,
.dashboard-priority-empty i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 20px;
}

.command-priority .dashboard-create-order {
  background:
    linear-gradient(135deg, rgba(214, 180, 107, 0.22), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.command-priority .dashboard-create-order:hover {
  background:
    linear-gradient(135deg, rgba(214, 180, 107, 0.28), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.13);
}

.dashboard-priority-item span,
.dashboard-priority-empty div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-priority-item strong,
.dashboard-priority-empty strong {
  color: #111827;
  font-size: 14px;
}

.dashboard-priority-item small,
.dashboard-priority-empty span {
  min-width: 0;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-priority-item em {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-priority-item.urgent i {
  background: #fff7ed;
  color: var(--warning);
}

.dashboard-priority-item.danger i {
  background: #fff1f0;
  color: var(--danger);
}

  .dashboard-priority-item.neutral i {
    background: #eff6ff;
    color: #2563eb;
  }

.dashboard-priority-item:hover {
  border-color: rgba(20, 116, 111, 0.34);
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.dashboard-priority-empty {
  grid-template-columns: 42px minmax(0, 1fr);
  background: #f0fdf4;
  border-color: rgba(21, 127, 59, 0.18);
}

.dashboard-priority-empty i {
  background: #dcfce7;
  color: var(--success);
}

.command-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.command-summary-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.command-summary-head strong {
  font-size: 18px;
}

.command-summary-head small {
  color: var(--muted);
  font-weight: 800;
}

.command-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  gap: 12px;
}

.dashboard-action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-content: start;
  height: 100%;
  min-height: 118px;
  padding: 14px;
  text-align: left;
}

.metric-card {
  min-height: 102px;
}

.dashboard-action-card i {
  grid-row: span 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #f0fdfa;
  color: var(--accent);
  font-size: 20px;
}

.dashboard-action-card span,
.dashboard-action-card small {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-action-card strong {
  color: #111827;
  font-size: 28px;
  line-height: 1;
}

.dashboard-action-card.urgent i {
  background: #fff7ed;
  color: var(--warning);
}

.dashboard-action-card.danger i {
  background: #fff1f0;
  color: var(--danger);
}

.dashboard-action-card.neutral i {
  background: #eff6ff;
  color: #2563eb;
}

.dashboard-action-card.ok i {
  background: #ecfdf3;
  color: var(--success);
}

.dashboard-action-card:hover {
  border-color: rgba(20, 116, 111, 0.34);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.section-flash-target {
  box-shadow: 0 0 0 2px rgba(209, 77, 67, 0.22), 0 18px 36px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.28s ease;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 16px;
}

.metric-card.metric-card-action {
  cursor: pointer;
}

.metric-card.metric-card-action[aria-disabled="true"] {
  cursor: default;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.metric-card.urgent {
  border-color: rgba(185, 92, 32, 0.32);
  background: #fffaf5;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.content-grid > :only-child {
  grid-column: 1 / -1;
}

.panel {
  overflow: hidden;
}

.panel-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  font-size: 18px;
}

.panel-header select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.compact-search {
  max-width: 280px;
  min-height: 38px;
}

.store-select-search {
  width: 100%;
  max-width: none;
  margin: 6px 0;
}

.store-select-native {
  display: none;
}

.store-multi-picker {
  display: grid;
  gap: 8px;
}

.store-selected-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.store-selected-strip span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(179, 138, 69, 0.34);
  border-radius: 999px;
  background: #fff8e9;
  color: #5c4320;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.store-picker-options {
  display: grid;
  gap: 6px;
  max-height: 188px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.store-picker-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.store-picker-option:hover,
.store-picker-option.is-selected {
  border-color: rgba(21, 100, 84, 0.28);
  background: #eef7f3;
}

.store-picker-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #156454;
}

.store-picker-option span {
  min-width: 0;
}

.store-picker-option strong,
.store-picker-option small {
  display: block;
  overflow-wrap: anywhere;
}

.store-picker-option strong {
  color: #13241f;
  font-size: 13px;
  line-height: 1.35;
}

.store-picker-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.store-picker-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8faf9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

td {
  font-size: 14px;
}

tbody tr:hover {
  background: #f8fbfa;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-paid {
  background: rgba(21, 127, 59, 0.12);
  color: var(--success);
}

.status-partial {
  background: rgba(20, 116, 111, 0.12);
  color: var(--accent);
}

.status-unpaid {
  background: rgba(104, 115, 110, 0.12);
  color: #4d5954;
}

.partner-share-status,
.share-eligible,
.share-not-ready,
.share-no-share {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  white-space: normal;
}

.share-eligible {
  background: rgba(21, 127, 59, 0.12);
  color: var(--success);
}

.share-not-ready {
  background: rgba(154, 82, 15, 0.12);
  color: #9a520f;
}

.share-no-share {
  background: rgba(104, 115, 110, 0.12);
  color: #4d5954;
}

.share-status-hint {
  display: block;
  margin-top: 4px;
}

.status-overdue {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.status-confirmed {
  background: rgba(21, 127, 59, 0.12);
  color: var(--success);
}

.status-disputed {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.status-pending {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.status-applied {
  background: rgba(21, 127, 59, 0.12);
  color: var(--success);
}

.status-rejected {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.select-bill-button {
  min-width: 58px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.select-bill-button.selected {
  border-color: var(--accent);
  background: rgba(20, 116, 111, 0.12);
  color: var(--accent-strong);
}

.bills-view .select-bill-button {
  min-width: 42px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.muted-text {
  color: var(--muted);
}

.metric-action {
  padding: 0;
  font-size: 12px;
}

.metric-action:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.text-button.align-left {
  justify-self: start;
}

.danger-text {
  color: var(--danger);
}

.warning-text {
  color: var(--warning);
}

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

.bill-money-summary,
.bill-status-summary,
.bill-action-stack {
  display: grid;
  gap: 8px;
}

.bill-money-summary {
  min-width: 0;
}

.bill-money-summary small,
.bill-status-summary small {
  color: var(--muted);
  line-height: 1.4;
}

.bill-money-item,
.bill-status-item {
  display: grid;
  align-items: start;
  gap: 6px 10px;
}

.bill-money-item {
  grid-template-columns: 32px minmax(0, 1fr);
}

.bill-money-item span,
.bill-status-item > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bill-money-item strong {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.bill-money-item.accent strong {
  color: var(--accent-strong);
}

.bill-money-item.danger strong {
  color: var(--danger);
}

.bill-money-item.success strong {
  color: var(--success);
}

.bill-status-item {
  grid-template-columns: 32px minmax(0, 1fr);
}

.bill-status-item > div {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.bill-action-stack {
  min-width: 0;
}

.bill-action-primary {
  display: flex;
  justify-content: flex-end;
}

.bill-action-primary .primary-button,
.bill-action-primary .ghost-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.bill-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: flex-end;
}

.bill-action-links.muted .text-button {
  font-size: 12px;
}

.bills-view table {
  min-width: 100%;
  table-layout: fixed;
}

.bills-view th,
.bills-view td {
  padding: 11px 8px;
  white-space: normal;
  vertical-align: top;
}

.bills-view table th:nth-child(1),
.bills-view table td:nth-child(1) {
  width: 52px;
}

.bills-view table th:nth-child(2),
.bills-view table td:nth-child(2) {
  width: 90px;
}

.bills-view table th:nth-child(3),
.bills-view table td:nth-child(3) {
  width: 110px;
}

.bills-view table th:nth-child(4),
.bills-view table td:nth-child(4) {
  width: 76px;
}

.bills-view table th:nth-child(5),
.bills-view table td:nth-child(5) {
  width: 100px;
}

.bills-view table th:nth-child(6),
.bills-view table td:nth-child(6) {
  width: 128px;
}

.bills-view table th:nth-child(7),
.bills-view table td:nth-child(7) {
  width: 78px;
}

.bills-view table th:nth-child(8),
.bills-view table td:nth-child(8) {
  width: 136px;
}

.bills-view table th:nth-child(9),
.bills-view table td:nth-child(9) {
  width: 124px;
}

.client-rank,
.client-grid,
.renewal-list,
.category-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.rank-item,
.client-card,
.category-item,
.renewal-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.rank-item {
  display: grid;
  gap: 8px;
}

.rank-line {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.rank-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.client-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.client-card {
  display: grid;
  gap: 12px;
}

.client-card h4 {
  margin: 0;
  font-size: 17px;
}

.client-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.client-total {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-weight: 800;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-summary span,
.store-summary small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
}

.store-summary strong {
  color: var(--ink);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.product-master-panel {
  min-width: 0;
}

.product-hero-header {
  align-items: flex-start;
}

.product-hero-header h3 {
  margin-top: 4px;
  font-size: 22px;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.product-side-stack {
  display: grid;
  gap: 16px;
}

.product-side-panel {
  overflow: hidden;
}

.compact-header {
  padding: 15px 16px;
}

.product-table {
  min-width: 980px;
}

.product-row {
  transition: background 0.16s ease, opacity 0.16s ease;
}

.product-row[draggable="true"] {
  cursor: grab;
}

.product-row.is-dragging {
  opacity: 0.48;
}

.product-row.is-drag-over {
  background: #ecfdf5;
  outline: 2px solid rgba(13, 148, 136, 0.32);
  outline-offset: -2px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  color: var(--muted);
  vertical-align: -4px;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.product-table th:last-child,
.product-table td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -10px 0 14px rgba(15, 23, 42, 0.04);
}

.product-table th:last-child {
  background: #f8fafc;
}

.product-category-row td {
  position: sticky;
  left: 0;
  background: #f1f8f7;
  color: var(--accent-strong);
  font-weight: 900;
}

.product-category-row span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.partner-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.compact-form {
  padding: 12px 16px;
}

.compact-list {
  gap: 8px;
  padding: 12px 16px 16px;
}

.compact-list .category-item {
  padding: 11px 12px;
}

.stacked-header {
  border-top: 1px solid var(--line);
}

.category-item,
.renewal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-item div,
.renewal-item div {
  display: grid;
  gap: 5px;
}

.category-item span,
.renewal-item span,
td small {
  color: var(--muted);
  font-size: 12px;
}

.renewal-panel {
  margin-top: 18px;
}

.renewal-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.renewal-ops-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}

.renewal-ops-toolbar label {
  min-width: 220px;
}

.renewal-table {
  min-width: 1220px;
}

.renewal-table td {
  vertical-align: top;
}

.renewal-select-cell {
  width: 42px;
  text-align: center;
}

.renewal-table td strong,
.renewal-table td small {
  display: block;
}

.renewal-search-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.renewal-search-field {
  position: relative;
  flex: 1 1 300px;
  min-width: 240px;
}

.renewal-search-field i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.renewal-search-field input {
  width: 100%;
  padding-left: 36px;
}

.renewal-result-count {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.renewal-table td small {
  margin-top: 5px;
}

.renewal-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: flex-start;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.renewal-note-cell {
  max-width: 220px;
  color: var(--muted);
  line-height: 1.5;
}

.renewal-action-heading,
.renewal-action-cell {
  width: 188px;
  min-width: 188px;
}

.renewal-action-cell {
  padding-right: 24px;
}

.renewal-action-cell .text-button {
  white-space: nowrap;
}

.renewal-overdue-row {
  background: #fff8f7;
}

.renewal-table tbody tr.section-flash-target {
  outline: 2px solid rgba(209, 77, 67, 0.32);
  outline-offset: -2px;
}

.renewal-item.expired {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff8f7;
}

.masked-value {
  color: var(--muted);
  font-weight: 800;
}

.annual-fields {
  display: none;
  gap: 14px;
  border: 1px solid rgba(20, 116, 111, 0.18);
  border-radius: 8px;
  background: rgba(20, 116, 111, 0.06);
  padding: 14px;
}

.annual-fields.active {
  display: grid;
}

.sensitive-box {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #f0fdfa;
  padding: 14px;
}

.sensitive-box > div:first-child {
  display: grid;
  gap: 4px;
}

.sensitive-box strong {
  color: var(--ink);
}

.sensitive-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sensitive-box.locked {
  border-color: #e4e7ec;
  background: #f8fafc;
}

.renewal-order-settings {
  display: grid;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.renewal-config-box {
  display: grid;
  gap: 12px;
  border: 1px solid #dce5e3;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.renewal-config-box.is-enabled {
  border-color: rgba(15, 118, 110, 0.28);
  background: #eef8f4;
}

.renewal-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.renewal-config-intro {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.renewal-config-intro strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.renewal-config-intro span {
  color: #51615d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.renewal-config-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f6f68;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.renewal-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.renewal-toggle-card:hover {
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.renewal-toggle-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.renewal-toggle-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.renewal-toggle-copy span {
  color: #51615d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.renewal-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}

.renewal-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.renewal-switch span {
  position: absolute;
  inset: 0;
  border: 1px solid #cbd5d1;
  border-radius: 999px;
  background: #e8eeec;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.renewal-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
  transition: transform 0.16s ease;
}

.renewal-switch input:checked + span {
  border-color: #0f766e;
  background: #0f766e;
}

.renewal-switch input:checked + span::after {
  transform: translateX(20px);
}

.renewal-switch input:focus-visible + span {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

.renewal-config-body {
  display: grid;
  gap: 12px;
  padding: 0 4px 4px;
}

.renewal-config-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.renewal-config-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px 11px;
  min-width: 0;
}

.renewal-config-summary strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.renewal-config-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.renewal-field-copy {
  display: grid;
  gap: 4px;
}

.renewal-field-copy strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.renewal-field-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.renewal-config-body[hidden] {
  display: none;
}

.renewal-order-settings {
  display: none;
}

.renewal-order-settings.active {
  display: grid;
}

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

@media (max-width: 520px) {
  .renewal-config-head,
  .renewal-toggle-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .renewal-switch {
    align-self: flex-end;
  }

  .renewal-config-summary {
    grid-template-columns: 1fr;
  }
}

dialog {
  width: min(680px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

dialog.wide-dialog {
  width: min(1240px, calc(100vw - 28px));
}

dialog.bill-detail-dialog {
  width: min(1180px, calc(100vw - 28px));
}

dialog.dispute-review-dialog {
  width: min(720px, calc(100vw - 28px));
}

dialog.payment-review-dialog {
  width: min(920px, calc(100vw - 28px));
}

dialog.batch-settlement-dialog {
  width: min(980px, calc(100vw - 28px));
}

dialog.manual-payment-dialog {
  width: min(680px, calc(100vw - 28px));
}

dialog.sensitive-unlock-dialog {
  width: min(520px, calc(100vw - 28px));
}

dialog.danger-confirm-dialog {
  width: min(620px, calc(100vw - 28px));
}

dialog.restore-backup-dialog {
  width: min(680px, calc(100vw - 28px));
}

dialog.permission-preview-dialog {
  width: min(920px, calc(100vw - 28px));
}

dialog.renewal-import-dialog,
#renewalBatchDateDialog,
#renewalFollowUpDialog,
#renewalFilterDialog {
  width: min(760px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(10, 20, 18, 0.45);
}

.modal-form {
  display: grid;
  gap: 16px;
  padding: 20px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.modal-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.sticky-modal-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  margin: 0 -20px -20px;
  padding: 12px 20px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.renewal-followup-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f8f6;
}

.renewal-followup-targets span,
.renewal-followup-targets small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.renewal-followup-targets span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.renewal-followup-targets .is-muted,
.renewal-followup-targets small {
  color: var(--muted);
}

.renewal-followup-restriction {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 8px;
  background: #fff9ed;
  color: #7a3f08;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.renewal-followup-entry {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.renewal-followup-history {
  min-width: 0;
}

.renewal-followup-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

.renewal-followup-section-heading h4 {
  margin: 0;
  font-size: 15px;
}

.renewal-followup-section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.renewal-followup-history-list {
  max-height: 280px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.renewal-followup-history-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.6fr);
  gap: 16px;
  min-width: 0;
  padding: 12px 2px;
}

.renewal-followup-history-row + .renewal-followup-history-row {
  border-top: 1px solid var(--line);
}

.renewal-followup-history-meta,
.renewal-followup-history-result {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.renewal-followup-history-meta span,
.renewal-followup-history-result small {
  color: var(--muted);
  font-size: 12px;
}

.renewal-followup-history-result p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.renewal-followup-summary {
  color: #356657;
}

.danger-confirm-body {
  display: grid;
  gap: 10px;
}

.danger-confirm-body article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 8px;
  background: #fff8f7;
  padding: 12px;
}

.danger-confirm-body span,
.danger-confirm-body small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.danger-confirm-body strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.danger-confirm-button {
  border-color: var(--danger);
  background: var(--danger);
}

.permission-preview-body {
  display: grid;
  gap: 12px;
}

.permission-preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-preview-metrics article,
.store-import-preview {
  border: 1px solid #e5ece8;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.permission-preview-metrics article {
  display: grid;
  gap: 5px;
}

.permission-preview-metrics span,
.permission-preview-list span,
.permission-preview-list small,
.store-import-preview-head span,
.store-import-preview-list span,
.store-import-preview-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.permission-preview-metrics strong,
.store-import-preview-head strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.permission-preview-list,
.store-import-preview-list {
  display: grid;
  gap: 8px;
}

.permission-preview-list div,
.store-import-preview-list article {
  display: grid;
  gap: 4px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.partner-profit-toolbar,
.partner-profit-batch-actions,
.partner-profit-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.partner-profit-toolbar {
  justify-content: space-between;
}

.partner-profit-month-filter,
.partner-profit-row-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.partner-profit-month-filter input {
  width: 150px;
  min-height: 36px;
}

.partner-profit-row-head input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.partner-profit-row-actions .ghost-button,
.partner-profit-batch-actions .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.import-error-summary {
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fef2f2;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.import-error-summary strong {
  color: #b91c1c;
  font-size: 13px;
}

.import-error-summary ol {
  margin: 0;
  padding-left: 18px;
  color: #7f1d1d;
  display: grid;
  gap: 4px;
}

.store-import-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.store-import-preview:empty {
  display: none;
}

.store-import-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h3 {
  margin: 0;
}

.bill-detail-panel {
  max-height: min(86vh, 880px);
  overflow: auto;
  background: #fff;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 20px;
  backdrop-filter: blur(14px);
}

.detail-header h3 {
  margin: 4px 0;
  font-size: 24px;
}

.detail-header span {
  color: var(--muted);
}

.detail-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-header-actions .ghost-button {
  min-height: 34px;
  padding: 8px 11px;
}

.detail-body {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.55fr);
  gap: 18px;
  padding: 18px;
  background: #f8faf9;
}

.detail-main,
.detail-side,
.detail-section,
.payment-record-list,
.timeline-list {
  display: grid;
  align-content: start;
  gap: 14px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-stat {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.detail-stat span,
.detail-list dt,
.timeline-item span,
.payment-record p,
.payment-record small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-stat strong {
  color: #111827;
  font-size: 20px;
}

.detail-stat.important {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff8f7;
}

.detail-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-status-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.detail-status-card.confirmation-card {
  align-content: center;
  gap: 9px;
  border-color: #dbe4ec;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.detail-status-card.confirmation-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-status-card.confirmation-card strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f6;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.detail-status-card.confirmation-card.confirmed strong {
  background: #dff7ed;
  color: #047857;
}

.detail-status-card.confirmation-card.disputed strong {
  background: #fff1f2;
  color: #be123c;
}

.detail-status-card.confirmation-card.pending strong {
  background: #f3f4f6;
  color: #4b5563;
}

.detail-status-card span,
.detail-status-card small,
.payment-record-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-status-card strong {
  color: #111827;
  font-size: 17px;
}

.detail-status-card.warning,
.detail-status-card.pending {
  border-color: rgba(217, 119, 6, 0.2);
  background: #fffbeb;
}

.detail-status-card.success {
  border-color: rgba(5, 150, 105, 0.18);
  background: #f0fdfa;
}

.detail-status-card.danger {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff8f7;
}

.detail-audit-summary {
  border-color: rgba(15, 111, 104, 0.16);
  background: #ffffff;
}

.detail-audit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-audit-grid article {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 13px;
}

.detail-audit-grid article.warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: #fffaf0;
}

.detail-audit-grid article.danger {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff8f7;
}

.detail-audit-grid article.success {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
}

.detail-audit-grid span,
.detail-audit-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-audit-grid strong {
  min-width: 0;
  color: #111827;
  overflow-wrap: anywhere;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.detail-table {
  min-width: 620px;
}

.detail-table tfoot td {
  border-top: 1px solid var(--line);
  color: #111827;
  font-weight: 900;
}

.detail-cell-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 3px;
}

.detail-list dd {
  margin: 0;
  color: #111827;
  line-height: 1.5;
}

.detail-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.resolution-note {
  border-left: 3px solid var(--accent);
  background: #f0fdfa;
  padding: 10px 12px;
}

.dispute-review-summary,
.payment-review-summary,
.batch-settlement-summary,
.manual-payment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dispute-review-summary article,
.payment-review-summary article,
.batch-settlement-summary article,
.manual-payment-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.dispute-review-summary article.danger {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff8f7;
}

.payment-review-summary article.pending,
.batch-settlement-summary article.pending,
.manual-payment-summary article.pending {
  border-color: rgba(217, 119, 6, 0.2);
  background: #fffbeb;
}

.dispute-review-summary span,
.dispute-review-summary small,
.payment-review-summary span,
.payment-review-summary small,
.batch-settlement-summary span,
.batch-settlement-summary small,
.manual-payment-summary span,
.manual-payment-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dispute-review-summary strong,
.payment-review-summary strong,
.batch-settlement-summary strong,
.manual-payment-summary strong {
  min-width: 0;
  color: #111827;
  overflow-wrap: anywhere;
}

.manual-payment-form textarea {
  min-height: 96px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.payment-review-table,
.batch-settlement-table {
  min-width: 760px;
}

.payment-review-table td:first-child {
  display: grid;
  gap: 4px;
}

.payment-review-table td:first-child small {
  color: var(--muted);
  font-weight: 800;
}

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

.sensitive-stat {
  background: #fbfcfd;
}

.payment-record,
.timeline-item {
  display: grid;
  gap: 8px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.payment-record > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.payment-record-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.payment-record-grid dd {
  min-width: 0;
  margin: 0;
  color: #111827;
  overflow-wrap: anywhere;
}

.payment-record strong {
  color: #111827;
}

.payment-record p,
.payment-record small,
.timeline-item p {
  margin: 0;
  line-height: 1.5;
}

.timeline-item strong {
  color: #111827;
}

.compact-empty {
  padding: 14px;
}

.detail-command-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-command-panel button,
.detail-actions a {
  width: 100%;
  justify-content: center;
}

.detail-command-panel .primary-button {
  grid-column: span 2;
}

.warning-action {
  border-color: rgba(217, 119, 6, 0.28);
  color: #92400e;
}

.danger-action {
  border-color: rgba(180, 35, 24, 0.28);
  color: #b42318;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.org-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.org-summary-grid article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 13px 14px;
}

.org-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.org-summary-grid strong {
  color: #111827;
  font-size: 22px;
}

.org-summary-grid small {
  color: var(--muted);
  font-size: 12px;
}

.active-region-health {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.active-region-health article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.active-region-health article.warning-card,
.org-summary-grid article.warning-card {
  border-color: rgba(217, 119, 6, 0.24);
  background: #fffbeb;
}

.active-region-health span,
.active-region-health small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.active-region-health strong {
  color: #111827;
  font-size: 18px;
}

.store-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.store-edit-table {
  table-layout: fixed;
  min-width: 860px;
}

.store-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.region-panel,
.store-panel {
  display: grid;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 12px;
}

.region-panel {
  align-content: start;
  border-right: 1px solid var(--line);
  background: #f6f8f7;
}

.store-panel {
  align-content: start;
  min-width: 0;
  background: #fff;
  padding: 16px;
}

.store-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.store-panel-header > div:first-child {
  display: grid;
  gap: 4px;
}

.store-panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.store-list-header {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.store-finder {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe7e1;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.store-finder .compact-search,
.region-panel .compact-search {
  width: 100%;
  max-width: none;
}

.store-finder-results {
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow: auto;
}

.store-finder-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.store-finder-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  text-align: left;
}

.store-finder-result:hover {
  border-color: rgba(20, 116, 111, 0.38);
  background: rgba(20, 116, 111, 0.06);
}

.store-finder-result strong,
.store-finder-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-finder-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.store-edit-table tr.is-located {
  background: rgba(20, 116, 111, 0.1);
  box-shadow: inset 4px 0 0 var(--accent);
}

.region-detail-panel {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
  border: 1px solid #dbe7e1;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.region-detail-panel .primary-button,
.region-detail-panel .ghost-button {
  white-space: nowrap;
}

.region-detail-panel .ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.store-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px dashed #cfded7;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.store-import-panel textarea {
  min-height: 88px;
  resize: vertical;
}

.region-list {
  display: grid;
  gap: 6px;
  max-height: 460px;
  overflow: auto;
}

.region-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  cursor: pointer;
}

.region-list-item:hover {
  background: #fff;
  border-color: var(--line);
}

.region-list-item.is-active {
  border-color: #2f7d68;
  background: #fff;
  box-shadow: inset 3px 0 0 #2f7d68;
}

.region-list-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.region-list-main strong,
.region-list-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-list-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.region-list-badges {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex: 0 0 auto;
}

.region-list-badges small {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.region-list-badges small.ok {
  border-color: rgba(5, 150, 105, 0.22);
  background: #f0fdfa;
  color: #047857;
}

.region-list-badges small.warning {
  border-color: rgba(217, 119, 6, 0.25);
  background: #fffbeb;
  color: #92400e;
}

.store-row-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.store-row-hint.is-moving {
  color: #92400e;
}

.compact-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bill-item-table {
  min-width: 680px;
}

.bill-item-table th,
.bill-item-table td {
  padding: 10px;
}

.bill-item-table input,
.bill-item-table select {
  min-width: 110px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading > div {
  display: grid;
  gap: 4px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bill-items-editor {
  display: grid;
  gap: 12px;
}

.bill-favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.bill-favorite-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 2px 0;
}

.product-favorite-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.store-edit-table th,
.store-edit-table td {
  padding: 9px;
}

.store-edit-table input,
.store-edit-table select {
  min-width: 0;
}

.store-edit-table th:nth-child(1),
.store-edit-table td:nth-child(1) {
  width: 140px;
}

.store-edit-table th:nth-child(2),
.store-edit-table td:nth-child(2) {
  width: 150px;
}

.store-edit-table th:nth-child(3),
.store-edit-table td:nth-child(3) {
  width: 130px;
}

.store-edit-table th:nth-child(4),
.store-edit-table td:nth-child(4),
.store-edit-table th:nth-child(5),
.store-edit-table td:nth-child(5) {
  width: 145px;
}

.store-edit-table th:last-child,
.store-edit-table td:last-child {
  width: 90px;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 116, 111, 0.12);
  outline: none;
}

textarea {
  resize: vertical;
}

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

.styled-select-shell {
  position: relative;
  display: block;
  border: 1px solid #bfd9ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
  min-height: 41px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.styled-select-shell:hover {
  border-color: rgba(15, 118, 110, 0.44);
}

.styled-select-shell::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5b6b66;
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
}

.styled-select-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 116, 111, 0.12);
}

.styled-select {
  border: none;
  min-height: 41px;
  padding: 10px 36px 10px 12px;
  background: transparent;
  color: var(--ink);
  appearance: none;
}

.styled-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.styled-select:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

.renewal-select-label {
  display: grid;
  gap: 7px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-field .ghost-button {
  min-width: 68px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

/* Tabler-inspired UI refresh */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warning: #d97706;
  --danger: #b42318;
  --success: #15803d;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), transparent 260px),
    var(--bg);
}

.sidebar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 1px 0 0 rgba(16, 24, 40, 0.04);
}

.brand-mark {
  background: linear-gradient(135deg, #0f766e, #2563eb);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.24);
}

.brand h1 {
  letter-spacing: 0;
}

.nav-item {
  gap: 10px;
  min-height: 44px;
  color: #475467;
  font-weight: 700;
}

.nav-item .ti {
  font-size: 20px;
}

.nav-item:hover {
  background: #f2f7f7;
  color: var(--accent-strong);
}

.nav-item.active {
  border-color: rgba(15, 118, 110, 0.18);
  background: #e9f7f5;
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-summary {
  border: 1px solid #d7efe9;
  background: linear-gradient(135deg, #eefaf8, #f8fbff);
}

.workspace {
  padding: 30px;
}

.topbar {
  min-height: 72px;
  border: 1px solid rgba(228, 231, 236, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.topbar h2 {
  font-size: 25px;
}

.topbar-actions,
.row-actions,
.client-actions {
  align-items: center;
}

.primary-button,
.ghost-button,
.file-button,
.select-bill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  line-height: 1;
}

.primary-button {
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.ghost-button,
.file-button,
.icon-button {
  background: #ffffff;
}

.metric-card,
.panel,
.rank-item,
.client-card,
.category-item,
.renewal-item,
.login-card {
  border-color: rgba(228, 231, 236, 0.92);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 116px;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
}

.metric-card.urgent::before {
  background: var(--warning);
}

.metric-card strong {
  color: #111827;
}

.metric-card.urgent {
  border-color: rgba(217, 119, 6, 0.22);
  background: #fffaf0;
}

.panel-header {
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.table-wrap {
  background: #fff;
}

table {
  min-width: 900px;
}

th {
  background: #f8fafc;
  color: #667085;
  text-transform: none;
}

td {
  color: #344054;
}

tbody tr:hover {
  background: #f6fbfa;
}

input,
select,
textarea {
  border-color: #d0d5dd;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

dialog {
  border: 1px solid rgba(228, 231, 236, 0.92);
}

.modal-header {
  background: #fbfcfd;
  margin: -20px -20px 0;
  padding: 18px 20px;
}

.modal-actions {
  border-top: 1px solid var(--line);
  margin: 0 -20px -20px;
  padding: 16px 20px;
  background: #fbfcfd;
}

.renewal-actions {
  align-items: end;
  justify-items: end;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}

.settings-shell-panel {
  overflow: hidden;
}

.settings-scope-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  padding: 0 16px 12px;
}

.settings-scope-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #42504b;
  font-weight: 800;
  padding: 10px 16px;
}

.settings-scope-button.active {
  border-color: rgba(20, 116, 111, 0.28);
  background: #ecfdf5;
  color: #0f5d58;
}

.settings-scope-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.settings-scope-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.settings-scope-summary article.warning-card {
  border-color: rgba(185, 92, 32, 0.24);
  background: #fff7ed;
}

.settings-scope-summary article.success-card {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
}

.settings-scope-summary span,
.settings-scope-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.settings-scope-summary strong {
  color: #111827;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.settings-section-stack {
  display: none;
  gap: 18px;
}

.settings-section-stack.active {
  display: grid;
}

.settings-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.settings-card span {
  color: var(--muted);
  line-height: 1.6;
}

.settings-permission-panel {
  margin-top: 18px;
}

.settings-ops-banner[hidden] {
  display: none;
}

.settings-inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid rgba(185, 92, 32, 0.2);
  border-radius: 8px;
  background: #fff7ed;
  padding: 14px 16px;
}

.settings-inline-alert.is-danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff1f2;
}

.settings-inline-alert.is-warning {
  border-color: rgba(185, 92, 32, 0.22);
  background: #fff7ed;
}

.settings-inline-alert > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-inline-alert strong {
  color: #111827;
}

.settings-inline-alert span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.ops-alerts-panel,
.backup-ops-panel,
.security-audit-panel {
  margin-top: 18px;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding: 16px 16px 0;
}

.backup-status-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.backup-status-grid article.warning-card {
  border-color: rgba(185, 92, 32, 0.24);
  background: #fff7ed;
}

.backup-status-grid article.success-card {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
}

.backup-status-grid span,
.backup-status-grid small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.backup-status-grid strong {
  min-width: 0;
  color: #111827;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.backup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  padding: 16px;
}

.backup-list-panel,
.backup-restore-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.backup-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.backup-subhead span,
.backup-restore-note span,
.backup-restore-note small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.backup-list {
  display: grid;
  gap: 10px;
}

.backup-version-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.backup-version-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.ops-alert-list {
  display: grid;
  gap: 10px;
}

.backup-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.backup-list-item div,
.backup-restore-note {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.backup-list-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-list-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.backup-list-item::-webkit-details-marker {
  display: none;
}

.backup-version-body {
  display: grid;
  gap: 10px;
  padding: 10px 0 2px;
}

.backup-version-stats,
.backup-version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-version-stats span,
.backup-version-actions span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf9;
  color: #42504b;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.backup-version-summary,
.backup-version-empty {
  margin: 0;
  color: #111827;
  font-size: 13px;
  line-height: 1.6;
}

.backup-version-base {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.backup-version-log {
  display: grid;
  gap: 8px;
}

.backup-version-log article {
  display: grid;
  gap: 2px;
  border-left: 2px solid #d7e5e0;
  padding-left: 10px;
}

.backup-version-log span,
.backup-version-log small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.backup-version-restore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.backup-version-restore small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.danger-outline-button {
  flex: 0 0 auto;
  border: 1px solid rgba(180, 35, 24, 0.32);
  border-radius: 8px;
  background: #fff8f7;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
  padding: 9px 12px;
}

.danger-outline-button:hover {
  background: #ffeae7;
}

.ops-alert-item {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ops-alert-item p,
.ops-alert-item small {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ops-alert-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ops-alert-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-alert-head strong,
.ops-alert-head span {
  overflow-wrap: anywhere;
}

.ops-alert-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-restore-note code {
  display: block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: #111827;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.operation-guide {
  display: grid;
  gap: 10px;
}

.operation-guide summary {
  color: #111827;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.operation-guide summary::-webkit-details-marker {
  display: none;
}

.operation-guide summary::after {
  content: "展开";
  color: var(--muted);
  float: right;
  font-size: 12px;
  font-weight: 800;
}

.operation-guide[open] summary::after {
  content: "收起";
}

.operation-guide-body {
  display: grid;
  gap: 8px;
}

.account-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 16px 0;
}

.account-overview-metrics article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.account-overview-metrics article.warning-card {
  border-color: rgba(217, 119, 6, 0.22);
  background: #fffaf0;
}

.account-overview-metrics article.success-card {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
}

.account-overview-metrics span,
.account-overview-metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-overview-metrics strong {
  color: #111827;
  font-size: 22px;
}

.account-overview-table {
  min-width: 760px;
}

.project-workspace {
  display: grid;
  gap: 18px;
}

.project-side-summary strong {
  color: var(--accent-strong);
}

.project-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(220, 229, 227, 0.88);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-quiet);
  padding: 20px;
}

.project-hero-panel h3,
.project-hero-panel span,
.project-progress-ring strong,
.project-progress-ring span {
  margin: 0;
}

.project-hero-panel h3 {
  color: #0f1f1c;
  font-size: 24px;
  font-weight: 900;
}

.project-hero-panel > div:first-child {
  display: grid;
  gap: 8px;
}

.project-hero-panel > div:first-child > span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.project-progress-ring {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 154px;
  height: 154px;
  border: 12px solid rgba(20, 116, 111, 0.16);
  border-top-color: var(--accent);
  border-right-color: var(--gold);
  border-radius: 50%;
  background: #fff;
  text-align: center;
}

.project-progress-ring strong {
  color: #0f1f1c;
  font-size: 32px;
  font-weight: 900;
}

.project-progress-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.project-summary-card,
.project-window-card,
.project-plan-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(220, 229, 227, 0.88);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-quiet);
  padding: 16px;
}

.project-summary-card span,
.project-summary-card small,
.project-window-card p,
.project-mini-columns span,
.project-mini-columns small,
.project-blockers small,
.project-list-item span,
.project-list-item small,
.project-plan-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.project-summary-card strong {
  color: #0f1f1c;
  font-size: 27px;
  font-weight: 900;
}

.project-board-panel .panel-header {
  padding: 18px 18px 0;
}

.project-window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  padding: 18px;
}

.project-window-card {
  align-content: start;
}

.project-window-card.active {
  border-color: rgba(37, 99, 235, 0.22);
}

.project-window-card.ok {
  border-color: rgba(20, 122, 69, 0.2);
}

.project-window-head,
.project-window-status,
.project-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-window-head span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.project-window-head strong {
  min-width: 0;
  flex: 1;
  color: #0f1f1c;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.project-window-head em,
.project-window-status strong,
.project-list-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.project-window-status {
  justify-content: space-between;
}

.project-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.project-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.project-mini-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-mini-columns div,
.project-blockers {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.project-blockers {
  border-color: rgba(217, 119, 6, 0.24);
  background: #fffaf0;
}

.status-pill.project-status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill.project-status-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.project-status-neutral {
  background: #f1f5f9;
  color: #475569;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.project-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-list-item {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.project-list-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-list-item i {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
}

.project-list-item.ok i {
  background: #dcfce7;
  color: #166534;
}

.project-list-item.active i {
  background: #dbeafe;
  color: #1d4ed8;
}

.project-list-item.danger i {
  background: #fee2e2;
  color: #b91c1c;
}

.project-list-item div {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 0;
}

.project-list-item strong {
  color: #0f1f1c;
}

.project-list-item em {
  flex: 0 0 auto;
}

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

.project-plan-card strong {
  color: #0f1f1c;
  font-size: 17px;
}

.project-plan-card span {
  position: relative;
  padding-left: 14px;
}

.project-plan-card span::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.portal-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 118, 110, 0.78) 330px, transparent 331px),
    var(--bg);
}

.portal-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.portal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 190px;
  color: #fff;
}

.portal-hero .eyebrow {
  color: #99f6e4;
}

.portal-hero h1 {
  max-width: 760px;
  margin: 8px 0;
  font-size: 34px;
  line-height: 1.18;
}

.portal-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.portal-scope-card {
  display: grid;
  gap: 5px;
  width: min(520px, 100%);
  margin-top: 18px;
  border: 1px solid rgba(153, 246, 228, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  backdrop-filter: blur(12px);
}

.portal-scope-card span,
.portal-scope-card small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.portal-scope-card strong {
  color: #ffffff;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.portal-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(12px);
}

.portal-overview {
  display: grid;
  gap: 16px;
  margin-top: -72px;
  margin-bottom: 18px;
}

.portal-main-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(20, 116, 111, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.portal-main-header,
.portal-main-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.portal-main-headline {
  display: grid;
  gap: 8px;
}

.portal-main-headline span,
.portal-main-state span,
.portal-main-amount span,
.portal-main-meta span,
.portal-main-statuses span,
.portal-action-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-main-headline > span {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(15, 111, 104, 0.16);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 5px 9px;
}

.portal-main-headline h2,
.portal-main-headline p,
.portal-main-state strong,
.portal-main-amount strong,
.portal-main-meta strong,
.portal-main-statuses strong,
.portal-action-copy strong {
  margin: 0;
}

.portal-main-headline h2 {
  color: #10201d;
  font-size: 30px;
  font-weight: 900;
}

.portal-main-headline p {
  max-width: 720px;
  line-height: 1.6;
}

.portal-main-state {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
  text-align: right;
}

.portal-main-state strong {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(20, 116, 111, 0.14);
  border-radius: 999px;
  background: #f8faf9;
  color: #10201d;
  padding: 7px 12px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.portal-main-state[data-state="overdue"] strong,
.portal-main-card[data-state="overdue"] {
  border-color: rgba(180, 35, 24, 0.18);
}

.portal-main-state[data-state="overdue"] strong {
  background: #fff5f4;
  color: var(--danger);
}

.portal-main-state[data-state="disputed"] strong {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff5f4;
  color: var(--danger);
}

.portal-main-state[data-state="pending"] strong,
.portal-main-state[data-state="warning"] strong,
.portal-main-state[data-state="unpaid"] strong {
  border-color: rgba(183, 121, 31, 0.18);
  background: #fffaf0;
  color: var(--warning);
}

.portal-main-state[data-state="paid"] strong {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
  color: var(--success);
}

.portal-main-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-main-amount {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.portal-main-amount.primary {
  background: linear-gradient(180deg, #ffffff, #f8faf9);
}

.portal-main-amount.primary strong {
  color: var(--accent-strong);
  font-size: 42px;
  line-height: 1;
}

.portal-main-amount.secondary strong {
  color: #10201d;
  font-size: 28px;
  line-height: 1.1;
}

.portal-main-amount.secondary[data-tone="warning"] {
  border-color: rgba(183, 121, 31, 0.18);
  background: #fffaf0;
}

.portal-main-amount.secondary[data-tone="danger"] {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff5f4;
}

.portal-main-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.portal-action-cta {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
}

.portal-action-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-action-copy strong,
.portal-action-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-action-copy strong {
  color: #10201d;
  font-size: 14px;
}

.primary-button.portal-action-cta .portal-action-copy strong,
.primary-button.portal-action-cta .portal-action-copy small,
.primary-button.portal-action-cta i {
  color: #fff;
}

.primary-button.portal-action-cta .portal-action-copy small {
  opacity: 0.84;
}

.portal-main-meta,
.portal-main-statuses,
.portal-secondary-metrics {
  display: grid;
  gap: 12px;
}

.portal-main-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-main-meta article,
.portal-main-statuses article {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.portal-main-meta strong {
  color: #13231f;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.portal-main-statuses {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-main-statuses article {
  background: #fbfcfd;
}

.portal-main-statuses strong {
  color: #111827;
  font-size: 24px;
}

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

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.portal-panel-header {
  align-items: center;
}

.portal-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.portal-list-controls select,
.portal-list-controls input {
  min-height: 38px;
}

.portal-list-controls select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #10201d;
  padding: 0 34px 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.portal-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 16px 0;
}

.portal-filter-strip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #dce8e3;
  border-radius: 999px;
  background: #fff;
  color: #41504c;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.portal-filter-strip button:hover,
.portal-filter-strip button.is-active {
  border-color: rgba(15, 111, 104, 0.32);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-filter-strip strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 111, 104, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
}

.portal-bill-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.portal-load-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -76px 0 18px;
  border: 1px solid rgba(205, 221, 218, 0.96);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 18px;
}

.portal-load-state[hidden] {
  display: none;
}

.portal-load-state > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.portal-load-state i {
  flex: none;
  color: var(--accent-strong);
  font-size: 24px;
}

.portal-load-state[data-state="loading"] i {
  animation: portal-load-spin 900ms linear infinite;
}

.portal-load-state[data-state="error"] {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fffafa;
}

.portal-load-state[data-state="error"] i {
  color: #b42318;
}

.portal-load-state span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portal-load-state strong {
  color: #13231f;
}

.portal-load-state small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.portal-actions a.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

@keyframes portal-load-spin {
  to {
    transform: rotate(360deg);
  }
}

.portal-bill-card {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.portal-bill-group {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 1px solid rgba(220, 229, 227, 0.92);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.portal-bill-group[open] {
  box-shadow: var(--shadow-quiet);
}

.portal-group-summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.portal-group-summary::-webkit-details-marker {
  display: none;
}

.portal-group-summary:focus-visible {
  outline: 2px solid rgba(15, 111, 104, 0.32);
  outline-offset: -2px;
}

.portal-group-chevron {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #f1f6f4;
  color: var(--accent-strong);
}

.portal-bill-group[open] .portal-group-chevron i {
  transform: rotate(90deg);
}

.portal-group-chevron i {
  transition: transform 160ms ease;
}

.portal-group-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.portal-group-title strong {
  color: #13231f;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.portal-group-title small,
.portal-group-metrics span,
.portal-group-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.portal-group-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid rgba(220, 229, 227, 0.72);
  background: #f8faf9;
  padding: 12px 14px;
}

.portal-group-metrics div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-group-metrics strong {
  color: #10201d;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.portal-group-metrics div:nth-child(5) strong {
  color: var(--accent-strong);
}

.portal-group-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid rgba(220, 229, 227, 0.72);
  padding: 12px 14px 0;
}

.portal-group-detail-head strong {
  color: #13231f;
  font-size: 14px;
}

.portal-group-bills {
  display: grid;
  padding: 0 14px 14px;
}

.portal-bill-row {
  display: grid;
  gap: 13px;
  min-width: 0;
  border-top: 1px solid rgba(220, 229, 227, 0.72);
  padding: 14px 0;
}

.portal-bill-row.is-located {
  margin-inline: -8px;
  border-radius: 8px;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(15, 111, 104, 0.2);
  padding-inline: 8px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.portal-bill-row:first-child {
  border-top: 0;
}

.portal-bill-head,
.portal-statuses,
.portal-card-actions,
.portal-bill-meta,
.portal-amount-row {
  display: flex;
  gap: 10px;
}

.portal-bill-head {
  align-items: flex-start;
  justify-content: space-between;
}

.portal-bill-head > div:first-child {
  display: grid;
  gap: 4px;
}

.portal-bill-head strong {
  font-size: 18px;
}

.portal-bill-head span,
.portal-bill-meta,
.portal-note {
  color: var(--muted);
}

.portal-statuses,
.portal-card-actions,
.portal-bill-meta {
  flex-wrap: wrap;
}

.portal-amount-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.portal-amount-row div {
  display: grid;
  gap: 4px;
}

.portal-amount-row small {
  color: var(--muted);
  font-weight: 800;
}

.portal-amount-row strong {
  font-size: 18px;
}

.portal-item-table {
  min-width: 0;
}

.portal-item-table td:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-item-table td:last-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.portal-item-table th,
.portal-item-table td {
  padding: 9px 10px;
  white-space: normal;
}

.portal-commission-box {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(15, 111, 104, 0.18);
  border-radius: 12px;
  background: #f2fbf8;
  padding: 12px;
}

.portal-commission-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(15, 111, 104, 0.18);
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px;
}

.portal-commission-lock div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-commission-lock span,
.portal-commission-lock small {
  color: var(--muted);
}

.portal-commission-lock strong,
.portal-commission-lock small {
  overflow-wrap: anywhere;
}

.portal-commission-head,
.portal-commission-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-commission-head span,
.portal-commission-row span,
.portal-commission-row small {
  color: var(--muted);
}

.portal-commission-row {
  border-top: 1px solid rgba(15, 111, 104, 0.12);
  padding-top: 10px;
  flex-wrap: wrap;
}

.portal-commission-row > div {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.portal-commission-row small {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.portal-commission-row .text-button {
  margin-left: auto;
}

@media (max-width: 640px) {
  .portal-commission-lock {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-commission-lock .primary-button {
    width: 100%;
  }
}

.portal-note {
  margin: 0;
  border-left: 3px solid var(--accent);
  background: #f0fdfa;
  padding: 9px 10px;
  font-size: 13px;
}

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

.portal-payment-list > div {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
  font-size: 13px;
}

.portal-payment-list strong {
  color: #111827;
}

.portal-payment-list span:last-child {
  min-width: 0;
  color: var(--muted);
}

.portal-payment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.portal-payment-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-payment-dialog,
.portal-dispute-dialog,
.portal-confirm-dialog,
.portal-payer-change-dialog {
  width: min(620px, calc(100vw - 28px));
}

.portal-payment-form textarea,
.portal-dispute-form textarea,
.portal-confirm-form textarea,
.portal-payer-change-form textarea {
  min-height: 96px;
  resize: vertical;
}

.payer-search-input {
  margin-bottom: 8px;
}

.portal-dispute-form textarea {
  min-height: 128px;
}

.portal-payment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(20, 116, 111, 0.18);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.portal-payment-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.portal-payment-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-payment-summary strong {
  min-width: 0;
  color: #111827;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.form-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portal-side-panel {
  position: sticky;
  top: 18px;
}

/* Executive polish layer */
:root {
  --bg: #eef3f4;
  --surface: #ffffff;
  --surface-soft: #f6f8f8;
  --ink: #16211f;
  --muted: #64716f;
  --line: #dce5e3;
  --accent: #0f6f68;
  --accent-strong: #084d49;
  --accent-soft: #e6f5f2;
  --gold: #b8872f;
  --gold-soft: #fff7e6;
  --slate: #17211f;
  --warning: #b7791f;
  --danger: #b42318;
  --success: #147a45;
  --shadow: 0 18px 42px rgba(17, 32, 30, 0.08);
  --shadow-quiet: 0 1px 2px rgba(17, 32, 30, 0.06);
}

body {
  background:
    linear-gradient(180deg, rgba(12, 59, 55, 0.08), rgba(238, 243, 244, 0) 310px),
    radial-gradient(circle at 82% 0%, rgba(184, 135, 47, 0.11), transparent 300px),
    var(--bg);
}

.sidebar {
  border-right: 1px solid rgba(220, 229, 227, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.94)),
    #fff;
}

.brand-mark {
  background: linear-gradient(135deg, #0b4f4a, #0f766e 58%, #b8872f);
  box-shadow: 0 16px 28px rgba(15, 111, 104, 0.24);
}

.brand h1 {
  color: #10201d;
  font-size: 21px;
  font-weight: 900;
}

.brand p {
  font-size: 12px;
  font-weight: 800;
}

.nav-list {
  gap: 6px;
}

.nav-item {
  min-height: 46px;
  border-radius: 8px;
  color: #53615f;
}

.nav-item.active {
  border-color: rgba(15, 111, 104, 0.18);
  background: linear-gradient(90deg, rgba(15, 111, 104, 0.14), rgba(15, 111, 104, 0.05));
  color: var(--accent-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-summary {
  border-color: rgba(184, 135, 47, 0.24);
  background:
    linear-gradient(135deg, rgba(15, 111, 104, 0.1), rgba(184, 135, 47, 0.12)),
    #fff;
}

.topbar {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 251, 0.78)),
    #fff;
  box-shadow: var(--shadow);
}

.topbar h2 {
  color: #0f1f1c;
  font-weight: 900;
}

.eyebrow {
  color: var(--gold);
  font-weight: 900;
}

.primary-button {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 22px rgba(15, 111, 104, 0.2);
}

.ghost-button,
.file-button,
.icon-button,
.select-bill-button {
  border-color: rgba(220, 229, 227, 0.98);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-quiet);
}

.metric-card,
.panel,
.client-card,
.rank-item,
.category-item,
.renewal-item,
.settings-card {
  border-color: rgba(220, 229, 227, 0.88);
  box-shadow: var(--shadow-quiet);
}

.metric-card {
  overflow: hidden;
  min-height: 104px;
  padding: 16px;
}

.metric-card::before {
  top: 0;
  right: 0;
  width: 58px;
  height: 58px;
  border-radius: 0 0 0 100%;
  background: linear-gradient(135deg, rgba(15, 111, 104, 0.14), rgba(15, 111, 104, 0));
}

.metric-card.urgent::before {
  background: linear-gradient(135deg, rgba(184, 135, 47, 0.2), rgba(184, 135, 47, 0));
}

.metric-card strong {
  font-size: 30px;
  font-weight: 900;
}

.dashboard-command-panel {
  grid-template-columns: minmax(420px, 1.12fr) minmax(300px, 0.88fr);
  gap: 16px;
}

.command-priority {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 111, 104, 0.2);
  background:
    linear-gradient(145deg, rgba(13, 46, 43, 0.96), rgba(11, 79, 74, 0.92)),
    var(--slate);
  color: #fff;
  box-shadow: 0 24px 58px rgba(13, 46, 43, 0.22);
}

.command-priority::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(184, 135, 47, 0.18);
}

.command-priority > * {
  position: relative;
  z-index: 1;
}

.command-priority .eyebrow {
  color: #d6b46b;
}

.command-priority h3 {
  color: #fff;
  font-size: 26px;
}

.priority-kicker {
  width: max-content;
  border: 1px solid rgba(214, 180, 107, 0.34);
  border-radius: 999px;
  background: rgba(214, 180, 107, 0.12);
  color: #ffe7a8;
}

.command-priority > span,
.dashboard-priority-empty span {
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-priority-item,
.dashboard-priority-empty {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

.dashboard-priority-item:hover {
  border-color: rgba(214, 180, 107, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-priority-item strong,
.dashboard-priority-empty strong {
  color: #fff;
}

.dashboard-priority-item span,
.dashboard-priority-item small {
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-priority-item em {
  background: rgba(214, 180, 107, 0.16);
  color: #ffe7a8;
}

.dashboard-priority-item i,
.dashboard-priority-empty i {
  background: rgba(255, 255, 255, 0.12);
  color: #d6b46b;
}

.command-summary {
  border: 1px solid rgba(220, 229, 227, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  padding: 16px;
}

.command-summary-head strong {
  color: #14231f;
  font-size: 17px;
}

.command-summary-head small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-action-card {
  min-height: 120px;
  border-color: rgba(220, 229, 227, 0.9);
  background:
    linear-gradient(180deg, #ffffff, #fbfcfb);
  box-shadow: var(--shadow-quiet);
}

.dashboard-action-card:hover {
  border-color: rgba(15, 111, 104, 0.35);
  transform: translateY(-1px);
}

.panel-header {
  background: linear-gradient(180deg, #ffffff, #f8faf9);
}

th {
  color: #5c6866;
  font-size: 12px;
  letter-spacing: 0;
}

td {
  color: #24312f;
}

.status-pill {
  border: 1px solid transparent;
}

.status-overdue,
.status-disputed,
.status-rejected {
  border-color: rgba(180, 35, 24, 0.16);
}

.status-pending {
  border-color: rgba(183, 121, 31, 0.18);
}

.status-confirmed,
.status-paid,
.status-applied {
  border-color: rgba(20, 122, 69, 0.16);
}

.bill-detail-panel {
  background: #f4f7f6;
}

.detail-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 249, 0.92)),
    #fff;
}

.detail-body {
  background: #f4f7f6;
}

.detail-status-card,
.detail-stat,
.detail-section,
.payment-record,
.timeline-item {
  border-color: rgba(220, 229, 227, 0.9);
  box-shadow: var(--shadow-quiet);
}

.portal-page {
  background:
    linear-gradient(180deg, rgba(10, 33, 31, 0.96), rgba(11, 79, 74, 0.9) 360px, rgba(238, 243, 244, 0) 361px),
    radial-gradient(circle at 78px 60px, rgba(214, 180, 107, 0.18), transparent 280px),
    var(--bg);
}

.portal-shell {
  width: min(1200px, calc(100vw - 36px));
}

.portal-hero {
  min-height: 224px;
  padding-top: 6px;
  padding-bottom: 86px;
}

.portal-hero .eyebrow {
  color: #d6b46b;
}

.portal-hero h1 {
  font-size: 40px;
  font-weight: 900;
}

.portal-hero p {
  color: rgba(255, 255, 255, 0.76);
}

.portal-scope-card {
  border-color: rgba(214, 180, 107, 0.28);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.portal-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.portal-overview {
  margin-top: -68px;
}

.portal-metrics .metric-card {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 50px rgba(14, 34, 32, 0.12);
}

.portal-period-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
}

.portal-period-control strong {
  grid-column: 1 / -1;
}

.portal-period-control input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #dce8e3;
  border-radius: 8px;
  background: #fff;
  color: #13231f;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.portal-main-card {
  border-color: rgba(15, 111, 104, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 251, 0.95));
  box-shadow: var(--shadow);
}

.portal-main-headline h2 {
  color: #13231f;
}

.portal-main-amount.primary {
  border-color: rgba(15, 111, 104, 0.14);
}

.portal-main-amount.secondary {
  background: #fff;
}

.portal-main-meta article,
.portal-main-statuses article {
  border-color: rgba(220, 229, 227, 0.9);
  box-shadow: var(--shadow-quiet);
}

.portal-main-statuses article {
  background: #fbfcfd;
}

.portal-grid .panel,
.portal-side-panel {
  box-shadow: var(--shadow);
}

.portal-grid > .panel:first-child {
  position: relative;
}

.portal-grid > .panel:first-child::after {
  content: "YBHC";
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: rgba(15, 111, 104, 0.055);
  font-size: 54px;
  font-weight: 900;
  pointer-events: none;
}

.portal-bill-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(220, 229, 227, 0.9);
  box-shadow: var(--shadow-quiet);
}

.portal-bill-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(184, 135, 47, 0.72));
}

.portal-bill-card > * {
  position: relative;
}

.portal-bill-head strong {
  color: #13231f;
  font-size: 19px;
}

.portal-amount-row {
  border-color: rgba(220, 229, 227, 0.9);
  background: #f8faf9;
}

.portal-amount-row div:last-child {
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}

.portal-amount-row div:last-child strong {
  color: var(--accent-strong);
}

.portal-payment-summary {
  background: linear-gradient(180deg, #ffffff, #f8faf9);
}

.portal-main-headline {
  gap: 7px;
}

#portalNextDue {
  color: #7a5b18;
}

.portal-action-cta:disabled,
.portal-card-actions button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-button.portal-action-cta:disabled {
  border-color: var(--ledger-line);
  background: #eef3f2;
  color: var(--ledger-muted);
}

.primary-button.portal-action-cta:disabled .portal-action-copy strong,
.primary-button.portal-action-cta:disabled .portal-action-copy small,
.primary-button.portal-action-cta:disabled i {
  color: var(--ledger-muted);
  opacity: 1;
}

.account-governance-list {
  display: grid;
  gap: 12px;
  padding: 16px 16px 0;
}

.governance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(183, 121, 31, 0.22);
  border-radius: 8px;
  background: var(--gold-soft);
  padding: 14px;
}

.governance-head.is-complete {
  border-color: rgba(20, 122, 69, 0.18);
  background: #f0fdfa;
}

.governance-head > div {
  display: grid;
  gap: 4px;
}

.governance-head strong {
  color: #16211f;
}

.governance-head span,
.governance-items span,
.governance-items small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.governance-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.governance-items article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow-quiet);
}

.governance-items strong {
  min-width: 0;
  color: #111827;
  overflow-wrap: anywhere;
}

.governance-more {
  align-self: center;
  border: 1px dashed #d7e1de;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  text-align: center;
}

.bill-row.status-row-overdue {
  background: #fffafa;
}

.bill-row.status-row-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.dashboard-view table td:nth-child(3),
.dashboard-view table td:nth-child(4),
.recycle-view table td:nth-child(4),
.product-table td:nth-child(5),
.product-table td:nth-child(6),
.product-table td:nth-child(8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-view table th:nth-child(3),
.dashboard-view table th:nth-child(4),
.recycle-view table th:nth-child(4),
.product-table th:nth-child(5),
.product-table th:nth-child(6),
.product-table th:nth-child(8) {
  text-align: right;
}

.recycle-summary-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.recycle-view .status-pill {
  margin-top: 4px;
}

.bills-view table th:last-child,
.bills-view table td:last-child,
.dashboard-view table th:last-child,
.dashboard-view table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -10px 0 16px rgba(15, 23, 42, 0.04);
}

.bills-view table th:last-child,
.dashboard-view table th:last-child {
  z-index: 2;
  background: #f8fafc;
}

.bills-view .row-actions {
  justify-content: flex-end;
}

.bills-view table td:nth-child(5) {
  vertical-align: top;
}

.bills-view table td:nth-child(7),
.bills-view table td:nth-child(8) {
  vertical-align: top;
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-auto-flow: column;
  }

  .side-summary {
    margin-left: auto;
    margin-top: 0;
  }

  .metrics-grid,
  .content-grid,
  .dashboard-command-panel,
  .product-layout,
  .portal-grid,
  .store-layout,
  .detail-body {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .dashboard-command-panel {
    grid-template-columns: 1fr;
  }

  .command-actions {
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  }

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

  .portal-main-header,
  .portal-main-body {
    grid-template-columns: 1fr;
  }

  .portal-main-state {
    justify-items: start;
    text-align: left;
  }

  .portal-main-meta,
  .portal-main-statuses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-detail-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-region-health {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-import-panel {
    grid-template-columns: 1fr;
  }

  .product-master-panel {
    grid-column: 1 / -1;
  }

  .product-side-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-status-strip,
  .detail-audit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .compact-upgrade-actions {
    justify-content: flex-start;
  }

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

  .project-summary-grid,
  .project-detail-grid,
  .project-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .sidebar,
  .topbar,
  .panel-header,
  .topbar-actions {
    align-items: stretch;
  }

  .sidebar,
  .topbar,
  .panel-header {
    flex-direction: column;
  }

  .nav-list {
    grid-auto-flow: row;
    width: 100%;
  }

  .side-summary {
    width: 100%;
    margin-left: 0;
  }

	  .metrics-grid,
	  .content-grid,
	  .dashboard-command-panel,
	  .upgrade-control-grid,
	  .command-actions,
	  .settings-scope-summary,
	  .product-layout,
	  .portal-grid,
	  .store-layout,
	  .detail-body,
	  .org-summary-grid,
	  .account-overview-metrics,
	  .backup-status-grid,
	  .backup-layout,
	  .project-hero-panel,
	  .project-summary-grid,
	  .project-detail-grid,
	  .project-plan-grid,
		  .active-region-health,
		  .detail-metrics,
		  .detail-status-strip,
		  .detail-audit-grid,
		  .sensitive-metrics,
	  .payment-record-grid,
	  .detail-command-panel,
	  .form-row {
	    grid-template-columns: 1fr;
	  }

  .project-progress-ring {
    justify-self: start;
    width: 132px;
    height: 132px;
  }

  .project-window-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .project-mini-columns {
    grid-template-columns: 1fr;
  }

  .detail-header {
    position: static;
    flex-direction: column;
  }

  .dashboard-priority-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .dashboard-priority-item em {
    grid-column: 2;
    width: max-content;
  }

  .detail-header-actions {
    justify-content: flex-start;
  }

  .portal-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .portal-hero {
    display: grid;
    min-height: 250px;
  }

  .portal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .portal-list-controls {
    width: 100%;
    justify-content: stretch;
  }

  .portal-list-controls select,
  .portal-list-controls input {
    width: 100%;
  }

  .portal-metrics,
  .portal-main-meta,
  .portal-main-statuses,
  .portal-main-amounts,
  .portal-group-metrics,
  .portal-payment-summary,
  .portal-amount-row {
    grid-template-columns: 1fr;
  }

  .portal-group-summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .portal-group-summary .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .portal-main-headline h2 {
    font-size: 24px;
  }

  .portal-main-amount.primary strong {
    font-size: 34px;
  }

  .portal-main-amount.secondary strong {
    font-size: 24px;
  }

  .portal-main-state {
    justify-items: start;
    text-align: left;
  }

  .portal-period-control {
    grid-template-columns: 1fr;
  }

  .portal-main-header,
  .portal-main-body {
    grid-template-columns: 1fr;
  }

  .portal-side-panel {
    position: static;
  }

  .settings-scope-switch {
    display: grid;
    grid-auto-flow: row;
  }

  .settings-inline-alert,
  .ops-alert-head,
  .backup-subhead {
    align-items: stretch;
    flex-direction: column;
  }

  .store-layout {
    min-height: auto;
  }

  .region-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .store-panel-header {
    display: grid;
  }

  .region-detail-panel {
    grid-template-columns: 1fr;
  }

  .store-import-panel {
    grid-template-columns: 1fr;
  }

  .product-side-stack {
    grid-template-columns: 1fr;
  }

  .product-actions {
    justify-content: stretch;
  }

  .product-actions > * {
    flex: 1 1 160px;
  }

  .inline-form,
  .category-item,
  .renewal-item {
    grid-template-columns: 1fr;
  }

  .category-item,
  .renewal-item {
    align-items: stretch;
  }

  .renewal-actions {
    justify-items: start;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button,
  .ghost-button,
  .file-button {
    width: 100%;
  }
}

/* YBHC premium finance polish layer */
:root {
  --ledger-bg: #edf3f2;
  --ledger-surface: #ffffff;
  --ledger-surface-raised: #fbfdfc;
  --ledger-ink: #101c1a;
  --ledger-muted: #53625f;
  --ledger-line: #d7e2df;
  --ledger-line-strong: #c2d2ce;
  --ledger-accent: #0d665f;
  --ledger-accent-strong: #073f3b;
  --ledger-brass: #9f7226;
  --ledger-brass-soft: #fff6df;
  --ledger-danger-soft: #fff5f3;
  --ledger-warning-soft: #fff9ed;
  --ledger-success-soft: #eefbf4;
  --ledger-focus: 0 0 0 3px rgba(13, 102, 95, 0.16);
}

body {
  color: var(--ledger-ink);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--ledger-focus);
}

.login-page {
  background:
    linear-gradient(118deg, rgba(7, 24, 22, 0.98), rgba(9, 68, 62, 0.92) 50%, rgba(237, 243, 242, 0.98) 50.2%),
    var(--ledger-bg);
}

.login-card {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 72px rgba(8, 28, 26, 0.24);
}

.brand-mark {
  background: linear-gradient(135deg, #083f3b, #0d665f 62%, #9f7226);
}

.primary-button {
  border-color: var(--ledger-accent);
  background: linear-gradient(135deg, var(--ledger-accent), var(--ledger-accent-strong));
  box-shadow: none;
}

.primary-button:hover {
  border-color: var(--ledger-accent-strong);
  background: var(--ledger-accent-strong);
}

.ghost-button,
.file-button,
.icon-button,
.select-bill-button {
  box-shadow: none;
}

.ghost-button:hover,
.file-button:hover,
.icon-button:hover,
.select-bill-button:hover {
  border-color: rgba(13, 102, 95, 0.28);
  background: #f6faf9;
}

.panel,
.metric-card,
.settings-card,
.rank-item,
.client-card,
.category-item,
.renewal-item,
.project-summary-card,
.project-window-card,
.project-plan-card {
  border-color: rgba(215, 226, 223, 0.96);
  box-shadow: 0 1px 2px rgba(16, 28, 26, 0.05);
}

.panel-header {
  border-bottom-color: rgba(215, 226, 223, 0.92);
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
}

.panel-header h3,
.topbar h2,
.brand h1 {
  color: var(--ledger-ink);
}

.panel-header p,
.brand p,
.metric-card small,
.side-summary small {
  color: var(--ledger-muted);
}

.metric-card {
  min-height: 104px;
}

.metric-card::before,
.metric-card.urgent::before {
  width: 0;
  height: 0;
  background: none;
}

.metric-card span,
.backup-status-grid span,
.backup-status-grid small,
.portal-main-headline span,
.portal-main-state span,
.portal-main-amount span,
.portal-main-meta span,
.portal-main-statuses span {
  color: var(--ledger-muted);
}

.metric-card strong,
.portal-main-amount strong,
.portal-main-statuses strong,
.backup-status-grid strong {
  letter-spacing: 0;
}

.dashboard-command-panel {
  gap: 18px;
}

.upgrade-control-panel {
  border-color: rgba(215, 226, 223, 0.92);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
}

.upgrade-control-head h3 {
  font-size: 19px;
}

.upgrade-control-head > div:first-child > span {
  max-width: 760px;
}

.command-priority {
  border-color: rgba(159, 114, 38, 0.28);
  background:
    linear-gradient(145deg, rgba(10, 35, 32, 0.98), rgba(8, 74, 68, 0.94)),
    #0b241f;
  box-shadow: 0 18px 42px rgba(8, 28, 26, 0.22);
}

.command-priority::after {
  inset: auto -100px -150px auto;
  opacity: 0.72;
}

.dashboard-priority-item,
.dashboard-priority-empty {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.075);
}

.dashboard-priority-item em {
  justify-self: end;
  white-space: nowrap;
}

.command-summary {
  border-color: rgba(215, 226, 223, 0.96);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 28, 26, 0.05);
}

.dashboard-action-card {
  min-height: 108px;
  box-shadow: none;
}

.dashboard-action-card strong {
  font-size: 26px;
}

.table-wrap,
.renewal-table-wrap,
.store-table-wrap,
.compact-table-wrap {
  border-top: 1px solid var(--ledger-line);
}

table {
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: var(--ledger-line-strong);
  background: #f4f8f7;
  color: #52625e;
}

td {
  border-bottom-color: rgba(215, 226, 223, 0.82);
  color: #20302d;
}

tbody tr:hover {
  background: #f3faf8;
}

td strong,
.renewal-table td strong,
.payment-review-table td:first-child strong {
  color: var(--ledger-ink);
}

td small,
.renewal-table td small,
.payment-review-table td:first-child small {
  color: var(--ledger-muted);
}

.status-pill {
  min-height: 24px;
  border-radius: 999px;
  padding-inline: 9px;
}

.status-overdue,
.status-disputed,
.status-rejected {
  background: var(--ledger-danger-soft);
}

.status-pending,
.status-partial {
  background: var(--ledger-warning-soft);
}

.status-confirmed,
.status-paid,
.status-applied {
  background: var(--ledger-success-soft);
}

.portal-page {
  background:
    linear-gradient(180deg, rgba(8, 30, 28, 0.98), rgba(9, 78, 71, 0.92) 356px, rgba(237, 243, 242, 0) 357px),
    radial-gradient(circle at 80px 74px, rgba(218, 188, 120, 0.18), transparent 270px),
    radial-gradient(circle at 88% 34px, rgba(79, 150, 142, 0.2), transparent 280px),
    var(--ledger-bg);
}

.portal-hero {
  min-height: 232px;
}

.portal-hero h1 {
  max-width: 720px;
  font-size: 38px;
  line-height: 1.15;
  text-wrap: balance;
}

.portal-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.portal-scope-card {
  border-color: rgba(218, 188, 120, 0.3);
}

.portal-main-card {
  gap: 18px;
  border-color: rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 252, 251, 0.98)),
    #ffffff;
  box-shadow: 0 24px 54px rgba(8, 28, 26, 0.14);
}

.portal-main-card[data-state="overdue"] {
  border-color: rgba(180, 35, 24, 0.2);
}

.portal-main-headline h2 {
  font-size: 32px;
  line-height: 1.16;
  text-wrap: balance;
}

.portal-main-headline > span {
  border-color: rgba(159, 114, 38, 0.24);
  background: var(--ledger-brass-soft);
  color: #775416;
}

.portal-main-amount.primary {
  border-color: rgba(13, 102, 95, 0.18);
  background:
    linear-gradient(180deg, #ffffff, #f4faf8);
}

.portal-main-amount.primary strong {
  color: var(--ledger-accent-strong);
}

.portal-main-amount.secondary[data-tone="warning"] {
  border-color: rgba(159, 114, 38, 0.22);
  background: var(--ledger-warning-soft);
}

.portal-main-actions .ghost-button.portal-action-cta {
  background: #ffffff;
}

.portal-action-cta {
  min-height: 72px;
}

.portal-main-meta article,
.portal-main-statuses article,
.portal-bill-card {
  border-color: rgba(215, 226, 223, 0.94);
  box-shadow: none;
}

.portal-main-statuses article {
  background: #f9fcfb;
}

.portal-main-statuses strong {
  font-size: 22px;
}

.portal-metrics .metric-card {
  border-color: rgba(215, 226, 223, 0.92);
  box-shadow: 0 1px 2px rgba(16, 28, 26, 0.05);
}

.portal-filter-strip {
  gap: 8px;
}

.portal-filter-strip button {
  border-color: rgba(215, 226, 223, 0.96);
  background: #ffffff;
}

.portal-filter-strip button:hover,
.portal-filter-strip button.is-active {
  border-color: rgba(13, 102, 95, 0.32);
  background: #edf8f5;
}

.portal-bill-card::before {
  width: 3px;
  background: var(--ledger-accent);
}

.portal-bill-card.status-overdue-card::before,
.bill-row.status-row-overdue td:first-child {
  background: var(--danger);
}

.portal-grid > .panel:first-child::after {
  content: "";
}

.backup-status-grid article,
.backup-list-panel,
.backup-restore-note {
  box-shadow: none;
}

.backup-status-grid article.warning-card {
  border-color: rgba(159, 114, 38, 0.24);
  background: var(--ledger-warning-soft);
}

.backup-status-grid article.success-card {
  border-color: rgba(20, 122, 69, 0.18);
  background: var(--ledger-success-soft);
}

.ops-alert-item {
  border-top-color: rgba(215, 226, 223, 0.94);
}

.backup-restore-note code {
  border-color: rgba(215, 226, 223, 0.98);
  background: #f7faf9;
}

.project-hero-panel {
  border-color: rgba(215, 226, 223, 0.96);
  box-shadow: 0 1px 2px rgba(16, 28, 26, 0.05);
}

.project-progress-ring {
  border-color: rgba(13, 102, 95, 0.13);
  border-top-color: var(--ledger-accent);
  border-right-color: var(--ledger-brass);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 720px) {
  .portal-main-card {
    padding: 16px;
  }

  .portal-action-cta {
    min-height: 64px;
  }

  .portal-main-headline h2 {
    font-size: 25px;
  }

  .dashboard-action-card,
  .metric-card {
    min-height: auto;
  }

  .backup-version-restore {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-version-restore .danger-outline-button {
    width: 100%;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .renewal-action-heading,
  .renewal-action-cell {
    width: 164px;
    min-width: 164px;
  }

  .renewal-action-cell {
    padding-right: 18px;
  }

  .renewal-row-actions {
    gap: 4px 8px;
  }
}

/* YBHC strong-perception UI v2 */
:root {
  --v2-bg: #e8f0ef;
  --v2-ink: #0c1917;
  --v2-muted: #4d5d59;
  --v2-accent: #006f65;
  --v2-accent-deep: #043c38;
  --v2-gold: #b88325;
  --v2-line: #cdddda;
  --v2-panel-shadow: 0 16px 34px rgba(9, 34, 31, 0.09);
  --v2-hero-shadow: 0 34px 80px rgba(6, 31, 28, 0.2);
}

body {
  background:
    linear-gradient(90deg, rgba(6, 43, 39, 0.055) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, rgba(6, 43, 39, 0.035) 0 1px, transparent 1px 64px),
    var(--v2-bg);
}

.sidebar {
  border-right-color: rgba(0, 111, 101, 0.16);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfa 56%, #eef5f3 100%);
  box-shadow: 12px 0 36px rgba(9, 34, 31, 0.06);
}

.brand-mark {
  box-shadow: 0 12px 28px rgba(0, 111, 101, 0.25);
}

.nav-item {
  border-radius: 8px;
}

.nav-item.active {
  border-color: rgba(0, 111, 101, 0.26);
  background:
    linear-gradient(90deg, rgba(0, 111, 101, 0.13), rgba(255, 255, 255, 0.68));
  box-shadow: inset 4px 0 0 var(--v2-accent);
}

.workspace {
  background:
    radial-gradient(circle at 92% 2%, rgba(184, 131, 37, 0.16), transparent 260px),
    radial-gradient(circle at 12% 0%, rgba(0, 111, 101, 0.1), transparent 260px);
}

.topbar {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 251, 0.92)),
    #fff;
  box-shadow: var(--v2-panel-shadow);
}

.topbar h2 {
  font-size: 27px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--v2-gold);
  letter-spacing: 0;
}

.panel,
.metric-card,
.settings-card,
.rank-item,
.client-card,
.category-item,
.renewal-item,
.project-summary-card,
.project-window-card,
.project-plan-card {
  border-color: rgba(205, 221, 218, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--v2-panel-shadow);
}

.dashboard-command-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.command-priority {
  min-height: 446px;
  padding: 26px 28px;
  border-color: rgba(184, 131, 37, 0.34);
  background:
    linear-gradient(135deg, rgba(4, 32, 29, 0.98), rgba(0, 85, 78, 0.94) 62%, rgba(2, 57, 52, 0.98)),
    #052622;
  box-shadow: var(--v2-hero-shadow);
}

.command-priority::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 72px);
  content: "";
  mask-image: linear-gradient(135deg, #000, transparent 76%);
}

.command-priority::after {
  right: -70px;
  bottom: -94px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 231, 168, 0.16);
  background:
    radial-gradient(circle, rgba(184, 131, 37, 0.34), rgba(184, 131, 37, 0.08) 62%, transparent 63%);
}

.command-priority h3 {
  max-width: 520px;
  font-size: 34px;
  line-height: 1.16;
  text-wrap: balance;
}

.priority-kicker {
  min-height: 82px;
  border-radius: 999px;
  padding-inline: 18px;
  background: rgba(255, 231, 168, 0.13);
  font-size: 14px;
}

.command-priority > span {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.dashboard-priority-list {
  margin-top: auto;
}

.dashboard-priority-item,
.dashboard-priority-empty {
  min-height: 82px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.command-summary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 251, 0.9));
}

.command-actions {
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 14px;
}

.dashboard-action-card {
  height: 100%;
  min-height: 132px;
  border-color: rgba(205, 221, 218, 0.96);
  background:
    linear-gradient(145deg, #ffffff, #f8fbfa);
}

.dashboard-action-card strong {
  font-size: 31px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  inset: auto 14px 0 14px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(0, 111, 101, 0.72), rgba(184, 131, 37, 0.65));
  content: "";
}

.metric-card.urgent {
  background:
    linear-gradient(145deg, #fffdf9, #fff7e7);
}

.content-grid .panel-header {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(190px, 0.8fr) minmax(250px, 1fr);
  gap: 12px;
  align-items: center;
}

.content-grid .panel-header h3 {
  white-space: nowrap;
}

.content-grid .panel-header p {
  white-space: nowrap;
}

.table-wrap {
  border-top-color: rgba(0, 111, 101, 0.18);
}

table {
  background: #fff;
}

th {
  background: #edf4f3;
  color: #344744;
}

td {
  border-bottom-color: rgba(205, 221, 218, 0.88);
}

tbody tr:nth-child(even) {
  background: #fbfdfc;
}

.bills-view table {
  min-width: 1120px;
}

.bills-view table th:nth-child(2),
.bills-view table td:nth-child(2) {
  min-width: 150px;
}

.bills-view table th:nth-child(5),
.bills-view table td:nth-child(5) {
  min-width: 170px;
}

.batch-settlement-bar {
  border-color: rgba(0, 111, 101, 0.16);
  background:
    linear-gradient(90deg, #f7fbfa, #fffaf0);
}

.bill-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) repeat(2, minmax(130px, 0.8fr)) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  background: #fbfcfb;
}

.bill-filter-panel .compact-search,
.bill-filter-panel select,
.bill-filter-panel input[type="date"] {
  width: 100%;
  max-width: none;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.bill-filter-panel .ghost-button {
  min-height: 38px;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .bill-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bill-filter-panel {
    grid-template-columns: 1fr;
  }
}

.project-entry-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid rgba(0, 111, 101, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #062a27, #0a665e);
  box-shadow: var(--v2-hero-shadow);
  color: #fff;
  padding: 22px 24px;
}

.project-entry-panel h3,
.project-entry-panel span,
.project-entry-panel p {
  margin: 0;
}

.project-entry-panel h3 {
  font-size: 24px;
  color: #fff;
}

.project-entry-panel span {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.project-entry-panel .ghost-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-page {
  place-items: stretch;
  padding: 0;
  background:
    linear-gradient(112deg, rgba(3, 24, 22, 0.99) 0%, rgba(0, 84, 77, 0.96) 48%, rgba(232, 240, 239, 0.98) 48.2% 100%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 430px);
  gap: 42px;
  align-items: center;
  width: min(1120px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
}

.login-visual {
  display: grid;
  gap: 22px;
  color: #fff;
}

.login-visual h2 {
  max-width: 640px;
  margin: 0;
  color: #fff;
  font-size: 48px;
  line-height: 1.08;
  text-wrap: balance;
}

.login-visual .eyebrow {
  color: #ffe1a0;
}

.login-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 440px;
}

.login-visual-grid article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.login-visual-grid span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 900;
}

.login-visual-grid strong {
  color: #fff;
  font-size: 18px;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 34px 86px rgba(5, 30, 27, 0.26);
}

.login-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--v2-accent), var(--v2-gold));
  content: "";
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--v2-muted);
  font-size: 13px;
  font-weight: 900;
}

.login-card input {
  min-height: 44px;
  border: 1px solid var(--v2-line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.login-card .primary-button {
  min-height: 48px;
  font-size: 16px;
}

.portal-page {
  background:
    radial-gradient(circle at 12% 80px, rgba(255, 225, 160, 0.18), transparent 280px),
    linear-gradient(180deg, rgba(3, 28, 25, 0.99), rgba(0, 96, 88, 0.94) 430px, rgba(232, 240, 239, 0) 431px),
    var(--v2-bg);
}

.portal-hero {
  min-height: 286px;
  padding-top: 16px;
  padding-bottom: 116px;
}

.portal-hero h1 {
  max-width: 820px;
  font-size: 46px;
}

.portal-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.portal-trust-strip span {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
}

.portal-scope-card {
  margin-top: 16px;
  border-color: rgba(255, 225, 160, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.portal-overview {
  margin-top: -96px;
}

.portal-main-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 34px 86px rgba(5, 30, 27, 0.18);
}

.portal-main-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--v2-accent), var(--v2-gold));
  content: "";
}

.portal-main-card > * {
  position: relative;
}

.portal-main-headline h2 {
  font-size: 38px;
}

.portal-main-amount.primary {
  background:
    linear-gradient(145deg, #06332f, #0a756c);
}

.portal-main-amount.primary span,
.portal-main-amount.primary strong {
  color: #fff;
}

.portal-main-amount.primary strong {
  font-size: 48px;
}

.portal-action-cta {
  border-radius: 8px;
}

.portal-bill-card {
  box-shadow: 0 10px 22px rgba(9, 34, 31, 0.06);
}

.project-hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 216px;
  padding: 30px;
  border-color: rgba(255, 255, 255, 0.84);
  background:
    linear-gradient(135deg, #062a27, #0a665e);
  box-shadow: var(--v2-hero-shadow);
}

.project-hero-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 78px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 78px);
  content: "";
  mask-image: linear-gradient(135deg, #000, transparent 76%);
}

.project-hero-panel > * {
  position: relative;
}

.project-hero-panel h3 {
  max-width: 640px;
  color: #fff;
  font-size: 34px;
  line-height: 1.14;
}

.project-hero-panel > div:first-child > span {
  color: rgba(255, 255, 255, 0.76);
}

.project-progress-ring {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-right-color: var(--v2-gold);
  background: rgba(255, 255, 255, 0.1);
}

.project-progress-ring strong,
.project-progress-ring span {
  color: #fff;
}

.project-summary-grid {
  margin-top: 4px;
}

.project-window-card.active,
.project-window-card.ok,
.project-window-card.neutral {
  box-shadow: var(--v2-panel-shadow);
}

@media (max-width: 1050px) {
  .dashboard-command-panel {
    grid-template-columns: 1fr;
  }

  .content-grid .panel-header {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 24px;
    padding-block: 32px;
  }

  .login-visual h2 {
    font-size: 38px;
  }

  .portal-hero h1 {
    font-size: 38px;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--v2-bg);
  }

  .login-shell {
    width: min(100% - 28px, 430px);
  }

  .login-visual {
    display: none;
  }

  .login-card {
    padding: 24px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .command-priority {
    min-height: auto;
    padding: 22px;
  }

  .command-priority h3 {
    font-size: 28px;
  }

  .priority-kicker {
    min-height: 44px;
  }

  .dashboard-create-order {
    min-height: 72px;
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px;
  }

  .dashboard-create-order i {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .dashboard-create-order strong {
    font-size: 17px;
  }

  .dashboard-create-order small {
    font-size: 12px;
  }

  .dashboard-action-card strong {
    font-size: 28px;
  }

  .project-entry-panel {
    display: grid;
    padding: 20px;
  }

  .portal-page {
    background:
      linear-gradient(180deg, rgba(3, 28, 25, 0.99), rgba(0, 96, 88, 0.94) 440px, rgba(232, 240, 239, 0) 441px),
      var(--v2-bg);
  }

  .portal-hero {
    min-height: 320px;
    padding-bottom: 94px;
  }

  .portal-actions {
    gap: 8px;
    margin-bottom: 14px;
  }

  .portal-hero h1 {
    font-size: 30px;
  }

  .portal-overview {
    margin-top: -76px;
  }

  .portal-main-card {
    padding: 18px 16px;
  }

  .portal-load-state {
    align-items: stretch;
    flex-direction: column;
    margin-top: -58px;
  }

  .portal-load-state .primary-button {
    width: 100%;
    min-height: 44px;
  }

  .portal-card-actions button,
  .portal-card-actions a {
    min-height: 44px;
  }

  .portal-main-headline h2 {
    font-size: 28px;
  }

  .portal-main-amount.primary strong {
    font-size: 38px;
  }

  .project-hero-panel {
    min-height: auto;
    padding: 22px;
  }

  .project-hero-panel h3 {
    font-size: 28px;
  }
}

@media (max-width: 520px) {
  .renewal-search-toolbar {
    gap: 6px;
  }

  .renewal-search-field {
    flex-basis: 100%;
    min-width: 0;
  }

  .renewal-search-toolbar .ghost-button,
  .renewal-search-toolbar .renewal-result-count {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
  }

  .renewal-result-count {
    padding-inline: 8px;
  }

  .renewal-import-panel .compact-actions,
  .sticky-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-form {
    padding: 16px;
    max-height: calc(100vh - 24px);
  }

  .sticky-modal-actions {
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px 16px;
  }

  .renewal-action-heading,
  .renewal-action-cell {
    width: 148px;
    min-width: 148px;
  }

  .renewal-action-cell {
    padding-right: 14px;
  }

  .renewal-row-actions {
    gap: 4px 6px;
  }

  .renewal-action-cell .text-button {
    font-size: 12px;
    line-height: 1.35;
  }

  .renewal-followup-targets {
    display: grid;
  }

  .renewal-followup-history-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-block: 12px;
  }

  .renewal-followup-history-list {
    max-height: 240px;
  }
}
