/* HBT WORKSPACE - GLOBAL THEME */
:root {
  color-scheme: dark;

  --hbt-background: #151821;
  --hbt-header: #202432;
  --hbt-border: #343A4B;
  --hbt-text: #F4F5FB;
  --hbt-muted: #9CA3B8;
  --hbt-accent: #6366F1;
  --hbt-accent-light: #A5B4FC;
}

html {
  min-height: 100%;
  font-size: 14px;
  background: var(--hbt-background);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--hbt-background);
  color: #E2E5F0;
  font-family: "Segoe UI", Arial, sans-serif;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* FOCUS STYLES*/
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow:
    0 0 0 0.1rem var(--hbt-header),
    0 0 0 0.25rem var(--hbt-accent);
}

/* HEADER */
.hbt-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  flex-shrink: 0;
  background: var(--hbt-header);
  border-bottom: 1px solid var(--hbt-border);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

.hbt-navbar {
  min-height: 76px;
  padding: 10px 28px;
}

/* COMPANY BRAND*/
.hbt-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  color: var(--hbt-text);
  text-decoration: none;
}

.hbt-brand:hover {
  color: #FFFFFF;
}

.hbt-brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
}

.hbt-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hbt-brand-mark {
  display: flex;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #41485B;
  border-radius: 11px;
  background: #2C3243;
  color: #C7D2FE;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -1px;
}

.hbt-brand-company {
  color: var(--hbt-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.hbt-brand-product {
  margin-top: 4px;
  color: var(--hbt-accent-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* HEADER CONTROLS Theme Button + Mobile Menu*/
.hbt-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.hbt-header-controls .navbar-toggler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* THEME SWITCHER BUTTON */
.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hbt-border);
  border-radius: 10px;
  background: var(--hbt-header);
  color: var(--hbt-accent-light);
  font-size: 16px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle-button:hover {
  background: #303750;
  border-color: var(--hbt-accent);
  color: #C7D2FE;
  transform: translateY(-1px);
}

.theme-toggle-button:focus-visible {
  outline: 2px solid var(--hbt-accent-light);
  outline-offset: 3px;
}

.theme-toggle-button:active {
  transform: translateY(0);
}

/* MOBILE NAVIGATION BUTTON*/
.hbt-navbar .navbar-toggler {
  padding: 8px 10px;
  border: 1px solid #454C60;
  border-radius: 8px;
  box-shadow: none;
}

.hbt-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.hbt-toggler-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
}

.hbt-toggler-icon span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #D7DAE6;
}

/* NAVIGATION LINKS */
.hbt-navbar-links {
  align-items: center;
  gap: 7px;
}

.hbt-navbar-links .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 13px !important;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #B6BDCE;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}

.hbt-navbar-links .nav-link:hover {
  background: #303647;
  color: #FFFFFF;
}

.hbt-navbar-links .nav-link.active {
  border-color: #41446F;
  background: #303252;
  color: #C7D2FE;
}

.hbt-nav-icon {
  margin-right: 8px;
  font-size: 16px;
  vertical-align: middle;
}

.hbt-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7778F8;
}

/* HEADER STATUS */
.hbt-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--hbt-border);
  border-radius: 9px;
  color: #B6BDCE;
  font-size: 12px;
  white-space: nowrap;
}

.hbt-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

/*  MAIN PAGE CONTENT */
.hbt-main {
  width: 100%;
  max-width: 1600px;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 28px;
}

/* FOOTER*/
.hbt-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--hbt-border);
  background: #191D28;
}

.hbt-footer-inner {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 28px;
}

.hbt-footer-brand {
  color: #C5CAD8;
  font-size: 14px;
  font-weight: 600;
}

.hbt-footer-copy {
  color: #7F879D;
  font-size: 13px;
}

.hbt-footer a {
  color: var(--hbt-accent-light);
  text-decoration: none;
}

.hbt-footer a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.hbt-footer-right {
  color: #7F879D;
  font-size: 14px;
}

.hbt-footer-separator {
  color: var(--hbt-accent);
}

/* DESKTOP RESPONSIVENESS*/
@media (min-width: 768px) {
  .hbt-navbar>.container-fluid {
    flex-wrap: nowrap;
  }

  /* Keep the navigation between the brand and theme button. */
  #mainNavbar {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  #mainNavbar .hbt-navbar-links {
    margin-left: auto;
  }

  /* Hide the hamburger on desktop. */
  .hbt-header-controls .navbar-toggler {
    display: none;
  }

  /* The JavaScript places the theme button inside #mainNavbarimmediately before the Admin Panel status. */
  #mainNavbar .theme-toggle-button {
    flex-shrink: 0;
    margin: 0 0 0 12px;
  }

  #mainNavbar .hbt-header-tag {
    flex-shrink: 0;
    margin-left: 12px !important;
  }
}

