/*
 * ═══════════════════════════════════════════════════════════════════════════
 * MFUMO WA STOO - layout.css  (navbar, mobile menu, scroll-top, footers)
 * ───────────────────────────────────────────────────────────────────────────
 *   1. Navbar + mobile offcanvas (Digital Cards navbar.css, unchanged)
 *   2. Stock Portal navbar additions: store pickers, logout / idle modal,
 *      fallback tokens for pages without main.css
 *   3. Scroll-to-top button
 *   4. Site footer (auth pages: components/site-footer)
 *   5. Portal footer (components/portal/footer)
 *
 * Load order (partials/portal/head.blade.php, partials/auth/head.blade.php):
 *   Bootstrap -> icons -> AOS -> main.css -> layout.css -> dashboard.css -> pwa.css
 *   -> forms.css (every portal page) -> tables.css (pages with tables)
 *   -> auth.css (login / register / reset) or welcome.css (welcome page).
 * No page carries its own <style> block or style="" attribute any more -
 * page-specific rules live in the matching file under a 'PAGE:' heading.
 * ═══════════════════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════════
   1. NAVBAR  (shared with Digital Cards - was portal/navbar.css)
   ═══════════════════════════════════════════════════════════════ */
/*
 * STOCK PORTAL (Mfumo wa Stoo) - copied unchanged from the Digital Cards Portal
 * (digital_cards_portal/public/assets/css/navbar.css) so both share one look. Keep in sync.
 */
/* PHASE 3: the local :root token block that used to live here has been
   removed - navbar.css now consumes the master tokens defined once in
   styles.css (which always loads first). Mapping from the old local
   names to the tokens now used throughout this file:
     --dc-nav-blue      -> var(--brand)          (identical value, #50c5ff)
     --dc-nav-blue-dark -> var(--brand-hover)     (distinct dark-navbar hover shade)
     --dc-nav-dark      -> var(--nav-bg)
     --dc-nav-dark-2    -> var(--nav-bg-secondary)
     --dc-nav-text      -> var(--nav-text)
     --dc-nav-muted     -> var(--nav-muted)
     --dc-nav-card      -> var(--nav-card)
     --dc-nav-danger    -> var(--red)             (identical value, #ef4444) */

.dc-command-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background:
    radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.16), transparent 28%),
    linear-gradient(135deg, var(--nav-bg), var(--nav-bg-secondary));
  border-bottom: 1px solid rgba(var(--brand-rgb), 0.16);
  box-shadow: 0 12px 35px rgba(var(--nav-deep-rgb, 2, 8, 23), 0.22);
}

.dc-command-nav,
.dc-command-nav .container {
  min-height: 82px;
}

.dc-command-nav .container {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1800px;
  width: 100%;
  padding-left: 28px;
  padding-right: 28px;
}

.dc-command-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
  flex: 0 0 auto;
}

.dc-command-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), 0.16);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.dc-command-logo img {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: block;
  object-fit: contain;
}

/* Match footer logo hover */
.dc-command-brand:hover .dc-command-logo {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(var(--brand-rgb), 0.26);
}

.dc-command-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1;
}

.dc-command-brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  white-space: nowrap;
}

.dc-command-brand-title span {
  color: var(--brand);
}

