/*
 * LDG International Inc. — Premium Responsive Interface v2026.07.12.4
 * Global UI layer for public, authentication, member, admin, distribution,
 * and management pages. Business logic is intentionally untouched.
 */

:root {
  --ldg-black: #050505;
  --ldg-black-soft: #0a0a0b;
  --ldg-charcoal: #111113;
  --ldg-charcoal-2: #19191c;
  --ldg-gold-100: #fff6d7;
  --ldg-gold-200: #f8e7aa;
  --ldg-gold-300: #f1d27b;
  --ldg-gold-400: #dfb950;
  --ldg-gold-500: #c99a2e;
  --ldg-gold-600: #a97416;
  --ldg-gold-700: #76500d;
  --ldg-paper: #f8f6ef;
  --ldg-paper-2: #f1eee4;
  --ldg-surface: #ffffff;
  --ldg-surface-soft: #fbfaf6;
  --ldg-ink: #151515;
  --ldg-ink-soft: #34312b;
  --ldg-muted: #6d685e;
  --ldg-line: rgba(126, 88, 12, .20);
  --ldg-line-dark: rgba(248, 215, 125, .22);
  --ldg-success: #1b7f4b;
  --ldg-danger: #b4232f;
  --ldg-warning: #9b6707;
  --ldg-info: #285a8e;
  --ldg-radius-xs: 10px;
  --ldg-radius-sm: 14px;
  --ldg-radius: 20px;
  --ldg-radius-lg: 28px;
  --ldg-shadow-xs: 0 5px 15px rgba(30, 22, 5, .06);
  --ldg-shadow-sm: 0 12px 30px rgba(30, 22, 5, .09);
  --ldg-shadow: 0 20px 55px rgba(30, 22, 5, .12);
  --ldg-shadow-dark: 0 24px 70px rgba(0, 0, 0, .34);
  --ldg-header-height: 68px;
  --ldg-mobile-dock-height: 72px;
  --ldg-sidebar-width: 304px;
  --ldg-font-ui: "Segoe UI Variable Text", "Aptos", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ldg-font-display: "Segoe UI Variable Display", "Aptos Display", "Segoe UI", Arial, sans-serif;
  --adminuiux-content-font: var(--ldg-font-ui);
  --adminuiux-title-font: var(--ldg-font-display);
  --adminuiux-theme-1: var(--ldg-gold-500);
  --adminuiux-theme-2: var(--ldg-gold-300);
  --bs-primary: #a97416;
  --bs-primary-rgb: 169, 116, 22;
  --bs-body-font-family: var(--ldg-font-ui);
  --bs-body-color: var(--ldg-ink);
  --bs-body-bg: var(--ldg-paper);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ldg-ink) !important;
  font-family: var(--ldg-font-ui) !important;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  letter-spacing: -.006em;
  background:
    radial-gradient(680px 360px at 2% -5%, rgba(223, 185, 80, .16), transparent 64%),
    radial-gradient(560px 330px at 100% 8%, rgba(169, 116, 22, .08), transparent 65%),
    linear-gradient(180deg, #fbfaf6 0%, var(--ldg-paper) 48%, var(--ldg-paper-2) 100%) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body, input, select, textarea, button { font-family: var(--ldg-font-ui) !important; }
button, input, select, textarea { font: inherit; }
img, picture, svg, video, canvas, iframe { max-width: 100%; }
img { display: block; height: auto; }
canvas, video, iframe { width: 100%; }
iframe { border: 0; }
figure { margin: 0; }
.row > *, .d-flex > *, .grid > *, .adminuiux-wrap > * { min-width: 0; }
p, li, td, th, label, .card, .modal-content, .dropdown-menu { overflow-wrap: anywhere; }
a { color: #865b08; text-underline-offset: 3px; }
a:hover { color: #aa7915; }
::selection { color: #171000; background: rgba(241, 210, 123, .65); }

h1, h2, h3, h4, h5, h6,
.page-title, .card-title, .modal-title, .offcanvas-title {
  margin-top: 0;
  color: inherit;
  font-family: var(--ldg-font-display) !important;
  font-weight: 760;
  letter-spacing: -.025em;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Reliable contrast on light and dark surfaces
   -------------------------------------------------------------------------- */
.card, .adminuiux-card, .card-soft, .page-section, .modal-content,
.dropdown-menu, .popover, .toast, .list-group-item, .accordion-item,
.offcanvas:not(.adminuiux-sidebar), .table-responsive, .filter-panel,
.activation-card, .clinical-card, .content-card {
  color: var(--ldg-ink) !important;
}

.bg-white, .bg-light, .table-light, .card:not(.bg-dark):not(.bg-black),
.modal-content, .dropdown-menu, .popover, .offcanvas:not(.adminuiux-sidebar) {
  --bs-body-color: var(--ldg-ink);
  color: var(--ldg-ink) !important;
}

.bg-white .text-white:not(.badge):not(.btn),
.bg-light .text-white:not(.badge):not(.btn),
.table-light .text-white:not(.badge):not(.btn),
.modal-content .text-white:not(.badge):not(.btn),
.dropdown-menu .text-white:not(.badge):not(.btn),
.offcanvas:not(.adminuiux-sidebar) .text-white:not(.badge):not(.btn),
.ldg-auto-dark-text {
  color: var(--ldg-ink) !important;
  text-shadow: none !important;
}

.bg-dark, .bg-black, .text-bg-dark, .text-bg-black,
.ldg-dark-surface, .adminuiux-header, .adminuiux-sidebar {
  color: #fff !important;
}
.bg-dark .text-dark:not(.badge), .bg-black .text-dark:not(.badge),
.ldg-dark-surface .text-dark:not(.badge), .ldg-auto-light-text {
  color: #fff !important;
}

.text-muted, .text-secondary { color: var(--ldg-muted) !important; }
.text-primary { color: #8a5e09 !important; }
.text-success { color: #177443 !important; }
.text-danger { color: #a7202d !important; }

/* --------------------------------------------------------------------------
   Brand image rules: transparent, proportional, never stretched
   -------------------------------------------------------------------------- */
[data-ldg-logo], .ldg-logo, .ldg-brand-logo,
.navbar-brand img, .brand img, .logo img,
img[src*="ldg-logo"], img[src*="ldg-mark"] {
  display: block !important;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain !important;
  object-position: center !important;
  aspect-ratio: 1 / 1;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
}
.ldg-logo-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  isolation: isolate;
}
.ldg-logo-frame::before {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223, 185, 80, .20), transparent 70%);
  filter: blur(10px);
}
.avatar img, .member-avatar, .profile-image,
img[class*="avatar"], img[class*="profile"] {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center top;
}
img.ldg-image-fallback { object-fit: contain !important; background: #0a0a0b !important; }
figure, .image-wrapper, .img-wrapper { max-width: 100%; overflow: hidden; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.adminuiux-header, .adminuiux-header .navbar {
  color: #fff !important;
  background:
    radial-gradient(260px 90px at 18% 0%, rgba(241, 210, 123, .15), transparent 70%),
    rgba(5, 5, 5, .95) !important;
  border-bottom: 1px solid rgba(241, 210, 123, .24) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.adminuiux-header .navbar {
  min-height: var(--ldg-header-height);
  padding-block: 7px;
}
.adminuiux-header .container-fluid { gap: 6px; }
.adminuiux-header .btn-link-header,
.adminuiux-header .sidebar-toggler,
.adminuiux-header .navbar .btn-link {
  color: var(--ldg-gold-200) !important;
}
.adminuiux-header .btn-link-header:hover,
.adminuiux-header .sidebar-toggler:hover,
.adminuiux-header .navbar .btn-link:hover {
  color: #fff !important;
  background: rgba(223, 185, 80, .14) !important;
}
.ldg-navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-width: 0 !important;
  max-width: min(360px, 54vw);
  min-height: 48px;
  padding: 3px 10px 3px 5px !important;
  color: #fff !important;
  border: 1px solid rgba(241, 210, 123, .25) !important;
  border-radius: 15px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(223,185,80,.08)) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.22) !important;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.ldg-navbar-brand:hover {
  transform: translateY(-1px);
  border-color: rgba(241, 210, 123, .48) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(223,185,80,.13)) !important;
}
.ldg-navbar-brand__mark {
  position: relative;
  display: grid;
  flex: 0 0 43px;
  place-items: center;
  width: 43px;
  height: 43px;
  overflow: visible;
  border-radius: 12px;
  background: transparent;
}
.ldg-navbar-brand__mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223,185,80,.18), transparent 70%);
}
.ldg-navbar-brand__mark img { width: 43px !important; height: 43px !important; position: relative; }
.ldg-brand-copy { min-width: 0; line-height: 1.05; }
.ldg-brand-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ldg-gold-200) !important;
  font-family: var(--ldg-font-display) !important;
  font-size: .77rem;
  font-weight: 820;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ldg-brand-copy span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: rgba(255,255,255,.58) !important;
  font-size: .55rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ldg-header-actions { flex: 0 0 auto; gap: 2px; }
.ldg-global-search { min-width: 0; }
.search-wrap {
  max-width: 100%;
  color: #fff !important;
  border: 1px solid rgba(241, 210, 123, .17);
  background: rgba(255,255,255,.07) !important;
}
.search-wrap input, .search-wrap .input-group-text { color: #fff !important; background: transparent !important; }
.search-wrap input::placeholder { color: rgba(255,255,255,.55) !important; }
.search-dropdown {
  overflow: auto;
  color: var(--ldg-ink) !important;
  border: 1px solid var(--ldg-line) !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: var(--ldg-shadow-dark) !important;
}
.search-item, .search-item-title { color: var(--ldg-ink) !important; background: #fff !important; }
.search-item-desc { color: var(--ldg-muted) !important; }
.search-item:hover { background: var(--ldg-gold-100) !important; }

/* --------------------------------------------------------------------------
   Non-blocking loader with full uploaded LDG logo
   -------------------------------------------------------------------------- */
.pageloader.ldg-page-loader {
  position: fixed !important;
  inset: calc(var(--ldg-header-height) + 10px) 14px auto auto !important;
  z-index: 2147483000 !important;
  display: block !important;
  width: min(390px, calc(100vw - 28px)) !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
  visibility: visible;
  opacity: 1;
  background: transparent !important;
  transform: translateY(0) scale(1);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease !important;
}
.pageloader.ldg-page-loader.is-hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(-9px) scale(.98) !important;
}
.ldg-page-loader__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 9px 14px 9px 9px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(241, 210, 123, .38);
  border-radius: 20px;
  background:
    radial-gradient(180px 90px at 0 50%, rgba(223,185,80,.14), transparent 75%),
    rgba(6,6,7,.97);
  box-shadow: 0 20px 55px rgba(0,0,0,.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.ldg-page-loader__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.08) 48%, transparent 72%);
  transform: translateX(-120%);
  animation: ldgLoaderSweep 1.2s ease-in-out infinite;
}
.ldg-page-loader__logo {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 76px;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: visible;
  background: transparent;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.34));
  animation: ldgLogoBreath 1.35s ease-in-out infinite alternate;
}
.ldg-page-loader__logo img {
  width: 76px !important;
  height: 76px !important;
  object-fit: contain !important;
}
.ldg-page-loader__copy { position: relative; z-index: 1; flex: 1; min-width: 0; }
.ldg-page-loader__copy strong {
  display: block;
  color: var(--ldg-gold-200) !important;
  font-family: var(--ldg-font-display) !important;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.3;
}
.ldg-page-loader__copy span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: rgba(255,255,255,.64) !important;
  font-size: .69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ldg-page-loader__copy i {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.ldg-page-loader__copy i::after {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ldg-gold-600), var(--ldg-gold-200), var(--ldg-gold-500));
  animation: ldgLoaderBar 1s ease-in-out infinite;
}
@keyframes ldgLoaderBar { from { transform: translateX(-120%); } to { transform: translateX(340%); } }
@keyframes ldgLoaderSweep { 0%,25% { transform: translateX(-120%); } 75%,100% { transform: translateX(120%); } }
@keyframes ldgLogoBreath { from { transform: scale(.97); opacity: .88; } to { transform: scale(1.025); opacity: 1; } }

