/*!
 * AeroGlass UI Framework v1.0.1
 * Bootstrap-inspired Iridescent Glassmorphism & Soft Neumorphism Framework
 * Single Source of Truth — Pure CSS (Standalone, Zero-dependency)
 *
 * WCAG 2.2 AA Accessible • prefers-reduced-motion • Focus Visible • Contrast Verified
 */

/* ==========================================================================
   Design Tokens & CSS Custom Properties
   ========================================================================== */
:root {
  color-scheme: light;
  /* Dynamic Font Scale & Blur Tokens */
  --ag-font-scale: 1;
  --ag-blur-amount: 24px;
  --ag-toast-duration: 3.6s;

  /* Core Surfaces & Canvas (Light Mode - Iridescent Pearl) */
  --ag-canvas-bg: linear-gradient(135deg, #d5dbe6 0%, #e4e8f1 45%, #d6dce8 100%);
  --ag-surface-board: linear-gradient(145deg, rgba(242, 245, 250, 0.84) 0%, rgba(229, 234, 242, 0.76) 100%);
  --ag-surface-card: linear-gradient(145deg, rgba(247, 249, 253, 0.80) 0%, rgba(235, 239, 247, 0.66) 100%);
  --ag-surface-card-solid: #eef1f8; /* Opaque backing token (P0-5 fix for border-anim) */
  --ag-surface-card-hover: linear-gradient(145deg, rgba(252, 253, 255, 0.92) 0%, rgba(240, 244, 251, 0.80) 100%);
  --ag-surface-pill: linear-gradient(180deg, rgba(249, 251, 254, 0.92) 0%, rgba(237, 241, 248, 0.78) 100%);
  --ag-surface-row: linear-gradient(90deg, rgba(245, 247, 252, 0.88) 0%, rgba(238, 242, 249, 0.76) 100%);
  --ag-surface-inset: rgba(218, 224, 235, 0.58);
  --ag-surface-floating: rgba(248, 250, 254, 0.96);

  /* Specular Borders */
  --ag-border-color: rgba(255, 255, 255, 0.88);
  --ag-border-light: 1px solid rgba(255, 255, 255, 0.86);
  --ag-border-bright: 1.5px solid rgba(255, 255, 255, 0.96);
  --ag-border-subtle: 1px solid rgba(255, 255, 255, 0.62);
  --ag-divider: rgba(255, 255, 255, 0.70);

  /* Neumorphic & Glass Shadows */
  --ag-shadow-board:
    0 24px 60px -12px rgba(92, 106, 136, 0.22),
    0 4px 16px -2px rgba(92, 106, 136, 0.08),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.96);
  --ag-shadow-sidebar:
    10px 0 44px -6px rgba(84, 102, 142, 0.22),
    4px 0 24px -2px rgba(135, 175, 255, 0.20),
    inset -1.5px 0 2px rgba(255, 255, 255, 0.98);
  --ag-shadow-card:
    0 12px 28px -8px rgba(96, 110, 140, 0.14),
    0 2px 6px -1px rgba(96, 110, 140, 0.06),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.94);
  --ag-shadow-card-xl:
    0 28px 58px -10px rgba(55, 68, 98, 0.34),
    0 12px 24px -6px rgba(55, 68, 98, 0.18),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.98);
  --ag-shadow-pill:
    0 6px 16px -4px rgba(96, 110, 140, 0.12),
    0 1px 3px rgba(96, 110, 140, 0.06),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.96);
  --ag-shadow-active-nav:
    0 8px 22px -4px rgba(76, 110, 245, 0.22),
    0 0 12px rgba(255, 255, 255, 0.65),
    inset 0 1px 2px rgba(255, 255, 255, 1);
  --ag-shadow-primary-btn:
    0 8px 20px -4px rgba(62, 94, 242, 0.52),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45);

  /* Typography & High Contrast Colors (WCAG 2.2 AA verified) */
  --ag-text-main: #1b2234;
  --ag-text-secondary: #4a5568;
  --ag-text-muted: #5b667c; /* P1-4: Darkened from #7b879e for 4.5:1 AA contrast! */
  --ag-icon-color: #3b465e;
  --ag-icon-muted: #5b667c;
  --ag-icon-active: #3b5bdb;

  /* Active Navigation States */
  --ag-nav-hover-bg: rgba(255, 255, 255, 0.48);
  --ag-nav-active-bg: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 245, 255, 0.82) 100%);
  --ag-nav-active-border: 1.5px solid rgba(255, 255, 255, 0.98);
  --ag-nav-active-text: #3b5bdb;

  /* Brand & Semantic Colors */
  --ag-primary: #4868f6;
  --ag-primary-hover: #3855e0;
  --ag-success: #0b6b4a; /* P1-4: Darkened for WCAG AA */
  --ag-danger: #b42318;  /* P1-4: Darkened for WCAG AA */
  --ag-warning: #92520a; /* P1-4: Darkened for WCAG AA */

  /* Radii */
  --ag-radius-board: 34px;
  --ag-radius-sidebar: 32px;
  --ag-radius-card: 22px;
  --ag-radius-sm: 14px;
  --ag-radius-pill: 9999px;

  /* Fonts */
  --ag-font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ag-font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   P0-3: [hidden] attribute must always win over component display styles
   ========================================================================== */
[hidden] {
  display: none !important;
}

