/* ==========================================================================
   Trading ADMIN — TRADING APP ADMIN CONSOLE DESIGN SYSTEM
   Aligned with DESIGN.md — fintech SaaS aesthetic, bento-grid architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------------------------
   New brand palette source-of-truth (`--color-*` namespace) is defined first.
   Legacy aliases (`--brand`, `--ink`, `--line`, `--success`, etc.) reference
   the new tokens so existing components automatically inherit the new scheme.
   -------------------------------------------------------------------------- */
:root {
  /* ─── 3.1 BRAND ─── */
  --color-brand-primary: #0B28BF;
  --color-brand-primary-hover: #091FA0;
  --color-brand-tint-bg: #EEF2FF;
  --color-brand-tint: rgba(11, 40, 191, 0.10);
  --color-brand-deep-tint: rgba(30, 51, 201, 0.12);

  /* ─── 3.2 NEUTRAL SURFACES ─── */
  --color-white: #FFFFFF;
  --color-surface-soft: #F8FAFC;
  --color-surface-softer: #F1F5F9;

  /* ─── 3.3 BORDERS ─── */
  --color-border: #E5E7EB;
  --color-border-card: #E6E8EF;
  --color-border-soft: #E2E8F0;
  --color-border-strong: #CBD5E1;

  /* ─── 3.3 TEXT ─── */
  --color-text-strong: #0F172A;
  --color-text: #1E293B;
  --color-text-muted-strong: #334155;
  --color-text-muted: #475569;
  --color-text-subtle: #64748B;
  --color-text-faint: #94A3B8;

  /* ─── 3.4 BULL / BEAR (sector & state badges) ─── */
  --color-bull-soft: #A5D6A7;
  --color-bull: #5DD68A;
  --color-bull-bright: #2CC56F;
  --color-c-15803d: #1B9E4B;
  --color-c-052e16: #0B6623;

  --color-bear-soft: #E57373;
  --color-bear: #D85A55;
  --color-bear-bright: #C52F2C;
  --color-bear-strong: #B71C1C;
  --color-c-7f1d1d: #7F0000;

  /* ─── ACCENT ALIASES — remapped to approved palette ─── */
  --color-sector-consumer: var(--color-brand-primary);
  --color-sector-info: var(--color-brand-primary-hover);
  --color-sector-utilities: var(--color-brand-primary);
  --color-sector-financials: var(--color-brand-primary);
  --color-sector-tech: var(--color-brand-primary);
  --color-sector-materials: var(--color-bull-bright);
  --color-sector-energy: var(--color-bear);
  --color-sector-financial-services: var(--color-brand-primary);
  --color-sector-industrials: var(--color-text-subtle);
  --color-sector-neutral: var(--color-text-muted);

  /* ─── 3.5 SHADOWS & EFFECTS ─── */
  --color-shadow: rgba(0, 0, 0, 0.10);
  --color-highlight: rgba(255, 255, 255, 0.18);
  --shadow-card-rest: 0 1px 2px var(--color-shadow);
  --shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 20px 48px rgba(15, 23, 42, 0.18);

  /* ════════ LEGACY ALIASES — mapped to new design tokens ════════ */

  /* Brand */
  --brand: var(--color-brand-primary);
  --brand-2: var(--color-brand-primary-hover);
  --brand-deep: var(--color-brand-primary-hover);
  --brand-soft: var(--color-brand-tint-bg);

  /* Legacy accent aliases — remapped to brand */
  --violet: var(--color-brand-primary);
  --teal: var(--color-brand-primary);

  /* Legacy brand chain (kept for back-compat) */
  --brand-navy-900: var(--color-text-strong);
  --brand-navy-800: var(--color-text-strong);
  --brand-navy-700: var(--color-brand-primary-hover);
  --brand-blue-600: var(--color-brand-primary);
  --brand-blue-500: var(--color-brand-primary-hover);
  --brand-blue-400: var(--color-brand-primary);
  --brand-violet-500: var(--color-brand-primary);
  --brand-cyan-500: var(--color-brand-primary);

  /* Surfaces */
  --bg: var(--color-surface-soft);
  --surface-bg: var(--color-surface-soft);
  --surface-bg-grad:
    radial-gradient(1200px 600px at 0% -10%, var(--color-brand-tint-bg) 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--color-surface-softer) 0%, transparent 55%),
    var(--color-surface-soft);
  --surface-card: var(--color-white);
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-glass-strong: rgba(255, 255, 255, 0.88);
  --surface-elevated: var(--color-white);

  /* Text */
  --ink: var(--color-text-strong);
  --ink-soft: var(--color-text);
  --muted: var(--color-text-subtle);
  --text-primary: var(--color-text-strong);
  --text-secondary: var(--color-text-muted);
  --text-muted: var(--color-text-subtle);
  --text-faint: var(--color-text-faint);
  --text-on-brand: var(--color-white);

  /* Borders */
  --line: var(--color-border);
  --line-soft: var(--color-surface-softer);
  --border-soft: var(--color-border-soft);
  --border-default: var(--color-border);
  --border-strong: var(--color-border-strong);

  /* Semantic — mapped to bull/bear/amber */
  --green: var(--color-bull-bright);
  --green-soft: rgba(165, 214, 167, 0.30);
  --red: var(--color-bear);
  --red-soft: rgba(229, 115, 115, 0.30);
  /* Amber/warning aliases — remapped to bear palette (approved) */
  --amber: var(--color-bear);
  --amber-soft: rgba(229, 115, 115, 0.18);

  --success: var(--color-bull-bright);
  --success-soft: rgba(165, 214, 167, 0.45);
  --success-tint: rgba(165, 214, 167, 0.22);
  --warning: var(--color-bear);
  --warning-soft: rgba(229, 115, 115, 0.18);
  --warning-tint: rgba(229, 115, 115, 0.12);
  --danger: var(--color-bear);
  --danger-soft: rgba(229, 115, 115, 0.40);
  --danger-tint: rgba(229, 115, 115, 0.18);
  --info: var(--color-brand-primary);
  --info-soft: rgba(11, 40, 191, 0.20);
  --info-tint: var(--color-brand-tint);

  /* Gradients — recomputed against approved brand palette */
  --grad-brand: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-primary-hover) 100%);
  --grad-brand-soft: linear-gradient(135deg, var(--color-brand-tint) 0%, var(--color-brand-deep-tint) 100%);
  --grad-success: linear-gradient(135deg, var(--color-bull-bright) 0%, var(--color-bull) 100%);
  --grad-warning: linear-gradient(135deg, var(--color-bear) 0%, var(--color-bear-strong) 100%);
  --grad-danger: linear-gradient(135deg, var(--color-bear) 0%, var(--color-bear-strong) 100%);
  --grad-info: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-primary-hover) 100%);
  --grad-violet: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-primary-hover) 100%);
  --grad-hero: linear-gradient(135deg, var(--color-brand-primary-hover) 0%, var(--color-brand-primary) 50%, var(--color-brand-primary-hover) 100%);

  /* Shadows — DESIGN.md elevations */
  --shadow-xs: var(--shadow-card-rest);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: var(--shadow-card-hover);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --shadow-xl: var(--shadow-modal);
  --shadow-glow: 0 0 0 4px var(--color-brand-tint);
  --shadow-glow-success: 0 0 0 4px rgba(93, 214, 138, 0.20);
  --shadow-glow-danger: 0 0 0 4px rgba(216, 90, 85, 0.20);

  /* Radius — DESIGN.md cards use 14px */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 26px;
  --radius-pill: 999px;

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --tx-fast: 0.16s;
  --tx: 0.24s;
  --tx-slow: 0.4s;

  /* ─── STATUS PILLS ─── */
  --status-active: #2cc56f;
  --status-pending: #eab308;
  --status-deactivated: var(--text-muted);
  --status-rejected: #c52f2c;
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--surface-bg-grad);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-inter), "Inter", system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