/* --------------------------------------------------------------------------
   Sidebar and menu
   -------------------------------------------------------------------------- */
.adminuiux-sidebar {
  width: var(--ldg-sidebar-width) !important;
  max-width: min(92vw, var(--ldg-sidebar-width));
  color: #fff !important;
  border-right: 1px solid rgba(241, 210, 123, .18) !important;
  background:
    radial-gradient(350px 260px at 0 0, rgba(223,185,80,.12), transparent 70%),
    linear-gradient(180deg, #070708 0%, #111113 68%, #080809 100%) !important;
  box-shadow: 16px 0 44px rgba(0,0,0,.20) !important;
}
.adminuiux-sidebar-inner {
  height: 100%;
  padding: 9px 0 max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(223,185,80,.45) transparent;
}
.adminuiux-sidebar-inner::-webkit-scrollbar { width: 6px; }
.adminuiux-sidebar-inner::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(223,185,80,.35); }
.adminuiux-sidebar .nav { gap: 1px; }
.adminuiux-sidebar .nav-item { min-width: 0; }
.adminuiux-sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  margin: 3px 9px;
  padding: 10px 12px !important;
  overflow: hidden;
  color: rgba(255,255,255,.78) !important;
  border: 1px solid transparent;
  border-radius: 13px !important;
  font-size: .82rem;
  font-weight: 670;
  line-height: 1.25;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, transform .18s ease, border-color .18s ease;
}
.adminuiux-sidebar .nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.08), transparent);
  transform: translateX(-100%);
  transition: opacity .2s ease, transform .45s ease;
}
.adminuiux-sidebar .nav-link:hover {
  color: #fff7d8 !important;
  border-color: rgba(241,210,123,.14);
  background: rgba(223,185,80,.10) !important;
  transform: translateX(2px);
}
.adminuiux-sidebar .nav-link:hover::before { opacity: 1; transform: translateX(100%); }
.adminuiux-sidebar .nav-link.active,
.adminuiux-sidebar .nav-link[aria-current="page"] {
  color: #171000 !important;
  border-color: rgba(255,255,255,.32) !important;
  background: linear-gradient(135deg, #f9e8aa 0%, #dfb950 50%, #b87d16 100%) !important;
  box-shadow: 0 11px 27px rgba(201,154,46,.24);
  transform: translateX(2px);
}
.adminuiux-sidebar .nav-link[aria-expanded="true"]:not(.active) {
  color: var(--ldg-gold-200) !important;
  background: rgba(223,185,80,.11) !important;
}
.adminuiux-sidebar .menu-icon,
.adminuiux-sidebar .nav-link > i:first-child,
.adminuiux-sidebar .ldg-menu-icon {
  display: inline-grid;
  flex: 0 0 25px;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--ldg-gold-300) !important;
  font-size: 1rem;
}
.adminuiux-sidebar .nav-link.active .menu-icon,
.adminuiux-sidebar .nav-link.active > i,
.adminuiux-sidebar .nav-link.active .ldg-menu-icon,
.adminuiux-sidebar .nav-link.active * { color: #171000 !important; }
.adminuiux-sidebar .menu-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adminuiux-sidebar .nav-link[data-bs-toggle="collapse"]::after {
  content: "\f282";
  flex: 0 0 auto;
  margin-left: auto;
  font-family: "bootstrap-icons";
  font-size: .72rem;
  transition: transform .18s ease;
}
.adminuiux-sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after { transform: rotate(180deg); }
.adminuiux-sidebar .collapse .nav-link {
  min-height: 41px;
  margin-left: 21px;
  padding-block: 8px !important;
  font-size: .76rem;
  background: rgba(255,255,255,.025);
}
.adminuiux-sidebar .collapse.show { animation: ldgMenuReveal .2s ease both; }
@keyframes ldgMenuReveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

#usersidebarprofile {
  margin: 6px 9px 12px;
  padding: 14px 12px !important;
  color: #fff;
  border: 1px solid rgba(241,210,123,.18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(223,185,80,.055));
}
#usersidebarprofile h5 { color: #fff !important; font-size: .95rem; }
#usersidebarprofile .text-secondary { color: rgba(255,255,255,.57) !important; }
#usersidebarprofile .avatar { border: 2px solid rgba(241,210,123,.52); background: #111 !important; }