/* ==========================================================================
   P1-5: Accessibility: prefers-reduced-motion & Fallbacks
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ag-card--border-anim::before {
    animation: none !important;
  }
}

/* Fallback for browsers or devices without backdrop-filter support */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ag-board, .ag-card, .ag-sidebar, .ag-modal-dialog, .ag-toast, .ag-dropdown-panel {
    background: var(--ag-surface-card-solid) !important;
  }
}

/* ==========================================================================
   P1-1: Shared, Theme-Aware Focus Indicators (:focus-visible)
   ========================================================================== */
:where(
  .ag-btn,
  .ag-btn-primary,
  .ag-squircle-btn,
  .ag-nav-link,
  .ag-filter-pill,
  .ag-segmented-item,
  .ag-action-pill,
  .ag-accordion-header,
  .ag-drag-handle,
  .ag-switch,
  .ag-mini-thumb
):focus-visible {
  outline: 2px solid var(--ag-primary) !important;
  outline-offset: 2px !important;
}

.ag-search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(72, 104, 246, 0.35), var(--ag-shadow-pill) !important;
}

/* ==========================================================================
   Font Size Scaling (html[data-ag-fontsize="sm|md|lg|xl"])
   ========================================================================== */
html[data-ag-fontsize="sm"] { font-size: 14px; --ag-font-scale: 0.88; }
html[data-ag-fontsize="md"] { font-size: 16px; --ag-font-scale: 1; }
html[data-ag-fontsize="lg"] { font-size: 17.5px; --ag-font-scale: 1.1; }
html[data-ag-fontsize="xl"] { font-size: 19px; --ag-font-scale: 1.2; }

/* Blur Presets */
html[data-ag-blur="low"] { --ag-blur-amount: 8px; }
html[data-ag-blur="normal"] { --ag-blur-amount: 24px; }
html[data-ag-blur="high"] { --ag-blur-amount: 42px; }

/* ==========================================================================
   True Carbon / Obsidian Black Dark Mode ([data-ag-theme="dark"])
   ========================================================================== */
[data-ag-theme="dark"] {
  color-scheme: dark;
  --ag-canvas-bg: linear-gradient(135deg, #050506 0%, #0c0c0e 50%, #070709 100%);
  --ag-surface-board: linear-gradient(145deg, rgba(20, 20, 23, 0.88) 0%, rgba(12, 12, 14, 0.85) 100%);
  --ag-surface-card: linear-gradient(145deg, rgba(28, 28, 32, 0.82) 0%, rgba(18, 18, 21, 0.74) 100%);
  --ag-surface-card-solid: #16161a; /* Opaque dark backing token */
  --ag-surface-card-hover: linear-gradient(145deg, rgba(38, 38, 43, 0.92) 0%, rgba(25, 25, 29, 0.84) 100%);
  --ag-surface-pill: linear-gradient(180deg, rgba(36, 36, 42, 0.92) 0%, rgba(22, 22, 26, 0.86) 100%);
  --ag-surface-row: linear-gradient(90deg, rgba(30, 30, 35, 0.88) 0%, rgba(20, 20, 24, 0.80) 100%);
  --ag-surface-inset: rgba(8, 8, 10, 0.72);
  --ag-surface-floating: rgba(22, 22, 26, 0.96);

  --ag-border-color: rgba(255, 255, 255, 0.16);
  --ag-border-light: 1px solid rgba(255, 255, 255, 0.14);
  --ag-border-bright: 1.5px solid rgba(255, 255, 255, 0.26);
  --ag-border-subtle: 1px solid rgba(255, 255, 255, 0.09);
  --ag-divider: rgba(255, 255, 255, 0.11);

  --ag-shadow-board: 0 28px 64px -12px rgba(0, 0, 0, 0.85), 0 6px 20px rgba(0, 0, 0, 0.65), inset 0 1.5px 2px rgba(255, 255, 255, 0.18);
  --ag-shadow-sidebar: 14px 0 52px -6px rgba(0, 0, 0, 0.88), 6px 0 28px -2px rgba(72, 104, 246, 0.14), inset -1.5px 0 2px rgba(255, 255, 255, 0.22);
  --ag-shadow-card: 0 14px 32px -8px rgba(0, 0, 0, 0.72), 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 1.5px rgba(255, 255, 255, 0.16);
  --ag-shadow-card-xl: 0 32px 68px -10px rgba(0, 0, 0, 0.92), 0 16px 28px -6px rgba(0, 0, 0, 0.75), inset 0 1.5px 2px rgba(255, 255, 255, 0.24);
  --ag-shadow-pill: 0 6px 18px -4px rgba(0, 0, 0, 0.65), inset 0 1px 1.5px rgba(255, 255, 255, 0.18);
  --ag-shadow-primary-btn: 0 8px 24px -4px rgba(99, 130, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  --ag-shadow-active-nav: 0 8px 24px -4px rgba(72, 104, 246, 0.45), 0 0 16px rgba(72, 104, 246, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.35);

  --ag-text-main: #f4f4f6;
  --ag-text-secondary: #a1a1aa;
  --ag-text-muted: #71717a;
  --ag-icon-color: #f4f4f6;
  --ag-icon-muted: #a1a1aa;
  --ag-icon-active: #93b0ff;

  --ag-nav-hover-bg: rgba(255, 255, 255, 0.08);
  --ag-nav-active-bg: linear-gradient(90deg, rgba(72, 104, 246, 0.32) 0%, rgba(59, 91, 219, 0.18) 100%);
  --ag-nav-active-border: 1.5px solid rgba(147, 176, 255, 0.45);
  --ag-nav-active-text: #ffffff;

  --ag-primary: #6382ff;
  --ag-primary-hover: #4868f6;
  --ag-success: #4ade80;
  --ag-danger: #f87171;
  --ag-warning: #fcd34d; /* P2-6: Added dark warning token */
}

/* ==========================================================================
   Typography & Helper Utilities
   ========================================================================== */
.ag-tabular { font-variant-numeric: tabular-nums; }
.ag-mono { font-family: var(--ag-font-mono); font-variant-numeric: tabular-nums; }
.ag-text-main { color: var(--ag-text-main); }
.ag-text-secondary { color: var(--ag-text-secondary); }
.ag-text-muted { color: var(--ag-text-muted); }
.ag-icon { color: var(--ag-icon-color); }
.ag-icon-muted { color: var(--ag-icon-muted); }
.ag-divider-bottom { border-bottom: 1px solid var(--ag-divider); }
.ag-divider-top { border-top: 1px solid var(--ag-divider); }

.ag-kpi-value {
  font-size: calc(1.75rem * var(--ag-font-scale, 1));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.ag-clock-display {
  font-family: var(--ag-font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.ag-app-shell {
  min-height: 100vh;
  width: 100%;
  background: var(--ag-canvas-bg);
  color: var(--ag-text-main);
  position: relative;
}

.ag-mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--ag-surface-board);
  backdrop-filter: blur(var(--ag-blur-amount)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--ag-blur-amount)) saturate(140%);
  border-bottom: var(--ag-border-light);
  position: sticky;
  top: 0;
  z-index: 40;
}

.ag-main-search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ag-text-main);
  font-size: calc(0.875rem * var(--ag-font-scale, 1));
}