a {
  text-decoration: none;
  color: var(--brand);
  transition: color var(--tx-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-deep);
}

input::-ms-reveal,
input::-ms-clear {
  display: none;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-border-strong), var(--color-text-faint));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-brand-primary), var(--color-brand-primary-hover));
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* Selection */
::selection {
  background: var(--color-brand-deep-tint);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. LAYOUT — main content + bento grid utilities
   -------------------------------------------------------------------------- */
#main {
  margin-top: var(--header-h);
  padding: 22px 28px 32px;
  transition: all var(--tx) var(--ease-out);
}

.main-content {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  padding: 24px 28px 36px;
  transition: margin-left var(--tx) var(--ease-out);
  min-height: calc(100vh - var(--header-h));
}

.layout-wrapper.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-w-collapsed);
}

@media (max-width: 1199px) {
  .main-content {
    margin-left: var(--sidebar-w-collapsed);
    padding: 20px;
  }

  #main {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
}

/* Bento grid utility — primary / secondary / tertiary panel layout
   per DESIGN.md "1.6fr 1fr 1fr" pattern */
.bento-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 20px;
}

.bento-grid.bento-2 {
  grid-template-columns: 1.6fr 1fr;
}

.bento-grid>.bento-wide {
  grid-column: span 2;
}

@media (max-width: 1280px) {

  .bento-grid,
  .bento-grid.bento-2 {
    grid-template-columns: 1fr 1fr;
  }

  .bento-grid>.bento-wide {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {

  .bento-grid,
  .bento-grid.bento-2 {
    grid-template-columns: 1fr;
  }

  .bento-grid>.bento-wide {
    grid-column: span 1;
  }
}

/* Page title */
.pagetitle {
  margin-bottom: 18px;
}

.pagetitle h1,
.pagetitle h2 {
  font-size: 24px;
  margin-bottom: 0;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   4. HEADER — sticky topbar with command-palette search
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 997;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  display: flex;
  align-items: center;
  padding: 0 22px;
  transition: all var(--tx) var(--ease-out);
}

.header .logo {
  display: flex;
  align-items: center;
  line-height: 1;
}

@media (min-width: 1200px) {
  .header .logo {
    width: calc(var(--sidebar-w) - 48px);
  }
}

.header .logo img {
  max-height: 28px;
  margin-right: 8px;
  filter: drop-shadow(0 4px 12px rgba(11, 40, 191, 0.18));
}

.header .logo span {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  min-width: 320px;
  transition: all var(--tx-fast) var(--ease-out);
}

.header-search:focus-within {
  background: #fff;
  border-color: var(--brand-2);
  box-shadow: var(--shadow-glow);
}

.header-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.header-search input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.header-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-search kbd {
  font-family: var(--font-inter), "Inter", system-ui, sans-serif;
}

@media (max-width: 991px) {
  .header-search {
    display: none;
  }
}

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--tx-fast) var(--ease-out);
}

