/* ======================================================
   0) UTILITY & RESET
   ====================================================== */
/* Prevent horizontal scrolling & hide until theme loads */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
.hidden {
  display: none;
}

/* ======================================================
   1) THEME COLOR VARIABLES
   ====================================================== */
:root,
[data-bs-theme=light] {
  --cell-bg: #fff;
  --header-bg: #f1f1f1;
  --text-color: #212529;
  --border-color: #dee2e6;
  --zebra-bg: #f8f9fa;
  --section-bg: #e2e8f0;
  --section-color: #212529;
}

[data-bs-theme=dark] {
  --cell-bg: #0f1727;
  --header-bg: #1e293b;
  --text-color: #fff;
  --border-color: #334155;
  --zebra-bg: #172554;
  --section-bg: #1e293b;
  --section-color: #fff;
}

/* Improve visual separation in dark mode */
[data-bs-theme=dark] .section-card,
[data-bs-theme=dark] .dashboard-tiles .card,
[data-bs-theme=dark] .detail-tile-row .card {
  background-color: #13233a;
  border: 1px solid #3b4f70;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
}

[data-bs-theme=dark] .section-card .card-body,
[data-bs-theme=dark] .dashboard-tiles .card .card-body,
[data-bs-theme=dark] .detail-tile-row .card .card-body {
  background-color: #13233a;
}

[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select {
  background-color: #0e1b2e;
  border-color: #40557a;
}

/* ======================================================
   2) LAYOUT & SPACING
   ====================================================== */
/* Remove top padding from page sections globally */
.py-3 {
  padding-top: 0 !important;
}
section {
  padding-top: 0 !important;
}
.content {
  padding-top: 0 !important;
}
/* Full-width container with symmetric horizontal padding */
.container,
.container-fluid {
  max-width: 100vw;
  padding: 0 1.25rem;
}

/* Slightly more padding on larger screens */
@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* Give main content a bit of breathing room on the right */
.content {
  padding-right: 1rem;
  padding-left: 1rem;
}

/* ======================================================
   3) CARDS
   ====================================================== */
.card {
  border-color: var(--border-color);
  margin-bottom: 1.5rem;
}
.section-card {
  margin-bottom: 0.375rem;
}
.detail-tile-row {
  --bs-gutter-y: 0.5rem;
}
.dashboard-tiles {
  --bs-gutter-y: 0.625rem;
}
.wizard-grid {
  --bs-gutter-y: 0.625rem;
}
.phone-call-grid {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0.625rem;
}
.dashboard-tiles .card {
  margin-bottom: 0;
}
.contacts-grid .card {
  margin-bottom: 0;
}
.contacts-grid {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0.75rem;
}
.section-card-body {
  padding: 0.75rem 0.9rem;
}
.tile-card .card-body {
  padding: 0.5rem 0.75rem;
}
.compact-card .card-body {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.card-header {
  background-color: var(--header-bg);
  color: var(--text-color);
  padding: 0.75rem 1rem;
}
.card-body {
  background-color: var(--cell-bg);
  color: var(--text-color);
  padding: 0.75rem 1rem;
}

/* ======================================================
   4) FORMS
   ====================================================== */
.mb-3 {
  margin-bottom: 1rem !important;
}
input.form-control,
textarea.form-control {
  background-color: var(--cell-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
}
button.btn-link {
  padding: 0.25rem;
}

/* ======================================================
   5) TABLES & SCORECARD
   ====================================================== */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cell-bg);
  color: var(--text-color);
}
.summary-table th,
.summary-table td {
  text-align: left;
}
.summary-account td {
  font-weight: 600;
  background: var(--header-bg);
}
.summary-total td {
  font-weight: 700;
  background: var(--header-bg);
}
.table th,
.table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: center;
}
.table th {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.table tbody tr:nth-child(odd) td {
  background: var(--zebra-bg);
}
.table tbody tr.section-header td {
  background: var(--section-bg);
  color: var(--section-color);
  font-weight: 600;
  text-transform: uppercase;
}

/* ======================================================
   6) TABS
   ====================================================== */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
}
.nav-tabs .nav-link {
  color: #888;
  font-weight: 500;
  padding: 0.5rem 1rem;
}
.nav-tabs .nav-link.active {
  color: var(--text-color);
  background: var(--header-bg);
  border-color: var(--border-color) var(--border-color) transparent;
}
.tab-content > .tab-pane {
  display: none;
}
.tab-content > .active {
  display: block;
}

/* ======================================================
   7) OTHER COMPONENTS
   ====================================================== */
.dropdown-menu {
  min-width: 10rem;
  font-size: 0.9rem;
}
.btn.dropdown-toggle {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
}
.text-danger {
  color: #dc3545 !important;
}
