/* ============================================================
   DOUYIN2FB — APPLE VISION / FROSTED GLASSMORPHISM DESIGN SYSTEM
   Framework: ui-ux-pro-craft Master Edition
   Aesthetics: Deep Space Obsidian, Multi-Layer Frosted Glass, Specular Edges,
               Apple Corner Radii, Fluid Ambient Glows
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* Surface Layers (Deep Space Obsidian + Translucent Frosted Glass) */
  --bg-base: #07090e;
  --bg-surface: rgba(13, 16, 27, 0.65);
  --bg-sidebar: rgba(10, 13, 22, 0.72);
  --bg-card: rgba(16, 20, 34, 0.55);
  --bg-card-hover: rgba(24, 30, 50, 0.75);
  --bg-card-elevated: rgba(20, 25, 42, 0.85);
  --bg-input: rgba(8, 10, 18, 0.65);
  --bg-hover: rgba(255, 255, 255, 0.06);

  /* Apple Vision Electric Palette */
  --primary: #0071e3;
  --primary-light: #47a3ff;
  --primary-glow: rgba(0, 113, 227, 0.35);

  --neon-cyan: #38bdf8;
  --neon-pink: #f472b6;
  --neon-purple: #a855f7;
  --neon-yellow: #fbbf24;
  --neon-green: #10b981;
  --neon-blue: #3b82f6;

  /* Gradients */
  --grad-cyber: linear-gradient(135deg, #0071e3 0%, #6366f1 50%, #a855f7 100%);
  --grad-cyan: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --grad-pink: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
  --grad-green: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-yellow: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  --grad-apple-blue: linear-gradient(135deg, #0071e3 0%, #47a3ff 100%);

  /* Specular Razor-Sharp Glass Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-active: #47a3ff;
  --border-focus: rgba(71, 163, 255, 0.6);

  /* Typography Text Scale (Apple SF/Jakarta Scale) */
  --text-1: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --text-code: #93c5fd;

  /* Elevation & Diffuse Glass Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  --shadow-lg: 0 20px 48px -6px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  --shadow-glow-primary: 0 8px 30px var(--primary-glow);

  /* Geometry & Apple Radii */
  --sidebar-w: 270px;
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 9999px;

  /* Typography Font Families */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Noto Sans SC", system-ui, sans-serif;
  --font-heading: 'Outfit', var(--font);
  --font-mono: 'JetBrains Mono', "SF Mono", monospace;

  /* Apple Spring Motion & Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.25s;
}

/* =================== LIGHT MODE CSS VARIABLES =================== */
/* Element-level overrides: /css/light-mode.css (loaded from layout) */
[data-mode="light"] {
  --bg-base: #eef2f7;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-sidebar: rgba(255, 255, 255, 0.88);
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(245, 248, 255, 0.97);
  --bg-card-elevated: rgba(255, 255, 255, 0.97);
  --bg-input: rgba(255, 255, 255, 0.9);
  --bg-hover: rgba(0, 113, 227, 0.05);

  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-light: rgba(0, 0, 0, 0.12);
  --border-active: #0071e3;
  --border-focus: rgba(0, 113, 227, 0.4);

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-code: #1d4ed8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
  --shadow-lg: 0 20px 48px -6px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

/* Theme mode toggle pill — shared for both modes */
.btn-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-mode-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ===================== RESET & BASE ===================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  font-family: var(--font);
  background-color: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient dynamic background lighting (Deep Space Mesh Glows) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 950px 600px at 15% -5%, rgba(0, 113, 227, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 850px 500px at 85% 95%, rgba(99, 102, 241, 0.1) 0%, transparent 65%),
    radial-gradient(ellipse 700px 450px at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle dot mesh texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ===================== LAYOUT ===================== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: auto;
}

/* ===================== APPLE VISION FROSTED SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  box-shadow: 6px 0 36px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(255, 255, 255, 0.05);
  transition: all var(--dur) var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  user-select: none;
}

.brand:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.brand:hover .brand-icon {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0071e3, #6366f1);
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
}

.brand-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
}

.brand-info h2 {
  font-family: var(--font-heading);
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-info span {
  font-size: 9.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* Nav Menu */
.nav-menu,
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #475569;
  padding: 14px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  width: 100%;
  text-align: left;
  position: relative;
  text-decoration: none;
}

.nav-item i {
  font-size: 15.5px;
  width: 20px;
  text-align: center;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

.nav-item:hover i {
  transform: scale(1.18);
  filter: drop-shadow(0 0 10px currentColor);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.22), rgba(0, 113, 227, 0.06));
  border: 1px solid rgba(71, 163, 255, 0.35);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3.5px;
  border-radius: 4px;
  background: linear-gradient(to bottom, #47a3ff, #0071e3);
  box-shadow: 0 0 12px #47a3ff;
}

.nav-item.active i {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px currentColor);
}

.badge-count {
  margin-left: auto;
  background: linear-gradient(135deg, #0071e3, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.system-status {
  display: none !important;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 36px;
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
}

/* ===================== FROSTED TOPBAR ===================== */
.topbar {
  position: relative;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  font-weight: 500;
}

.header-actions {
  position: relative;
  z-index: 1001;
  display: flex;
  gap: 10px;
  align-items: center;
}

.quick-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: #cbd5e1;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ===================== TABS ===================== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeSlide var(--dur) var(--ease);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===================== UTILITY & HELPERS ===================== */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-gap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

/* ===================== APPLE SCROLLBAR ===================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

::selection {
  background: rgba(0, 113, 227, 0.45);
  color: #ffffff;
}

/* ===================== MULTI-PAGE SELECTOR ===================== */
.multi-page-selector {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease);
}

.multi-page-selector:hover {
  border-color: rgba(71, 163, 255, 0.4);
}

.multi-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.multi-page-check-all {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
  user-select: none;
}

.multi-page-check-all input[type="checkbox"] {
  accent-color: #0071e3;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.multi-page-count {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
}

.multi-page-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.multi-page-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: 1px solid transparent;
  user-select: none;
}