.ag-main-search-input::placeholder {
  color: var(--ag-text-muted);
}

/* ==========================================================================
   Layout Grid & Workspace Structure
   ========================================================================== */
.ag-workspace {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--ag-canvas-bg);
}

.ag-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: var(--ag-border-bright);
  background: var(--ag-surface-board);
  backdrop-filter: blur(var(--ag-blur-amount)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--ag-blur-amount)) saturate(145%);
  box-shadow: var(--ag-shadow-sidebar);
  border-radius: 0 var(--ag-radius-sidebar) var(--ag-radius-sidebar) 0;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  z-index: 40;
}

@media (max-width: 1023px) {
  .ag-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 290px;
    border-radius: 0 24px 24px 0;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 60;
  }
  .ag-sidebar.ag-sidebar--open {
    transform: translateX(0);
  }
}

.ag-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 55;
}

.ag-main-stage {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 100px 24px;
}

@media (max-width: 640px) {
  .ag-main-stage {
    padding: 14px 12px 110px 12px;
  }
}

/* 12-Column Responsive Grid */
.ag-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.ag-col-12 { grid-column: span 12 / span 12; }
.ag-col-10 { grid-column: span 10 / span 10; }
.ag-col-9  { grid-column: span 9 / span 9; }
.ag-col-8  { grid-column: span 8 / span 8; }
.ag-col-7  { grid-column: span 7 / span 7; }
.ag-col-6  { grid-column: span 6 / span 6; }
.ag-col-5  { grid-column: span 5 / span 5; }
.ag-col-4  { grid-column: span 4 / span 4; }
.ag-col-3  { grid-column: span 3 / span 3; }

@media (max-width: 1180px) {
  .ag-col-7, .ag-col-5 { grid-column: span 12 / span 12; }
}

@media (max-width: 767px) {
  .ag-col-8, .ag-col-6, .ag-col-4, .ag-col-3 { grid-column: span 12 / span 12; }
  .ag-row { gap: 12px; }
}

/* ==========================================================================
   Main Glass Board & 6 Card Appearance Modifiers
   ========================================================================== */
.ag-board {
  border-radius: var(--ag-radius-board);
  background: var(--ag-surface-board);
  backdrop-filter: blur(var(--ag-blur-amount)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--ag-blur-amount)) saturate(140%);
  border: var(--ag-border-light);
  box-shadow: var(--ag-shadow-board);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 640px) {
  .ag-board {
    border-radius: 24px;
    padding: 16px 14px;
    gap: 14px;
  }
}

.ag-card {
  position: relative;
  border-radius: var(--ag-radius-card);
  background: var(--ag-surface-card);
  backdrop-filter: blur(var(--ag-blur-amount));
  -webkit-backdrop-filter: blur(var(--ag-blur-amount));
  border: var(--ag-border-light);
  box-shadow: var(--ag-shadow-card);
  padding: 18px 20px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
}

.ag-card-interactive:hover {
  transform: translateY(-2px);
  background: var(--ag-surface-card-hover);
}

/* Variant 1: Výraznější stín (.ag-card--shadow-xl) */
.ag-card--shadow-xl {
  box-shadow: var(--ag-shadow-card-xl);
  border: var(--ag-border-bright);
}

.ag-card--shadow-xl:hover {
  transform: translateY(-3px);
}

/* Variant 2: Bez pozadí / Transparentní (.ag-card--transparent) */
.ag-card--transparent {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: 1.5px dashed var(--ag-border-color);
}

:not([data-ag-theme="dark"]) .ag-card--transparent {
  border: 1.5px solid rgba(120, 136, 168, 0.35);
}