/* MOBILE RESPONSIVENESS*/

@media (max-width: 767.98px) {
  .hbt-navbar {
    padding: 10px 12px;
  }

  .hbt-navbar>.container-fluid {
    flex-wrap: wrap;
  }

  .hbt-brand {
    gap: 10px;
  }

  .hbt-brand-logo {
    width: 40px;
    height: 40px;
  }

  .hbt-header-controls {
    order: 0;
    margin-left: auto;
    gap: 8px;
  }

  /* Keep the theme button beside the hamburger. */
  .hbt-header-controls .theme-toggle-button {
    margin: 0;
  }

  #mainNavbar {
    order: 1;
    flex-basis: 100%;
    width: 100%;
  }

  #mainNavbar .hbt-navbar-links {
    align-items: stretch;
    padding-top: 14px;
  }

  #mainNavbar .hbt-navbar-links .nav-link {
    width: 100%;
  }

  #mainNavbar .theme-toggle-button {
    margin: 14px 0 8px;
  }

  #mainNavbar .hbt-header-tag {
    display: none;
  }

  .hbt-main {
    padding: 16px 12px;
  }

  .hbt-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 16px;
  }
}

/*REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {

  .theme-toggle-button,
  .hbt-navbar-links .nav-link {
    transition: none;
  }
}

/* LIGHT THEME - GLOBAL OVERRIDES and Keep this block at the end of site.css */
:root[data-theme="light"] {
  color-scheme: light;

  --hbt-background: #F4F6FB;
  --hbt-header: #FFFFFF;
  --hbt-border: #DCE1EC;
  --hbt-text: #20263A;
  --hbt-muted: #687187;
  --hbt-accent: #5558D9;
  --hbt-accent-light: #5558D9;
}

:root[data-theme="light"] body {
  background: var(--hbt-background);
  color: #30384D;
}

:root[data-theme="light"] .hbt-header {
  background: #FFFFFF;
  border-bottom-color: #DCE1EC;
  box-shadow: 0 4px 16px rgba(30, 41, 59, 0.07);
}

:root[data-theme="light"] .hbt-brand,
:root[data-theme="light"] .hbt-brand-company {
  color: #20263A;
}

:root[data-theme="light"] .hbt-brand:hover {
  color: #5558D9;
}

:root[data-theme="light"] .hbt-brand-product {
  color: #5558D9;
}

:root[data-theme="light"] .hbt-navbar-links .nav-link {
  color: #505970;
}

:root[data-theme="light"] .hbt-navbar-links .nav-link:hover {
  background: #F0F2FA;
  color: #30345D;
}

:root[data-theme="light"] .hbt-navbar-links .nav-link.active {
  background: #E9EAFE;
  border-color: #D6D8FC;
  color: #4548C4;
}

:root[data-theme="light"] .theme-toggle-button {
  background: #F4F6FB;
  border-color: #DCE1EC;
  color: #5558D9;
}

:root[data-theme="light"] .theme-toggle-button:hover {
  background: #E9EAFE;
  border-color: #5558D9;
  color: #4548C4;
}

:root[data-theme="light"] .hbt-navbar .navbar-toggler {
  border-color: #D0D6E3;
}

:root[data-theme="light"] .hbt-toggler-icon span {
  background: #3E465C;
}

:root[data-theme="light"] .hbt-header-tag {
  background: #F8F9FC;
  border-color: #DCE1EC;
  color: #505970;
}

:root[data-theme="light"] .hbt-footer {
  background: #FFFFFF;
  border-top-color: #DCE1EC;
}

:root[data-theme="light"] .hbt-footer-brand {
  color: #30384D;
}

:root[data-theme="light"] .hbt-footer-copy,
:root[data-theme="light"] .hbt-footer-right {
  color: #687187;
}

:root[data-theme="light"] .hbt-footer a {
  color: #5558D9;
}

:root[data-theme="light"] .hbt-footer a:hover {
  color: #3639AE;
}

:root[data-theme="light"] .btn:focus,
:root[data-theme="light"] .btn:active:focus,
:root[data-theme="light"] .btn-link.nav-link:focus,
:root[data-theme="light"] .form-control:focus,
:root[data-theme="light"] .form-check-input:focus {
  box-shadow:
    0 0 0 0.1rem #FFFFFF,
    0 0 0 0.25rem #7779E8;
}

:root[data-theme="light"] .form-control,
:root[data-theme="light"] .form-select {
  background-color: #FFFFFF;
  border-color: #CCD3E0;
  color: #30384D;
}

:root[data-theme="light"] .form-control::placeholder {
  color: #858DA0;
}

:root[data-theme="light"] .form-control:disabled,
:root[data-theme="light"] .form-select:disabled {
  background-color: #F0F2F7;
}