/* Formahostel Control — operational clarity refresh
   Additive visual layer; layout and interaction contracts remain unchanged. */
:root {
  --fh-primary: #23466b;
  --fh-primary-hover: #193a5c;
  --fh-primary-light: #386b9a;
  --fh-primary-lighter: #eaf1f7;
  --fh-secondary: #58697b;
  --fh-secondary-hover: #46586a;
  --fh-secondary-light: #7b8b9a;
  --fh-gray-50: #f5f8fa;
  --fh-gray-100: #edf2f5;
  --fh-gray-200: #dce5eb;
  --fh-gray-300: #c8d4dc;
  --fh-gray-400: #94a5b2;
  --fh-gray-500: #6c7d89;
  --fh-gray-600: #50616f;
  --fh-gray-700: #344654;
  --fh-gray-800: #243744;
  --fh-gray-900: #172b39;
  --fh-shadow-sm: 0 1px 2px rgba(28, 53, 72, .05);
  --fh-shadow: 0 2px 8px rgba(28, 53, 72, .055);
  --fh-shadow-md: 0 5px 16px rgba(28, 53, 72, .08);
  --fh-shadow-lg: 0 12px 32px rgba(28, 53, 72, .13);
  --fh-radius-sm: .4rem;
  --fh-radius: .55rem;
  --fh-radius-md: .7rem;
  --fh-radius-lg: .9rem;
  --fh-radius-xl: 1.1rem;
  --fh-transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  --fh-transition-fast: color .14s ease, background-color .14s ease, border-color .14s ease;
  --bs-body-color: #243744;
  --bs-secondary-color: #637581;
  --bs-tertiary-color: #82919b;
  --bs-border-color: #dce5eb;
  --bs-primary: #23466b;
  --bs-primary-rgb: 35, 70, 107;
}

html,
body {
  color: #243744;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #f1f5f7;
  background-image: radial-gradient(circle, rgba(35, 70, 107, .035) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, h4, h5, h6,
.page-header h1,
.card-title {
  color: #203848;
  letter-spacing: -.018em;
}

p,
.lead {
  color: #526674;
}

a {
  text-underline-offset: .16em;
}

/* Shared keyboard treatment, without disturbing native focus behavior. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(57, 112, 159, .38);
  outline-offset: 2px;
}

.btn {
  min-height: 40px;
  border-radius: .58rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .005em;
  box-shadow: 0 1px 2px rgba(27, 49, 65, .05);
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn:hover:not(:disabled):not(.disabled) {
  box-shadow: 0 3px 9px rgba(27, 49, 65, .11);
}

.btn:active:not(:disabled):not(.disabled) {
  box-shadow: inset 0 1px 2px rgba(27, 49, 65, .12);
}

.btn-sm {
  min-height: 36px;
  padding: .42rem .78rem;
}

.btn-lg {
  min-height: 48px;
  border-radius: .68rem;
}

.btn-primary {
  --bs-btn-bg: #23466b;
  --bs-btn-border-color: #23466b;
  --bs-btn-hover-bg: #193a5c;
  --bs-btn-hover-border-color: #193a5c;
  --bs-btn-active-bg: #193a5c;
  --bs-btn-active-border-color: #193a5c;
}

.btn-outline-primary {
  --bs-btn-color: #23466b;
  --bs-btn-border-color: #9aafc1;
  --bs-btn-hover-bg: #23466b;
  --bs-btn-hover-border-color: #23466b;
}

/* Shell and persistent navigation */
#sidebar.sidebar {
  background: #f8fafb !important;
  border-right-color: #dce5eb !important;
  box-shadow: 2px 0 14px rgba(26, 50, 68, .055) !important;
}

.sidebar-header {
  background: #fbfcfd !important;
  border-bottom-color: #e0e8ed !important;
}

#sidebar .fh-brand-icon {
  background: linear-gradient(145deg, #23466b, #3e709c) !important;
  box-shadow: 0 3px 9px rgba(35, 70, 107, .2) !important;
}

#sidebar .fh-brand-name,
.fh-brand-name-mobile {
  color: #203848 !important;
}

#sidebar .fh-brand-tagline {
  color: #758692 !important;
  border-top-color: #e8eef2 !important;
}