.ldg-sidebar-tools {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 10px 7px;
  background: linear-gradient(180deg, rgba(8,8,9,.98) 78%, transparent);
}
.ldg-sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(241,210,123,.18);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
}
.ldg-sidebar-search i { color: var(--ldg-gold-300); }
.ldg-sidebar-search input {
  width: 100%;
  min-width: 0;
  color: #fff !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.ldg-sidebar-search input::placeholder { color: rgba(255,255,255,.48) !important; }
.ldg-menu-empty {
  margin: 12px;
  padding: 14px;
  color: rgba(255,255,255,.58);
  border: 1px dashed rgba(241,210,123,.22);
  border-radius: 13px;
  font-size: .77rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Main content, cards, forms, buttons, tables
   -------------------------------------------------------------------------- */
.adminuiux-wrap, .adminuiux-content, main { min-width: 0; max-width: 100%; }
.adminuiux-content { background: transparent !important; }
.adminuiux-content .container-fluid, main .container-fluid { width: 100%; max-width: 1720px; }

.card, .adminuiux-card, .card-soft, .page-section, .modal-content,
.offcanvas:not(.adminuiux-sidebar), .filter-panel, .activation-card,
.clinical-card, .content-card {
  color: var(--ldg-ink) !important;
  border: 1px solid var(--ldg-line) !important;
  border-radius: var(--ldg-radius) !important;
  background: rgba(255,255,255,.97) !important;
  box-shadow: var(--ldg-shadow-sm) !important;
}
.card:hover, .adminuiux-card:hover { border-color: rgba(169,116,22,.30) !important; }
.card-header, .modal-header, .offcanvas-header, .accordion-button {
  color: var(--ldg-ink) !important;
  border-bottom: 1px solid var(--ldg-line) !important;
  background: linear-gradient(180deg, #fffefa 0%, #f8f3e4 100%) !important;
}
.card-footer, .modal-footer { border-top: 1px solid var(--ldg-line) !important; background: #fcfaf4 !important; }

.btn, button {
  max-width: 100%;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 720;
  letter-spacing: -.005em;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn-theme, .btn-primary, .bg-theme-1, .text-bg-primary {
  color: #171000 !important;
  border-color: #d7ad42 !important;
  background: linear-gradient(135deg, #f9e8aa 0%, #dfb950 48%, #ad7414 100%) !important;
  box-shadow: 0 9px 22px rgba(169,116,22,.20) !important;
}
.btn-theme:hover, .btn-primary:hover {
  color: #111 !important;
  filter: brightness(1.035);
  transform: translateY(-1px);
  box-shadow: 0 12px 27px rgba(169,116,22,.25) !important;
}
.btn-outline-primary {
  color: #7c5408 !important;
  border-color: rgba(169,116,22,.48) !important;
  background: rgba(255,255,255,.65) !important;
}
.btn-outline-primary:hover { color: #171000 !important; background: var(--ldg-gold-200) !important; }
.btn-dark, .text-bg-dark { color: #fff !important; background: #111113 !important; }
.btn:focus-visible, button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(223,185,80,.38) !important;
  outline-offset: 2px;
}

.form-control, .form-select, .input-group-text {
  min-height: 45px;
  color: var(--ldg-ink) !important;
  border-color: rgba(96,72,18,.24) !important;
  border-radius: 12px !important;
  background-color: #fff !important;
}
.form-control::placeholder { color: #807a6f !important; opacity: 1; }
.form-control:focus, .form-select:focus {
  color: var(--ldg-ink) !important;
  border-color: var(--ldg-gold-500) !important;
  box-shadow: 0 0 0 .22rem rgba(223,185,80,.18) !important;
}
.form-label, .form-check-label { color: #332a18 !important; font-weight: 680; }
.input-group { max-width: 100%; }

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  border: 1px solid var(--ldg-line);
  border-radius: 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(169,116,22,.44) transparent;
}
.table-responsive > .table { width: max-content; min-width: 100%; margin-bottom: 0; }
.table { --bs-table-bg: transparent; color: var(--ldg-ink) !important; }
.table td, .table th { vertical-align: middle; }
.table thead th {
  color: var(--ldg-gold-200) !important;
  border-color: rgba(241,210,123,.14) !important;
  background: #0b0b0c !important;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { color: var(--ldg-ink) !important; background: transparent !important; }
.table tbody tr:hover { background: rgba(223,185,80,.075); }
.badge.bg-primary, .badge.text-bg-primary { color: #171000 !important; background: var(--ldg-gold-300) !important; }

.dropdown-menu {
  max-width: calc(100vw - 24px);
  border: 1px solid var(--ldg-line) !important;
  border-radius: 15px !important;
  box-shadow: var(--ldg-shadow) !important;
}
.dropdown-item { color: var(--ldg-ink) !important; white-space: normal; }
.dropdown-item:hover, .dropdown-item:focus { color: #111 !important; background: var(--ldg-gold-100) !important; }
.modal-dialog { max-width: min(var(--bs-modal-width, 720px), calc(100vw - 20px)); }
.offcanvas { max-width: min(92vw, 430px); }
.alert-info { color: #4c3506; border-color: #e3c35c; background: #fff5d1; }
.alert-warning { color: #5c3b00; border-color: #e0b951; background: #fff3c7; }

.admin-toast-container { max-width: calc(100vw - 24px); }
.admin-toast { width: min(380px, calc(100vw - 24px)); min-width: 0 !important; border-radius: 14px !important; }
.admin-toast.success { color: #fff !important; background: linear-gradient(135deg,#176b40,#23995a) !important; }
.admin-toast.info { color: #171000 !important; background: linear-gradient(135deg,#f0d378,#c9972c) !important; }
.admin-toast.error { color: #fff !important; background: linear-gradient(135deg,#9f1f2a,#c53845) !important; }

/* --------------------------------------------------------------------------
   Mobile dock and quick menu inspired by a clean app-style navigation shell
   -------------------------------------------------------------------------- */
.ldg-mobile-dock {
  position: fixed;
  inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px;
  z-index: 1055;
  display: none;
  grid-template-columns: repeat(5, minmax(0,1fr));
  min-height: var(--ldg-mobile-dock-height);
  padding: 6px;
  border: 1px solid rgba(241,210,123,.28);
  border-radius: 22px;
  background: rgba(8,8,9,.94);
  box-shadow: 0 18px 52px rgba(0,0,0,.32);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}
.ldg-mobile-dock__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 5px 3px;
  color: rgba(255,255,255,.64) !important;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: .61rem;
  font-weight: 720;
  line-height: 1.05;
  text-decoration: none;
}
.ldg-mobile-dock__item i { color: var(--ldg-gold-300); font-size: 1.12rem; }
.ldg-mobile-dock__item span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.ldg-mobile-dock__item:hover, .ldg-mobile-dock__item:focus-visible {
  color: #fff !important;
  background: rgba(223,185,80,.10);
}
.ldg-mobile-dock__item.is-active {
  color: #171000 !important;
  background: linear-gradient(145deg, #f7e39a, #c99228) !important;
  box-shadow: 0 8px 20px rgba(201,154,46,.24);
}
.ldg-mobile-dock__item.is-active i { color: #171000 !important; }
.ldg-mobile-dock__badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 7px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: #fff;
  border: 2px solid #090909;
  border-radius: 999px;
  background: var(--ldg-danger);
  font-size: .52rem;
  line-height: 12px;
  text-align: center;
}

.ldg-quick-menu {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: grid;
  align-items: end;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.ldg-quick-menu.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.ldg-quick-menu__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(5px); }
.ldg-quick-menu__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(84dvh, 760px);
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
  color: var(--ldg-ink);
  border: 1px solid rgba(241,210,123,.28);
  border-radius: 28px 28px 0 0;
  background: #fbfaf6;
  box-shadow: 0 -28px 80px rgba(0,0,0,.34);
  transform: translateY(34px);
  transition: transform .24s cubic-bezier(.22,.8,.24,1);
}
.ldg-quick-menu.is-open .ldg-quick-menu__panel { transform: translateY(0); }
.ldg-quick-menu__handle { width: 48px; height: 5px; margin: 0 auto 9px; border-radius: 999px; background: #d8d2c4; }
.ldg-quick-menu__header { display: flex; align-items: center; gap: 11px; padding: 5px 3px 12px; }
.ldg-quick-menu__brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ldg-quick-menu__brand img { width: 48px !important; height: 48px !important; }
.ldg-quick-menu__brand strong { display: block; color: #6f4b08; font-size: .82rem; letter-spacing: .055em; }
.ldg-quick-menu__brand span { display: block; color: var(--ldg-muted); font-size: .66rem; }
.ldg-quick-menu__close { flex: 0 0 42px; width: 42px; height: 42px; min-height: 42px; color: #fff; border: 0; border-radius: 13px; background: #111113; }
.ldg-quick-menu__search { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 14px; border: 1px solid var(--ldg-line); border-radius: 15px; background: #fff; }
.ldg-quick-menu__search i { color: #9b6a0d; }
.ldg-quick-menu__search input { width: 100%; min-width: 0; color: var(--ldg-ink) !important; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; }
.ldg-quick-menu__list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 12px; padding: 0 2px 8px; overflow-y: auto; overscroll-behavior: contain; }
.ldg-quick-menu__link {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 10px;
  color: var(--ldg-ink) !important;
  border: 1px solid var(--ldg-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ldg-shadow-xs);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.ldg-quick-menu__link:hover { transform: translateY(-1px); border-color: rgba(169,116,22,.38); box-shadow: var(--ldg-shadow-sm); }
.ldg-quick-menu__link i { display: grid; place-items: center; width: 38px; height: 38px; color: #171000; border-radius: 12px; background: linear-gradient(145deg, #f7e39a, #d6a840); font-size: 1rem; }
.ldg-quick-menu__link strong { display: block; overflow: hidden; font-size: .75rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.ldg-quick-menu__link small { display: block; margin-top: 2px; color: var(--ldg-muted); font-size: .6rem; }
.ldg-quick-menu__empty { grid-column: 1 / -1; padding: 26px 14px; color: var(--ldg-muted); text-align: center; }
body.ldg-menu-open { overflow: hidden !important; touch-action: none; }

/* --------------------------------------------------------------------------
   Authentication pages
   -------------------------------------------------------------------------- */
body.ldg-auth-page {
  min-height: 100dvh;
  color: var(--ldg-ink) !important;
  background:
    radial-gradient(740px 480px at 8% 5%, rgba(223,185,80,.22), transparent 68%),
    radial-gradient(640px 420px at 92% 36%, rgba(169,116,22,.16), transparent 66%),
    #050505 !important;
}
body.ldg-auth-page .coverimg {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  background:
    linear-gradient(145deg, rgba(4,4,4,.54), rgba(10,10,11,.88)),
    radial-gradient(circle at 50% 12%, rgba(223,185,80,.16), transparent 34rem) !important;
}
body.ldg-auth-page .coverimg::after { display: none !important; }
body.ldg-auth-page .auth-wrapper { min-height: 100dvh; padding: 24px 0; }
body.ldg-auth-page .login-box { width: 100%; max-width: 570px; }
body.ldg-auth-page .login-box > .text-center {
  padding: 18px 14px;
  color: #fff !important;
  border: 1px solid rgba(241,210,123,.19);
  border-radius: 24px 24px 0 0;
  background: rgba(6,6,7,.78);
  backdrop-filter: blur(14px);
}
body.ldg-auth-page .login-box > .text-center h1 { color: #fff !important; }
body.ldg-auth-page .login-box > .text-center .text-muted { color: rgba(255,255,255,.66) !important; }
body.ldg-auth-page .login-box > .text-center .text-success { color: var(--ldg-gold-200) !important; }
body.ldg-auth-page .login-box [data-ldg-logo] { width: min(210px, 58vw) !important; height: auto !important; margin-inline: auto; filter: drop-shadow(0 18px 30px rgba(0,0,0,.42)); }
body.ldg-auth-page .adminuiux-card,
body.ldg-auth-page .login-box .card {
  color: var(--ldg-ink) !important;
  border-radius: 0 0 24px 24px !important;
  background: rgba(255,255,255,.985) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.38) !important;
}
body.ldg-auth-page .text-theme-1 { color: #8a5e09 !important; }

/* --------------------------------------------------------------------------
   Dark mode
   -------------------------------------------------------------------------- */
html[data-bs-theme="dark"] { color-scheme: dark; }
html[data-bs-theme="dark"] body:not(.ldg-auth-page) {
  --ldg-surface: #151517;
  --ldg-surface-soft: #1b1b1e;
  --ldg-ink: #f4f1e7;
  --ldg-ink-soft: #dbd5c8;
  --ldg-muted: #b9b2a4;
  --ldg-line: rgba(241,210,123,.18);
  color: #f4f1e7 !important;
  background:
    radial-gradient(680px 360px at 2% -5%, rgba(223,185,80,.11), transparent 64%),
    #09090a !important;
}
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .adminuiux-card,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .offcanvas:not(.adminuiux-sidebar),
html[data-bs-theme="dark"] .list-group-item,
html[data-bs-theme="dark"] .table-responsive,
html[data-bs-theme="dark"] .filter-panel,
html[data-bs-theme="dark"] .activation-card {
  color: #f4f1e7 !important;
  background: rgba(20,20,22,.98) !important;
}
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .offcanvas-header,
html[data-bs-theme="dark"] .accordion-button,
html[data-bs-theme="dark"] .card-footer,
html[data-bs-theme="dark"] .modal-footer {
  color: var(--ldg-gold-200) !important;
  background: linear-gradient(180deg,#1d1c18,#121214) !important;
}
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .input-group-text {
  color: #f4f1e7 !important;
  background: #111113 !important;
}
html[data-bs-theme="dark"] .form-label,
html[data-bs-theme="dark"] .form-check-label,
html[data-bs-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .dropdown-item { color: #f4f1e7 !important; }
html[data-bs-theme="dark"] .dropdown-item:hover { background: rgba(223,185,80,.12) !important; }
html[data-bs-theme="dark"] .ldg-quick-menu__panel { color: #f4f1e7; background: #111113; }
html[data-bs-theme="dark"] .ldg-quick-menu__search,
html[data-bs-theme="dark"] .ldg-quick-menu__link { color: #f4f1e7 !important; background: #1a1a1d; }
html[data-bs-theme="dark"] .ldg-quick-menu__search input,
html[data-bs-theme="dark"] .ldg-quick-menu__link strong { color: #f4f1e7 !important; }

/* --------------------------------------------------------------------------
   System footer
   -------------------------------------------------------------------------- */
.ldg-system-footer {
  margin: 18px 0 8px;
  padding: 14px 16px;
  color: var(--ldg-muted);
  border: 1px solid var(--ldg-line);
  border-radius: 14px;
  background: rgba(255,255,255,.76);
  font-size: .75rem;
  text-align: center;
}
.ldg-system-footer strong { color: #775108; }
html[data-bs-theme="dark"] .ldg-system-footer { background: rgba(20,20,22,.86); }

/* --------------------------------------------------------------------------
   Responsive layout
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  :root { --ldg-sidebar-width: 288px; }
  .ldg-global-search { display: none !important; }
}

@media (max-width: 991.98px) {
  .adminuiux-content .container-fluid, main .container-fluid { padding-inline: 14px; }
  .dashboard-header-fixed { position: static !important; top: auto !important; }
  .width-300 { width: min(300px, 100%) !important; }
  .adminuiux-sidebar { width: min(88vw, 310px) !important; max-width: 88vw; }
}

@media (max-width: 767.98px) {
  :root { --ldg-header-height: 64px; }
  body { font-size: 14px; padding-bottom: calc(var(--ldg-mobile-dock-height) + 18px + env(safe-area-inset-bottom)); }
  .adminuiux-content .container-fluid, main .container-fluid { padding-inline: 10px; }
  .card, .adminuiux-card, .card-soft, .page-section,
  .activation-card, .filter-panel { border-radius: 16px !important; }
  .adminuiux-header .navbar { min-height: var(--ldg-header-height); padding-inline: 6px; }
  .ldg-navbar-brand { max-width: calc(100vw - 154px); min-height: 45px; gap: 6px; padding: 2px 7px 2px 3px !important; }
  .ldg-navbar-brand__mark, .ldg-navbar-brand__mark img { width: 39px !important; height: 39px !important; flex-basis: 39px; }
  .ldg-brand-copy strong { font-size: .66rem; }
  .ldg-brand-copy span { font-size: .47rem; }
  .ldg-header-actions .btn-square, .sidebar-toggler { width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; }
  .btn { min-height: 43px; }
  .modal-dialog { margin: 8px; }
  .modal-content { border-radius: 18px !important; }
  .ldg-system-footer { margin-bottom: 6px; }
  .pageloader.ldg-page-loader { inset: calc(var(--ldg-header-height) + 7px) 8px auto 8px !important; width: auto !important; }
  .ldg-page-loader__inner { min-height: 76px; padding: 7px 11px 7px 7px; border-radius: 18px; }
  .ldg-page-loader__logo, .ldg-page-loader__logo img { width: 64px !important; height: 64px !important; flex-basis: 64px; }
  .ldg-mobile-dock { display: grid; }
  .adminuiux-sidebar .nav-link { min-height: 48px; }
  body.ldg-auth-page { padding-bottom: 0; }
  body.ldg-auth-page .auth-wrapper { padding: 10px 0 22px; }
}

/* Convert simple tables into labeled cards on narrow phones. */
@media (max-width: 575.98px) {
  .ldg-table-cards { width: 100% !important; min-width: 0 !important; border-collapse: separate; border-spacing: 0 10px; }
  .ldg-table-cards thead { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
  .ldg-table-cards tbody, .ldg-table-cards tr, .ldg-table-cards td { display: block; width: 100%; }
  .ldg-table-cards tbody tr {
    margin: 0 0 10px;
    padding: 7px 12px;
    border: 1px solid var(--ldg-line);
    border-radius: 15px;
    background: var(--ldg-surface);
    box-shadow: var(--ldg-shadow-xs);
  }
  .ldg-table-cards tbody td {
    display: grid;
    grid-template-columns: minmax(100px, 39%) minmax(0,1fr);
    gap: 10px;
    align-items: start;
    min-height: 38px;
    padding: 9px 0 !important;
    color: var(--ldg-ink) !important;
    border: 0 !important;
    border-bottom: 1px dashed rgba(126,88,12,.18) !important;
    text-align: right !important;
    white-space: normal !important;
  }
  .ldg-table-cards tbody td:last-child { border-bottom: 0 !important; }
  .ldg-table-cards tbody td::before {
    content: attr(data-label);
    color: #775108;
    font-size: .66rem;
    font-weight: 820;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
  }
  .ldg-table-cards .btn-group, .ldg-table-cards td .d-flex { justify-content: flex-end; flex-wrap: wrap; }
  .admin-toast-container { inset: 8px 8px auto !important; }
  .admin-toast { width: 100% !important; }
  .ldg-quick-menu__list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ldg-quick-menu__link { min-height: 62px; padding: 9px; }
  body.ldg-auth-page .login-box [data-ldg-logo] { width: min(180px, 56vw) !important; }
}

@media (max-width: 390px) {
  .ldg-brand-copy { display: none !important; }
  .ldg-navbar-brand { max-width: 52px; padding-right: 4px !important; }
  .ldg-mobile-dock { inset-inline: 5px; border-radius: 20px; }
  .ldg-mobile-dock__item { font-size: .57rem; }
  .ldg-quick-menu__list { grid-template-columns: 1fr; }
}

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

@media print {
  .adminuiux-header, .adminuiux-sidebar, .no-print, #fixedbuttons,
  .pageloader, .ldg-mobile-dock, .ldg-quick-menu { display: none !important; }
  body, .adminuiux-content { padding: 0 !important; color: #000 !important; background: #fff !important; }
  .card, .adminuiux-card, .page-section, .activation-card {
    color: #000 !important;
    border: 1px solid #aaa !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  img { break-inside: avoid; }
}