.header-icon-btn:hover {
  background: var(--brand-soft);
  border-color: var(--line);
  color: var(--brand);
  transform: translateY(-1px);
}

.header-icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(216, 90, 85, 0.22);
  animation: pulse-dot 2s var(--ease-in-out) infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--tx-fast) var(--ease-out);
}

.header-profile:hover {
  background: #fff;
  border-color: var(--brand-2);
  box-shadow: var(--shadow-sm);
}

.header-profile .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(11, 40, 191, 0.28);
  overflow: hidden;
  flex-shrink: 0;
}

.header-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.header-profile .name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-profile .role {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

@media (max-width: 575px) {
  .header-profile .name-block {
    display: none;
  }
}

.header-profile-wrap {
  position: relative;
}

.header-profile-caret {
  margin-left: 4px;
  color: var(--text-muted);
  transition: transform var(--tx-fast) var(--ease-out);
}

.header-profile-caret.is-open {
  transform: rotate(180deg);
  color: var(--brand);
}

.header-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  z-index: 1000;
  display: block;
}

.header-profile-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.header-profile-menu .dropdown-item.danger {
  color: var(--color-bear-strong);
}

.header-profile-menu .dropdown-item.danger:hover {
  background: rgba(216, 90, 85, 0.10);
  color: var(--color-bear-strong);
}

/* --------------------------------------------------------------------------
   5. SIDEBAR (.sidebar overrides for legacy markup)
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 996;
  transition: all var(--tx) var(--ease-out);
  padding: 18px 12px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 24px rgba(15, 23, 42, 0.04);
}

@media (max-width: 1199px) {
  .sidebar {
    left: -100%;
  }

  .toggle-sidebar .sidebar {
    left: 0;
  }
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

/* --------------------------------------------------------------------------
   6. CARD — DESIGN.md: 14px radius, subtle hover lift
   -------------------------------------------------------------------------- */
.card {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--tx) var(--ease-out), box-shadow var(--tx) var(--ease-out),
    border-color var(--tx) var(--ease-out);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-default);
}

.card-header,
.card-footer {
  border-color: var(--line);
  background: transparent;
  color: var(--text-secondary);
  padding: 16px 20px;
}

