/**
 * Bioryn Admin — Modern SaaS UI layer
 * Visual / UX overrides only. Does not change app behavior.
 */

:root,
html[data-theme="light"] {
  color-scheme: light;
  --primary: #0b1f3b;
  --primary-hover: #152d4f;
  --primary-soft: rgba(11, 31, 59, 0.08);
  --primary-muted: rgba(11, 31, 59, 0.55);
  --primary-border: rgba(11, 31, 59, 0.18);
  --accent: #1d6b8f;
  --main: #0f172a;
  --secondary: #64748b;
  --secondary-2: #94a3b8;
  --icon: #334155;
  --White: #ffffff;
  --Black: #0f172a;
  --bg-page: #eef2f6;
  --bg-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.86);
  --surface: #f1f5f9;
  --surface-2: #e2e8f0;
  --table-head: #e8eef5;
  --table-row-alt: #f8fafc;
  --table-row-hover: #f1f5f9;
  --critical: #dc2626;
  --critical-hover: #b91c1c;
  --critical-soft: #fef2f2;
  --critical-border: #fecaca;
  --critical-text: #b91c1c;
  --warning: #ea580c;
  --warning-soft: #fff7ed;
  --warning-border: #fed7aa;
  --warning-text: #c2410c;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;
  --yellow: #ca8a04;
  --yellow-soft: #fefce8;
  --yellow-border: #fde68a;
  --yellow-text: #a16207;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1d4ed8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --focus-border: #7db8d4;
  --pink: #ec749d;
  --blue: #1d6b8f;
  --skeleton-1: #f1f5f9;
  --skeleton-2: #e2e8f0;
  --login-glow-1: rgba(29, 107, 143, 0.14);
  --login-glow-2: rgba(11, 31, 59, 0.1);
  --login-bg-1: #f8fafc;
  --login-bg-2: #e8eef5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04);
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 76px;
  --header-h: 68px;
  --font-display: "Instrument Sans", "Kumbh Sans", system-ui, sans-serif;
  --font-body: "Kumbh Sans", "Instrument Sans", system-ui, sans-serif;
  --focus-ring: 0 0 0 3px rgba(29, 107, 143, 0.22);
  --nav-active-bg: rgba(29, 107, 143, 0.1);
  --overlay: rgba(15, 23, 42, 0.45);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #00A6A6;
  --primary-hover: #7ec4e0;
  --primary-soft: rgba(94, 179, 212, 0.12);
  --primary-muted: rgba(148, 189, 210, 0.7);
  --primary-border: rgba(94, 179, 212, 0.28);
  --accent: #00A6A6;
  --main: #e8eef5;
  --secondary: #94a3b8;
  --secondary-2: #64748b;
  --icon: #94a3b8;
  --White: #151b28;
  --Black: #e8eef5;
  --bg-page: #0b1018;
  --bg-elevated: #151b28;
  --bg-sidebar: #111722;
  --bg-header: rgba(17, 23, 34, 0.88);
  --surface: #1a2232;
  --surface-2: #243044;
  --table-head: #1a2232;
  --table-row-alt: #121826;
  --table-row-hover: #1e293b;
  --critical: #f87171;
  --critical-hover: #ef4444;
  --critical-soft: rgba(248, 113, 113, 0.12);
  --critical-border: rgba(248, 113, 113, 0.35);
  --critical-text: #fca5a5;
  --warning: #fb923c;
  --warning-soft: rgba(251, 146, 60, 0.12);
  --warning-border: rgba(251, 146, 60, 0.35);
  --warning-text: #fdba74;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --success-border: rgba(74, 222, 128, 0.32);
  --success-text: #86efac;
  --yellow: #facc15;
  --yellow-soft: rgba(250, 204, 21, 0.12);
  --yellow-border: rgba(250, 204, 21, 0.32);
  --yellow-text: #fde047;
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --info-border: rgba(96, 165, 250, 0.32);
  --info-text: #93c5fd;
  --line: #243044;
  --line-strong: #334155;
  --focus-border: #00A6A6;
  --pink: #f0a0bc;
  --blue: #00A6A6;
  --skeleton-1: #1a2232;
  --skeleton-2: #243044;
  --login-glow-1: rgba(94, 179, 212, 0.16);
  --login-glow-2: rgba(94, 179, 212, 0.08);
  --login-bg-1: #0b1018;
  --login-bg-2: #111722;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.3);
  --focus-ring: 0 0 0 3px rgba(94, 179, 212, 0.28);
  --nav-active-bg: rgba(94, 179, 212, 0.14);
  --overlay: rgba(0, 0, 0, 0.6);
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */

body {
  background: var(--bg-page) !important;
  color: var(--main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body a:focus-visible,
body button:focus-visible,
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.main-content {
  background:
    radial-gradient(900px 420px at 0% 0%, var(--login-glow-1), transparent 55%),
    var(--bg-page) !important;
  min-height: calc(100vh - var(--header-h));
}

.main-content-inner {
  padding: 28px 28px 40px !important;
  max-width: none;
  width: 100%;
}

.bottom-page {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bottom-page .copyright .text-caption-1 {
  font-size: 13px;
  color: var(--secondary-2) !important;
}

/* -------------------------------------------------------------------------- */
/* Typography & page header                                                   */
/* -------------------------------------------------------------------------- */

.heading,
h4.heading,
h5.heading,
h6.heading {
  font-family: var(--font-display) !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em;
  color: var(--main) !important;
  font-size: 24px !important;
  line-height: 1.25 !important;
  margin: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.page-header__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--main);
  line-height: 1.2;
  margin: 0;
}

.page-header__subtitle {
  font-size: 14px;
  color: var(--secondary);
  margin: 0;
  line-height: 1.45;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--secondary-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-nav a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-nav a:hover {
  color: var(--primary);
}

.breadcrumb-nav .sep {
  color: var(--line-strong);
  font-size: 11px;
}

.breadcrumb-nav .current {
  color: var(--main);
  font-weight: 550;
}

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */

.wg-box {
  background: var(--White) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 22px 22px 18px !important;
  margin-top: 0 !important;
}

.wg-box + .wg-box {
  margin-top: 20px !important;
}

.wg-box.p-40 {
  padding: 28px !important;
}

.wg-box .box-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.wg-box .box-title,
.box-title {
  font-family: var(--font-display);
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--main) !important;
  letter-spacing: -0.01em;
}

.wg-card {
  background: var(--White) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 22px !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  min-height: 108px;
}

.wg-card:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: var(--line-strong) !important;
  transform: translateY(-1px);
}

.wg-card .content .title {
  font-size: 13px !important;
  font-weight: 500;
  color: var(--secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.wg-card .content .number,
.wg-card .content .number h4,
.wg-card .counter .number {
  font-family: var(--font-display);
  font-size: 28px !important;
  font-weight: 650 !important;
  letter-spacing: -0.03em;
  color: var(--main) !important;
  line-height: 1.15;
}

.wg-card .icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wg-card .icon i {
  font-size: 22px !important;
  color: var(--primary) !important;
}

/* -------------------------------------------------------------------------- */
/* Sidebar — light, readable (compatible with Themesflat structure)           */
/* -------------------------------------------------------------------------- */

.section-menu-left {
  width: 260px !important;
  min-width: 260px !important;
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--line) !important;
  box-shadow: var(--shadow-sm) !important;
  z-index: 30 !important;
}

/* Theme paints panel via ::before — match elevated sidebar surface */
.section-menu-left::before {
  display: block !important;
  background: var(--bg-sidebar) !important;
  opacity: 1 !important;
}

.section-menu-left > .box-logo {
  height: var(--header-h) !important;
  width: 260px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: var(--bg-sidebar) !important;
  justify-content: space-between !important;
  z-index: 40 !important;
}

.section-menu-left > .box-logo #logo_header {
  filter: none !important;
  opacity: 1 !important;
  max-height: 36px;
  width: auto;
  transition: filter 0.2s ease;
}

html[data-theme="dark"] .section-menu-left > .box-logo #logo_header {
  filter: brightness(0) invert(1) !important;
  opacity: 0.95 !important;
}