.dc-command-brand-subtitle {
  display: block;
  margin-top: 6px;
  color: var(--nav-muted);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.dc-command-desktop {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dc-command-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  min-width: 0;
  list-style: none;
}

/* TEXT-ONLY navigation options (no icon fonts anywhere) */
.dc-command-link {
  min-height: 38px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: 0.22s ease;
}

.dc-command-link:hover,
.dc-command-link:focus {
  color: #ffffff;
  background: var(--nav-card);
  border-color: rgba(var(--brand-rgb), 0.18);
}

.dc-command-link.active {
  color: var(--nav-bg-secondary);
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 10px 25px rgba(var(--brand-rgb), 0.25);
}

.dc-command-dropdown .dropdown-menu {
  margin-top: 12px;
  padding: 10px;
  min-width: 250px;
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 55px rgba(var(--nav-deep-rgb, 2, 8, 23), 0.22);
}

.dc-command-dropdown .dropdown-header {
  color: #6f7177;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 8px 12px 10px;
}

.dc-command-dropdown .dropdown-item {
  min-height: 40px;
  border-radius: 12px;
  color: #414042;
  font-size: 0.84rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  transition: 0.18s ease;
}

.dc-command-dropdown .dropdown-item:hover {
  background: var(--brand-wash-2, #eaf8ff);
  color: #414042;
}

.dc-command-dropdown .dropdown-item.active {
  background: var(--brand-wash-3, #e0f4ff);
  color: var(--brand-ink, #0b4a63);
  font-weight: 800;
}

.dc-command-user {
  margin-left: 6px;
}

.dc-command-user-btn {
  min-height: 42px;
  max-width: 245px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  color: var(--nav-text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: 0.22s ease;
}

.dc-command-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: var(--nav-bg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

.dc-command-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  min-width: 0;
}

.dc-command-user-name {
  max-width: 120px;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-command-user-role {
  margin-top: 3px;
  color: var(--nav-muted);
  font-size: 0.6rem;
  font-weight: 650;
}

.dc-command-divider {
  height: 1px;
  background: rgba(65, 64, 66, 0.12);
  margin: 8px 4px;
}

.dc-command-logout {
  color: var(--red) !important;
  font-weight: 800 !important;
}

.dc-command-logout:hover {
  background: #fff1f1 !important;
  color: var(--red) !important;
}

/* ==========================================================
   LOGOUT CONFIRMATION MODAL
========================================================== */

.portal-logout-modal {
  z-index: 20050;
}

.portal-logout-modal .modal-dialog {
  width: min(92vw, 480px);
  max-width: 480px;
  margin: 1rem auto;
}

.portal-logout-modal .modal-content {
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: var(--r-2xl);

  background: var(--surface);
  color: var(--text);

  box-shadow: var(--shadow-xl);
}

.portal-logout-top {
  display: flex;
  justify-content: center;

  padding: 30px 24px 0;
}

.portal-logout-icon {
  width: 92px;
  height: 92px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(var(--brand-rgb), 0.25);
  border-radius: 50%;

  background: var(--brand-50);
  color: var(--brand-deeper);

  font-size: 2.2rem;

  box-shadow: 0 12px 30px rgba(var(--brand-rgb), 0.18);
}

.portal-logout-body {
  padding: 22px 30px 26px;
  text-align: center;
}

.portal-logout-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 14px;
  padding: 6px 13px;

  border: 1px solid var(--brand-200);
  border-radius: var(--r-pill);

  background: var(--brand-50);
  color: var(--brand-deeper);

  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-logout-body h5 {
  margin: 0 0 10px;

  color: var(--text-head);

  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.3;
}

.portal-logout-body > p {
  max-width: 390px;
  margin: 0 auto 22px;

  color: var(--text-muted);

  font-size: 0.92rem;
  line-height: 1.65;
}

.portal-logout-user {
  display: flex;
  align-items: center;
  gap: 12px;

  max-width: 340px;
  margin: 0 auto;
  padding: 13px 15px;

  border: 1px solid var(--border);
  border-radius: var(--r-lg);

  background: var(--surface-1);

  text-align: left;
}

.portal-logout-user .dc-command-avatar {
  flex: 0 0 auto;
}

.portal-logout-user div {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.portal-logout-user strong {
  overflow: hidden;

  color: var(--text-head);

  font-size: 0.9rem;
  font-weight: 750;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-logout-user span:last-child {
  color: var(--text-muted);

  font-size: 0.78rem;
  font-weight: 600;
}

.portal-logout-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;

  padding: 18px 24px 24px;

  border-top: 1px solid var(--border);

  background: var(--surface-1);
}

.portal-logout-confirm {
  min-height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 0 20px;

  border: 1px solid var(--brand);
  border-radius: var(--r-lg);

  background: var(--brand);
  color: var(--text-head);
  /* PHASE 4 a11y fix - was --text-inv (#fff) at 1.95:1 */

  font-size: 0.88rem;
  font-weight: 800;

  cursor: pointer;

  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.22);

  transition:
    background var(--t-base),
    border-color var(--t-base),
    transform var(--t-base),
    box-shadow var(--t-base);
}

.portal-logout-confirm:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: var(--text-head);

  transform: translateY(-1px);

  box-shadow: 0 12px 26px rgba(var(--brand-rgb), 0.28);
}

.portal-logout-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.portal-logout-confirm .spinner-border {
  width: 1rem;
  height: 1rem;
}

.dc-command-logout.js-open-logout-modal {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 10px;

  border: 0;

  background: transparent;

  text-align: left;
}

@media (max-width: 575.98px) {
  .portal-logout-modal .modal-dialog {
    width: calc(100vw - 24px);
    margin: 12px auto;
  }

  .portal-logout-top {
    padding-top: 24px;
  }

  .portal-logout-icon {
    width: 78px;
    height: 78px;

    font-size: 1.9rem;
  }

  .portal-logout-body {
    padding: 18px 20px 22px;
  }

  .portal-logout-body h5 {
    font-size: 1.25rem;
  }

  .portal-logout-footer {
    flex-direction: column-reverse;

    padding: 16px 18px 20px;
  }

  .portal-logout-footer .btn-secondary,
  .portal-logout-confirm {
    width: 100%;
  }
}

/* Hamburger: drawn in CSS, so no icon font is needed */
.dc-command-mobile-btn {
  min-width: auto;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(var(--brand-rgb), 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: 0.22s ease;
}

.dc-command-mobile-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(var(--brand-rgb), 0.45);
  color: #ffffff;
}

.dc-command-burger {
  position: relative;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  display: inline-block;
  flex-shrink: 0;
}

.dc-command-burger::before,
.dc-command-burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.dc-command-burger::before {
  top: -5px;
}

.dc-command-burger::after {
  top: 5px;
}

.dc-command-offcanvas {
  background:
    radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.16), transparent 30%),
    linear-gradient(160deg, var(--nav-bg), var(--nav-bg-secondary));
  color: #ffffff;
  border-left: 1px solid rgba(var(--brand-rgb), 0.18);
}

.dc-command-offcanvas .offcanvas-header {
  padding: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.dc-command-offcanvas .offcanvas-title {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.dc-command-offcanvas .btn-close {
  filter: invert(1);
  opacity: 0.8;
}

.dc-command-mobile-list {
  display: grid;
  gap: 8px;
  padding: 18px 0;
}

.dc-command-mobile-link,
.dc-command-mobile-dropdown-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 15px;
  padding: 0 16px;
  color: var(--nav-text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  transition: 0.22s ease;
}

.dc-command-mobile-link:hover,
.dc-command-mobile-dropdown-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.dc-command-mobile-dropdown-btn {
  justify-content: space-between;
}

/* CSS chevron instead of an icon font; it flips when the section opens */
.dc-command-mobile-dropdown-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.dc-command-mobile-dropdown-btn[aria-expanded="true"]::after {
  transform: rotate(-135deg) translateY(-2px);
}

.dc-command-mobile-submenu {
  display: grid;
  gap: 6px;
  margin: 7px 0 4px;
  padding-left: 12px;
}

.dc-command-mobile-submenu a {
  min-height: 42px;
  border-radius: 13px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 650;
}

.dc-command-mobile-submenu a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.dc-command-mobile-user {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dc-command-mobile-user-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dc-command-mobile-actions {
  display: grid;
  gap: 7px;
}

.dc-command-mobile-actions a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  min-height: 38px;
}

.dc-command-mobile-actions a:hover {
  color: #ffffff;
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background:
    radial-gradient(circle at top, rgba(var(--brand-rgb), 0.18), transparent 35%),
    linear-gradient(135deg, var(--nav-bg), var(--nav-bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}

#preloader::before {
  content: "";
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--brand);
  animation: dcPreloaderSpin 0.85s linear infinite;
}

#preloader::after {
  content: "Kadi Digital";
  position: absolute;
  margin-top: 105px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@keyframes dcPreloaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
       RESPONSIVE NAV  (text options only - no icon fonts)

       >= 1200px ......... full text menu in the bar
       <  1200px ......... "Menu" button + offcanvas (text options)

       NOTE: the old 768-1199px tier was an ICON-ONLY rail (links had
       font-size: 0 and showed just the icon). With icons removed those
       buttons would be blank, and 8-10 text labels will not fit at that
       width - so tablets now use the offcanvas, where every option has
       room for its full word.
    ========================================================== */

/* ---- DESKTOP: text menu in the bar ---- */
@media (min-width: 1200px) {
  .dc-command-desktop {
    display: flex;
  }

  .dc-command-mobile-btn {
    display: none;
  }

  .dc-command-menu {
    gap: 2px;
  }

  .dc-command-link {
    padding: 0 11px;
    font-size: 0.8rem;
  }

  .dc-command-user-role {
    display: none;
  }
}

/* Wide screens: a little more breathing room */
@media (min-width: 1500px) {
  .dc-command-menu {
    gap: 4px;
  }

  .dc-command-link {
    padding: 0 14px;
    font-size: 0.83rem;
  }

  .dc-command-user-role {
    display: block;
  }
}

/* ---- TABLET + PHONE: offcanvas with full text options ---- */
@media (max-width: 1199.98px) {
  .dc-command-desktop {
    display: none;
  }

  .dc-command-mobile-btn {
    display: inline-flex;
  }
}

@media (max-width: 767.98px) {
  .dc-command-nav,
  .dc-command-nav .container {
    min-height: 74px;
  }
}

@media (max-width: 991.98px) {
  .dc-command-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
  }

  .dc-command-logo img {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
  }
}

@media (max-width: 575.98px) {
  .dc-command-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 13px;
  }

  .dc-command-logo img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
  }
}

@media (max-width: 360px) {
  .dc-command-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .dc-command-logo img {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
  }
}

/* ==========================================================
   RESPONSIVE BRAND
========================================================== */

@media (max-width: 1199.98px) {
  .dc-command-brand-title {
    font-size: 1.25rem;
  }

  .dc-command-brand-subtitle {
    font-size: 0.58rem;
  }
}

@media (max-width: 767.98px) {
  .dc-command-brand-title {
    font-size: 1.12rem;
  }

  .dc-command-brand-subtitle {
    margin-top: 4px;
    font-size: 0.54rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 575.98px) {
  .dc-command-brand-title {
    font-size: 1.05rem;
  }

  .dc-command-brand-subtitle {
    font-size: 0.5rem;
  }
}

@media (max-width: 420px) {
  .dc-command-brand-subtitle {
    display: none;
  }

  .dc-command-brand-title {
    font-size: 1rem;
  }
}

.dc-command-offcanvas {
  width: 86% !important;
}

/* ==========================================================
   MOBILE LOGOUT - REMOVE WHITE FLASH
========================================================== */

@media (max-width: 1199.98px) {
  /* Keep the page background dark while offcanvas/modal changes */
  html,
  body {
    background-color: var(--nav-bg);
  }

  /* Logout button must never inherit Bootstrap's white button bg */
  .dc-command-mobile-actions .dc-command-logout,
  .dc-command-mobile-actions .dc-command-logout:hover,
  .dc-command-mobile-actions .dc-command-logout:focus,
  .dc-command-mobile-actions .dc-command-logout:active {
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Prevent white Bootstrap focus/active state */
  .dc-command-logout.js-open-logout-modal:focus,
  .dc-command-logout.js-open-logout-modal:focus-visible,
  .dc-command-logout.js-open-logout-modal:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  /* Keep offcanvas dark during closing animation */
  .dc-command-offcanvas,
  .dc-command-offcanvas.show,
  .dc-command-offcanvas.showing,
  .dc-command-offcanvas.hiding {
    background:
      radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.16), transparent 30%),
      linear-gradient(160deg, var(--nav-bg), var(--nav-bg-secondary)) !important;
  }

  /* Bootstrap backdrop */
  .offcanvas-backdrop,
  .modal-backdrop {
    background-color: var(--nav-deep, #02081c) !important;
  }

  .offcanvas-backdrop.show,
  .modal-backdrop.show {
    opacity: 0.65;
  }
}

/* ==========================================================
   KADI DIGITAL WEBSITE CTA
   MAIN PORTAL NAVBAR - DESKTOP
========================================================== */

.dc-command-website-item {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 4px;
}

.dc-command-website-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 38px;
  padding: 0 14px;

  border: 1px solid var(--brand);
  border-radius: 10px;

  background: var(--brand);
  color: var(--nav-bg) !important;

  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;

  box-shadow: 0 6px 18px rgba(var(--brand-rgb), 0.18);

  transition:
    transform 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.dc-command-website-btn > i:first-child {
  font-size: 0.92rem;
}

.dc-command-website-btn .dc-command-external-icon {
  font-size: 0.68rem;
  opacity: 0.7;
  transition: transform 0.22s ease;
}

.dc-command-website-btn:hover {
  color: var(--nav-bg) !important;
  background: #ffffff;
  border-color: #ffffff;

  transform: translateY(-1px);

  box-shadow: 0 8px 22px rgba(var(--brand-rgb), 0.24);
}

.dc-command-website-btn:hover .dc-command-external-icon {
  transform: translate(2px, -2px);
}

.dc-command-website-btn:focus-visible {
  outline: none;

  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb), 0.22),
    0 8px 22px rgba(var(--brand-rgb), 0.2);
}

.dc-command-website-btn:active {
  transform: translateY(0);
}

/* ==========================================================
   KADI DIGITAL WEBSITE CTA
   MAIN PORTAL NAVBAR - MOBILE / TABLET OFFCANVAS
========================================================== */

.dc-command-mobile-website {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dc-command-mobile-website-label {
  display: block;
  margin: 0 0 9px 4px;

  color: rgba(255, 255, 255, 0.46);

  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.dc-command-mobile-website-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;

  padding: 12px 13px;

  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: 14px;

  background: rgba(var(--brand-rgb), 0.08);
  color: #ffffff;

  text-decoration: none;

  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

.dc-command-mobile-website-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  background: var(--brand);
  color: var(--nav-bg);

  font-size: 1rem;
}

.dc-command-mobile-website-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.dc-command-mobile-website-content strong {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.dc-command-mobile-website-content small {
  color: var(--nav-muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
}

.dc-command-mobile-website-arrow {
  flex: 0 0 auto;
  margin-left: auto;

  color: var(--brand);
  font-size: 0.9rem;

  transition: transform 0.22s ease;
}

.dc-command-mobile-website-btn:hover,
.dc-command-mobile-website-btn:focus {
  color: #ffffff;
  background: rgba(var(--brand-rgb), 0.14);
  border-color: rgba(var(--brand-rgb), 0.5);
}

.dc-command-mobile-website-btn:hover {
  transform: translateY(-1px);
}

.dc-command-mobile-website-btn:hover .dc-command-mobile-website-arrow {
  transform: translate(2px, -2px);
}

/* ==========================================================
   SIMPLE / SECOND NAVBAR
   WEBSITE CTA - ICON ONLY
========================================================== */

.dc-command-public-website {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.dc-command-website-icon-only {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  flex: 0 0 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(var(--brand-rgb), 0.42);
  border-radius: 11px;

  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand) !important;

  text-decoration: none;

  box-shadow: 0 6px 18px rgba(var(--brand-rgb), 0.1);

  transition:
    transform 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.dc-command-website-icon-only i {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;

  color: inherit;

  font-size: 1rem;
  line-height: 1;
}

.dc-command-website-icon-only:hover {
  color: var(--nav-bg) !important;
  background: var(--brand);
  border-color: var(--brand);

  transform: translateY(-1px);

  box-shadow: 0 8px 22px rgba(var(--brand-rgb), 0.22);
}

.dc-command-website-icon-only:active {
  transform: translateY(0);
}

.dc-command-website-icon-only:focus-visible {
  outline: none;
  border-color: var(--brand);

  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb), 0.18),
    0 8px 22px rgba(var(--brand-rgb), 0.18);
}

/* ==========================================================
   SIMPLE NAVBAR RESPONSIVE
========================================================== */

@media (max-width: 767.98px) {
  .dc-command-website-icon-only {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-basis: 40px;

    border-radius: 10px;
  }

  .dc-command-website-icon-only i {
    font-size: 0.95rem;
  }
}

@media (max-width: 420px) {
  .dc-command-website-icon-only {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    flex-basis: 38px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   2. NAVBAR - STOCK PORTAL ADDITIONS  (were inline in components/portal/navbar)
   ═══════════════════════════════════════════════════════════════ */
/* Fallback for the old pages that load neither portal/styles.css nor
   Bootstrap 5 (Madeni, stores/open). Same token values as styles.css and
   the Bootstrap 5 defaults navbar.css builds on, scoped to the navbar. */
:where(body:has(.dc-command-offcanvas)) .dc-command-header,
:where(body:has(.dc-command-offcanvas)) .dc-command-offcanvas,
:where(body:has(.dc-command-offcanvas)) .portal-logout-modal,
:where(body:has(.dc-command-offcanvas)) .pwa-install-sheet,
:where(body:has(.dc-command-offcanvas)) .pwa-update-banner {
    --border-md: #cbd5e1; --surface-2: #f1f5f9; --text-faint: #94a3b8; --text-inv: #ffffff;
    --brand-soft: rgba(var(--brand-rgb), 0.12); --r-md: 10px; --r-xl: 18px;
    --t-fast: 0.15s ease; --t-slow: 0.3s ease; --font-sans: "Inter", system-ui, sans-serif;
    /* brand / nav colours come from main.css :root and the theme file (themes/*.css) */
    --nav-text: rgba(255, 255, 255, 0.86);
    --nav-muted: rgba(255, 255, 255, 0.56); --nav-card: rgba(255, 255, 255, 0.06);
    --text-head: #0f172a; --text: #334155; --text-muted: #64748b; --red: #ef4444;
    --border: #e2e8f0; --surface: #ffffff; --surface-1: #f8fafc;
    --r-lg: 14px; --r-2xl: 24px; --r-pill: 9999px; --t-base: 0.2s ease;
    --shadow-xl: 0 16px 40px rgba(15, 23, 42, 0.08), 0 6px 12px rgba(15, 23, 42, 0.04);
    --font-display: "Poppins", "Inter", system-ui, sans-serif;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
}
.dc-command-header *, .dc-command-offcanvas *, .portal-logout-modal *, .pwa-install-sheet * { box-sizing: border-box; }
/* install sheet buttons on the old pages without portal/styles.css */
:where(body:has(.dc-command-offcanvas)) .pwa-install-actions .btn-primary, :where(body:has(.dc-command-offcanvas)) .pwa-install-actions .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: var(--r-md); font-weight: 700; cursor: pointer; font-family: inherit; padding: 0 14px;
}
:where(body:has(.dc-command-offcanvas)) .pwa-install-actions .btn-primary { background: var(--brand); border: 1px solid var(--brand); color: var(--nav-bg); }
:where(body:has(.dc-command-offcanvas)) .pwa-install-actions .btn-secondary { background: var(--surface); border: 1px solid var(--border-md); color: var(--text-head); }
.dc-command-nav .container { margin-left: auto; margin-right: auto; }
.dc-command-dropdown { position: relative; }
.dc-command-dropdown .dropdown-menu {
    position: absolute; top: 100%; left: 0; z-index: 1000; display: none;
    margin: 12px 0 0; list-style: none; text-align: left;
}
.dc-command-dropdown .dropdown-menu.show { display: block; }
.dc-command-dropdown .dropdown-menu { max-height: calc(100vh - 110px); overflow-y: auto; }
.dc-command-dropdown .dropdown-menu-end { left: auto; right: 0; }
.dc-command-dropdown .dropdown-header { display: block; margin: 0; white-space: nowrap; }
.dc-command-dropdown .dropdown-item {
    width: 100%; clear: both; white-space: nowrap; text-decoration: none;
    background: transparent; border: 0; cursor: pointer; font-family: inherit;
}
.dc-command-link.dropdown-toggle, .dc-command-user-btn { cursor: pointer; font-family: inherit; }
.dc-command-link.dropdown-toggle::after, .dc-command-user-btn.dropdown-toggle::after {
    content: ""; display: inline-block; margin-left: 0.4em; vertical-align: 0.2em;
    border-top: 0.3em solid; border-right: 0.3em solid transparent; border-bottom: 0; border-left: 0.3em solid transparent;
}
button.dc-command-link { background: transparent; }
.dc-command-offcanvas.offcanvas {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1045; display: flex; flex-direction: column;
    width: 86%; visibility: hidden; transform: translateX(100%);
    transition: transform 0.3s ease-in-out, visibility 0.3s;
}
.dc-command-offcanvas.offcanvas.show { visibility: visible; transform: none; }
.dc-command-offcanvas .offcanvas-header { display: flex; align-items: center; justify-content: space-between; }
.dc-command-offcanvas .offcanvas-body { flex-grow: 1; padding: 0 22px 22px; overflow-y: auto; }
.dc-command-offcanvas .btn-close {
    width: 1em; height: 1em; padding: 0.25em; border: 0; border-radius: 0.375rem; cursor: pointer;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
}
.dc-command-mobile-submenu:not(.show) { display: none; }
.dc-command-mobile-dropdown-btn { cursor: pointer; font-family: inherit; }
.dc-command-mobile-submenu a.active { color: #ffffff; background: rgba(var(--brand-rgb), 0.18); }
.dc-command-mobile-link.active { color: var(--nav-bg-secondary); background: var(--brand); border-color: var(--brand); }
.dc-command-mobile-section {
    margin: 6px 0 0; padding: 4px 4px 0; color: var(--nav-muted);
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
}
.dc-command-mobile-section:first-child { margin-top: 0; }
/* ── Agiza / Linganisha / Toa / Pokea: store pickers ── */
.sp-drop-hint {
    max-width: 240px; padding: 0 12px 8px; color: #6f7177; font-size: 0.74rem; line-height: 1.35;
}
.dc-command-dropdown .dropdown-item.sp-all { color: var(--brand-deeper); font-weight: 750; }
.dc-command-dropdown .dropdown-item.sp-store::before,
.dc-command-mobile-submenu a.sp-store::before {
    content: ""; width: 7px; height: 7px; margin-right: 9px; flex: 0 0 7px;
    border-radius: 50%; background: var(--brand);
}
.sp-mobile-hint {
    padding: 0 4px 2px; color: rgba(255, 255, 255, 0.5); font-size: 0.72rem; line-height: 1.35;
}
.sp-nav-backdrop {
    position: fixed; inset: 0; z-index: 1040; background: var(--nav-deep, #02081c); opacity: 0;
    visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s;
}
.sp-nav-backdrop.show { opacity: 0.65; visibility: visible; }
.portal-logout-modal.modal { position: fixed; inset: 0; display: none; overflow-y: auto; }
.portal-logout-modal.modal.show { display: block; }
.portal-logout-modal .modal-dialog { position: relative; display: flex; align-items: center; min-height: calc(100% - 2rem); }
.portal-logout-modal .modal-content { position: relative; display: flex; flex-direction: column; width: 100%; }
.portal-logout-modal .modal-content > div:first-child { position: relative; }
.portal-logout-cancel {
    min-height: 46px; padding: 0 20px; border: 1px solid var(--border); border-radius: var(--r-lg);
    background: #ffffff; color: var(--text-head); font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
.portal-logout-cancel:hover { background: var(--surface-1); }
.sp-idle-count { color: var(--text-head); font-variant-numeric: tabular-nums; }
.portal-logout-confirm .sp-spin {
    width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: dcPreloaderSpin 0.75s linear infinite;
}
.dc-command-logout { display: flex; align-items: center; gap: 10px; }
/* The bar now holds Agiza / Linganisha / Toa / Pokea as their own tabs;
   on 1200-1439px laptops make room: avatar-only user button, tighter pills. */
/* Sakinisha App: icon only until there is room for the label */
.sp-install-btn { min-width: 38px; padding: 0 11px; }
@media (max-width: 1679.98px) {
    .sp-install-btn span { display: none; }
}
.dc-command-mobile-website-btn { cursor: pointer; font-family: inherit; }
@media (min-width: 1200px) and (max-width: 1439.98px) {
    .dc-command-nav .container { padding-left: 18px; padding-right: 18px; gap: 10px; }
    .dc-command-brand-subtitle { display: none; }
    .dc-command-menu { gap: 0; }
    .dc-command-link { padding: 0 8px; font-size: 0.78rem; }
    .dc-command-user { margin-left: 2px; }
    .dc-command-user-btn { padding: 4px; gap: 4px; }
    .dc-command-user-meta { display: none; }
}
body { margin: 0; }
body.sp-nav-open { overflow: hidden; }
/* navbar.css (shared with Digital Cards) paints html/body dark below
   1200px; Stock Portal pages keep their own page background. */
@media (max-width: 1199.98px) {
    html { background-color: transparent; }
    body { background-color: var(--bg, var(--background-color, #ffffff)); }
}
@media (max-width: 575.98px) { .portal-logout-cancel { width: 100%; } }
@media print { .dc-command-header, .dc-command-offcanvas, .sp-nav-backdrop, .portal-logout-modal { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════
   13. SCROLL TO TOP
   ═══════════════════════════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  background: var(--brand);
  color: var(--text-head); /* PHASE 4 a11y fix - was #fff at 1.95:1 */
  border: none;
  box-shadow: 0 4px 12px rgba(var(--brand-alt-rgb, 14, 165, 233), 0.35);
  cursor: pointer;
  transition: all var(--t-base);
}

.scroll-top i {
  font-size: 18px;
}

.scroll-top:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--brand-alt-rgb, 14, 165, 233), 0.4);
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}


/* Stock Portal button (components/portal/navbar): DC look, white arrow */
#scroll-top.scroll-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 99999;
    width: 42px; height: 42px; border-radius: 9999px; border: none;
    display: flex; align-items: center; justify-content: center;
    visibility: hidden; opacity: 0; transform: translateY(12px);
    background: var(--brand); color: rgba(255, 255, 255, 0.82); text-decoration: none; cursor: pointer;
    box-shadow: 0 4px 12px rgba(var(--brand-alt-rgb, 14, 165, 233), 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#scroll-top.scroll-top i { font-size: 18px; line-height: 1; }
#scroll-top.scroll-top:hover { color: rgba(255, 255, 255, 0.82); background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(var(--brand-alt-rgb, 14, 165, 233), 0.4); }
#scroll-top.scroll-top:focus-visible { outline: 3px solid rgba(var(--brand-rgb), 0.45); outline-offset: 2px; }
#scroll-top.scroll-top.active { visibility: visible; opacity: 1; transform: translateY(0); }
/* keep clear of the sticky "Umechagua ..." bars (Agiza, Toa, Linganisha, Sasisha) */
body:has(.bu-selbar) #scroll-top.scroll-top { bottom: 92px; }
@media (max-width: 767.98px) { body:has(.bu-selbar) #scroll-top.scroll-top { bottom: 150px; } }
/* step aside while the install sheet or a menu / modal is open */
body:has(.pwa-install-sheet.is-visible) #scroll-top.scroll-top,
body.sp-nav-open #scroll-top.scroll-top,
body.modal-open #scroll-top.scroll-top { visibility: hidden; opacity: 0; }
@media print { #scroll-top { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════
   16. FOOTER (site-wide, every page)
   Migrated from components/footer.blade.php's embedded <style> block.
   Selectors and appearance are unchanged - only the local :root has been
   folded into the global one above (see the PHASE 4 comment there).
   ═══════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  overflow: hidden;
  color: var(--footer-text);
  font-size: 14px;
  background:
    radial-gradient(circle at top right, rgba(var(--brand-rgb), 0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(var(--brand-rgb), 0.08), transparent 32%),
    linear-gradient(90deg, var(--nav-bg) 0%, var(--nav-bg) 45%, var(--nav-bg) 100%);
  border-top: 1px solid rgba(var(--brand-rgb), 0.08);
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.footer .footer-top,
.footer .copyright {
  position: relative;
  z-index: 2;
}

.footer .footer-top {
  padding: 56px 0 24px;
}

.footer .footer-container {
  width: 96%;
  max-width: 1550px;
}

.footer .footer-row {
  --bs-gutter-x: 3.5rem;
  align-items: flex-start;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 18px;
  color: var(--text-inv);
  text-decoration: none;
}

.footer-logo-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), 0.16);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.footer-logo-mark img {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: block;
  object-fit: contain;
}

.footer-logo-text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  color: var(--text-inv);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  white-space: nowrap;
}

.footer-logo-text span {
  color: var(--brand);
}

.footer-logo:hover {
  color: var(--text-inv);
}

.footer-logo:hover .footer-logo-mark {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(var(--brand-rgb), 0.26);
}

.footer .footer-desc {
  max-width: 430px;
  margin: 0 0 18px;
  color: var(--footer-soft);
  font-size: 14px;
  line-height: 1.82;
}

.footer .footer-contact {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.footer .footer-contact p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.65;
}

.footer .footer-contact i {
  width: 18px;
  min-width: 18px;
  margin-top: 2px;
  color: var(--brand);
  font-size: 15px;
  text-align: center;
}

.footer .footer-contact strong {
  color: var(--text-inv);
  font-weight: 600;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer .footer-contact a {
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.25s ease;
}

.footer .footer-contact a:hover {
  color: var(--brand);
}

.footer h4 {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 10px;
  color: var(--text-inv);
  font-size: 17px;
  font-weight: 700;
}

.footer h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.footer .footer-links {
  margin-bottom: 24px;
}

.footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer .footer-links ul li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
}

.footer .footer-links ul li:first-child {
  padding-top: 0;
}

.footer .footer-links ul i {
  color: var(--brand);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.footer .footer-links ul a {
  position: relative;
  display: inline-block;
  color: var(--footer-soft);
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer .footer-links ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--brand);
  transition: width 0.25s ease;
}

.footer .footer-links ul li:hover i {
  transform: translateX(3px);
}

.footer .footer-links ul a:hover {
  color: var(--text-inv);
}

.footer .footer-links ul a:hover::after {
  width: 100%;
}

.footer .social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.footer .social-links a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--brand);
  background: var(--footer-card);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  text-decoration: none;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.footer .social-links a:hover {
  transform: translateY(-3px);
  color: var(--text-inv);
  background: var(--brand);
  border-color: var(--brand);
}

.footer .subscribe-note {
  margin-bottom: 14px;
  color: var(--footer-soft);
  line-height: 1.72;
}

.footer form {
  margin-top: 8px;
}

.footer .form-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
}

.footer .subscribe-methods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer .subscribe-methods .form-check {
  margin: 0;
  padding: 0;
}

.footer .subscribe-methods label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.footer .subscribe-methods .form-check-input {
  margin: 0;
  cursor: pointer;
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.footer .subscribe-methods .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.footer .subscribe-methods .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(var(--brand-rgb), 0.16);
}

.footer .subscribe-methods i {
  color: var(--brand);
  font-size: 14px;
}

.footer .subscribe-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: var(--text-inv);
  color: var(--nav-bg);
  box-shadow: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.footer .subscribe-input::placeholder {
  color: #98a2b3;
}

.footer .subscribe-input:focus {
  border-color: rgba(var(--brand-rgb), 0.65);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.1);
  background: var(--text-inv);
  color: var(--nav-bg);
}

/* Invalid field state (set by the subscribe script) */
.footer .subscribe-input.is-invalid {
  border-color: rgba(255, 143, 143, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 143, 143, 0.12);
}

.footer .subscribe-btn {
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand);
  color: var(--nav-bg);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.18);
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.footer .subscribe-btn:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--nav-bg);
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), 0.22);
}

.footer .subscribe-btn:disabled {
  opacity: 0.9;
  cursor: not-allowed;
  transform: none;
}

/* Feedback banner after subscribing / unsubscribing */
.footer .subscribe-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.footer .subscribe-alert i {
  margin-top: 2px;
  flex-shrink: 0;
}

.footer .subscribe-alert-success {
  background: rgba(126, 226, 184, 0.1);
  border: 1px solid rgba(126, 226, 184, 0.3);
  color: var(--footer-success);
}

.footer .subscribe-alert-danger {
  background: rgba(255, 143, 143, 0.1);
  border: 1px solid rgba(255, 143, 143, 0.3);
  color: var(--footer-error);
}

/* Secondary "Unsubscribe" action under the main button */
.footer .subscribe-secondary {
  margin-top: 14px;
}

.footer .subscribe-link-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.footer .subscribe-link-btn i {
  font-size: 1rem;
  color: var(--brand);
}

.footer .subscribe-link-btn:hover {
  background: rgba(var(--brand-rgb), 0.12);
  border-color: rgba(var(--brand-rgb), 0.55);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), 0.18);
}

