/* Project-wide corner-radius enforcement.
 * Loaded right after material-dashboard.css so it overrides any variant
 * (.min.css, the fixed-plugin theme swap, third-party widgets, etc.) that
 * ships rounder defaults than the dashboard page actually uses.
 *
 * Reference tokens (from static/assets/css/material-dashboard.css, the
 * unminified bundle that the dashboard renders with):
 *   --bs-card-border-radius : 0.225rem   (≈3.6px)   ← cards, modals, list-groups
 *   --bs-border-radius      : 0.375rem   (≈6px)
 *   --bs-border-radius-lg   : 0.375rem   (≈6px)
 *   --bs-border-radius-sm   : 0.1925rem  (≈3px)
 *   --bs-border-radius-xl   : 0.75rem    (kept for outer hero blocks only)
 *
 * The minified bundle (material-dashboard.min.css) ships a different
 * --bs-card-border-radius of 0.5rem, and the Material-Dashboard fixed
 * plugin (#pagestyle) can hot-swap stylesheets at runtime. Lock the
 * variables here so the result is deterministic regardless.
 */

:root,
.dark-version {
  --bs-card-border-radius: 0.225rem;
  --bs-card-inner-border-radius: 0.225rem;
  --bs-border-radius: 0.225rem;
  --bs-border-radius-sm: 0.1925rem;
  --bs-border-radius-lg: 0.375rem;
  --bs-border-radius-xl: 0.5rem;
  --bs-modal-border-radius: 0.375rem;
  --bs-modal-inner-border-radius: 0.375rem;
  --bs-dropdown-border-radius: 0.225rem;
  --bs-nav-pills-border-radius: 0.3rem;
  --bs-list-group-border-radius: 0.225rem;
  --bs-toast-border-radius: 0.225rem;
  --bs-alert-border-radius: 0.225rem;
}

/* Direct overrides for any component whose rule sets border-radius literally
 * (some Material Dashboard variants hard-code the value instead of reading
 * the CSS variable). */
.card,
.card .card-header,
.card .card-footer {
  border-radius: var(--bs-card-border-radius);
}
.card .card-header:first-child {
  border-top-left-radius: var(--bs-card-border-radius);
  border-top-right-radius: var(--bs-card-border-radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.card .card-footer:last-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--bs-card-border-radius);
  border-bottom-right-radius: var(--bs-card-border-radius);
}

.modal-content,
.modal-header,
.modal-footer {
  border-radius: var(--bs-modal-border-radius);
}
.modal-header { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.modal-footer { border-top-left-radius: 0; border-top-right-radius: 0; }

.dropdown-menu { border-radius: var(--bs-dropdown-border-radius); }
.list-group, .list-group-item-action { border-radius: var(--bs-list-group-border-radius); }
.alert { border-radius: var(--bs-alert-border-radius); }
.toast, .toast-header { border-radius: var(--bs-toast-border-radius); }

/* Material Dashboard utility classes — pin to the dashboard's tight scale.
 * !important is justified here because we're overriding utilities that
 * other CSS bundles set with the same specificity. */
.border-radius-sm { border-radius: 0.1925rem !important; }
.border-radius-md { border-radius: 0.225rem !important; }
.border-radius-lg { border-radius: 0.375rem !important; }
.border-radius-xl { border-radius: 0.5rem !important; }
.border-radius-2xl { border-radius: 0.75rem !important; }

/* Bootstrap rounded-N utilities */
.rounded   { border-radius: 0.225rem !important; }
.rounded-1 { border-radius: 0.1925rem !important; }
.rounded-2 { border-radius: 0.225rem !important; }
.rounded-3 { border-radius: 0.375rem !important; }
.rounded-4 { border-radius: 0.5rem !important; }
/* .rounded-circle / .rounded-pill intentionally untouched */