.section-menu-left .button-show-hide {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.section-menu-left .button-show-hide i {
  color: var(--main) !important;
  font-size: 14px !important;
}

.section-menu-left .section-menu-left-wrap {
  padding: 12px !important;
  background-color: var(--bg-sidebar) !important;
  background: var(--bg-sidebar) !important;
  position: relative;
  z-index: 5;
}

.section-menu-left .center {
  padding: 4px !important;
}

.section-menu-left .menu-item {
  margin-bottom: 2px !important;
  visibility: visible !important;
}

.section-menu-left .menu-item a,
.section-menu-left .menu-item a.menu-item-button,
.section-menu-left .menu-item button.menu-item-button,
.section-menu-left .menu-item .menu-item-button {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 11px 12px !important;
  border-radius: 10px !important;
  color: var(--main) !important;
  text-decoration: none !important;
  text-align: left !important;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  border: none;
  background: transparent !important;
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
  position: relative;
  z-index: 1;
}

.section-menu-left .menu-item a:hover,
.section-menu-left .menu-item a.menu-item-button:hover,
.section-menu-left .menu-item button.menu-item-button:hover,
.section-menu-left .menu-item .menu-item-button:hover {
  background: var(--surface) !important;
  color: var(--primary) !important;
}

.section-menu-left .menu-item a.is-active,
.section-menu-left .menu-item a.menu-item-button.is-active,
.section-menu-left .menu-item a.menu-item-button.active,
.section-menu-left .menu-item.has-children.active > a.menu-item-button {
  background: var(--nav-active-bg) !important;
  color: var(--primary) !important;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.section-menu-left .menu-item a .icon,
.section-menu-left .menu-item button .icon,
.section-menu-left .menu-item .icon,
.section-menu-left .menu-item a .icon i,
.section-menu-left .menu-item button .icon i,
.section-menu-left .menu-item .icon i {
  color: var(--icon) !important;
  font-size: 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.section-menu-left .menu-item a.is-active .icon i,
.section-menu-left .menu-item a.menu-item-button.is-active .icon i {
  color: var(--primary) !important;
}

.section-menu-left .menu-item a .text,
.section-menu-left .menu-item button .text,
.section-menu-left .menu-item .text,
.section-menu-left .menu-item .text.text-title {
  display: block !important;
  flex-grow: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--main) !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-line-clamp: unset !important;
}

.section-menu-left .menu-item button .icon,
.section-menu-left .menu-item .menu-item-button .icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0 !important;
}

.section-menu-left .menu-item a.is-active .text,
.section-menu-left .menu-item a.menu-item-button.is-active .text {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.section-menu-left .sub-menu {
  margin: 2px 0 8px 8px !important;
  padding: 4px 0 4px 10px !important;
  border-left: none !important;
  display: block;
}

.section-menu-left .menu-item .sub-menu .sub-menu-item {
  padding-left: 0 !important;
}

.section-menu-left .menu-item .sub-menu .sub-menu-item::before {
  display: none !important;
}

.section-menu-left .sub-menu-item a,
.section-menu-left .menu-item .sub-menu a {
  display: flex !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  color: var(--secondary) !important;
  font-size: 13.5px !important;
  min-height: 38px;
  background: transparent !important;
}

.section-menu-left .sub-menu-item a .text,
.section-menu-left .menu-item .sub-menu a .text {
  color: var(--secondary) !important;
}

.section-menu-left .sub-menu-item a:hover,
.section-menu-left .sub-menu-item a.is-active,
.section-menu-left .menu-item .sub-menu a:hover,
.section-menu-left .menu-item .sub-menu a.is-active {
  background: var(--surface) !important;
  color: var(--primary) !important;
}

.section-menu-left .sub-menu-item a:hover .text,
.section-menu-left .sub-menu-item a.is-active .text {
  color: var(--primary) !important;
}

.section-menu-left .menu-item-logout .menu-item-button,
.section-menu-left .menu-item-logout .menu-item-button .text,
.section-menu-left .menu-item-logout .menu-item-button .icon i {
  color: var(--critical) !important;
}

.section-menu-left .menu-item-logout .menu-item-button:hover {
  background: var(--critical-soft) !important;
}

.section-menu-left .menu-item.has-children::after {
  color: var(--secondary-2) !important;
  z-index: 2;
}

.section-menu-left .menu-item.has-children.active::after,
.section-menu-left .menu-item.has-children:hover::after {
  color: var(--primary) !important;
}

/* Ensure Font Awesome nav icons match icomoon sizing/color */
.section-menu-left .menu-item .icon .fas,
.section-menu-left .menu-item .icon .far,
.section-menu-left .menu-item .icon .fab {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  color: var(--icon) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  width: 1.1em;
  text-align: center;
  display: inline-block;
}

.section-menu-left .menu-item a.is-active .icon .fas,
.section-menu-left .menu-item a.menu-item-button.is-active .icon .fas {
  color: var(--primary) !important;
}

.section-content-right {
  background: var(--bg-page) !important;
}

/* -------------------------------------------------------------------------- */
/* Collapsed sidebar — icon rail (desktop)                                    */
/* -------------------------------------------------------------------------- */

/* Desktop: never show header reopen control — logo toggle handles expand/collapse */
.header-dashboard .wrap .header-left .button-show-hide.sidebar-expand-mobile {
  display: none !important;
}

@media (min-width: 1201px) {
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left {
    left: 0 !important;
    width: var(--sidebar-collapsed-w) !important;
    min-width: var(--sidebar-collapsed-w) !important;
    overflow: visible !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left > .box-logo {
    left: 0 !important;
    width: var(--sidebar-collapsed-w) !important;
    min-width: var(--sidebar-collapsed-w) !important;
    padding: 0 10px !important;
    justify-content: center !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left > .box-logo #site-logo-inner {
    display: none !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .button-show-hide {
    display: flex !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .section-menu-left-wrap {
    padding: 10px 8px !important;
    overflow: visible !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .center {
    overflow: visible !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item {
    position: relative;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > a,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > button,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > .menu-item-button {
    justify-content: center !important;
    padding: 12px 10px !important;
    gap: 0 !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > a .icon,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > button .icon,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > .menu-item-button .icon {
    margin: 0 !important;
    flex-shrink: 0;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > a .text,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > button .text,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > .menu-item-button .text {
    position: absolute !important;
    left: calc(100% + 14px) !important;
    top: 50% !important;
    transform: translateY(-50%);
    width: max-content !important;
    max-width: 200px;
    flex-grow: 0 !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--line) !important;
    color: var(--main) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: var(--shadow-md) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 80;
    overflow: visible !important;
    white-space: nowrap !important;
    transition: opacity 0.12s ease, visibility 0.12s ease;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > a:hover .text,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > button:hover .text,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > .menu-item-button:hover .text {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Hide tooltip when flyout submenu is open for that item */
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item.has-children.active > a .text {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item.has-children::after {
    display: none !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item.has-children .sub-menu {
    position: absolute !important;
    left: calc(100% + 10px) !important;
    top: 0 !important;
    min-width: 190px;
    margin: 0 !important;
    padding: 8px !important;
    border-left: none !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--bg-elevated) !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 90;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item.has-children.active .sub-menu {
    display: block !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item .sub-menu .text {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-content-right .main-content {
    padding-left: var(--sidebar-collapsed-w) !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-content-right .header-dashboard {
    width: calc(100% - var(--sidebar-collapsed-w)) !important;
    padding-left: 16px !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .main-content-inner {
    max-width: none !important;
    width: 100% !important;
  }
}

@media (max-width: 1200px) {
  .header-dashboard .wrap .header-left .button-show-hide.sidebar-expand-mobile {
    display: flex !important;
  }

  /* On smaller screens keep drawer hide/show — do not keep icon rail */
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left {
    width: 260px !important;
    min-width: 260px !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left > .box-logo {
    width: 260px !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left > .box-logo #site-logo-inner {
    display: block !important;
  }

  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > a .text,
  .layout-wrap.full-width.sidebar-collapsed .section-menu-left .menu-item > button .text {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.header-dashboard {
  height: var(--header-h) !important;
  padding: 0 24px 0 16px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background: var(--bg-header) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line) !important;
  box-shadow: var(--shadow-xs) !important;
  /* theme already uses position:fixed — don't override to sticky */
  z-index: 40 !important;
}

.header-dashboard .wrap {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.header-dashboard .wrap .header-left {
  display: flex !important;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  max-width: none;
}

.header-dashboard .wrap .header-left .button-show-hide {
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  border: 1px solid var(--line) !important;
  background: var(--White) !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.header-dashboard .wrap .header-left .button-show-hide i {
  color: var(--main) !important;
  font-size: 15px !important;
}

.header-context {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.header-context__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--main) !important;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1 !important;
  line-height: 1.2;
}

.header-context__crumb {
  font-size: 11px;
  color: var(--secondary) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1 !important;
  line-height: 1.2;
}

.header-search {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 560px;
  min-width: 220px;
  z-index: 50;
}

.header-search__form {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--White);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search__form:focus-within {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.header-search__icon {
  display: inline-flex;
  color: var(--secondary);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
}

.header-search__input {
  flex: 1;
  min-width: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--main) !important;
  font-size: 13px;
  padding: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  line-height: 1.2;
}

.header-search__input::placeholder {
  color: var(--secondary);
  opacity: 0.85;
}

.header-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.header-search__hint {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  color: var(--secondary);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.3;
}

.header-search__results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 280px;
  max-width: 560px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md, 0 12px 32px rgba(10, 14, 22, 0.18));
}

.header-search__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--main);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.header-search__item:hover,
.header-search__item.is-active {
  background: var(--surface);
}

.header-search__item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--main);
}

.header-search__item-crumb {
  font-size: 11px;
  color: var(--secondary);
  white-space: nowrap;
}

.header-search__empty {
  padding: 12px 10px;
  font-size: 12.5px;
  color: var(--secondary);
  text-align: center;
}

.header-dashboard .wrap .header-grid {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
  flex: 0 0 auto;
  min-width: 0;
}

.header-dashboard .wrap .header-grid .line1 {
  width: 1px !important;
  height: 24px !important;
  background: var(--line) !important;
  margin: 0 2px !important;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--White);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  position: relative;
  cursor: default;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header-icon-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--main);
}

.header-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--critical);
  border: 2px solid var(--bg-elevated);
}

.header-dashboard .wg-user {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px !important;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--White);
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none !important;
  max-width: 160px;
}

.header-dashboard .wg-user:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.header-dashboard .wg-user .name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--main) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.header-dashboard .wg-user .image,
.header-dashboard .wg-user .image img,
.header-avatar-fallback {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  object-fit: cover;
  flex-shrink: 0;
}

.header-avatar-fallback {
  background: var(--primary) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.header-dashboard .btn.btn-secondary.dropdown-toggle {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.header-dashboard .btn.btn-secondary.dropdown-toggle::after {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.tf-button,
a.tf-button,
button.tf-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px !important;
  border-radius: 10px !important;
  font-family: var(--font-display) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  border: 1px solid transparent !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}

.tf-button:hover {
  background: var(--primary-hover) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}

.tf-button:active {
  transform: translateY(0.5px);
}

.tf-button:disabled,
.tf-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.tf-button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.tf-button.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: admin-spin 0.7s linear infinite;
}

.tf-button.btn-lite,
.tf-button.btn-secondary,
a.tf-button.btn-lite {
  background: var(--White) !important;
  color: var(--main) !important;
  border-color: var(--line-strong) !important;
  box-shadow: none;
}

.tf-button.btn-lite:hover,
.tf-button.btn-secondary:hover {
  background: var(--surface) !important;
  color: var(--main) !important;
  border-color: var(--secondary-2) !important;
}

.tf-button.btn-danger,
.tf-button.btns-trash,
button.tf-button.btn-danger {
  background: var(--critical) !important;
  border-color: var(--critical) !important;
  color: #fff !important;
}

.tf-button.btn-danger:hover {
  background: var(--critical-hover) !important;
}

.tf-btn-small,
a.tf-btn-small,
button.tf-btn-small {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  border-radius: 9px !important;
  border: 1px solid var(--line) !important;
  background: var(--White) !important;
  color: var(--secondary) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none !important;
}

.tf-btn-small:hover {
  background: var(--primary-soft) !important;
  border-color: var(--primary-border) !important;
  color: var(--primary) !important;
}

.tf-btn-small.btn-danger:hover,
.tf-btn-small.btns-trash:hover {
  background: var(--critical-soft) !important;
  border-color: var(--critical-border) !important;
  color: var(--critical) !important;
}

.action-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */

.form-type-1 .text-caption-1,
.form-type-2 .text-caption-1,
.form-wrap .text-caption-1,
.login-field .text-caption-1 {
  font-size: 13px !important;
  font-weight: 550 !important;
  color: var(--main) !important;
  margin-bottom: 8px !important;
}

.form-type-1 input,
.form-type-2 input,
.form-wrap input,
.form-type-1 textarea,
.form-type-2 textarea,
.form-wrap textarea,
.form-type-1 select,
.form-type-2 select,
.wg-box input[type="text"],
.wg-box input[type="email"],
.wg-box input[type="number"],
.wg-box input[type="tel"],
.wg-box input[type="password"],
.wg-box input[type="date"],
.wg-box input[type="datetime-local"],
.wg-box textarea,
.login-card input {
  min-height: 44px !important;
  padding: 10px 14px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: var(--White) !important;
  color: var(--main) !important;
  font-size: 14px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.form-type-1 textarea,
.form-type-2 textarea,
.wg-box textarea {
  min-height: 110px !important;
  resize: vertical;
}

.form-type-1 input:focus,
.form-type-2 input:focus,
.form-wrap input:focus,
.wg-box input:focus,
.wg-box textarea:focus,
.login-card input:focus {
  border-color: var(--focus-border) !important;
  box-shadow: var(--focus-ring) !important;
  outline: none !important;
}

.form-type-1 input::placeholder,
.form-type-2 input::placeholder,
.wg-box input::placeholder,
.login-card input::placeholder {
  color: var(--secondary-2) !important;
}

.text-primary {
  color: var(--critical) !important;
}

/* Clickable order numbers — primary brand color */
.order-no-link {
  color: var(--primary) !important;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.order-no-link:hover {
  color: var(--primary-hover) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.order-no-link--muted {
  cursor: default;
  font-weight: 600;
  opacity: 0.85;
}

.order-no-link--muted:hover {
  text-decoration: none !important;
  color: var(--primary) !important;
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--main);
  margin: 0 0 4px;
}

.form-section__help {
  font-size: 13px;
  color: var(--secondary);
  margin: 0 0 16px;
  line-height: 1.45;
}

.tf-select select,
.wg-box .tf-select select {
  min-height: 42px !important;
  padding: 8px 36px 8px 12px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background-color: var(--White) !important;
  font-size: 13.5px !important;
  color: var(--main) !important;
  cursor: pointer;
}

/* Smaller caret for native .tf-select wrappers */
.tf-select::after {
  font-size: 12px !important;
  right: 12px !important;
  color: var(--secondary) !important;
  pointer-events: none;
  line-height: 1;
}

/* Custom select — matches admin UI (no OS native menu) */
.tf-select.tf-select--custom {
  position: relative;
  display: inline-block;
  min-width: 140px;
  vertical-align: middle;
}

.tf-select.tf-select--custom.w-100 {
  display: block;
  width: 100%;
  min-width: 0;
}

.tf-select.tf-select--custom::after {
  display: none !important;
  content: none !important;
}

.tf-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--White);
  color: var(--main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tf-select__trigger:hover:not(:disabled) {
  border-color: var(--focus-border);
}

.tf-select__trigger:focus-visible {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.tf-select__trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tf-select.is-open .tf-select__trigger {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.tf-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-select__caret {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--secondary);
  border-bottom: 1.5px solid var(--secondary);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.tf-select.is-open .tf-select__caret {
  margin-top: 2px;
  transform: rotate(225deg);
}

.tf-select__menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.tf-select__menu li {
  margin: 0;
  padding: 0;
}

.tf-select__option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.tf-select__option:hover:not(:disabled),
.tf-select__option:focus-visible {
  outline: none;
  background: var(--surface);
}

.tf-select__option.is-selected {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.tf-select__option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-search-2 {
  display: flex !important;
  align-items: center;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: var(--White) !important;
  overflow: hidden;
  min-height: 42px;
  min-width: 240px;
  flex: 1;
  max-width: 360px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-search-2:focus-within {
  border-color: var(--focus-border) !important;
  box-shadow: var(--focus-ring);
}

.form-search-2 input {
  border: none !important;
  box-shadow: none !important;
  min-height: 40px !important;
  padding: 8px 14px !important;
  background: transparent !important;
}

.form-search-2 .button-submit button {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-search-2 .button-submit button:hover {
  color: var(--primary);
}

.login-error,
.field-error {
  background: var(--critical-soft);
  color: var(--critical-text) !important;
  border: 1px solid var(--critical-border);
  border-radius: 10px;
  padding: 10px 12px !important;
  font-size: 13px !important;
}

/* -------------------------------------------------------------------------- */
/* Tables                                                                     */
/* -------------------------------------------------------------------------- */

.wg-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--White);
}

.wg-table table {
  table-layout: auto !important;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

/* Override legacy flex-row tables so cells are flat text, not boxed chips */
.wg-table table tr,
.wg-table table thead tr,
.wg-table table tbody tr {
  display: table-row !important;
  align-items: unset !important;
  justify-content: unset !important;
  gap: 0 !important;
  padding: 0 !important;
}

.wg-table table thead {
  background-color: transparent !important;
  border-radius: 0 !important;
}

.wg-table thead th,
.wg-table table thead th,
.wg-table table thead th.text-title {
  display: table-cell !important;
  background: var(--table-head) !important;
  color: var(--main) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
  text-align: left;
  opacity: 1 !important;
  visibility: visible !important;
  width: auto !important;
  max-width: none !important;
  overflow: visible !important;
}

.wg-table tbody td,
.wg-table table tbody td {
  display: table-cell !important;
  padding: 14px 16px !important;
  font-size: 14px !important;
  color: var(--main) !important;
  border-bottom: 1px solid var(--line) !important;
  vertical-align: middle !important;
  background: transparent !important;
  border-radius: 0 !important;
  opacity: 1 !important;
  place-content: unset !important;
  width: auto !important;
  max-width: none !important;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}

.wg-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

.wg-table tbody tr:hover {
  background: var(--table-row-hover);
}

.wg-table tbody tr:last-child td {
  border-bottom: none !important;
}

.wg-table .text-title {
  font-weight: 700 !important;
  color: var(--main) !important;
}

/* Keep ID / Action columns compact; other columns size to content */
.wg-table th:first-child,
.wg-table td:first-child,
.wg-table th:last-child,
.wg-table td:last-child {
  width: 1% !important;
  white-space: nowrap !important;
}

/* Compact tables (few columns) should not stretch empty middle columns */
.wg-table.table-compact {
  width: fit-content;
  max-width: 100%;
}

.wg-table.table-compact table {
  width: auto !important;
  min-width: 0 !important;
  table-layout: auto !important;
}

.wg-table.table-compact th,
.wg-table.table-compact td {
  width: auto !important;
  max-width: none !important;
}

.wg-table.table-compact .col-id {
  width: 72px !important;
}

.wg-table.table-compact .col-cod-amount {
  width: 140px !important;
  min-width: 120px !important;
  max-width: 160px !important;
}

.wg-table.table-compact .col-action {
  width: 110px !important;
}

.action-btns {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  visibility: visible !important;
  opacity: 1 !important;
}

.tf-btn-small,
a.tf-btn-small,
button.tf-btn-small {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 9px !important;
  border: 1px solid var(--line-strong) !important;
  background: var(--bg-elevated) !important;
  color: var(--icon) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none !important;
}

.tf-btn-small i,
.tf-btn-small .icon {
  color: var(--icon) !important;
  font-size: 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.tf-btn-small:hover {
  background: var(--primary-soft) !important;
  border-color: var(--focus-border) !important;
  color: var(--primary) !important;
}

.tf-btn-small:hover i {
  color: var(--primary) !important;
}

.tf-btn-small.btns-trash,
a.tf-btn-small.btns-trash {
  color: var(--critical) !important;
  border-color: var(--critical-border) !important;
  background: var(--critical-soft) !important;
}

.tf-btn-small.btns-trash i {
  color: var(--critical) !important;
}

.tf-btn-small.btns-trash:hover {
  background: var(--critical-soft) !important;
  border-color: var(--critical) !important;
}

/* -------------------------------------------------------------------------- */
/* Badges                                                                     */
/* -------------------------------------------------------------------------- */

.box-status,
.status-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  line-height: 1.2;
  width: auto !important;
  max-width: max-content;
  border: 1px solid transparent;
  white-space: nowrap;
}

.box-status.type-completed,
.status-badge.success,
.status-badge.active,
.status-badge.paid,
.status-badge.published,
.status-badge.in-stock {
  background: var(--success-soft) !important;
  color: var(--success-text) !important;
  border-color: var(--success-border) !important;
}

.box-status.type-pending,
.status-badge.pending,
.status-badge.draft,
.status-badge.warning-soft {
  background: var(--yellow-soft) !important;
  color: var(--yellow-text) !important;
  border-color: var(--yellow-border) !important;
}

.box-status.type-delivery,
.status-badge.info,
.status-badge.confirmed {
  background: var(--info-soft) !important;
  color: var(--info-text) !important;
  border-color: var(--info-border) !important;
}

.box-status.type-inactive,
.status-badge.inactive,
.status-badge.cancelled,
.status-badge.error,
.status-badge.out-of-stock {
  background: var(--critical-soft) !important;
  color: var(--critical-text) !important;
  border-color: var(--critical-border) !important;
}

.status-badge.warning {
  background: var(--warning-soft) !important;
  color: var(--warning-text) !important;
  border-color: var(--warning-border) !important;
}

/* -------------------------------------------------------------------------- */
/* Pagination                                                                 */
/* -------------------------------------------------------------------------- */

.wg-pagination {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.wg-pagination ul {
  display: flex !important;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wg-pagination ul li a {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px !important;
  border: 1px solid var(--line) !important;
  background: var(--White) !important;
  color: var(--secondary) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 13.5px !important;
  font-weight: 550;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wg-pagination ul li a:hover {
  background: var(--surface) !important;
  color: var(--main) !important;
  border-color: var(--line-strong) !important;
}

.wg-pagination ul li.active a {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.wg-pagination .text-secondary {
  font-size: 13px !important;
  color: var(--secondary) !important;
}

/* -------------------------------------------------------------------------- */
/* Empty / Loading                                                            */
/* -------------------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 10px;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-2);
  font-size: 26px;
  margin-bottom: 4px;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--main);
  margin: 0;
}

.empty-state__text {
  font-size: 14px;
  color: var(--secondary);
  margin: 0 0 8px;
  max-width: 320px;
  line-height: 1.45;
}

.table-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px;
}

.skeleton-row {
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--skeleton-1) 0%, var(--skeleton-2) 50%, var(--skeleton-1) 100%);
  background-size: 200% 100%;
  animation: admin-shimmer 1.2s ease-in-out infinite;
}

.admin-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: admin-spin 0.7s linear infinite;
  margin: 0 auto 10px;
}

@keyframes admin-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes admin-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.preload-container.loader-off {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Confirm modal                                                              */
/* -------------------------------------------------------------------------- */

.admin-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.admin-confirm-modal {
  background: var(--White);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  padding: 28px 24px 22px;
}

.admin-confirm-modal__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--critical-soft);
  color: var(--critical);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}

.admin-confirm-modal__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  color: var(--main);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.admin-confirm-modal__text {
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.5;
  margin: 0 0 22px;
}

.admin-confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-content {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--line) !important;
  padding: 16px 20px !important;
  align-items: center !important;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 650 !important;
  font-size: 17px !important;
  color: var(--main) !important;
  margin: 0 !important;
}

.modal-body {
  padding: 18px 20px !important;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.5;
}

.modal-footer {
  border-top: 1px solid var(--line) !important;
  padding: 14px 20px !important;
  gap: 10px;
}

.btn-close {
  width: 1em;
  height: 1em;
  padding: 0.35em;
  margin: 0 !important;
  opacity: 0.85;
  box-shadow: none !important;
}

.btn-close:hover {
  opacity: 1;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.95;
}

html[data-theme="dark"] .section-menu-left .button-show-hide i {
  color: #ffffff !important;
}

html[data-theme="dark"] .section-menu-left .menu-item a.is-active,
html[data-theme="dark"] .section-menu-left .menu-item a.is-active .text,
html[data-theme="dark"] .section-menu-left .menu-item a.is-active .text.text-title,
html[data-theme="dark"] .section-menu-left .menu-item a.is-active .icon i {
  color: #00A6A6 !important;
}

html[data-theme="dark"] .section-menu-left .menu-item a .text,
html[data-theme="dark"] .section-menu-left .menu-item a .text.text-title {
  color: #e8eef5 !important;
}

html[data-theme="dark"] .section-menu-left .menu-item a .icon i {
  color: #94a3b8 !important;
}

/* -------------------------------------------------------------------------- */
/* Toast                                                                      */
/* -------------------------------------------------------------------------- */

.Toastify__toast {
  border-radius: 12px !important;
  box-shadow: var(--shadow-md) !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
}

/* -------------------------------------------------------------------------- */
/* Sign-in                                                                    */
/* -------------------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--login-glow-1), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--login-glow-2), transparent 50%),
    linear-gradient(180deg, var(--login-bg-1) 0%, var(--login-bg-2) 100%) !important;
}

.login-page .main-content,
.login-page .main-content-inner {
  background: transparent !important;
  max-width: none;
}

.login-card.wg-box {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--line) !important;
  background: var(--bg-elevated) !important;
}

.login-card .heading {
  font-size: 28px !important;
}

.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
}

/* -------------------------------------------------------------------------- */
/* Blog / feedback list cards                                                 */
/* -------------------------------------------------------------------------- */

.list-feedback .feedback-item,
.list-item-function .feedback-item {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  padding: 18px !important;
  margin-bottom: 14px !important;
  background: var(--White);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.list-feedback .feedback-item:hover,
.list-item-function .feedback-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--line-strong) !important;
}

/* -------------------------------------------------------------------------- */
/* Blogs grid                                                                 */
/* -------------------------------------------------------------------------- */

.blogs-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blogs-toolbar {
  align-items: center;
  gap: 12px !important;
}

.blogs-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.blogs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--White);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.blog-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--table-head);
  overflow: hidden;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.04);
}

.blog-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    145deg,
    var(--primary-soft),
    var(--table-head)
  );
  color: var(--primary);
  font-size: 36px;
  font-weight: 700;
}

.blog-card__media .status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  backdrop-filter: blur(6px);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 12px;
  flex: 1;
}

.blog-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--secondary) !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary) !important;
}

.blog-card__meta i {
  font-size: 13px;
  opacity: 0.8;
}

.blog-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}

.blog-card__actions .tf-btn-small {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .blogs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .blogs-grid {
    grid-template-columns: 1fr;
  }

  .blogs-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .blogs-toolbar__filters {
    width: 100%;
  }

  .blogs-toolbar__filters .tf-select {
    flex: 1;
  }
}

.wg-box input[type="date"],
.wg-box input[type="datetime-local"] {
  min-height: 42px !important;
  border-radius: 10px !important;
  border: 1px solid var(--line-strong) !important;
  padding: 8px 12px !important;
}

.upload-image .upload-img,
.upload-box {
  border-radius: var(--radius-md) !important;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .main-content-inner {
    padding: 20px 16px 32px !important;
  }

  .page-header__title,
  .heading {
    font-size: 22px !important;
  }

  .header-dashboard .wrap {
    gap: 10px !important;
    padding: 0 !important;
  }

  .header-dashboard {
    padding: 0 14px 0 12px !important;
  }

  .header-search {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 140px;
  }

  .header-search__hint {
    display: none;
  }

  .header-search__input {
    font-size: 12.5px;
  }

  .wg-card .content .number,
  .wg-card .content .number h4,
  .wg-card .counter .number {
    font-size: 24px !important;
  }
}

@media (max-width: 767px) {
  .form-search-2 {
    max-width: 100%;
    width: 100%;
  }

  .wg-box .box-top {
    flex-direction: column;
    align-items: stretch;
  }

  .header-dashboard .wrap {
    gap: 8px !important;
  }

  .header-search {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 100px;
  }

  .header-search__item-crumb {
    display: none;
  }

  .header-dashboard .wg-user .content {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header__actions {
    width: 100%;
  }

  .page-header__actions .tf-button {
    width: 100%;
  }
}

/* -------------------------------------------------------------------------- */
/* Theme toggle                                                               */
/* -------------------------------------------------------------------------- */

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  padding: 0;
}

.theme-toggle-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--main);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
}

.theme-toggle-btn i {
  font-size: 16px;
  line-height: 1;
}

html {
  transition: background-color 0.2s ease, color 0.2s ease;
}

body,
.main-content,
.wg-box,
.header-dashboard,
.section-menu-left {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash),
a.tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash),
button.tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash) {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%) !important;
}