[data-ag-theme="dark"] .ag-card--transparent {
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

/* Variant 3: Rotující světlo kolem okraje (.ag-card--border-anim) with P0-5 fix! */
@keyframes agBorderSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.ag-card--border-anim {
  position: relative;
  overflow: hidden;
  border-color: transparent !important;
  isolation: isolate;
}

.ag-card--border-anim::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220%;
  height: 220%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 60deg,
    #5474f7 110deg,
    #ff9770 160deg,
    #e070ff 210deg,
    #4ade80 260deg,
    transparent 310deg,
    transparent 360deg
  );
  animation: agBorderSpin 4.5s linear infinite;
  z-index: -2;
  pointer-events: none;
}

/* P0-5 fix: dual background with solid backing so gradient doesn't bleed through card body */
.ag-card--border-anim::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: calc(var(--ag-radius-card) - 2px);
  background: var(--ag-surface-card), var(--ag-surface-card-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

/* Variant 4: Duhový / Iridiscentní povrch (.ag-card--iridescent) */
.ag-card--iridescent {
  background:
    radial-gradient(85% 85% at 90% 15%, rgba(255, 180, 145, 0.35) 0%, rgba(215, 155, 255, 0.28) 45%, transparent 80%),
    radial-gradient(80% 80% at 12% 88%, rgba(130, 220, 255, 0.32) 0%, transparent 75%),
    var(--ag-surface-card);
  border: var(--ag-border-bright);
}

[data-ag-theme="dark"] .ag-card--iridescent {
  background:
    radial-gradient(85% 85% at 90% 15%, rgba(255, 165, 120, 0.18) 0%, rgba(195, 125, 255, 0.16) 45%, transparent 80%),
    radial-gradient(80% 80% at 12% 88%, rgba(90, 195, 255, 0.16) 0%, transparent 75%),
    var(--ag-surface-card);
}

/* Variant 5: Vnořený neomorfní povrch (.ag-card--inset) */
.ag-card--inset {
  background: var(--ag-surface-inset);
  box-shadow:
    inset 0 3px 7px rgba(20, 28, 45, 0.14),
    inset 0 -1px 2px rgba(255, 255, 255, 0.75);
  border: var(--ag-border-subtle);
}

[data-ag-theme="dark"] .ag-card--inset {
  box-shadow:
    inset 0 4px 10px rgba(0, 0, 0, 0.75),
    inset 0 -1px 1px rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Holographic Virtual Credit Card (.ag-virtual-card)
   ========================================================================== */
.ag-virtual-card {
  position: relative;
  border-radius: 24px;
  padding: 20px 22px 18px 22px;
  min-height: 218px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 22px 42px -12px rgba(84, 96, 128, 0.28),
    0 4px 12px rgba(84, 96, 128, 0.10),
    inset 0 1.5px 3px rgba(255, 255, 255, 0.98);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  isolation: isolate;
}

.ag-virtual-card--prism {
  background:
    radial-gradient(55% 60% at 90% 92%, rgba(226, 170, 255, 0.55) 0%, rgba(165, 185, 255, 0.25) 48%, transparent 75%),
    radial-gradient(60% 55% at 55% 15%, rgba(255, 185, 225, 0.38) 0%, rgba(160, 225, 255, 0.28) 55%, transparent 80%),
    linear-gradient(135deg, #e7ecf4 0%, #d5dce9 45%, #cfd7e6 72%, #e2e6f1 100%);
  color: #1e2536;
}

.ag-virtual-card--cyber {
  background:
    radial-gradient(65% 75% at 72% 28%, rgba(56, 239, 125, 0.36) 0%, rgba(17, 153, 142, 0.22) 55%, transparent 80%),
    linear-gradient(135deg, #111614 0%, #192621 52%, #0c120f 100%);
  color: #f0fdf4;
  border-color: rgba(134, 239, 172, 0.42);
}

.ag-virtual-card--sand {
  background:
    radial-gradient(70% 70% at 75% 80%, rgba(255, 175, 145, 0.55) 0%, rgba(255, 215, 185, 0.35) 55%, transparent 80%),
    linear-gradient(135deg, #f6efe8 0%, #e5d4c5 52%, #efe2d5 100%);
  color: #2b2118;
}

.ag-virtual-card--obsidian {
  background:
    radial-gradient(70% 80% at 80% 25%, rgba(192, 108, 255, 0.45) 0%, rgba(56, 189, 248, 0.28) 50%, transparent 80%),
    linear-gradient(135deg, #111115 0%, #1c1c22 52%, #0a0a0d 100%);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.30);
}

.ag-virtual-card__top-facet {
  position: absolute;
  top: -24px;
  left: -12%;
  width: 75%;
  height: 76px;
  transform: rotate(-15.5deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(225, 234, 248, 0.25) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 1;
}

.ag-virtual-card__beam {
  position: absolute;
  top: 18px;
  left: -16%;
  width: 134%;
  height: 74px;
  transform: rotate(-15.5deg);
  background: linear-gradient(
    90deg,
    rgba(255, 192, 150, 0.72) 0%,
    rgba(255, 224, 182, 0.76) 18%,
    rgba(175, 236, 255, 0.82) 40%,
    rgba(198, 182, 255, 0.76) 62%,
    rgba(255, 168, 220, 0.74) 82%,
    rgba(255, 240, 250, 0.88) 100%
  );
  border-top: 1.5px solid rgba(255, 255, 255, 0.95);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.90);
  box-shadow:
    0 10px 26px rgba(120, 145, 210, 0.22),
    inset 0 2px 6px rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 2;
}

.ag-virtual-card__under-wedge {
  position: absolute;
  top: 66px;
  right: -14%;
  width: 78%;
  height: 62px;
  transform: rotate(-15.5deg);
  background: linear-gradient(
    90deg,
    rgba(122, 136, 168, 0.58) 0%,
    rgba(148, 160, 188, 0.42) 55%,
    rgba(185, 195, 218, 0.15) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px 0 0 0;
  pointer-events: none;
  z-index: 1;
}

.ag-emv-chip {
  width: 42px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #e6ebf2 0%, #c3ccd9 48%, #dde3ec 100%);
  border: 1px solid rgba(92, 104, 126, 0.65);
  box-shadow:
    0 2px 5px rgba(55, 65, 85, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
}

.ag-emv-chip span {
  border: 0.5px solid rgba(88, 100, 122, 0.45);
}

.ag-card-embossed {
  font-size: calc(1.92rem * var(--ag-font-scale));
  font-weight: 500;
  letter-spacing: 0.015em;
  color: #ffffff;
  text-shadow:
    0 2px 10px rgba(58, 70, 98, 0.52),
    0 1px 2px rgba(58, 70, 98, 0.35);
}

.ag-btn-reveal {
  background: linear-gradient(180deg, #5474f7 0%, #3d5af1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 8px 18px -3px rgba(61, 90, 241, 0.48),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
  border-radius: var(--ag-radius-pill);
  padding: 8px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ag-btn-reveal:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Mini Card Tray (.ag-mini-tray) */
.ag-mini-tray {
  border-radius: 20px;
  background: var(--ag-surface-card);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-card);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 86%;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .ag-mini-tray {
    width: 100%;
    gap: 8px;
    padding: 8px 10px;
  }
}

.ag-mini-thumb {
  height: 58px;
  border-radius: 12px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 6px 14px -3px rgba(20, 26, 40, 0.28);
}

.ag-mini-thumb:hover { transform: translateY(-2px); }
.ag-mini-thumb.ag-active {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 2px rgba(72, 104, 246, 0.35), 0 8px 16px -3px rgba(20, 26, 40, 0.32);
}

.ag-mini-thumb--1 {
  background: radial-gradient(80% 60% at 80% 80%, rgba(224, 112, 255, 0.85) 0%, rgba(168, 85, 247, 0.4) 50%, transparent 75%), linear-gradient(155deg, #1b1d26 0%, #2b2f3c 55%, #d8d4e2 100%);
  color: #ffffff;
}

.ag-mini-thumb--2 {
  background: radial-gradient(circle at 50% 42%, rgba(74, 222, 128, 0.35) 0%, transparent 68%), linear-gradient(160deg, #0d1311 0%, #17241f 100%);
  color: #4ade80;
}

.ag-mini-thumb--3 {
  background: radial-gradient(80% 70% at 35% 80%, rgba(235, 165, 135, 0.72) 0%, transparent 70%), linear-gradient(160deg, #faf6f2 0%, #ebd9c8 60%, #dcbfa6 100%);
  color: #3b2a1d;
}

.ag-mini-thumb--4 {
  background: radial-gradient(circle at 75% 30%, rgba(56, 189, 248, 0.4) 0%, transparent 65%), linear-gradient(160deg, #161e2e 0%, #233148 100%);
  color: #ffffff;
}

/* ==========================================================================
   Buttons, Squircles & Pills (.ag-btn, .ag-btn--*, .ag-squircle-btn)
   ========================================================================== */
.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ag-font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--ag-radius-pill);
  padding: 8px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  border: var(--ag-border-light);
  background: var(--ag-surface-pill);
  color: var(--ag-text-main);
  box-shadow: var(--ag-shadow-pill);
}

.ag-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

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

.ag-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* Button Variants: Primary & BEM Modifiers */
.ag-btn-primary,
.ag-btn--primary {
  background: linear-gradient(180deg, #5677fc 0%, #4263eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: var(--ag-shadow-primary-btn);
}

.ag-btn--primary:hover {
  filter: brightness(1.08);
}

/* Button Sizes (P3) */
.ag-btn--sm {
  padding: 5px 12px;
  font-size: 0.75rem;
}

.ag-btn--lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.ag-btn-ledger {
  background: linear-gradient(180deg, #5271df 0%, #3b5bdb 100%); /* P1-4 contrast fix */
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 12px -2px rgba(74, 108, 232, 0.45);
  padding: 6px 18px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--ag-radius-pill);
  min-width: 86px;
}

.ag-squircle-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--ag-surface-pill);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ag-icon-color);
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.ag-squircle-btn:hover,
.ag-squircle-btn.ag-active {
  color: var(--ag-icon-active);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--ag-shadow-active-nav);
}

.ag-action-pill {
  position: relative;
  border-radius: 16px;
  background: var(--ag-surface-pill);
  border: var(--ag-border-light);
  box-shadow: var(--ag-shadow-pill);
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ag-text-main);
  cursor: pointer;
  transition: all 0.16s ease;
}

.ag-action-pill:hover { transform: translateY(-1px); }

.ag-action-pill--glow {
  border: var(--ag-border-bright);
  box-shadow:
    0 10px 22px -6px rgba(76, 110, 245, 0.34),
    inset 0 1px 2px rgba(255, 255, 255, 0.98);
}

.ag-action-pill--glow::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 18%;
  right: 18%;
  height: 2.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #4c6ef5, transparent);
}

.ag-filter-pill {
  border-radius: var(--ag-radius-pill);
  padding: 6px 15px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  border: var(--ag-border-light);
  background: var(--ag-surface-pill);
  color: var(--ag-text-secondary);
  box-shadow: var(--ag-shadow-pill);
  transition: all 0.15s ease;
}

.ag-filter-pill:hover { color: var(--ag-text-main); }

.ag-filter-pill.ag-active {
  background: linear-gradient(180deg, #5271df 0%, #3b5bdb 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 12px -2px rgba(74, 108, 232, 0.45);
}

.ag-nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9.5px 13px;
  border-radius: 14px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ag-text-main);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.ag-nav-link .ag-nav-icon {
  color: var(--ag-icon-color);
  transition: color 0.15s ease;
}

.ag-nav-link:hover {
  background: var(--ag-nav-hover-bg);
}

.ag-nav-link.ag-active {
  background: var(--ag-nav-active-bg);
  border: var(--ag-nav-active-border);
  box-shadow: var(--ag-shadow-active-nav);
  color: var(--ag-nav-active-text);
  font-weight: 600;
}

.ag-nav-link.ag-active .ag-nav-icon {
  color: var(--ag-icon-active);
}

/* ==========================================================================
   Badges & Status Tags (.ag-badge, .ag-badge--*) with WCAG AA Contrast Fixes
   ========================================================================== */
.ag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--ag-radius-pill);
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border: var(--ag-border-subtle);
  background: var(--ag-surface-pill);
  color: var(--ag-text-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

/* P1-4: Light mode text colors tuned to satisfy >= 4.5:1 ratio */
.ag-badge--primary {
  background: rgba(72, 104, 246, 0.15);
  color: #2f4bc4;
  border-color: rgba(72, 104, 246, 0.35);
}

.ag-badge--success {
  background: rgba(28, 168, 122, 0.15);
  color: #0b6b4a;
  border-color: rgba(28, 168, 122, 0.35);
}

.ag-badge--warning {
  background: rgba(245, 159, 0, 0.15);
  color: #92520a;
  border-color: rgba(245, 159, 0, 0.35);
}

.ag-badge--danger {
  background: rgba(227, 93, 122, 0.15);
  color: #b42318;
  border-color: rgba(227, 93, 122, 0.35);
}

.ag-badge--info {
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.35);
}

[data-ag-theme="dark"] .ag-badge--primary {
  background: rgba(72, 104, 246, 0.25);
  color: #93b0ff;
  border-color: rgba(72, 104, 246, 0.45);
}

[data-ag-theme="dark"] .ag-badge--success {
  background: rgba(28, 168, 122, 0.25);
  color: #4ade80;
  border-color: rgba(28, 168, 122, 0.45);
}

[data-ag-theme="dark"] .ag-badge--warning {
  background: rgba(245, 159, 0, 0.25);
  color: #fcd34d;
  border-color: rgba(245, 159, 0, 0.45);
}

[data-ag-theme="dark"] .ag-badge--danger {
  background: rgba(227, 93, 122, 0.25);
  color: #f87171;
  border-color: rgba(227, 93, 122, 0.45);
}

[data-ag-theme="dark"] .ag-badge--info {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.45);
}

/* ==========================================================================
   Form Controls (.ag-input, .ag-select, .ag-textarea, .ag-switch)
   ========================================================================== */
.ag-input,
.ag-select,
.ag-textarea {
  width: 100%;
  border-radius: 14px;
  background: var(--ag-surface-inset);
  border: var(--ag-border-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--ag-text-main);
  outline: none;
  transition: all 0.15s ease;
  font-family: var(--ag-font-sans);
}

[data-ag-theme="dark"] .ag-select option {
  background-color: #16161a;
  color: #f4f4f6;
}

.ag-input:focus,
.ag-select:focus,
.ag-textarea:focus {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 3px rgba(72, 104, 246, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ag-input::placeholder,
.ag-textarea::placeholder {
  color: var(--ag-text-muted);
}

/* Form validation states (P2-4) */
.ag-input--invalid,
.ag-select--invalid {
  border-color: var(--ag-danger) !important;
  box-shadow: 0 0 0 2px rgba(227, 93, 122, 0.25) !important;
}

.ag-input--valid,
.ag-select--valid {
  border-color: var(--ag-success) !important;
}

.ag-field-error {
  font-size: 0.72rem;
  color: var(--ag-danger);
  margin-top: 4px;
  font-weight: 500;
}

/* P1-2: Accessible Glass Switch Button */
.ag-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.ag-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--ag-surface-inset);
  border: var(--ag-border-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
}

.ag-switch.ag-checked,
.ag-switch[aria-checked="true"] {
  background: linear-gradient(90deg, #4868f6 0%, #3b5bdb 100%);
  border-color: rgba(255, 255, 255, 0.6);
}

.ag-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.ag-switch.ag-checked .ag-switch-thumb,
.ag-switch[aria-checked="true"] .ag-switch-thumb {
  transform: translateX(20px);
}

.ag-search-bar {
  border-radius: var(--ag-radius-pill);
  background: var(--ag-surface-pill);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-pill);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ag-text-main);
}

.ag-sidebar-search {
  border-radius: 14px;
  background: var(--ag-surface-pill);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-pill);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ag-text-main);
}

.ag-stepper {
  border-radius: var(--ag-radius-pill);
  background: var(--ag-surface-pill);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-pill);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ag-text-main);
}

.ag-segmented {
  display: inline-flex;
  align-items: center;
  background: var(--ag-surface-inset);
  border: var(--ag-border-subtle);
  border-radius: var(--ag-radius-pill);
  padding: 4px;
  gap: 3px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.ag-segmented-item {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--ag-radius-pill);
  color: var(--ag-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ag-segmented-item:hover { color: var(--ag-text-main); }
.ag-segmented-item.ag-active {
  background: var(--ag-surface-card);
  color: var(--ag-primary);
  border-color: var(--ag-border-color);
  box-shadow: var(--ag-shadow-pill);
}

/* ==========================================================================
   Tables & Drag & Drop (.ag-table, .ag-ledger-row, .ag-sortable-item)
   ========================================================================== */
.ag-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: var(--ag-border-light);
  background: var(--ag-surface-card);
}

.ag-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.8125rem;
}

.ag-table th {
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ag-text-muted);
  border-bottom: var(--ag-border-light);
  background: rgba(255, 255, 255, 0.2);
}