.multi-page-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.multi-page-item.active {
  background: rgba(0, 113, 227, 0.15);
  border-color: rgba(71, 163, 255, 0.35);
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.15);
}

.multi-page-item > input[type="checkbox"] {
  accent-color: #0071e3;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.multi-page-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.multi-page-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-page-category {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR (APPLE VISION FROSTED DOCK)
   Framework: responsive-omni-craft & ui-ux-pro-craft
   ══════════════════════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  background: rgba(10, 13, 24, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  z-index: 9990;
  align-items: center;
  justify-content: space-around;
  padding-left: max(6px, env(safe-area-inset-left, 6px));
  padding-right: max(6px, env(safe-area-inset-right, 6px));
}

[data-mode="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #94a3b8;
  height: 100%;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 2px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

[data-mode="light"] .mobile-nav-item {
  color: #64748b;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-icon {
  font-size: 18px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  position: relative;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mobile-nav-item.active {
  color: #38bdf8 !important;
}

[data-mode="light"] .mobile-nav-item.active {
  color: #0071e3 !important;
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7));
}

.mobile-nav-item.active .mobile-nav-label {
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

[data-mode="light"] .mobile-nav-item.active .mobile-nav-label {
  color: #0f172a;
  text-shadow: none;
}

.mobile-badge-count {
  position: absolute;
  top: -4px;
  right: -10px;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.6);
  min-width: 16px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   BREAKPOINT 2: MOBILE TABLETS & PHONES (<= 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide heavy desktop sidebar completely on mobile */
  .sidebar {
    display: none !important;
  }

  /* Reset main content to full width and reserve bottom nav padding */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 14px 12px calc(82px + env(safe-area-inset-bottom, 16px)) !important;
    min-height: 100dvh !important;
  }

  /* Show Bottom Navigation Dock */
  .mobile-bottom-nav {
    display: flex !important;
  }

  /* Topbar responsive compact */
  .topbar {
    padding: 8px 12px !important;
    margin-bottom: 14px !important;
  }

  .header-title h1 {
    font-size: 18px !important;
  }

  .header-title p {
    font-size: 11px !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Touch Ergonomics: Minimum 44x44px Hit Target Rule */
  .stg-btn,
  button:not(.chip):not(.badge),
  .stg-input,
  select,
  .interval-chip,
  .user-platform-pill {
    min-height: 44px !important;
  }

  .btn-close-modal,
  .stg-btn--ghost {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* iOS Safari Auto-Zoom Prevention */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }

  .stg-toggle-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .stg-icon-circle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
  }

  .platform-pill {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }

  .stg-card__inner {
    padding: 14px 12px !important;
  }

  .stg-stat-value {
    font-size: 20px !important;
  }

  .modal-dialog,
  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
  }

  /* Toast notification on mobile: above bottom nav */
  .toast,
  #toastContainer {
    left: 12px !important;
    right: 12px !important;
    max-width: calc(100vw - 24px) !important;
    bottom: calc(75px + env(safe-area-inset-bottom, 16px)) !important;
    font-size: 12.5px !important;
    z-index: 10000 !important;
  }
}

/* ══════════════════════════════════════════════════════════
   BREAKPOINT 3: ULTRA-COMPACT SMARTPHONES (<= 480px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .header-actions .stg-btn span:not(.badge) {
    display: none;
  }

  .header-actions .stg-btn {
    padding: 8px 10px !important;
  }

  .stg-card__title {
    font-size: 14.5px !important;
  }

  .stg-card__sub {
    font-size: 11.5px !important;
  }

  .stg-stat-value {
    font-size: 22px !important;
  }
}