:root {
  color-scheme: light;
  --bg: #fff8e6;
  --surface: #ffffff;
  --surface-strong: #fff1b7;
  --text: #211613;
  --muted: #765d54;
  --line: #f0d8ab;
  --primary: #d8232a;
  --primary-dark: #a9151b;
  --accent: #ffd600;
  --accent-dark: #dba900;
  --danger: #a9151b;
  --shadow: 0 18px 50px rgba(128, 34, 24, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

body.login-active {
  overflow: hidden;
}

body.login-active .app-shell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(255, 248, 230, 0.94);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(33, 22, 19, 0.38);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  display: grid;
  gap: 16px;
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-status,
.connection-status,
.save-status {
  margin-bottom: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffdf4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.connection-status {
  min-height: 42px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  padding: 0 12px;
}

.settings-status:empty {
  display: none;
}

.save-status:empty {
  display: none;
}

.connection-status.success,
.settings-status.success,
.save-status.success {
  background: #fff1b7;
  color: var(--primary-dark);
}

.connection-status.error,
.settings-status.error,
.save-status.error {
  background: #fff1e8;
  color: var(--danger);
}

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

.modal-actions .primary-button {
  width: auto;
  margin-top: 0;
}

.invoice-preview-card {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.invoice-preview-frame {
  width: 100%;
  height: min(68vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

body.login-active .login-screen {
  display: grid;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-logo {
  width: min(280px, 100%);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 10px 18px rgba(33, 22, 19, 0.12));
}

.login-card h1 {
  font-size: 25px;
}

.login-bismillah {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
  direction: rtl;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #d8232a;
  color: #f8fbf5;
}

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

.brand-logo {
  width: 58px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(33, 22, 19, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #fff4bd;
  margin-top: 2px;
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: #fff8e6;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(33, 22, 19, 0.18);
}

.master-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.master-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.master-tab.active {
  background: var(--surface-strong);
  color: var(--accent-strong);
  border-color: var(--accent);
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
}

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

.active-user {
  min-height: 42px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
}

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

.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.ghost-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.danger-button {
  background: #fff1e8;
  border-color: #efb0a7;
  color: var(--danger);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

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

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 26px;
  line-height: 1.1;
}

.dashboard-grid,
.split-layout,
.master-grid,
.backup-reset-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid,
#dashboard,
#dashboard .panel,
#dashboard .table-panel,
#dashboard .table-wrap {
  min-width: 0;
  max-width: 100%;
}

#dashboard {
  overflow-x: hidden;
}

#dashboard .panel-header,
#dashboard .panel-header > div,
#dashboard .invoice-filters,
#dashboard .search-input {
  min-width: 0;
  max-width: 100%;
}

#dashboard h2,
#dashboard h3,
#dashboard p,
#dashboard .text-column {
  overflow-wrap: anywhere;
}

.price-analysis-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.price-analysis-summary {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.price-analysis-summary strong {
  color: var(--text);
  font-size: 14px;
}

.price-analysis-table {
  min-width: 1540px;
}

.price-analysis-table th,
.price-analysis-table td {
  max-width: 190px;
  vertical-align: top;
}

.price-analysis-table th {
  white-space: nowrap;
}

.price-analysis-table td {
  white-space: normal;
}

.price-analysis-cards {
  display: none;
}

.price-analysis-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.price-analysis-card header {
  margin-bottom: 12px;
}

.price-analysis-card h3,
.price-analysis-card header span {
  margin: 0;
}

.price-analysis-card header span {
  color: var(--muted);
  font-size: 12px;
}

.price-card-values {
  display: grid;
  gap: 0;
  margin: 0 0 12px;
}

.price-card-values > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.price-card-values dt,
.price-card-values dd {
  margin: 0;
}

.price-card-values dt {
  color: var(--muted);
}

.price-card-values dd {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.price-card-summary,
.price-card-margins {
  font-weight: 700;
}

.wisning-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.wisning-tabs .master-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.wisning-view-stack,
.wisning-items,
.wisning-dashboard-grid {
  display: grid;
  gap: 18px;
}

.wisning-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(90px, 0.6fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.wisning-mutasi-item {
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.4fr) auto;
}

.wisning-remove-item {
  min-width: 72px;
}

.wisning-form-total {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

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

.wisning-dashboard-grid section {
  min-width: 0;
}

.wisning-dashboard-grid h3,
#wisning-rekap-content h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}

.wisning-offline-summary,
.wisning-info-section {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.wisning-offline-summary span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.wisning-info-section h3 {
  margin: 16px 0 0;
}

#wisning-komisi-penjual-table {
  min-width: 0;
  max-width: 100%;
}

#wisning-komisi-penjual-table .table-wrap {
  max-width: 100%;
}

#wisning-komisi-penjual-table table,
.wisning-commission-table {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
}

#wisning-komisi-penjual-table th,
#wisning-komisi-penjual-table td,
.wisning-commission-table th,
.wisning-commission-table td {
  padding: 9px 8px;
  line-height: 1.35;
}

#wisning-komisi-penjual-table th:nth-child(n+2):nth-child(-n+4),
#wisning-komisi-penjual-table td:nth-child(n+2):nth-child(-n+4),
.wisning-commission-table th:nth-child(n+2):nth-child(-n+4),
.wisning-commission-table td:nth-child(n+2):nth-child(-n+4) {
  text-align: right;
  white-space: nowrap;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}

#wisning-komisi-penjual-table td:first-child,
.wisning-commission-table td:first-child {
  max-width: 240px;
  white-space: normal;
}

.table-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
}

.split-layout {
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  align-items: start;
}

.internal-finance-stack {
  display: grid;
  gap: 18px;
}

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

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

.backup-reset-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  align-items: start;
}

.period-close-panel {
  display: grid;
  gap: 18px;
}

.period-close-controls {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(240px, 360px) max-content;
  gap: 12px;
  align-items: end;
}

.period-close-warning {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid #d89c22;
  background: #fff8e8;
  color: #704d08;
  font-size: 13px;
  line-height: 1.5;
}

.period-close-result {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.period-close-result[hidden] {
  display: none;
}

.compact-panel-header {
  margin-bottom: 0;
}

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

.period-close-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle, #fafafa);
}

.period-close-card h4,
.period-close-plan h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.period-close-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.period-close-table th,
.period-close-table td {
  padding: 7px 8px;
  overflow-wrap: anywhere;
}

.period-close-table th:last-child,
.period-close-table td.numeric-cell {
  width: 42%;
  text-align: right;
  white-space: nowrap;
}

.period-close-table .empty-cell {
  text-align: center;
  color: var(--muted);
}

.period-close-plan {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.period-close-plan ul {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding-left: 20px;
}

.period-close-plan code {
  overflow-wrap: anywhere;
}

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

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

.period-close-confirmation {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d7a33c;
  border-radius: 6px;
  background: #fffaf0;
}

.period-close-confirmation label {
  max-width: 320px;
}

.period-close-plan .success-text {
  color: #17643a;
}

.period-close-plan .error-text {
  color: #a22b2b;
}

.period-close-backup-result {
  display: grid;
  gap: 8px;
}

.period-close-backup-link {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.period-close-backup-link:hover {
  border-color: var(--accent);
}

.period-close-backup-link span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.single-form-grid {
  grid-template-columns: 1fr;
}

.full-width-button {
  width: 100%;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.order-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.order-items-header h3,
.order-summary h3 {
  margin: 0;
  font-size: 15px;
}

.order-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.order-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf4;
}

.order-item .product-suggestions {
  grid-column: 1 / -1;
  order: 2;
}

.order-item .icon-button {
  justify-self: end;
  width: 42px;
}

.icon-button {
  min-height: 42px;
  border: 1px solid #efb0a7;
  border-radius: 8px;
  background: #fff1e8;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.order-summary {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin-top: 12px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-grid strong {
  text-align: right;
}

.summary-section-title,
.summary-items {
  grid-column: 1 / -1;
}

.summary-section-title {
  margin-top: 6px;
  color: var(--text);
}

.summary-items {
  display: grid;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.summary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.summary-item span {
  color: var(--text);
  font-weight: 700;
}

.summary-item strong {
  white-space: nowrap;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 3px solid rgba(216, 35, 42, 0.18);
  border-color: var(--primary);
}

input[readonly] {
  background: #fff1b7;
  color: var(--primary-dark);
  cursor: not-allowed;
  font-weight: 800;
}

.autocomplete-list {
  grid-column: 1 / -1;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.autocomplete-option {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.autocomplete-option:last-child {
  border-bottom: 0;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
  background: var(--surface-strong);
  outline: 0;
}

.autocomplete-option strong,
.autocomplete-option span {
  display: block;
}

.autocomplete-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-input {
  max-width: 260px;
}

.invoice-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-select {
  min-width: 112px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

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

table.content-sized-table.compact-table,
table.content-sized-table.balanced-table {
  min-width: 0;
}

table.content-sized-table.scroll-table {
  min-width: 760px;
  max-width: none;
}

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

th {
  color: var(--primary-dark);
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

td {
  font-size: 14px;
}

th.money-column,
td.money-column {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th.qty-column,
td.qty-column {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

th.date-column,
td.date-column {
  width: 1%;
  white-space: nowrap;
}

th.money-column,
td.money-column {
  width: 1%;
}

th.text-column,
td.text-column {
  min-width: 140px;
  max-width: 380px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

#dashboard .table-wrap {
  overflow-x: auto;
}

#dashboard table {
  width: max-content;
  max-width: none;
}

#dashboard .compact-table {
  min-width: 100%;
}

#dashboard .balanced-table {
  min-width: min(620px, 100%);
}

#dashboard th,
#dashboard td {
  overflow-wrap: anywhere;
}

#dashboard th.money-column,
#dashboard td.money-column,
#dashboard th.qty-column,
#dashboard td.qty-column,
#dashboard th.date-column,
#dashboard td.date-column {
  overflow-wrap: normal;
  word-break: normal;
}

.financial-report-wrap {
  max-width: 820px;
  margin-bottom: 22px;
}

.financial-report-table {
  width: auto;
  min-width: min(620px, 100%);
  table-layout: auto;
}

.financial-report-table th,
.financial-report-table td {
  padding: 8px 12px;
  white-space: nowrap;
}

.financial-report-table th:first-child,
.financial-report-table td:first-child {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.financial-report-table .number-cell {
  min-width: 120px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.financial-report-table .financial-section-row td {
  padding-top: 16px;
  padding-bottom: 10px;
  background: #fff1b7;
  color: var(--primary-dark);
  font-weight: 900;
  text-transform: uppercase;
}

.financial-report-table .financial-section-row + tr td {
  border-top: 6px solid #fffdf4;
}

.financial-report-table .empty-cell {
  color: transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warning {
  background: #211613;
  color: var(--accent);
}

.bar-chart {
  display: grid;
  gap: 12px;
  min-height: 260px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 92px;
  align-items: center;
  gap: 12px;
}

.bar-track {
  height: 16px;
  border-radius: 999px;
  background: #ffe999;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.promo-chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 12px 0;
}

.promo-chart-wrap canvas {
  width: 100%;
  min-width: 720px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

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

.follow-up-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.follow-up-item strong,
.follow-up-item span {
  display: block;
}

.follow-up-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

  .price-analysis-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .split-layout {
    align-items: stretch;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1;
  }

  .connection-status,
  .active-user {
    width: 100%;
  }

  .metric-grid,
  .dashboard-grid,
  .split-layout,
  .master-grid,
  .backup-reset-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .period-close-controls,
  .period-close-preview-grid {
    grid-template-columns: 1fr;
  }

  .period-close-controls button,
  .period-close-actions button {
    width: 100%;
  }

  .price-analysis-layout {
    grid-template-columns: 1fr;
  }

  .wisning-dashboard-grid,
  .wisning-item-row,
  .wisning-mutasi-item {
    grid-template-columns: 1fr;
  }

  .order-item {
    grid-template-columns: 1fr;
  }

  .order-items-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header {
    display: grid;
  }

  .search-input {
    max-width: none;
  }

  .invoice-filters {
    justify-content: stretch;
  }

  #dashboard .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #dashboard table,
  #dashboard table.content-sized-table,
  #dashboard table.compact-table,
  #dashboard table.balanced-table,
  #dashboard table.content-sized-table.compact-table,
  #dashboard table.content-sized-table.balanced-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
  }

  #dashboard th,
  #dashboard td {
    padding: 9px 6px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #dashboard th {
    font-size: 10px;
  }

  #dashboard .text-column {
    width: auto;
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #dashboard .money-column,
  #dashboard .qty-column,
  #dashboard .date-column {
    width: auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 11px;
  }

  .table-wrap table.scroll-table {
    min-width: 760px;
    table-layout: auto;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 7px 5px;
    font-size: 10.5px;
    line-height: 1.3;
  }

  .table-wrap table.compact-table {
    min-width: 0;
    width: max-content;
    max-width: 100%;
    table-layout: auto;
  }

  .compact-table th,
  .compact-table td {
    min-width: 0;
    padding-inline: 4px;
  }

  .compact-table th {
    font-size: 9.5px;
  }

  .compact-table .text-column {
    min-width: 110px;
    max-width: 220px;
  }

  .compact-table .date-column {
    width: 1%;
  }

  .compact-table .qty-column {
    width: 1%;
  }

  .compact-table .money-column {
    width: 1%;
  }

  .scroll-table .text-column {
    min-width: 150px;
  }

  .scroll-table .date-column {
    min-width: 92px;
  }

  .scroll-table .qty-column {
    min-width: 48px;
  }

  .scroll-table .money-column {
    min-width: 94px;
  }

  .orders-search-table td:nth-child(2) {
    min-width: 120px;
  }

  .orders-search-table th:nth-child(3),
  .orders-search-table td:nth-child(3),
  .account-recap-table .text-column,
  .wisning-offline-sales-table th:nth-child(3),
  .wisning-offline-sales-table td:nth-child(3) {
    min-width: 220px;
    white-space: normal;
  }

  .wisning-offline-sales-table th:nth-child(5),
  .wisning-offline-sales-table td:nth-child(5) {
    white-space: nowrap;
    min-width: 100px;
  }

  .price-analysis-table-wrap {
    display: none;
  }

  .price-analysis-cards {
    display: grid;
    gap: 12px;
  }

  .financial-report-table {
    min-width: 0;
    width: max-content;
    max-width: 100%;
  }

  .financial-report-table th,
  .financial-report-table td {
    padding: 8px 7px;
  }

  .financial-report-table th {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .financial-report-table td {
    white-space: normal;
    overflow-wrap: break-word;
  }

  .financial-report-table th:first-child,
  .financial-report-table td:first-child {
    min-width: 130px;
  }

  .financial-report-table .number-cell {
    min-width: 92px;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .bar-row {
    grid-template-columns: 82px 1fr;
  }

  .bar-row strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 25px;
  }

  .metric strong {
    font-size: 22px;
  }

  .panel,
  .metric {
    padding: 14px;
  }

  #dashboard .panel {
    padding: 12px;
  }

  #dashboard .panel-header {
    gap: 10px;
  }

  #dashboard .invoice-filters,
  #dashboard .search-input {
    width: 100%;
  }

  #dashboard .dashboard-grid {
    gap: 12px;
  }

  #dashboard .table-panel {
    display: grid;
    gap: 8px;
  }

  #dashboard .table-panel h3 {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.25;
  }

  #dashboard .table-wrap {
    overflow-x: hidden;
  }

  #dashboard table,
  #dashboard table.content-sized-table,
  #dashboard table.compact-table,
  #dashboard table.balanced-table,
  #dashboard thead,
  #dashboard tbody,
  #dashboard tr,
  #dashboard th,
  #dashboard td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #dashboard thead {
    display: none;
  }

  #dashboard tbody {
    display: grid;
    gap: 8px;
  }

  #dashboard tbody tr {
    display: grid;
    gap: 0;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf4;
  }

  #dashboard tbody td {
    display: grid;
    grid-template-columns: minmax(88px, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid rgba(240, 216, 171, 0.72);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #dashboard tbody td:last-child {
    border-bottom: 0;
  }

  #dashboard tbody td::before {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  #dashboard tbody td > * {
    min-width: 0;
    max-width: 100%;
    justify-self: end;
  }

  #dashboard .status-pill {
    white-space: normal;
    text-align: right;
  }

  #dashboard-orders-table td:nth-child(1)::before {
    content: "Invoice";
  }

  #dashboard-orders-table td:nth-child(2)::before {
    content: "Customer";
  }

  #dashboard-orders-table td:nth-child(3)::before {
    content: "Produk";
  }

  #dashboard-orders-table td:nth-child(4)::before {
    content: "Total Pcs";
  }

  #dashboard-shipping-table td:nth-child(1)::before {
    content: "Expedisi";
  }

  #dashboard-shipping-table td:nth-child(2)::before {
    content: "Customer";
  }

  #dashboard-shipping-table td:nth-child(3)::before {
    content: "Produk";
  }

  #dashboard-shipping-table td:nth-child(4)::before {
    content: "Total Pcs";
  }

  #dashboard-payments-table td:nth-child(1)::before {
    content: "Konsumen";
  }

  #dashboard-payments-table td:nth-child(2)::before {
    content: "Metode";
  }

  #dashboard-payments-table td:nth-child(3)::before {
    content: "Invoice";
  }

  #dashboard-payments-table td:nth-child(4)::before {
    content: "Nominal";
  }

  #dashboard-cash-table td:nth-child(1)::before {
    content: "Jenis";
  }

  #dashboard-cash-table td:nth-child(2)::before {
    content: "Keterangan";
  }

  #dashboard-cash-table td:nth-child(3)::before {
    content: "Masuk";
  }

  #dashboard-cash-table td:nth-child(4)::before {
    content: "Keluar";
  }

  #dashboard-stock-alert-table td:nth-child(1)::before {
    content: "Nama Komponen";
  }

  #dashboard-stock-alert-table td:nth-child(2)::before {
    content: "Lokasi Mitra";
  }

  #dashboard-stock-alert-table td:nth-child(3)::before {
    content: "Stock Akhir";
  }

  #dashboard-stock-alert-table td:nth-child(4)::before {
    content: "Status Stock";
  }

  #dashboard-product-ranking-table td:nth-child(1)::before {
    content: "Produk";
  }

  #dashboard-product-ranking-table td:nth-child(2)::before {
    content: "Total Pcs";
  }

  #dashboard-customer-ranking-table td:nth-child(1)::before {
    content: "Konsumen";
  }

  #dashboard-customer-ranking-table td:nth-child(2)::before {
    content: "Total Pcs";
  }
}

@media (max-width: 360px) {
  .main {
    padding-right: 10px;
    padding-left: 10px;
  }

  #dashboard .panel {
    padding: 10px;
  }

  #dashboard tbody tr {
    padding: 8px;
  }

  #dashboard tbody td {
    grid-template-columns: minmax(78px, 40%) minmax(0, 1fr);
    gap: 8px;
    font-size: 11.5px;
  }

  #dashboard tbody td::before {
    font-size: 10px;
  }
}