[data-ag-theme="dark"] .ag-table th {
  background: rgba(255, 255, 255, 0.04);
}

.ag-table td {
  padding: 12px 16px;
  color: var(--ag-text-main);
  border-bottom: 1px solid var(--ag-divider);
  transition: background 0.15s ease;
}

.ag-table tr:last-child td { border-bottom: none; }
.ag-table tbody tr:hover td { background: rgba(255, 255, 255, 0.35); }
[data-ag-theme="dark"] .ag-table tbody tr:hover td { background: rgba(255, 255, 255, 0.05); }

.ag-ledger-row {
  border-radius: 14px;
  background: var(--ag-surface-row);
  border: var(--ag-border-subtle);
  box-shadow: 0 3px 10px -3px rgba(100, 114, 142, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 24px 24px 68px 50px 72px 1fr 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ag-text-main);
  transition: all 0.15s ease;
}

.ag-ledger-row:hover {
  background: var(--ag-surface-card-hover);
  border-color: var(--ag-border-color);
}

[data-ag-theme="dark"] .ag-ledger-row {
  box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .ag-ledger-row {
    grid-template-columns: 22px 20px 62px 44px 1fr auto;
    padding: 8px 10px;
  }
  .ag-ledger-hide-sm { display: none; }
}

@media (max-width: 480px) {
  .ag-ledger-row { grid-template-columns: 20px 58px 42px 1fr auto; }
  .ag-ledger-hide-xs { display: none; }
}