.card-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title {
  padding: 16px 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.card-title span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.card-body {
  padding: 20px;
}

.card-img-overlay {
  background: rgba(255, 255, 255, 0.6);
}

/* Glass / elevated variants */
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.card-elevated {
  border: 0;
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   7. ACCENT / TINTED BACKGROUNDS
   -------------------------------------------------------------------------- */
.bg-primary-light {
  background-color: var(--brand-soft);
  border-color: var(--brand-soft);
}

.bg-secondary-light {
  background-color: var(--line-soft);
  border-color: var(--line-soft);
}

.bg-success-light {
  background-color: var(--success-tint);
  border-color: var(--success-tint);
}

.bg-danger-light {
  background-color: var(--danger-tint);
  border-color: var(--danger-tint);
}

.bg-warning-light {
  background-color: var(--warning-tint);
  border-color: var(--warning-tint);
}

.bg-info-light {
  background-color: var(--info-tint);
  border-color: var(--info-tint);
}

.bg-dark-light {
  background-color: var(--color-surface-softer);
  border-color: var(--color-surface-softer);
}

/* Bootstrap text-* convenience overrides aligned with brand */
.text-primary {
  color: var(--brand) !important;
}

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

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

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

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

/* --------------------------------------------------------------------------
   8. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: all var(--tx-fast) var(--ease-out);
  padding: 8px 18px;
  font-size: 14px;
  border-width: 1px;
}

.btn:focus,
.btn:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-glow) !important;
}

.btn-primary {
  background: var(--brand);
  border: 0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 40, 191, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(9, 31, 160, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--color-text-faint);
  box-shadow: none;
  opacity: 0.7;
}

.btn-outline-primary {
  border: 1px solid var(--brand-2);
  color: var(--brand);
  background: var(--brand-soft);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11, 40, 191, 0.24);
}

.btn-outline-secondary {
  border: 1px solid var(--line);
  color: var(--text-secondary);
  background: #fff;
}

.btn-outline-secondary:hover {
  background: var(--brand-soft);
  border-color: var(--brand-2);
  color: var(--brand);
}

.btn-success {
  background: var(--success);
  border: 0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(44, 197, 111, 0.26);
}

.btn-success:hover {
  background: var(--color-c-15803d);
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border: 0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(216, 90, 85, 0.26);
}

.btn-danger:hover {
  background: var(--color-bear-bright);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline-success {
  border: 1px solid var(--color-bull-soft);
  color: var(--color-c-15803d);
  background: var(--success-tint);
}

.btn-outline-success:hover {
  background: var(--success);
  border-color: transparent;
  color: #fff;
}

.btn-outline-danger {
  border: 1px solid var(--color-bear-soft);
  color: var(--color-bear-strong);
  background: var(--danger-tint);
}

.btn-outline-danger:hover {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

/* Glass button — for use over hero gradient */
.btn-glass {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-glass:hover,
.btn-glass:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   9. FORMS
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  font-weight: 500;
  transition: all var(--tx-fast) var(--ease-out);
}

.form-control::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-2);
  box-shadow: var(--shadow-glow);
  outline: 0;
}

.form-label {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}

.input-group .input-group-text {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: var(--radius-md);
}

.input-group>.form-control:not(:first-child),
.input-group>.form-select:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group>.input-group-text:not(:last-child) {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group>.input-group-text:not(:first-child) {
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within>.form-control,
.input-group:focus-within>.form-select {
  border-color: var(--brand-2);
}

.input-group:focus-within {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.input-group:focus-within>.form-control:focus,
.input-group:focus-within>.form-select:focus {
  box-shadow: none;
}

/* --- Polished filter card (Users page) ---------------------------------- */
.filter-panel {
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  position: relative;
  z-index: 5;
}

.filter-panel .card-body {
  overflow: visible;
}

.filter-panel:hover {
  transform: none;
}

.filter-dropdown.is-open {
  position: relative;
  z-index: 1050;
}

.filter-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.filter-field,
.filter-date,
.filter-select {
  transition: box-shadow var(--tx-fast) var(--ease-out),
    border-color var(--tx-fast) var(--ease-out);
}

.filter-field:hover .input-group-text,
.filter-field:hover>.form-control {
  border-color: var(--brand-2);
}

/* Signup From / Signup To date wrapper */
.filter-date {
  position: relative;
  border-radius: var(--radius-md);
}

.filter-date-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: color var(--tx-fast) var(--ease-out);
}

.filter-date-input {
  width: 100%;
  padding-left: 36px;
  padding-right: 12px;
  background-clip: padding-box;
}

.filter-date-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--tx-fast) var(--ease-out);
}

.filter-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.filter-date:hover .filter-date-input {
  border-color: var(--brand-2);
}

.filter-date:focus-within {
  box-shadow: var(--shadow-glow);
}

.filter-date:focus-within .filter-date-icon {
  color: var(--brand);
}

.filter-date:focus-within .filter-date-input {
  border-color: var(--brand-2);
  box-shadow: none;
}

/* Account Status custom select */
.filter-select {
  position: relative;
  border-radius: var(--radius-md);
}

.filter-select-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: color var(--tx-fast) var(--ease-out);
}

.filter-select-input {
  width: 100%;
  padding-left: 36px;
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  cursor: pointer;
}

.filter-select-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: transform var(--tx-fast) var(--ease-out),
    color var(--tx-fast) var(--ease-out);
}

.filter-select:hover .filter-select-input {
  border-color: var(--brand-2);
}

.filter-select:focus-within {
  box-shadow: var(--shadow-glow);
}

.filter-select:focus-within .filter-select-icon,
.filter-select:focus-within .filter-select-caret {
  color: var(--brand);
}

.filter-select:focus-within .filter-select-input {
  border-color: var(--brand-2);
  box-shadow: none;
}

/* --- Custom Account Status dropdown ------------------------------------- */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: border-color var(--tx-fast) var(--ease-out),
    box-shadow var(--tx-fast) var(--ease-out);
}

