:root {
  --orange: #f97316;
  --orange-dark: #c2410c;
  --orange-deep: #9a3412;
  --orange-soft: #fff7ed;
}

.sidebar {
  background: linear-gradient(180deg, #fb923c 0%, var(--orange) 46%, var(--orange-dark) 100%);
  border-right: 1px solid rgba(154, 52, 18, 0.22);
}

.brand-logo {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(154, 52, 18, 0.24);
}

.brand-text small,
.sidebar a {
  color: #fff7ed;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sidebar button {
  background: #fff;
  color: var(--orange-dark);
  box-shadow: 0 12px 26px rgba(154, 52, 18, 0.24);
}

.login-page {
  position: relative;
  overflow: hidden;
}

.login-card {
  padding: 34px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 34px 100px rgba(124, 45, 18, 0.28);
  backdrop-filter: blur(18px);
  text-align: center;
}

.login-card label,
.login-card input,
.login-card button,
.login-card a {
  text-align: left;
}

.login-card .auth-logo {
  margin-left: auto;
  margin-right: auto;
}

.auth-logo {
  width: 150px;
  height: auto;
  max-height: 120px;
  margin-bottom: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.content {
  background: linear-gradient(135deg, #fff 0%, var(--orange-soft) 100%);
}

.card,
.panel,
table {
  border-color: rgba(249, 115, 22, 0.16);
}

.dashboard-cards {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.dashboard-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin-left: auto;
  max-width: min(760px, 100%);
}

.period-filter {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.period-filter a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.period-filter a.active,
.period-filter a:hover {
  border-color: rgba(249, 115, 22, 0.38);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.metric-card {
  position: relative;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  overflow: hidden;
  border-left: 4px solid var(--orange);
  padding: 16px;
}

.metric-card:nth-child(2) {
  border-left-color: #2563eb;
}

.metric-card:nth-child(3) {
  border-left-color: #16a34a;
}

.metric-card:nth-child(4) {
  border-left-color: #7c3aed;
}

.metric-card strong {
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric-card small {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.dashboard-grid .panel {
  padding: 16px;
}

.dashboard-grid h2,
.panel h2 {
  font-size: 18px;
  line-height: 1.2;
}

.dashboard-grid p,
.panel p {
  font-size: 13px;
}

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

.dashboard-wide {
  margin-bottom: 12px;
  padding: 16px;
}

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

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.mini-kpis > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #f9fafb;
}

.mini-kpis strong,
.mini-kpis span {
  display: block;
}

.mini-kpis strong {
  color: #101828;
  font-size: 19px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.mini-kpis span {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.stack-list,
.rank-list {
  display: grid;
  gap: 8px;
}

.stack-row,
.rank-row {
  display: grid;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.stack-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-left: 4px solid #f97316;
}

.stack-row span,
.rank-row small {
  color: #667085;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stack-row strong,
.rank-row span {
  font-weight: 900;
}

.stack-row em {
  color: #344054;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.rank-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-left: 4px solid #16a34a;
}

.balance-row {
  border-left-color: #2563eb;
}

.bank-balance-row {
  border-left-color: #7c3aed;
}

.rank-row > div {
  min-width: 0;
}

.rank-row strong,
.rank-row small {
  display: block;
}

.rank-row span {
  color: #101828;
  white-space: nowrap;
}

.empty-state {
  padding: 12px;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
  background: #fff;
}

.currency-head {
  display: block;
  margin-bottom: 2px;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.primary-action {
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.22);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.topbar strong {
  display: block;
  font-size: 15px;
}

.topbar small {
  color: var(--muted);
  font-weight: 650;
}

.profile-menu-wrap {
  position: relative;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.24);
}

.profile-menu {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  min-width: 150px;
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
}

.profile-menu.open,
.profile-menu-wrap:hover .profile-menu {
  display: grid;
}

.profile-menu a,
.profile-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.profile-menu form {
  margin: 0;
}

.modal {
  border: 0;
  border-radius: 10px;
  padding: 0;
  width: min(960px, calc(100vw - 32px));
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.28);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.modal-box {
  padding: 18px;
  background: #fff;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
}

.polished-modal-head {
  position: relative;
  margin: -18px -18px 18px;
  padding: 18px 66px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fafafa);
}

.polished-modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: rgba(249, 115, 22, 0.45);
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.plain-action {
  border: 1px solid #eaecf0;
  background: #fff;
  color: #344054;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 750;
  cursor: pointer;
}

.modal-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  margin-bottom: 10px;
}

.dialog-message {
  margin: 6px 0 0;
  color: #667085;
  font-weight: 700;
}

.user-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.user-summary-strip div,
.api-credential-card,
.api-empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-summary-strip div {
  padding: 12px;
}

.user-summary-strip span,
.api-credential-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-summary-strip strong {
  display: block;
  margin-top: 4px;
}

.profile-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
}

.profile-list dt,
.profile-list dd {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.profile-list dt {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 800;
}

.profile-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-list dt:nth-last-of-type(1),
.profile-list dd:last-child {
  border-bottom: 0;
}

.profile-list small {
  display: block;
  color: var(--muted);
}

.ok-text {
  color: #027a48;
}

.warn-text {
  color: var(--orange-dark);
}

.danger-text {
  color: #9f1239;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.modal-footer-actions form {
  margin: 0;
}

.modal-footer-actions button,
.api-empty-state + form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.modal-footer-actions .danger-button {
  background: #9f1239;
}

.api-credential-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.api-credential-card strong {
  display: block;
  margin-top: 5px;
}

.api-warning {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-weight: 750;
}

.api-empty-state {
  padding: 18px;
}

.api-empty-state p {
  margin: 6px 0 0;
}

.ipn-modal {
  width: min(1180px, calc(100vw - 32px));
}

.ipn-table-shell {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 8px;
  background: #fff;
}

.ipn-table-shell table {
  min-width: 980px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ipn-url-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.ipn-url-table td {
  vertical-align: middle;
}

.ipn-url-table .action-cell {
  width: 74px;
}

.ipn-url-column {
  min-width: 360px;
}

.ipn-url-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font: 700 13px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.ipn-url-input:focus {
  border-color: var(--orange);
  outline: none;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.ipn-test-form {
  display: grid;
  gap: 6px;
  padding: 6px 0;
  min-width: 260px;
}

.ipn-test-form select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: #101828;
}

.picker-only {
  cursor: pointer;
  caret-color: transparent;
  background-color: #fff;
}

.mini-toggle {
  display: inline-flex;
  margin-top: 6px;
  padding: 5px 8px;
  font-size: 11px;
}

.muted-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f9fafb;
  border: 1px solid #eaecf0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.ipn-response-row td {
  background: #fafafa;
  padding: 0;
}

.ipn-response-preview {
  max-height: 180px;
  margin: 0;
  border: 0;
  border-radius: 0;
  white-space: pre-wrap;
}

.action-cell {
  position: relative;
  width: 86px;
}

.icon-action {
  width: 34px;
  height: 30px;
  border: 1px solid #eaecf0;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  color: #344054;
}

.action-menu {
  display: none;
  position: absolute;
  right: 12px;
  top: 44px;
  z-index: 5;
  min-width: 140px;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  padding: 6px;
}

.action-menu.floating-menu {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 1000;
}

.action-menu.open {
  display: grid;
}

.action-menu a,
.action-menu button {
  text-align: left;
  text-decoration: none;
  color: #344054;
  background: #fff;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.action-menu a:hover,
.action-menu button:hover {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.action-menu .danger-menu-button {
  color: #9f1239;
}

.action-menu .danger-menu-button:hover {
  background: #fff1f2;
  color: #9f1239;
}

.stk-status {
  border: 1px solid rgba(249, 115, 22, 0.2);
  background: var(--orange-soft);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  color: #344054;
}

.stk-status-success {
  border-color: rgba(22, 163, 74, 0.28);
  background: #ecfdf3;
  color: #14532d;
}

.stk-status-failed,
.stk-status-timeout {
  border-color: rgba(220, 38, 38, 0.26);
  background: #fef2f2;
  color: #7f1d1d;
}

.stk-success-details {
  margin-top: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.compact-form button:disabled,
.inline-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}

.sub-orange {
  display: block;
  margin-top: 3px;
  color: var(--orange-dark);
  font-size: 11px;
  font-style: italic;
  font-weight: 800;
}

.sub-green {
  display: block;
  margin-top: 3px;
  color: #027a48;
  font-size: 11px;
  font-weight: 800;
}

.amount-positive {
  color: #15803d;
  font-weight: 800;
}

.amount-negative {
  color: #b91c1c;
  font-weight: 800;
}

.title-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 72px;
  margin-left: 8px;
  padding: 8px 12px;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.32);
  font-size: 17px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  vertical-align: middle;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: #667085;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  vertical-align: middle;
}

.badge-success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #027a48;
}

.badge-warning {
  background: var(--orange-soft);
  border-color: rgba(249, 115, 22, 0.35);
  color: var(--orange-dark);
}

.badge-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.settings-row,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin-bottom: 4px;
}

.section-head p {
  margin: 0;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.switch-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.18s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.switch-line input:checked + .switch-ui {
  background: #16a34a;
}

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

.source-form {
  display: grid;
  gap: 10px;
}

.source-form button {
  justify-self: start;
  padding: 8px 12px;
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 2px;
}

.source-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.source-check input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.source-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-check small {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.ipn-backfill-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

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

.time-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

.time-card span {
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-card input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font: inherit;
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.time-card input:focus {
  border-color: var(--orange);
  outline: none;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.compact-source-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  max-height: 210px;
  margin-top: 8px;
}

.ipn-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ipn-submit-row button {
  padding: 10px 14px;
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.ipn-submit-row button:disabled {
  background: #eaecf0;
  color: #98a2b3;
  cursor: not-allowed;
  box-shadow: none;
}

.ipn-submit-row small {
  color: var(--muted);
  font-weight: 700;
}

.ipn-job-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 8px;
  background: #fff;
}

.ipn-job-card.active {
  background: linear-gradient(180deg, #fff 0%, var(--orange-soft) 100%);
}

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

.ipn-job-head strong,
.ipn-job-head small {
  display: block;
}

.ipn-job-head small,
.ipn-job-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaecf0;
}

.progress-track div {
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  transition: width 0.2s ease;
}

.ipn-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.ipn-kpis span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ipn-kpis strong {
  display: block;
  color: #101828;
  font-size: 18px;
  line-height: 1.1;
}

.ipn-history {
  margin-top: 18px;
}

.ipn-history h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.action-menu form {
  display: grid;
  gap: 2px;
  margin: 0;
}

.grid-form .span-2 {
  grid-column: span 2;
}

.secret-field {
  display: grid;
  gap: 6px;
}

.secret-field input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 700 13px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.content {
  width: 100%;
  min-width: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

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

table th,
table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

.compact-table td {
  max-width: 220px;
  overflow-wrap: anywhere;
}

.compact-table td strong,
.compact-table td small {
  white-space: normal;
}

.date-cell {
  min-width: 132px;
}

.date-cell strong {
  white-space: nowrap;
}

.till-code-cell {
  min-width: 112px;
}

.till-code-cell strong,
.till-code-cell small {
  display: block;
}

.till-code-cell small {
  margin-top: 2px;
}

.page-head {
  flex-wrap: wrap;
}

.page-head > div {
  min-width: 240px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar a {
  border-radius: 8px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.grid-form,
.compact-form,
.filter-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.filter-form {
  align-items: end;
}

.modal {
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.modal-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

.readonly-toggle-list input:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

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

  .dashboard-tools {
    justify-items: start;
  }

  .period-filter {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .mini-kpis,
  .stack-row,
  .rank-row,
  .two-column-list {
    grid-template-columns: 1fr;
  }

  .stack-row em,
  .rank-row span {
    white-space: normal;
  }
}

input,
select,
button {
  max-width: 100%;
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: center;
    padding: 14px;
  }

  .brand {
    grid-column: 1 / -1;
    padding: 4px 4px 10px;
  }

  .sidebar form {
    margin-top: 0;
  }

  .content {
    padding: 18px;
  }

  .page-head {
    gap: 10px;
  }

  .modal {
    width: calc(100vw - 20px);
  }
}

@media (max-width: 720px) {
  .ipn-time-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .content {
    padding: 14px;
  }

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

  th,
  td {
    padding: 9px 10px;
  }

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

  .sidebar a,
  .sidebar button {
    padding: 9px 10px;
    font-size: 13px;
  }

  .modal-box {
    padding: 14px;
  }
}
