:root {
  --app-font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;

  --app-font-size: 0.875rem;
  --app-line-height: 1.45;

  --app-text: #0f172a;
  --app-muted: #64748b;

  --app-bg: #f8fafc;
  --app-surface: rgba(255, 255, 255, 0.94);
  --app-surface-strong: rgba(255, 255, 255, 0.98);
  --app-border: rgba(148, 163, 184, 0.18);

  --app-radius: 1rem;
  --app-radius-sm: 0.8rem;
  --app-radius-lg: 1.25rem;

  --app-shadow-sm: 0 0.35rem 0.75rem rgba(15, 23, 42, 0.05);
  --app-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.06);
  --app-shadow-lg: 0 1rem 2rem rgba(15, 23, 42, 0.08);

  --app-focus: rgba(59, 130, 246, 0.18);
}

/* Base */
html,
body {
  font-family: var(--app-font) !important;
  font-size: var(--app-font-size);
  line-height: var(--app-line-height);
  color: var(--app-text);
  background: var(--app-bg);
}

body,
p,
span,
div,
small,
label,
input,
select,
textarea,
button,
a,
td,
th,
li {
  font-family: var(--app-font) !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.card-title,
.modal-title,
.offcanvas-title {
  font-family: var(--app-font) !important;
  color: var(--app-text);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

.text-muted,
.form-text,
small,
.text-secondary {
  color: var(--app-muted) !important;
}

/* Links */
a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Shared surfaces */
.card,
.modal-content,
.offcanvas,
.dropdown-menu,
.alert,
.list-group-item,
.toast,
.popover {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.card,
.modal-content,
.offcanvas,
.dropdown-menu {
  backdrop-filter: blur(10px);
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.offcanvas-header {
  background: transparent;
  border-color: var(--app-border);
}

.card-header {
  border-top-left-radius: var(--app-radius);
  border-top-right-radius: var(--app-radius);
}

.card-footer {
  border-bottom-left-radius: var(--app-radius);
  border-bottom-right-radius: var(--app-radius);
}

.card-body,
.modal-body,
.offcanvas-body {
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  font-family: var(--app-font) !important;
  font-weight: 500;
  border-radius: var(--app-radius-sm);
}

.btn-sm {
  border-radius: 0.7rem;
}

.btn-primary {
  box-shadow: var(--app-shadow-sm);
}

.btn:focus,
.btn:focus-visible {
  box-shadow: 0 0 0 0.2rem var(--app-focus);
}

/* Inputs */
.form-control,
.form-select,
textarea {
  font-family: var(--app-font) !important;
  font-size: 0.875rem;
  border-radius: var(--app-radius-sm);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: none;
  background: var(--app-surface-strong);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 0.2rem var(--app-focus);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn {
  border-radius: var(--app-radius-sm);
}

/* Tables */
.table {
  color: var(--app-text);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.8rem 0.9rem;
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

.table thead th {
  font-weight: 600;
  color: var(--app-muted);
  background: rgba(248, 250, 252, 0.9);
}

.table-responsive,
.table-wrap {
  border-radius: var(--app-radius);
  overflow: hidden;
}

.table-hover > tbody > tr:hover > * {
  background-color: rgba(241, 245, 249, 0.8);
}

/* Navs */
.nav-link,
.dropdown-item,
.navbar-brand,
.badge {
  font-family: var(--app-font) !important;
}

.nav-tabs {
  border-bottom-color: var(--app-border);
}

.nav-tabs .nav-link {
  border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
  color: var(--app-muted);
}

.nav-tabs .nav-link.active {
  color: var(--app-text);
  border-color: var(--app-border) var(--app-border) transparent;
  background: var(--app-surface);
}

.nav-pills .nav-link {
  border-radius: var(--app-radius-sm);
}

.dropdown-menu {
  padding: 0.45rem;
}

.dropdown-item {
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(241, 245, 249, 0.9);
}

/* Badges */
.badge {
  font-weight: 600;
  border-radius: 999px;
}

/* Lists */
.list-group {
  border-radius: var(--app-radius);
  overflow: hidden;
}

.list-group-item {
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.list-group-item:last-child {
  border-bottom: 0;
}

/* Toasts */
.toast {
  border-radius: var(--app-radius);
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--app-muted);
}

/* Forms layout helpers */
.form-label {
  font-weight: 500;
  color: var(--app-text);
  margin-bottom: 0.4rem;
}

.form-check-input {
  border-color: rgba(148, 163, 184, 0.35);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem var(--app-focus);
}

/* Utility helpers for your app surfaces */
.surface-soft {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.surface-soft-lg {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-lg);
}

/* Subtle page rhythm */
main .container > h1:first-child,
main .container > h2:first-child {
  margin-bottom: 1rem;
}

/* Optional: unify horizontal rules */
hr,
.dropdown-divider {
  border-color: rgba(148, 163, 184, 0.16);
  opacity: 1;
}

/* Menu-matching refinement pack: cards, tables, forms */

.card {
  border-radius: 1.1rem;
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.07);
}

.card-header,
.card-footer {
  padding: 0.9rem 1rem;
}

.card-body {
  padding: 1rem;
}

/* Stronger “launcher-like” cards for dashboards / summary blocks */
.card.soft-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(10px);
}

/* Table wrappers feel like one surface */
.table-responsive {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.05);
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tbody td {
  vertical-align: middle;
}

/* Forms look closer to the launcher tiles */
form .form-control,
form .form-select,
form textarea {
  min-height: 2.6rem;
  background: rgba(255, 255, 255, 0.97);
}

form textarea.form-control {
  min-height: 6rem;
}

form .form-control::placeholder,
form textarea::placeholder {
  color: #94a3b8;
}

/* Better spacing in stacked forms */
.form-group,
.mb-3 {
  margin-bottom: 1rem !important;
}

/* Input groups */
.input-group {
  gap: 0.35rem;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn {
  border-radius: 0.8rem !important;
}

/* Section blocks used around forms/tables */
.panel-shell {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.05);
  padding: 1rem;
}

/* Buttons feel a bit more polished */
.btn-primary,
.btn-outline-primary,
.btn-outline-secondary {
  min-height: 2.4rem;
}

/* Modal / offcanvas content a touch softer */
.modal-content,
.offcanvas {
  border-radius: 1.15rem;
}

/* Compact labels like the launcher */
.form-label,
.card-header,
.table thead th {
  font-weight: 600;
}