.filter-dropdown-trigger:hover {
  border-color: var(--brand-2);
}

.filter-dropdown.is-open .filter-dropdown-trigger,
.filter-dropdown-trigger:focus-visible {
  border-color: var(--brand-2);
  box-shadow: var(--shadow-glow);
  outline: 0;
}

.filter-dropdown-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--tx-fast) var(--ease-out);
}

.filter-dropdown.is-open .filter-dropdown-icon,
.filter-dropdown-trigger:focus-visible .filter-dropdown-icon {
  color: var(--brand);
}

.filter-dropdown-value {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-dropdown-caret {
  color: var(--text-muted);
  transition: transform var(--tx-fast) var(--ease-out),
    color var(--tx-fast) var(--ease-out);
}

.filter-dropdown.is-open .filter-dropdown-caret {
  color: var(--brand);
  transform: rotate(180deg);
}

.filter-dropdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(15, 23, 42, 0.06);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: filterDropdownIn 0.14s var(--ease-out);
}

@keyframes filterDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm, 8px);
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--tx-fast) var(--ease-out),
    color var(--tx-fast) var(--ease-out);
}

.filter-dropdown-item:hover,
.filter-dropdown-item:focus-visible {
  background: var(--line-soft);
  outline: 0;
}

.filter-dropdown-item.is-active {
  background: var(--brand-soft, var(--line-soft));
  color: var(--brand);
  font-weight: 600;
}

.filter-dropdown-check {
  color: var(--brand);
  flex-shrink: 0;
}

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

.form-check-input:focus {
  border-color: var(--brand-2);
  box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   10. TABLE — operational, scannable
   -------------------------------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 0;
}

.table>thead {
  background: var(--line-soft);
}

.table>thead>tr>th {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-top: 0;
}

.table>tbody>tr {
  transition: background var(--tx-fast) var(--ease-out);
}

.table>tbody>tr>td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.table>tbody>tr:hover {
  background: var(--brand-soft);
}

.table-striped>tbody>tr:nth-of-type(odd)>td {
  background: rgba(247, 248, 252, 0.6);
}

.table-hover>tbody>tr:hover>* {
  --bs-table-color-state: var(--text-primary);
  --bs-table-bg-state: var(--brand-soft);
}

.table-light {
  --bs-table-bg: var(--line-soft);
}

/* --------------------------------------------------------------------------
   11. BADGES / PILLS — colored dots, soft backgrounds, rounded
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 600;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.bg-success {
  background: var(--success) !important;
}

.bg-danger {
  background: var(--danger) !important;
}

.bg-warning {
  background: var(--warning) !important;
  color: #fff !important;
}

.bg-info {
  background: var(--info) !important;
}

.bg-secondary {
  background: var(--color-sector-industrials) !important;
}

/* Pill with leading dot */
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   12. ACCORDION
   -------------------------------------------------------------------------- */
.accordion-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.accordion-button:focus {
  outline: 0;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  color: var(--ink);
  background-color: var(--brand-soft);
}

.accordion-flush .accordion-button {
  padding: 15px 0;
  background: none;
  border: 0;
}

.accordion-flush .accordion-button:not(.collapsed) {
  box-shadow: none;
  color: var(--brand);
}

.accordion-flush .accordion-body {
  padding: 0 0 15px 0;
  color: var(--color-text-muted-strong);
  font-size: 15px;
}

.custom-accordion {
  max-width: 100%;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.accordion-section {
  position: relative;
  transition: background-color var(--tx) var(--ease-out);
}

.accordion-section.is-open {
  background: linear-gradient(180deg, var(--brand-soft) 0%, transparent 100%);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--tx-fast) var(--ease-out);
  position: relative;
}

.accordion-trigger::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--grad-brand);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height var(--tx) var(--ease-out);
}

.is-open .accordion-trigger::before {
  height: 60%;
}

.accordion-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 8px;
  letter-spacing: 0.02em;
}

.accordion-section.is-open .accordion-title {
  color: var(--brand);
}

.accordion-icon {
  transition: transform var(--tx) var(--ease-in-out);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line-soft);
}

.is-open .accordion-icon {
  transform: rotate(180deg);
  color: #fff;
  background: var(--grad-brand);
}

.accordion-content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--tx) var(--ease-out), opacity var(--tx-fast) var(--ease-out);
  opacity: 0;
  overflow: hidden;
}

