:root {
  --devbox-ink: #10212b;
  --devbox-muted: #6d7b84;
  --devbox-line: #dfe9ed;
  --devbox-panel: #ffffff;
  --devbox-canvas: #f5faf9;
  --devbox-navy: #123946;
  --devbox-teal: #0ea5a0;
  --devbox-green: #73c446;
  --devbox-sky: #dff4f2;
  --devbox-shadow: 0 16px 40px rgba(18, 57, 70, 0.1);
}

* {
  letter-spacing: 0;
}

body {
  background: var(--devbox-canvas);
  color: var(--devbox-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #0b7f7a;
}

#wrapper {
  display: flex;
  min-height: 100vh;
}

#sidebar-wrapper {
  background: linear-gradient(180deg, #ffffff 0%, #eef8f6 100%);
  border-right: 1px solid var(--devbox-line);
  box-shadow: 14px 0 34px rgba(18, 57, 70, 0.06);
  flex: 0 0 260px;
  min-height: 100vh;
  width: 260px;
}

#page-content-wrapper {
  flex: 1;
  min-width: 0;
}

.sidebar-heading {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 1rem 1rem;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 38px;
  width: 38px;
}

.brand-logo-lg {
  height: 46px;
  width: 46px;
}

.brand-name {
  color: var(--devbox-navy);
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--devbox-muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--devbox-line);
  box-shadow: 0 8px 26px rgba(18, 57, 70, 0.06);
  min-height: 60px;
}

.navbar-brand {
  color: var(--devbox-navy);
  font-weight: 750;
}

.nav-link {
  color: var(--devbox-navy);
  font-weight: 650;
}

.dropdown-menu {
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: var(--devbox-shadow);
}

.list-group {
  gap: 0.15rem;
  padding: 0 0.75rem 1.5rem;
}

.sidebar-nav {
  display: block;
}

.list-group-item {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #31505b;
  font-size: 0.92rem;
  margin-bottom: 0.1rem;
  padding: 0.58rem 0.75rem;
}

.list-group-item.fw-semibold {
  color: #7d9098 !important;
  font-size: 0.72rem;
  letter-spacing: 0;
  margin-top: 0.7rem;
  text-transform: uppercase;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background: var(--devbox-sky);
  color: var(--devbox-navy);
}

.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: transparent;
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(14, 165, 160, 0.14);
  --bs-accordion-active-bg: #e5f7f4;
  --bs-accordion-active-color: var(--devbox-navy);
  margin-top: 0.6rem;
}

.accordion-item {
  background: transparent;
  border: 0;
  margin-bottom: 0.35rem;
}

.accordion-button {
  border-radius: 8px !important;
  color: #31505b;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.7rem 0.75rem;
  text-transform: uppercase;
}

.accordion-button:not(.collapsed) {
  box-shadow: none;
}

.accordion-button::after {
  height: 0.8rem;
  width: 0.8rem;
}

.accordion-body {
  padding: 0.25rem 0 0.35rem 0.7rem;
}

.accordion-body .list-group-item {
  padding-left: 0.75rem;
}

.role-note {
  background: #fff8e5;
  border: 1px solid #f2d58b;
  border-radius: 8px;
  color: #6d5520;
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0.75rem 0;
  padding: 0.85rem;
}

.access-panel {
  background: var(--devbox-panel);
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 57, 70, 0.06);
  max-width: 620px;
  padding: 1.25rem;
}

.container-fluid {
  max-width: 1440px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--devbox-navy);
  font-weight: 750;
}

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

.card,
.table-responsive,
#reader {
  background: var(--devbox-panel);
  border: 1px solid var(--devbox-line);
  border-radius: 8px !important;
  box-shadow: 0 10px 28px rgba(18, 57, 70, 0.07);
}

.table-responsive {
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table th {
  background: #eef8f6;
  color: #31505b;
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.table td,
.table th {
  border-color: var(--devbox-line);
}

.table-hover tbody tr:hover {
  --bs-table-hover-bg: #f2fbf5;
}

.bulk-approve-bar {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 57, 70, 0.06);
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.9rem;
}

.bulk-approve-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.bulk-approve-actions .form-control {
  flex: 0 1 260px;
  min-width: 150px;
}

.bulk-approve-actions .btn {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .bulk-approve-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-approve-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.reward-check-col {
  text-align: center;
  width: 70px;
}

.reward-load-more {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0.75rem 0 0;
}

.reward-source-badge {
  min-width: 58px;
  text-transform: lowercase;
}

.duplicate-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.duplicate-details-table.table-responsive {
  box-shadow: none;
}

.receipt-preview {
  background: #ffffff;
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  max-height: 640px;
  overflow: auto;
  padding: 0.5rem;
}

.receipt-preview img {
  display: block;
  height: auto;
  max-width: 100%;
}

.form-control,
.form-select {
  border-color: #c9dce1;
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--devbox-teal);
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 160, 0.16);
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  --bs-btn-bg: var(--devbox-teal);
  --bs-btn-border-color: var(--devbox-teal);
  --bs-btn-hover-bg: #0b8c87;
  --bs-btn-hover-border-color: #0b8c87;
  --bs-btn-active-bg: #08726f;
  --bs-btn-active-border-color: #08726f;
}

.btn-success {
  --bs-btn-bg: var(--devbox-green);
  --bs-btn-border-color: var(--devbox-green);
  --bs-btn-hover-bg: #62aa3b;
  --bs-btn-hover-border-color: #62aa3b;
}

.btn-outline-secondary {
  --bs-btn-color: var(--devbox-navy);
  --bs-btn-border-color: #b8ccd2;
  --bs-btn-hover-bg: var(--devbox-navy);
  --bs-btn-hover-border-color: var(--devbox-navy);
}