.footer .subscribe-link-btn:active {
  transform: translateY(0);
}

.footer .subscribe-link-btn:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.15);
}

.footer .form-text-error {
  display: block;
  margin-top: 6px;
  color: var(--footer-error);
  font-size: 0.84rem;
  line-height: 1.45;
}

.footer .copyright {
  padding: 22px 0 20px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(var(--nav-deep-rgb, 2, 10, 28), 0.74);
}

.footer .copyright p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}

.footer .copyright .sitename {
  color: var(--text-inv);
}

.footer .credits {
  margin-top: 6px;
  color: var(--footer-muted);
  font-size: 13px;
}

.footer .credits a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.footer .footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--footer-muted);
  font-size: 13px;
}

.footer .footer-legal-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer .footer-legal-links a:hover {
  color: var(--brand);
}

.footer .footer-legal-links .footer-legal-sep {
  color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1199.98px) {
  .footer .footer-container {
    width: 100%;
    max-width: 100%;
  }

  .footer .footer-row {
    --bs-gutter-x: 2rem;
  }
}

@media (max-width: 991.98px) {
  .footer .footer-top {
    padding: 48px 0 20px;
  }

  .footer-logo-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 14px;
  }

  .footer-logo-mark img {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
  }

  .footer-logo-text {
    font-size: 1.3rem;
  }

  .footer .footer-desc {
    max-width: 100%;
  }
}