.is-open .accordion-content-wrapper {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-content {
  min-height: 0;
}

.accordion-body {
  padding: 0 22px 22px 22px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

.accordion-trigger:hover {
  background-color: var(--line-soft);
}

.accordion-section:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background-color: var(--border-soft);
}

/* --------------------------------------------------------------------------
   13. BREADCRUMBS / TABS
   -------------------------------------------------------------------------- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: 0.2s;
}

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

.breadcrumb .active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-tabs-bordered {
  border-bottom: 2px solid var(--line);
}

.nav-tabs-bordered .nav-link {
  margin-bottom: -2px;
  border: none;
  color: var(--text-secondary);
}

.nav-tabs-bordered .nav-link:hover,
.nav-tabs-bordered .nav-link:focus {
  color: var(--brand);
}

.nav-tabs-bordered .nav-link.active {
  background-color: transparent;
  color: var(--brand);
  border-bottom: 2px solid var(--brand);
}

/* --------------------------------------------------------------------------
   14. DROPDOWN
   -------------------------------------------------------------------------- */
.dropdown-menu {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  animation: dropdown-in var(--tx-fast) var(--ease-out);
}

.dropdown-menu .dropdown-item {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: 0.15s;
}

.dropdown-menu .dropdown-item:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.dropdown-menu .dropdown-divider {
  border-top: 1px solid var(--border-soft);
  margin: 4px 0;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   15. KPI / STAT TILES — DESIGN.md: 26px hero value, sparkline-ready
   -------------------------------------------------------------------------- */
.stat-tile {
  position: relative;
  padding: 18px 20px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform var(--tx) var(--ease-out), box-shadow var(--tx) var(--ease-out),
    border-color var(--tx) var(--ease-out);
}

.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.stat-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tile-icon-bg, var(--grad-brand));
  opacity: 0.92;
  pointer-events: none;
  z-index: 0;
}

.stat-tile::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -25%;
  width: 220px;
  height: 220px;
  background: var(--tile-grad, var(--grad-brand-soft));
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.stat-tile>* {
  position: relative;
  z-index: 1;
}

.stat-tile .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-icon-bg, var(--grad-brand));
  color: #fff;
  font-size: 18px;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px var(--tile-glow, rgba(11, 40, 191, 0.28));
}

.stat-tile .stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.stat-tile .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-tile .stat-trend {
  margin-top: auto;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--success-tint);
  border-radius: var(--radius-pill);
}

.stat-tile .stat-trend.is-down {
  color: var(--danger);
  background: var(--danger-tint);
}

/* Tile color variants — DESIGN.md palette mapped to new tokens */
.stat-tile.tile-primary {
  --tile-grad: linear-gradient(135deg, var(--color-brand-deep-tint), rgba(79, 85, 232, 0.06));
  --tile-icon-bg: var(--grad-brand);
  --tile-glow: rgba(11, 40, 191, 0.28);
}

.stat-tile.tile-success {
  --tile-grad: linear-gradient(135deg, rgba(44, 197, 111, 0.14), rgba(93, 214, 138, 0.06));
  --tile-icon-bg: var(--grad-success);
  --tile-glow: rgba(44, 197, 111, 0.28);
}

.stat-tile.tile-info {
  --tile-grad: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(11, 40, 191, 0.06));
  --tile-icon-bg: var(--grad-info);
  --tile-glow: rgba(14, 165, 233, 0.28);
}

.stat-tile.tile-warning {
  --tile-grad: linear-gradient(135deg, rgba(234, 179, 8, 0.16), rgba(216, 90, 85, 0.06));
  --tile-icon-bg: var(--grad-warning);
  --tile-glow: rgba(234, 179, 8, 0.28);
}

.stat-tile.tile-violet {
  --tile-grad: linear-gradient(135deg, var(--color-brand-tint), var(--color-brand-deep-tint));
  --tile-icon-bg: var(--grad-brand);
  --tile-glow: rgba(11, 40, 191, 0.28);
}

.stat-tile.tile-danger {
  --tile-grad: linear-gradient(135deg, rgba(216, 90, 85, 0.14), rgba(216, 90, 85, 0.04));
  --tile-icon-bg: var(--grad-danger);
  --tile-glow: rgba(216, 90, 85, 0.28);
}

/* --------------------------------------------------------------------------
   16. PAGE HERO STRIP — gradient fintech banner with live pulse
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 26px 30px;
  margin-bottom: 22px;
  background:
    radial-gradient(900px 250px at 100% 0%, var(--color-highlight), transparent 60%),
    var(--grad-hero);
  color: var(--text-on-brand);
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -55%;
  right: -8%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(79, 85, 232, 0.55) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: 26%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.32) 0%, transparent 65%);
  pointer-events: none;
}

.page-hero>* {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255);
  margin-bottom: 8px;
}

.page-hero h1,
.page-hero h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}

.page-hero p {
  margin: 8px 0 0 0;
  color: rgba(255, 255, 255);
  font-size: 13.5px;
  max-width: 640px;
  line-height: 1.55;
}

.page-hero .hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.page-hero .hero-pill svg {
  flex-shrink: 0;
}

/* Blinking status dot for hero pills */
.hero-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}