.ag-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  padding: 4px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--ag-icon-muted);
  transition: color 0.15s ease;
}

.ag-drag-handle:active { cursor: grabbing; }
.ag-drag-handle:hover { color: var(--ag-primary); }

.ag-dragging,
.ag-sortable-item.ag-dragging {
  opacity: 0.92;
  box-shadow: var(--ag-shadow-card-xl);
  border-color: var(--ag-primary);
}

.ag-drag-over,
.ag-sortable-item.ag-drag-over {
  border-color: var(--ag-primary);
  background: var(--ag-surface-card-hover);
}

/* ==========================================================================
   Modals & Popovers (.ag-modal-backdrop, .ag-modal-dialog, .ag-dropdown-panel)
   ========================================================================== */
@keyframes agModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ag-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.ag-modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 26px;
  background: var(--ag-surface-board);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-board);
  padding: 24px;
  color: var(--ag-text-main);
  animation: agModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ag-modal-dialog--lg { max-width: 720px; }

.ag-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: 92vw;
  border-radius: 22px;
  background: var(--ag-surface-floating);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-card-xl);
  padding: 14px;
  z-index: 80;
  color: var(--ag-text-main);
}

/* ==========================================================================
   Stacking Toasts (.ag-toast-stack, .ag-toast) with P0-4 & P1-4 Improvements
   ========================================================================== */