.sidebar-section-header {
  color: #71828e !important;
  font-weight: 700;
}

.sidebar-nav .nav-link,
#mobileMenu .nav-link {
  min-height: 40px;
  color: #405463 !important;
  border-radius: .58rem !important;
  transition: color .15s ease, background-color .15s ease !important;
}

.sidebar-nav .nav-link:hover,
#mobileMenu .nav-link:hover {
  background: #eaf0f4 !important;
  color: #213d52 !important;
}

.sidebar-nav .nav-link.active,
#mobileMenu .nav-link.active {
  background: #e7eff5 !important;
  color: #23466b !important;
  box-shadow: inset 3px 0 #386b9a, 0 1px 3px rgba(35, 70, 107, .07) !important;
}

.sidebar-nav .nav-link i,
#mobileMenu .nav-link i {
  color: #728491 !important;
}

.sidebar-nav .nav-link.active i,
#mobileMenu .nav-link.active i {
  color: #386b9a !important;
}

#mobileMenu.offcanvas {
  background: #f8fafb !important;
}

#mobileMenu .offcanvas-header--branded,
.offcanvas-header--branded {
  background: linear-gradient(135deg, #203f60, #386b9a) !important;
}

.navbar.navbar-light {
  background: rgba(250, 252, 253, .97) !important;
  border-bottom: 1px solid #dce5eb;
  box-shadow: 0 2px 10px rgba(29, 52, 69, .07) !important;
}

.navbar-toggler {
  min-width: 42px;
  min-height: 42px;
  border-color: #cbd8e0;
  border-radius: .6rem;
}

#sidebar .dropdown-menu,
#mobileMenu .dropdown-menu,
.dropdown-menu {
  background: #fbfcfd;
  border: 1px solid #dce5eb !important;
  border-radius: .72rem !important;
  box-shadow: 0 10px 28px rgba(24, 47, 64, .13) !important;
}

.dropdown-item {
  min-height: 38px;
  border-radius: .45rem !important;
  color: #405463;
  transition: color .14s ease, background-color .14s ease !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: #edf3f7 !important;
  color: #23466b !important;
}

/* Content canvas and page headings */
.main-content {
  background: transparent;
}

.content-wrapper {
  color: #243744;
}

.page-header {
  border-bottom: 1px solid #d8e2e8;
}

.page-header h1 {
  color: #23466b;
  font-weight: 750;
}

.dashboard-welcome-banner {
  background: linear-gradient(125deg, #203f60 0%, #2c567d 58%, #3b6c91 100%) !important;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(32, 63, 96, .17) !important;
}

.dashboard-welcome-banner h1,
.dashboard-welcome-banner .lead {
  color: #f7fafc;
}

.welcome-icon {
  border: 1px solid rgba(255, 255, 255, .22) !important;
  background: rgba(255, 255, 255, .12) !important;
  border-radius: .8rem !important;
}

/* Cards, configuration sections, and dashboard launch tiles */
.card,
.fh-config-card {
  background: #fbfcfd;
  border: 1px solid #dce5eb !important;
  border-radius: .88rem !important;
  box-shadow: 0 2px 8px rgba(28, 53, 72, .055) !important;
  transition: box-shadow .17s ease, border-color .17s ease !important;
}

.card:hover,
.fh-config-card:hover {
  border-color: #cbd9e2 !important;
  box-shadow: 0 5px 16px rgba(28, 53, 72, .085) !important;
  transform: none !important;
}

.card-header,
.card-footer {
  background: #f5f8fa;
  border-color: #e1e8ed;
}

.card-header {
  color: #304958;
}

.card-body {
  color: #344b59;
}

.fh-section-header {
  background: #f7f9fa !important;
  border-bottom-color: #e1e8ed !important;
}

.fh-section-header h5,
.fh-section-header h6 {
  color: #294454 !important;
}

.dashboard-tile {
  background: #fbfcfd;
  border-color: #dce5eb !important;
  border-radius: 1rem !important;
  box-shadow: 0 2px 9px rgba(28, 53, 72, .06) !important;
  transition: border-color .17s ease, box-shadow .17s ease, background-color .17s ease !important;
}

.dashboard-tile:hover {
  transform: none !important;
  border-color: #aebfcb !important;
  box-shadow: 0 7px 18px rgba(28, 53, 72, .1) !important;
}

.dashboard-tile::before {
  background: #386b9a !important;
}

.dashboard-tile h3,
.dashboard-tile-sm h6 {
  color: #294454;
}

.dashboard-tile p {
  color: #687c89 !important;
}

.tile-icon,
.tile-icon-lg,
.tile-icon-sm {
  box-shadow: 0 3px 8px rgba(35, 70, 107, .16) !important;
}

/* Fields and controls: clear borders, comfortable reading and hit areas */
.form-control,
.form-select,
.input-group-text {
  min-height: 40px;
  color: #2e4554;
  background-color: #fbfcfd;
  border-color: #cbd8e0 !important;
  border-radius: .55rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease !important;
}

.form-control::placeholder {
  color: #8796a0;
}

.form-control:focus,
.form-select:focus {
  border-color: #5780a1 !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(57, 112, 159, .14) !important;
}

.form-control-sm,
.form-select-sm {
  min-height: 36px;
}

.form-control-lg,
.form-select-lg {
  min-height: 48px;
}

.form-label {
  color: #3d5361;
  font-weight: 600;
}

.input-group-text {
  background: #eff3f6;
}

.form-check-input {
  border-color: #aebdc7;
}

.form-check-input:checked {
  background-color: #23466b;
  border-color: #23466b;
}

/* Data-heavy work surfaces */
.table-responsive,
.table-responsive-finance {
  border-radius: .65rem;
}

.table {
  --bs-table-color: #344b59;
  --bs-table-border-color: #e3e9ed;
  --bs-table-bg: transparent;
  margin-bottom: 0;
  vertical-align: middle;
}

.table thead th {
  background: #edf2f5 !important;
  color: #405562 !important;
  border-bottom: 1px solid #d6e0e6 !important;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: none;
}

.table tbody td,
.table tbody th {
  border-bottom-color: #e7edf0 !important;
}

.table-hover tbody tr:hover > * {
  --bs-table-bg-state: #f0f5f7;
  color: inherit;
  box-shadow: none !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: rgba(35, 70, 107, .022);
}

.nav-tabs {
  border-bottom-color: #d7e1e7;
}

.nav-tabs .nav-link {
  min-height: 40px;
  color: #607481;
}

.nav-tabs:not(#scTabs) .nav-link.active,
.nav-tabs:not(#scTabs) .nav-item.show .nav-link {
  color: #23466b !important;
  background-color: #e7eff5 !important;
  border-color: #b9cbd7 #b9cbd7 #e7eff5 !important;
  font-weight: 650;
}

#invTabs .nav-link {
  min-height: 44px;
  padding: .62rem .7rem;
  border-radius: .55rem .55rem 0 0;
}

/* Notices, status indicators, and progress */
.alert {
  border-radius: .7rem;
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(28, 53, 72, .035);
}

.badge {
  font-weight: 650;
  letter-spacing: .01em;
}

.progress {
  background: #e4ebef !important;
  border-radius: 999px !important;
}

.progress-bar {
  border-radius: 999px !important;
}

.fh-status-bar {
  background: #edf3f6 !important;
  border-color: #d5e0e6 !important;
  box-shadow: 0 1px 3px rgba(28, 53, 72, .05) !important;
}

/* Dialogs and overlays */
.modal-content {
  background: #fbfcfd;
  border: 1px solid #dce5eb !important;
  border-radius: .9rem !important;
  box-shadow: 0 20px 56px rgba(21, 43, 59, .2) !important;
}

.modal-header {
  border-bottom-color: #e2e9ed !important;
}

.modal-footer {
  background: #f5f8fa !important;
  border-top-color: #e2e9ed !important;
}

.modal-title {
  color: #294454;
  font-weight: 700;
}

.offcanvas {
  background-color: #fbfcfd;
}

/* Inventory and configuration-specific navigation */
.fh-config-nav-link {
  min-height: 40px;
  color: #526875;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.fh-config-nav-link:hover,
.fh-config-nav-link:focus-visible {
  color: #23466b;
  background-color: #eaf1f5;
}

.sc-header,
.sc-action-card {
  border-color: #dce5eb !important;
  border-radius: .85rem !important;
  box-shadow: 0 2px 8px rgba(28, 53, 72, .055) !important;
}

/* Authentication surfaces, including legacy and current login markup */
.login-container {
  background: linear-gradient(135deg, #1b344d 0%, #23466b 56%, #315d7c 100%) !important;
}

.login-card {
  background: #fbfcfd;
  border: 1px solid rgba(220, 229, 235, .9);
  border-top: 3px solid #7898b1;
  border-radius: 1rem;
  box-shadow: 0 20px 52px rgba(13, 30, 44, .28);
}

.login-subtitle,
.lp-subtitle {
  color: #607481;
}

.lp-outer {
  background: linear-gradient(135deg, #1b344d 0%, #23466b 56%, #315d7c 100%);
}

.lp-card {
  background: #f8fafb;
  border: 1px solid rgba(213, 224, 231, .9);
  border-radius: 1rem;
  box-shadow: 0 22px 56px rgba(13, 30, 44, .3);
}

.lp-label {
  color: #405867;
}

.lp-field input {
  min-height: 44px;
  border-color: #c7d4dc;
  border-radius: .55rem;
  color: #294454;
}

.lp-field input:focus {
  border-color: #5780a1;
  box-shadow: 0 0 0 3px rgba(57, 112, 159, .14);
}

.lp-submit {
  min-height: 44px;
  background: #23466b;
  border-radius: .58rem;
}

.lp-submit:hover {
  background: #193a5c;
}

.lp-links-in a,
.lp-visit-web {
  min-height: 36px;
  align-items: center;
}

/* Login styles are declared inside the page body, so use a scoped,
   high-specificity override while leaving its form and sizing behavior intact. */
html body .lp-outer {
  background: linear-gradient(135deg, #162d45 0%, #23466b 58%, #315d7c 100%) !important;
}

html body .lp-card {
  background: #f8fafb !important;
  border: 1px solid #dce5eb !important;
  border-radius: 1rem !important;
  box-shadow: 0 22px 56px rgba(13, 30, 44, .3) !important;
}

html body .lp-label {
  color: #405867 !important;
}

html body .lp-field input {
  border-color: #c7d4dc !important;
  border-radius: .58rem !important;
}

html body .lp-field input:focus {
  border-color: #5780a1 !important;
  box-shadow: 0 0 0 3px rgba(57, 112, 159, .18) !important;
}

html body .lp-submit {
  background: #23466b !important;
  border-radius: .62rem !important;
}

html body .lp-submit:hover:not(:disabled) {
  background: #193a5c !important;
}

.footer {
  background: #fbfcfd;
  border-top-color: #dce5eb;
  color: #748590;
}

@media (max-width: 767.98px) {
  .content-wrapper {
    padding-right: .9rem;
    padding-left: .9rem;
  }

  .page-header {
    margin-bottom: 1.25rem;
  }

  .btn-sm {
    min-height: 38px;
  }

  .dashboard-tile {
    padding: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