.hero-pill-dot--green {
  background: var(--color-bull-bright);
  box-shadow: 0 0 0 0 rgba(44, 197, 111, 0.6);
  animation: hero-pill-dot-pulse-green 1.6s var(--ease-in-out) infinite;
}

.hero-pill-dot--amber {
  background: #eab308;
  box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.65);
  animation: hero-pill-dot-pulse-amber 1.6s var(--ease-in-out) infinite;
}

.hero-pill-dot--red {
  background: var(--color-bear);
  box-shadow: 0 0 0 0 rgba(216, 90, 85, 0.65);
  animation: hero-pill-dot-pulse-red 1.6s var(--ease-in-out) infinite;
}

.hero-pill-dot--blue {
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.65);
  animation: hero-pill-dot-pulse-blue 1.6s var(--ease-in-out) infinite;
}

.hero-pill-dot--neutral {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  animation: hero-pill-dot-pulse-neutral 1.8s var(--ease-in-out) infinite;
}

@keyframes hero-pill-dot-pulse-green {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(44, 197, 111, 0.6);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(44, 197, 111, 0);
    transform: scale(1.18);
  }
}

@keyframes hero-pill-dot-pulse-amber {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.65);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(234, 179, 8, 0);
    transform: scale(1.18);
  }
}

@keyframes hero-pill-dot-pulse-red {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(216, 90, 85, 0.65);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(216, 90, 85, 0);
    transform: scale(1.18);
  }
}

@keyframes hero-pill-dot-pulse-blue {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.6);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(96, 165, 250, 0);
    transform: scale(1.18);
  }
}

@keyframes hero-pill-dot-pulse-neutral {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    transform: scale(1.15);
  }
}

.page-hero .page-hero-greeting {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px 0;
  color: #fff;
  line-height: 1.15;
}

.page-hero:has(.page-hero-greeting) h1,
.page-hero:has(.page-hero-greeting) h2 {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.005em;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   17. SECTION HEADER (small title above grid)
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header .title .accent-bar {
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--grad-brand);
}

.section-header .subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   18. RISK SIGNAL CARDS
   -------------------------------------------------------------------------- */
.signals-container {
  padding: 0;
}

.signals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

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

.signal-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  position: relative;
  transition: transform var(--tx) var(--ease-out), box-shadow var(--tx) var(--ease-out),
    border-color var(--tx) var(--ease-out);
}

.signal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.signal-card-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: linear-gradient(180deg, var(--line-soft), transparent);
}

.signal-card-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-color, var(--grad-brand));
}

.signal-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color, var(--grad-brand));
  color: #fff;
  font-size: 17px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px var(--accent-glow, rgba(11, 40, 191, 0.26));
}

.signal-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.signal-card-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.signal-card-body {
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: all var(--tx-fast) var(--ease-out);
}

.signal-item:hover {
  background: #fff;
  border-color: var(--border-default);
  transform: translateX(2px);
}

.signal-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13.5px;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signal-icon {
  font-size: 12px;
  font-weight: 700;
}

.signal-positive {
  background: var(--success-tint);
  color: var(--color-c-15803d);
  border: 1px solid var(--color-bull-soft);
}

.signal-negative {
  background: var(--danger-tint);
  color: var(--color-bear-strong);
  border: 1px solid var(--color-bear-soft);
}

.signal-neutral {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
  border: 1px solid rgba(234, 179, 8, 0.45);
}

.signal-legend {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  box-shadow: var(--shadow-xs);
}

.no-data-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  box-shadow: var(--shadow-xs);
}

.no-data-content {
  padding: 60px 24px;
  text-align: center;
}

.no-data-content p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   19. DATA-MONITORING STATUS PILLS / TILES
   -------------------------------------------------------------------------- */
.status-tile {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: all var(--tx) var(--ease-out);
}

.status-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-2);
}

.status-tile .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.status-tile .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.status-tile .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.status-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-pulse .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-pulse.is-fresh .dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(44, 197, 111, 0.22);
  animation: pulse-dot 2s var(--ease-in-out) infinite;
}

.status-pulse.is-fresh {
  color: var(--color-c-15803d);
}

.status-pulse.is-stale .dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(216, 90, 85, 0.22);
}

.status-pulse.is-stale {
  color: var(--color-bear-strong);
}

.status-pulse.is-down .dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(216, 90, 85, 0.22);
}

.status-pulse.is-down {
  color: var(--color-bear-strong);
}