@media (max-width: 767.98px) {
  .footer {
    font-size: 13.5px;
  }

  .footer .footer-top {
    padding: 42px 0 14px;
  }

  .footer-logo {
    margin-bottom: 15px;
  }

  .footer-logo-text {
    font-size: 1.2rem;
  }

  .footer .footer-desc,
  .footer .subscribe-note {
    font-size: 13.5px;
  }

  .footer h4 {
    margin-bottom: 14px;
    font-size: 15px;
  }

  .footer .footer-links {
    margin-bottom: 20px;
  }

  .footer .footer-links ul li {
    padding: 8px 0;
  }

  .footer .social-links a {
    width: 39px;
    height: 39px;
  }

  .footer .subscribe-input {
    min-height: 48px;
    border-radius: 13px;
  }

  .footer .subscribe-btn {
    min-height: 46px;
    font-size: 0.92rem;
  }
}

@media (max-width: 575.98px) {
  .footer .footer-top {
    padding: 38px 0 10px;
  }

  .footer-logo {
    gap: 8px;
  }

  .footer-logo-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 13px;
  }

  .footer-logo-mark img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
  }

  .footer-logo-text {
    max-width: 180px;
    overflow: hidden;
    font-size: 1.12rem;
    text-overflow: ellipsis;
  }

  .footer .footer-contact p,
  .footer .footer-links ul a,
  .footer .subscribe-note,
  .footer .credits {
    font-size: 13px;
  }

  .footer h4 {
    font-size: 14px;
  }

  .footer .social-links {
    gap: 8px;
  }

  .footer .social-links a {
    width: 36px;
    height: 36px;
  }

  .footer .subscribe-input {
    min-height: 46px;
    border-radius: 12px;
  }

  .footer .subscribe-btn {
    min-height: 44px;
    border-radius: 11px;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .footer-logo-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .footer-logo-mark img {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
  }

  .footer-logo-text {
    max-width: 150px;
    font-size: 1rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   5. PORTAL FOOTER  (components/portal/footer - was inline)
   ═══════════════════════════════════════════════════════════════ */
/* Keep the footer at the bottom on short pages (portal pages only) */
body:has(.pf-footer) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body:has(.pf-footer) > main {
    flex: 1 0 auto;
}

.pf-footer {
    margin-top: auto;
    font-family: "Inter", "Roboto", system-ui, -apple-system, sans-serif;
    color: rgba(255, 255, 255, 0.82);
    background:
        radial-gradient(circle at top right, rgba(var(--brand-rgb), 0.12), transparent 30%),
        linear-gradient(135deg, var(--nav-bg), var(--nav-bg-secondary));
    border-top: 1px solid rgba(var(--brand-rgb), 0.16);
}

.pf-footer-inner {
    max-width: 1800px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.pf-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
}

.pf-footer p strong {
    color: #fff;
    font-weight: 700;
}

.pf-version {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.14);
    border: 1px solid rgba(var(--brand-rgb), 0.28);
    color: var(--brand-200);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.pf-social {
    display: flex;
    gap: 8px;
}

.pf-social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pf-social a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--nav-bg);
    transform: translateY(-1px);
}

.pf-social svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 767.98px) {
    .pf-footer-inner {
        justify-content: center;
        text-align: center;
        padding: 18px 16px;
    }
}