@keyframes agToastSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes agToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.ag-toast-stack {
  position: fixed;
  bottom: 74px;
  right: 20px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.ag-toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--ag-surface-floating);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-card-xl);
  padding: 12px 14px 14px 14px;
  color: var(--ag-text-main);
  animation: agToastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ag-toast__title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ag-text-main);
}

.ag-toast__message {
  font-size: 0.75rem;
  color: var(--ag-text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}

.ag-toast__content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ag-toast__close {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ag-text-muted);
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.ag-toast__close:hover {
  color: var(--ag-text-main);
}

.ag-toast__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  transform-origin: left center;
  animation: agToastProgress var(--ag-toast-duration) linear forwards;
}

/* WCAG 2.2.1: Pause toast countdown on hover/focus */
.ag-toast:hover .ag-toast__bar,
.ag-toast:focus-within .ag-toast__bar {
  animation-play-state: paused;
}

.ag-toast--info .ag-toast__bar { background: #4868f6; }
.ag-toast--success .ag-toast__bar { background: #1ca87a; }
.ag-toast--warning .ag-toast__bar { background: #f59f00; }
.ag-toast--danger .ag-toast__bar { background: #e35d7a; }

/* ==========================================================================
   Progress, Accordions, Codebox & Floating Dock
   ========================================================================== */
.ag-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--ag-surface-inset);
  overflow: hidden;
  border: var(--ag-border-subtle);
}

.ag-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4868f6 0%, #a5b4fc 50%, #ff9770 100%);
  transition: width 0.25s ease;
}

.ag-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ag-accordion-item {
  border-radius: 16px;
  border: var(--ag-border-light);
  background: var(--ag-surface-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.ag-accordion-header {
  width: 100%;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ag-text-main);
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  transition: background 0.15s ease;
}

.ag-accordion-header:hover {
  background: var(--ag-nav-hover-bg);
}

.ag-accordion-header:focus-visible {
  outline: none;
  background: var(--ag-nav-hover-bg);
  box-shadow: inset 0 0 0 2px var(--ag-primary);
}

.ag-accordion-body {
  padding: 0 18px 16px 18px;
  font-size: 0.8rem;
  color: var(--ag-text-secondary);
  line-height: 1.5;
}

.ag-code-box {
  border-radius: 14px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
  font-family: var(--ag-font-mono);
  font-size: 0.76rem;
  color: #e6edf3;
  overflow-x: auto;
  line-height: 1.55;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.ag-floating-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  border-radius: var(--ag-radius-pill);
  background: var(--ag-surface-floating);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: var(--ag-border-bright);
  box-shadow:
    0 16px 38px -8px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 96vw;
  overflow-x: auto;
}

.ag-rewards-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ag-surface-pill);
  border: 4px solid var(--ag-border-color);
  box-shadow:
    0 8px 18px -4px rgba(100, 114, 142, 0.22),
    inset 0 2px 5px rgba(140, 154, 182, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ag-text-main);
  flex-shrink: 0;
}