/* --------------------------------------------------------------------------
   20. AUTH (LOGIN / FORGOT / RESET) — split layout
   -------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface-bg-grad);
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
}

.auth-brand {
  position: relative;
  padding: 48px;
  background: var(--grad-hero);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

@media (max-width: 991px) {
  .auth-brand {
    display: none;
  }
}

.auth-brand::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55) 0%, transparent 60%);
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  bottom: -25%;
  left: -15%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.40) 0%, transparent 65%);
  pointer-events: none;
}

.auth-brand>* {
  position: relative;
  z-index: 1;
}

.auth-brand .brand-mark img {
  max-height: 36px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.auth-brand .brand-headline {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  color: #fff;
}

.auth-brand .brand-headline em {
  font-style: normal;
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-bull) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand .brand-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.78);
  max-width: 460px;
  line-height: 1.6;
  margin-top: 14px;
}

.auth-brand .feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-brand .feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.auth-brand .feature-list li .check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bull);
  flex-shrink: 0;
}

.auth-brand .footer-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}

@media (max-width: 575px) {
  .auth-card {
    padding: 28px 22px;
  }
}

.auth-card .auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-card .auth-logo img {
  max-height: 38px;
}

.auth-card .auth-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  text-align: center;
}

.auth-card .auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 28px 0;
}

.auth-card .form-control {
  height: 46px;
}

.auth-card .btn-primary {
  height: 46px;
  font-weight: 700;
}

.auth-link-row {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

.auth-link-row a {
  color: var(--brand);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   21. PASSWORD VISIBILITY TOGGLE (reused)
   -------------------------------------------------------------------------- */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 48px;
  border-top-right-radius: var(--radius-md) !important;
  border-bottom-right-radius: var(--radius-md) !important;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  transition: background var(--tx-fast) var(--ease-out),
    color var(--tx-fast) var(--ease-out),
    transform var(--tx-fast) var(--ease-out);
}

.password-toggle:hover {
  background: var(--line-soft);
  color: var(--brand);
}

.password-toggle:focus-visible {
  outline: none;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--color-brand-tint);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.9);
}

/* --------------------------------------------------------------------------
   22. MODAL
   -------------------------------------------------------------------------- */
.modal-content {
  border: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}

.modal-header.bg-primary {
  background: var(--grad-brand) !important;
  border-bottom: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 22px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
}

.btn-close {
  background-size: 22%;
  border-radius: 50%;
  padding: 0;
  transition: background-color var(--tx-fast);
}

.btn-close:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.btn-close:focus {
  outline: 0;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   23. ALERTS / TOAST helpers
   -------------------------------------------------------------------------- */
.alert-heading {
  font-weight: 600;
  font-size: 18px;
}

/* --------------------------------------------------------------------------
   24. UTILITIES / MISC
   -------------------------------------------------------------------------- */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 16px 0;
}

.fade-in-up {
  animation: fade-in-up var(--tx-slow) var(--ease-out) both;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon-chip {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 15px;
  flex-shrink: 0;
}

.icon-chip.success {
  background: var(--success-tint);
  color: var(--color-c-15803d);
}

.icon-chip.warning {
  background: var(--warning-tint);
  color: var(--color-bear-strong);
}

.icon-chip.danger {
  background: var(--danger-tint);
  color: var(--color-bear-strong);
}

.icon-chip.info {
  background: var(--info-tint);
  color: var(--color-brand-primary);
}

.icon-chip.violet {
  background: var(--color-brand-tint);
  color: var(--color-brand-primary);
}

/* --------------------------------------------------------------------------
   25. CHIP / SEGMENTED toggle
   -------------------------------------------------------------------------- */
.segmented-toggle {
  display: inline-flex;
  background: var(--line-soft);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

.segmented-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--tx-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.segmented-toggle button:hover {
  color: var(--brand);
}

.segmented-toggle button.active {
  background: var(--surface-card);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* Non-interactive variant: a segmented-toggle used as a static label/pill */
.segmented-toggle--static button {
  cursor: default;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   26. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  padding: 18px 0;
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.footer .copyright,
.footer .credits {
  text-align: center;
}

/* --------------------------------------------------------------------------
   27. ERROR 404
   -------------------------------------------------------------------------- */
.error-404 {
  padding: 30px;
}

.error-404 h1 {
  font-size: 180px;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0;
  line-height: 150px;
}

.error-404 h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   28. SPINNERS
   -------------------------------------------------------------------------- */
.spinner-border {
  border-color: var(--brand-2);
  border-right-color: transparent;
}

/* --------------------------------------------------------------------------
   29. LEGACY DASHBOARD INFO CARDS (kept for compatibility)
   -------------------------------------------------------------------------- */
.dashboard .info-card {
  padding-bottom: 10px;
}

.dashboard .info-card h6 {
  font-size: 28px;
  color: var(--text-primary);
  font-weight: 800;
  margin: 0;
  padding: 0;
}

.dashboard .card-icon {
  font-size: 28px;
  line-height: 0;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   30. AUTH SKELETON refinements (when in legacy)
   -------------------------------------------------------------------------- */
.auth-loading-skeleton .skeleton-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
}