: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;
}

/* Start menu premium tile styling */
.start-menu-layout {
  gap: 0;
}

.start-menu-main {
  padding: 1.35rem 1.35rem 1.1rem;
}

.start-menu-section + .start-menu-section {
  margin-top: 1.35rem;
}

.start-menu-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7a90;
  margin-bottom: 0.95rem;
}

.start-menu-grid {
  gap: 1rem;
}

.start-menu-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  min-height: 9rem;
  padding: 1.2rem 1.15rem 1.1rem;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 0.35rem 0.75rem rgba(15, 23, 42, 0.04),
    0 1rem 2rem rgba(15, 23, 42, 0.06);
  color: #0f172a !important;
  text-decoration: none !important;
  text-align: center;
  overflow: hidden;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.start-menu-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}

.start-menu-tile:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border-color: rgba(203, 213, 225, 0.95);
  transform: translateY(-2px);
  box-shadow:
    0 0.5rem 1rem rgba(15, 23, 42, 0.05),
    0 1.25rem 2.4rem rgba(15, 23, 42, 0.08);
}

.start-menu-tile.active {
  border-color: rgba(96, 165, 250, 0.48);
  box-shadow:
    0 0 0 0.18rem rgba(191, 219, 254, 0.45),
    0 1rem 2rem rgba(15, 23, 42, 0.08);
}

.start-menu-tile-static,
.start-menu-tile-static:hover {
  transform: none;
}

.start-menu-tile-icon {
  position: relative;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  border: 1px solid rgba(191, 219, 254, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(59, 130, 246, 0.16);
  font-size: 1.8rem;
  line-height: 1;
  margin-inline: auto;
}

.start-menu-tile-icon::after {
  content: "";
  position: absolute;
  top: 0.32rem;
  left: 0.48rem;
  right: 0.48rem;
  height: 1.05rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.start-menu-grid > *:nth-child(6n + 1) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  border-color: rgba(191, 219, 254, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(59, 130, 246, 0.16);
}

.start-menu-grid > *:nth-child(6n + 2) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%);
  border-color: rgba(187, 247, 208, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(34, 197, 94, 0.16);
}

.start-menu-grid > *:nth-child(6n + 3) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #ede9fe 100%);
  border-color: rgba(221, 214, 254, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(139, 92, 246, 0.16);
}

.start-menu-grid > *:nth-child(6n + 4) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #fae8ff 100%);
  border-color: rgba(245, 208, 254, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(217, 70, 239, 0.14);
}

.start-menu-grid > *:nth-child(6n + 5) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%);
  border-color: rgba(253, 230, 138, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(245, 158, 11, 0.16);
}

.start-menu-grid > *:nth-child(6n + 6) .start-menu-tile-icon {
  background: linear-gradient(180deg, #ffffff 0%, #fee2e2 100%);
  border-color: rgba(254, 202, 202, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0.45rem 0.9rem rgba(239, 68, 68, 0.14);
}

.start-menu-tile-title {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 0.08rem;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.28;
  color: #0f172a;
  text-align: center;
}

.start-menu-tile-meta {
  position: relative;
  z-index: 1;
  width: 100%;
  font-size: 0.78rem;
  color: #6b7a90;
  line-height: 1.35;
  text-align: center;
}

.start-menu-tile-meta .badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
}

.start-menu-footer-strip {
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.72) 0%, rgba(241, 245, 249, 0.96) 100%);
}

.start-menu-account-line {
  font-size: 0.82rem;
  color: #526277;
}

.start-menu-footer-actions {
  gap: 0.55rem;
}

.start-menu-footer-actions .btn {
  min-height: 2.2rem;
  padding-inline: 0.95rem;
  border-radius: 0.85rem;
}

.start-menu-main::-webkit-scrollbar {
  width: 0.65rem;
}

.start-menu-main::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.start-menu-main::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1200px) {
  .start-menu-main {
    padding: 1.2rem 1.2rem 1rem;
  }

  .start-menu-grid {
    gap: 0.9rem;
  }
}

@media (max-width: 768px) {
  .start-menu-main {
    padding: 1rem;
  }

  .start-menu-tile {
    min-height: 8rem;
    padding: 1rem;
  }

  .start-menu-tile-icon {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.55rem;
    border-radius: 1.05rem;
  }

  .start-menu-footer-strip {
    padding: 0.95rem 1rem;
  }
}