.ag-bar-col {
  width: 30px;
  border-radius: 7px 7px 4px 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 6px 12px -3px rgba(88, 104, 142, 0.18);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ag-bar-col:hover { transform: scaleY(1.04); filter: brightness(1.06); }
.ag-bar-col--1 { height: 32px; background: linear-gradient(180deg, #cbb8ff 0%, #b197fc 100%); }
.ag-bar-col--2 { height: 54px; background: linear-gradient(180deg, #91a7ff 0%, #748ffc 100%); }
.ag-bar-col--3 { height: 104px; background: linear-gradient(180deg, #c5f6fa 0%, #bde0fe 44%, #748ffc 44%, #5c7cfa 100%); }
.ag-bar-col--4 { height: 126px; background: linear-gradient(180deg, #e3fafc 0%, #d0ebff 36%, #ffd8be 36%, #ffc9a8 100%); }

.ag-card-integrations {
  border-radius: 18px;
  background: radial-gradient(95% 85% at 85% 30%, rgba(255, 215, 175, 0.25) 0%, rgba(165, 210, 255, 0.22) 55%, transparent 100%), var(--ag-surface-card);
  border: var(--ag-border-bright);
  box-shadow: var(--ag-shadow-pill);
  padding: 12px 14px;
}

/* Spline & Sparkline Chart Utility */
.ag-chart-spline {
  position: relative;
  width: 100%;
}

/* ==========================================================================
   Dark Mode Component Polish
   ========================================================================== */
[data-ag-theme="dark"] .ag-floating-dock {
  box-shadow:
    0 22px 52px -10px rgba(0, 0, 0, 0.85),
    inset 0 1px 2px rgba(255, 255, 255, 0.18);
}

[data-ag-theme="dark"] .ag-rewards-ring {
  box-shadow:
    0 8px 18px -4px rgba(0, 0, 0, 0.65),
    inset 0 2px 4px rgba(255, 255, 255, 0.12);
}

[data-ag-theme="dark"] .ag-bar-col {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 12px -3px rgba(0, 0, 0, 0.55);
}

[data-ag-theme="dark"] .ag-card-integrations {
  background: radial-gradient(95% 85% at 85% 30%, rgba(255, 180, 120, 0.12) 0%, rgba(99, 130, 255, 0.14) 55%, transparent 100%), var(--ag-surface-card);
}

/* ==========================================================================
   Glassmorphic Scrollbar & Selection Styles
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 160, 190, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

*::-webkit-scrollbar-thumb {
  background: rgba(140, 160, 190, 0.35);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 160, 190, 0.55);
}

[data-ag-theme="dark"] * {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-ag-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

[data-ag-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

::selection {
  background: rgba(72, 104, 246, 0.3);
  color: inherit;
}

[data-ag-theme="dark"] ::selection {
  background: rgba(99, 130, 255, 0.4);
  color: #ffffff;
}

/* ==========================================================================
   EU GDPR Cookie Consent Banner & Modal
   ========================================================================== */
.ag-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: min(860px, calc(100% - 32px));
  z-index: 10000;
  border-radius: 20px;
  background: var(--ag-surface-floating);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: var(--ag-border-bright);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.45);
  padding: 22px 26px;
  color: var(--ag-text-main);
  animation: agCookieSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@keyframes agCookieSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ag-cookie-banner.ag-hidden {
  display: none !important;
}

[data-ag-theme="dark"] .ag-cookie-banner {
  background: rgba(18, 18, 22, 0.94);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.ag-cookie-option-card {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ag-surface-card);
  border: var(--ag-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Card Skins (Prism, Cyber, Emerald, Amber, Obsidian) */
.ag-card-skin--cyber {
  background: radial-gradient(120% 100% at 90% 10%, rgba(38, 132, 255, 0.22) 0%, transparent 60%), var(--ag-surface-card);
  border-color: rgba(38, 132, 255, 0.4);
}
.ag-card-skin--emerald {
  background: radial-gradient(120% 100% at 90% 10%, rgba(16, 185, 129, 0.20) 0%, transparent 60%), var(--ag-surface-card);
  border-color: rgba(16, 185, 129, 0.38);
}
.ag-card-skin--amber {
  background: radial-gradient(120% 100% at 90% 10%, rgba(245, 158, 11, 0.22) 0%, transparent 60%), var(--ag-surface-card);
  border-color: rgba(245, 158, 11, 0.4);
}
.ag-card-skin--obsidian {
  background: linear-gradient(145deg, rgba(20, 20, 24, 0.95) 0%, rgba(10, 10, 13, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
}

