/* ─── Bootstrap 5 Overrides for Compact + Readable Theme ─── */

/* Base font size: slightly larger for readability */
html {
  font-size: 15px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-main);
  line-height: 1.4;
}

/* Headings: keep modest */
h1 { font-size: 1.25rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 0.95rem; font-weight: 600; }
h4 { font-size: 0.875rem; font-weight: 600; }

/* ─── Form controls: compact but not tiny (target 32-36px tall) ─── */
.form-control-sm,
.form-select-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  line-height: 1.45;
  border-radius: var(--radius-md);
  border-color: var(--border-subtle);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  min-height: 34px;
}

.form-control-sm:focus,
.form-select-sm:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background-color: #fff;
}

.form-control-sm::placeholder {
  color: var(--text-faint);
}

/* Textareas */
textarea.form-control-sm {
  min-height: 60px;
  resize: vertical;
}

/* Checkboxes */
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: var(--focus-ring);
  border-color: var(--primary);
}

/* ─── Buttons: compact with readable labels ─── */
.btn {
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.3rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  min-height: 32px;
}

.btn:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Bootstrap card overrides ─── */
.card {
  border-radius: var(--radius-lg);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.card-header {
  background: transparent;
  border-bottom-color: var(--border-subtle);
  padding: 0.6rem 0.85rem;
}

.card-body {
  padding: 0.6rem 0.85rem;
}

/* ─── Nav tabs overrides ─── */
.nav-tabs {
  border-bottom-color: var(--border-subtle);
}

.nav-tabs .nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.nav-tabs .nav-link:hover:not(.active) {
  color: var(--text-main);
  border-color: transparent;
}

/* ─── Badge overrides ─── */
.badge {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
}

/* ─── Modal overrides ─── */
.modal-content {
  border-radius: var(--radius-lg);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

/* ─── Table overrides for density ─── */
.table {
  font-size: 0.875rem;
}

.table > :not(caption) > * > * {
  padding: 0.4rem 0.6rem;
}

/* ─── Scrollbar styling ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Selection colour ─── */
::selection {
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Link styling ─── */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