html[data-theme="dark"] .tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash),
html[data-theme="dark"] a.tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash),
html[data-theme="dark"] button.tf-button:not(.btn-lite):not(.btn-secondary):not(.btn-danger):not(.btns-trash) {
  background: linear-gradient(180deg, #6fbfd9 0%, var(--primary) 100%) !important;
  color: #0b1018 !important;
}

html[data-theme="dark"] .tf-button.btn-danger,
html[data-theme="dark"] button.tf-button.btn-danger {
  background: var(--critical) !important;
  color: #0b1018 !important;
}

/* Legacy theme classes that may still hard-code light text */
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-caption-1.text-secondary {
  color: var(--secondary) !important;
}

html[data-theme="dark"] .blog-card__excerpt,
html[data-theme="dark"] .blog-card__meta {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-card__title {
  color: #f1f5f9 !important;
}

/* CKEditor: readable text in both themes */
.ck.ck-editor {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ck.ck-toolbar {
  border-color: var(--line) !important;
  background: var(--surface) !important;
}

.ck.ck-editor__main > .ck-editor__editable,
.ck.ck-editor__editable.ck-focused,
.ck.ck-content {
  min-height: 280px;
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

.ck.ck-editor__editable p,
.ck.ck-editor__editable h1,
.ck.ck-editor__editable h2,
.ck.ck-editor__editable h3,
.ck.ck-editor__editable h4,
.ck.ck-editor__editable li,
.ck.ck-editor__editable blockquote,
.ck.ck-content p,
.ck.ck-content h1,
.ck.ck-content h2,
.ck.ck-content h3,
.ck.ck-content h4,
.ck.ck-content li {
  color: #1e293b !important;
}

html[data-theme="dark"] .ck.ck-toolbar {
  background: #1a2232 !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .ck.ck-toolbar .ck-button,
html[data-theme="dark"] .ck.ck-toolbar .ck-dropdown__button,
html[data-theme="dark"] .ck.ck-toolbar .ck-button__label {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .ck.ck-editor__main > .ck-editor__editable,
html[data-theme="dark"] .ck.ck-editor__editable.ck-focused,
html[data-theme="dark"] .ck.ck-content {
  background: #0f1623 !important;
  color: #e8eef5 !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .ck.ck-editor__editable p,
html[data-theme="dark"] .ck.ck-editor__editable h1,
html[data-theme="dark"] .ck.ck-editor__editable h2,
html[data-theme="dark"] .ck.ck-editor__editable h3,
html[data-theme="dark"] .ck.ck-editor__editable h4,
html[data-theme="dark"] .ck.ck-editor__editable li,
html[data-theme="dark"] .ck.ck-editor__editable blockquote,
html[data-theme="dark"] .ck.ck-content p,
html[data-theme="dark"] .ck.ck-content h1,
html[data-theme="dark"] .ck.ck-content h2,
html[data-theme="dark"] .ck.ck-content h3,
html[data-theme="dark"] .ck.ck-content h4,
html[data-theme="dark"] .ck.ck-content li {
  color: #e8eef5 !important;
}

html[data-theme="dark"] .ck.ck-editor__editable.ck-blurred,
html[data-theme="dark"] .ck.ck-editor__editable.ck-focused {
  border-color: var(--line-strong) !important;
}

html[data-theme="dark"] .modal-content {
  background: var(--bg-elevated) !important;
  color: var(--main) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: var(--line) !important;
}

html[data-theme="dark"] .modal-title {
  color: #e8eef5 !important;
}

/* Countries / compact admin edit modal */
.admin-edit-modal .modal-dialog {
  max-width: 420px;
}

.admin-edit-modal .form-control,
.modal .form-control {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  color: var(--main) !important;
  box-shadow: none !important;
}

.admin-edit-modal .form-control:focus,
.modal .form-control:focus {
  border-color: var(--focus-border) !important;
  box-shadow: var(--focus-ring) !important;
  background: var(--surface) !important;
  color: var(--main) !important;
}

.admin-edit-modal .form-control::placeholder,
.modal .form-control::placeholder {
  color: var(--secondary-2) !important;
}

html[data-theme="dark"] .admin-edit-modal .form-control,
html[data-theme="dark"] .modal .form-control {
  background: #1a2232 !important;
  color: #e8eef5 !important;
  border-color: #334155 !important;
  color-scheme: dark;
}

/* -------------------------------------------------------------------------- */
/* Dashboard — finance year / month overview                                  */
/* -------------------------------------------------------------------------- */

.dash-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dash-period-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dash-period-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dash-period-tab:hover {
  color: var(--main);
  background: rgba(255, 255, 255, 0.55);
}

.dash-period-tab.is-active {
  background: var(--White);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

html[data-theme="dark"] .dash-period-tab:hover {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .dash-period-tab.is-active {
  background: var(--bg-elevated);
  color: var(--primary);
}

.dash-charts-row {
  margin-top: 1.25rem !important;
}

.dash-chart-box .box-top {
  align-items: center;
  margin-bottom: 10px !important;
  padding-bottom: 12px !important;
}

.dash-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--main);
}

.dash-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  padding: 0;
}

.dash-chart-wrap--sm {
  min-height: 200px;
  max-width: 100%;
}

.dash-chart-wrap svg {
  display: block;
  max-height: 220px;
}

.dash-tooltip {
  position: absolute;
  top: 16px;
  background: var(--White);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--main);
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

html[data-theme="dark"] .dash-tooltip {
  background: var(--bg-elevated);
}

.dash-tooltip-title {
  font-weight: 650;
  margin-bottom: 2px;
}

.dash-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.dash-date-filter input[type="date"] {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--White);
  color: var(--main);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  height: 38px;
  min-width: 150px;
}

html[data-theme="dark"] .dash-date-filter input[type="date"] {
  background: var(--bg-elevated);
}

.dash-clear-date {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--main);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dash-clear-date:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 767.98px) {
  .dash-period-bar {
    align-items: stretch;
  }

  .dash-period-tabs {
    width: 100%;
  }

  .dash-period-tab {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* -------------------------------------------------------------------------- */
/* Dashboard — reference layout (KPI + Sales Overview + Insights)             */
/* -------------------------------------------------------------------------- */

.dash-kpi-row {
  margin-bottom: 0.25rem;
}

.dash-kpi-card {
  height: 100%;
}

.dash-kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary-2);
}

.dash-main-row {
  margin-top: 1.25rem !important;
}

.dash-overview-box {
  height: 100%;
  min-height: 380px;
}

.dash-overview-top {
  align-items: flex-start !important;
  gap: 16px !important;
  flex-wrap: wrap;
}

.dash-overview-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--secondary);
  line-height: 1.4;
}

.dash-overview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.dash-period-select select {
  appearance: none;
  min-width: 200px;
  padding: 8px 36px 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--White)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23647689' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--main);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

html[data-theme="dark"] .dash-period-select select {
  background-color: var(--bg-elevated);
}

.dash-chart-wrap--lg {
  min-height: 280px;
  max-width: 100%;
}

.dash-chart-wrap--lg svg {
  display: block;
  max-height: 300px;
}

.dash-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  text-align: center;
  padding: 1rem;
}

.dash-chart-empty--block {
  position: relative;
  min-height: 240px;
}

.dash-side-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.dash-insights-box .box-title,
.dash-snapshot-box .box-title {
  margin-bottom: 16px;
}

.dash-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-insights-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--secondary);
}

.dash-insights-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dash-insights-list li:first-child {
  padding-top: 0;
}

.dash-insights-list strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--main);
  text-align: right;
}

.dash-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}

.dash-snapshot-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--main);
  line-height: 1.15;
}

.dash-snapshot-label {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
}

.dash-snapshot-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  background: var(--accent) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  text-decoration: none !important;
  border: 0 !important;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.dash-snapshot-cta:hover {
  background: var(--primary) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.dash-snapshot-cta i {
  font-size: 16px;
}

.dash-orders-box {
  margin-top: 1.25rem;
}

@media (max-width: 1199.98px) {
  .dash-overview-controls {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 575.98px) {
  .dash-period-select select {
    min-width: 0;
    width: 100%;
  }

  .dash-overview-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-snapshot-value {
    font-size: 22px;
  }
}