.alert {
  border-radius: 8px;
}

.page-loader {
  align-items: center;
  background: rgba(245, 250, 249, 0.78);
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 2000;
}

.page-loader.is-visible {
  display: flex;
}

.page-loader-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: var(--devbox-shadow);
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
}

.page-loader-mark {
  animation: page-loader-spin 0.85s linear infinite;
  border: 3px solid #d5e7eb;
  border-top-color: #000000;
  border-radius: 999px;
  display: inline-block;
  height: 28px;
  width: 28px;
}

.page-loader-text {
  color: var(--devbox-navy);
  font-weight: 750;
}

@keyframes page-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dashboard-kicker {
  color: var(--devbox-teal);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-refresh {
  align-items: center;
  color: var(--devbox-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.6rem;
  justify-content: flex-end;
}

.dashboard-section {
  margin-bottom: 1.35rem;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric-card {
  background: var(--devbox-panel);
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 57, 70, 0.06);
  color: var(--devbox-ink);
  display: flex;
  flex-direction: column;
  min-height: 136px;
  padding: 1rem;
  text-decoration: none;
}

.metric-card:hover,
.metric-card:focus {
  border-color: rgba(14, 165, 160, 0.45);
  box-shadow: 0 16px 34px rgba(18, 57, 70, 0.11);
  color: var(--devbox-ink);
}

.metric-card-accent {
  border-top: 4px solid var(--devbox-teal);
}

.metric-label {
  color: var(--devbox-muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--devbox-navy);
  font-size: 2rem;
  line-height: 1;
  margin-top: 0.8rem;
}

.metric-action {
  color: #0b7f7a;
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: auto;
}

.dashboard-columns {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.status-list,
.health-grid {
  background: var(--devbox-panel);
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 57, 70, 0.06);
  overflow: hidden;
}

.status-list a,
.health-grid a {
  align-items: center;
  border-bottom: 1px solid var(--devbox-line);
  color: var(--devbox-ink);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  text-decoration: none;
}

.status-list a:last-child,
.health-grid a:last-child {
  border-bottom: 0;
}

.status-list a:hover,
.health-grid a:hover {
  background: #f2fbf5;
}

.status-list span,
.health-grid span {
  color: var(--devbox-muted);
  font-weight: 650;
}

.status-list strong,
.health-grid strong {
  color: var(--devbox-navy);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tenant-toolbar {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.tenant-search-wrap {
  max-width: 520px;
  width: 100%;
}

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

.tenant-sheet {
  font-size: 0.78rem;
  table-layout: fixed;
  width: max-content;
}

.tenant-sheet .btn-sm {
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
}

.tenant-sheet th,
.tenant-sheet td {
  min-width: 0;
  padding: 0.35rem 0.4rem;
  width: 112px;
}

.tenant-sheet th:first-child,
.tenant-sheet td:first-child {
  background: var(--devbox-panel);
  left: 0;
  position: sticky;
  width: 72px;
  z-index: 2;
}

.tenant-sheet thead th:first-child {
  background: #eef8f6;
  z-index: 3;
}

.tenant-sheet th:nth-child(3),
.tenant-sheet td:nth-child(3) {
  width: 150px;
}

.tenant-sheet th:nth-child(4),
.tenant-sheet td:nth-child(4) {
  width: 200px;
}

.tenant-sheet th:nth-child(5),
.tenant-sheet td:nth-child(5),
.tenant-sheet th:nth-child(14),
.tenant-sheet td:nth-child(14) {
  width: 230px;
}

.tenant-sheet th:nth-child(6),
.tenant-sheet td:nth-child(6),
.tenant-sheet th:nth-child(15),
.tenant-sheet td:nth-child(15) {
  width: 120px;
}

.tenant-sheet th:nth-child(7),
.tenant-sheet td:nth-child(7) {
  width: 170px;
}

.tenant-sheet th:nth-child(11),
.tenant-sheet td:nth-child(11) {
  width: 170px;
}

.tenant-sheet th:nth-child(12),
.tenant-sheet td:nth-child(12) {
  width: 210px;
}

.tenant-sheet th:nth-child(16),
.tenant-sheet td:nth-child(16),
.tenant-sheet th:nth-child(17),
.tenant-sheet td:nth-child(17),
.tenant-sheet th:nth-child(18),
.tenant-sheet td:nth-child(18),
.tenant-sheet th:nth-child(19),
.tenant-sheet td:nth-child(19) {
  width: 92px;
}

.tenant-sheet .tenant-save-state {
  width: 62px;
  white-space: nowrap;
}

.tenant-crm-id code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tenant-cell {
  font-size: 0.78rem;
  max-width: 100%;
  min-height: 30px;
  overflow: hidden;
  padding: 0.25rem 0.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.tenant-cell-wide {
  min-width: 0;
}

.login-page {
  background:
    radial-gradient(circle at top left, rgba(115, 196, 70, 0.2), transparent 28rem),
    linear-gradient(135deg, #eef8f6 0%, #ffffff 42%, #e7f7f5 100%);
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--devbox-line);
  border-radius: 8px;
  box-shadow: var(--devbox-shadow);
  max-width: 390px;
  width: 100%;
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.login-brand p {
  color: var(--devbox-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  #wrapper {
    display: block;
  }

  #sidebar-wrapper {
    min-height: auto;
    width: 100%;
  }

  .list-group {
    padding-bottom: 0.75rem;
  }

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

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .dashboard-refresh {
    justify-content: flex-start;
  }
}
