/* ==========================================================================
   PrincipioLab — Design System
   Tema claro + escuro (roxo), mobile-first, tipografia e espaçamento consistentes
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --touch-min: 44px;
  --nav-height: 72px;
  --sidebar-width: 268px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --duration-fast: 140ms;
  --duration-normal: 200ms;
  --duration-slow: 280ms;

  --transition-fast: transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
  --transition-smooth: transform var(--duration-normal) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out),
    background-color var(--duration-normal) ease,
    border-color var(--duration-normal) ease,
    box-shadow var(--duration-normal) ease;
}

/* Dark — roxo profundo com contraste legível */
body.dark-theme {
  --bg-primary: #0e0b16;
  --bg-secondary: #171222;
  --bg-elevated: #211a2e;
  --bg-card: #1e1830;
  --bg-card-hover: #2a223c;
  --bg-modal: #1a1428;
  --bg-input: #2a2238;
  --bg-overlay: rgba(8, 5, 14, 0.78);

  --border-color: rgba(196, 181, 253, 0.2);
  --border-strong: rgba(196, 181, 253, 0.32);
  --border-focus: #c4b5fd;

  --accent-primary: #c4b5fd;
  --accent-primary-hover: #a78bfa;
  --accent-primary-pressed: #8b5cf6;
  --accent-soft: rgba(196, 181, 253, 0.16);
  --accent-soft-strong: rgba(196, 181, 253, 0.28);
  --accent-cyan: #ddd6fe;
  --accent-purple: #d8b4fe;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 55%, #c084fc 100%);

  --color-success: #4ade80;
  --color-success-bg: rgba(74, 222, 128, 0.16);
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.16);
  --color-danger: #fca5a5;
  --color-danger-bg: rgba(252, 165, 165, 0.16);
  --danger-color: var(--color-danger);

  --text-main: #faf8ff;
  --text-muted: #d4cce6;
  --text-subtle: #b0a6c8;
  --text-on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(88, 28, 135, 0.18);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.52);
  --shadow-glow: 0 8px 28px rgba(139, 92, 246, 0.38);
  --shadow-fab: 0 10px 28px rgba(139, 92, 246, 0.52);

  color-scheme: dark;
}

/* Light — neutro limpo com acento roxo */
body.light-theme {
  --bg-primary: #f6f4fb;
  --bg-secondary: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8ff;
  --bg-modal: #ffffff;
  --bg-input: #f3f0fa;
  --bg-overlay: rgba(15, 10, 25, 0.45);

  --border-color: #e8e2f2;
  --border-strong: #d5cce8;
  --border-focus: #7c3aed;

  --accent-primary: #7c3aed;
  --accent-primary-hover: #6d28d9;
  --accent-primary-pressed: #5b21b6;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-soft-strong: rgba(124, 58, 237, 0.18);
  --accent-cyan: #6d28d9;
  --accent-purple: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a855f7 100%);

  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.1);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.1);
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.1);
  --danger-color: var(--color-danger);

  --text-main: #1a1228;
  --text-muted: #5b516d;
  --text-subtle: #8d849c;
  --text-on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(40, 20, 70, 0.05), 0 2px 8px rgba(40, 20, 70, 0.04);
  --shadow-md: 0 8px 24px rgba(40, 20, 70, 0.08), 0 2px 6px rgba(40, 20, 70, 0.04);
  --shadow-lg: 0 16px 40px rgba(40, 20, 70, 0.12);
  --shadow-glow: 0 8px 24px rgba(124, 58, 237, 0.22);
  --shadow-fab: 0 10px 24px rgba(124, 58, 237, 0.4);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  transition: background-color var(--duration-slow) ease, color var(--duration-slow) ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.main-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + var(--space-6));
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 900px) {
  .main-content {
    padding: var(--space-5) var(--space-6);
    padding-bottom: var(--space-8);
  }
}

.mobile-only {
  display: none !important;
}

.mobile-filter-bar {
  display: none !important;
}

.desktop-only-flex {
  display: flex !important;
}

#btn-install-pwa-header,
#btn-install-pwa-sidebar {
  display: none !important;
}

#btn-install-pwa-mobile {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  display: none;
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: var(--space-4);
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  z-index: 100;
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-4);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.user-profile-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.user-profile-badge .user-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.user-profile-badge .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-profile-badge #user-display-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.user-profile-badge #user-display-name:hover {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.35;
  margin-top: 2px;
}

#profile-email[readonly] {
  opacity: 0.85;
  cursor: default;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
}

.nav-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  opacity: 0.9;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: var(--accent-soft-strong);
  font-weight: 600;
}

.nav-item:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text-main);
  }
}

/* --------------------------------------------------------------------------
   Mobile chrome
   -------------------------------------------------------------------------- */
.bottom-nav {
  display: none;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff !important;
  font-size: 1.35rem !important;
  box-shadow: var(--shadow-fab);
  border: 3px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) ease;
}

.fab-button:active {
  transform: scale(0.94);
}

.mobile-top-bar {
  display: none;
}

@media (max-width: 899px) {
  .mobile-only {
    display: flex !important;
  }

  .mobile-filter-bar {
    display: block !important;
  }

  .desktop-only-flex {
    display: none !important;
  }

  #btn-install-pwa-mobile {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-glow) !important;
    font-size: 0.8125rem !important;
  }

  body.pwa-installed #btn-install-pwa-mobile {
    display: none !important;
  }

  .main-content {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }

  #section-inventory,
  .lens-accordion-list {
    padding-bottom: var(--space-4);
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-1) 0 var(--space-3);
    width: 100%;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .header-title h1 {
    font-size: 1.25rem !important;
    letter-spacing: -0.02em;
  }

  .header-title p {
    font-size: 0.8125rem !important;
    line-height: 1.4;
    color: var(--text-muted);
  }

  #type-pills-container {
    display: none !important;
  }

  .sidebar {
    display: none;
  }

  .sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 999999;
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    animation: slideRight var(--duration-normal) var(--ease-drawer);
    padding-top: max(var(--space-4), env(safe-area-inset-top, 0px));
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
  }

  .mobile-sidebar-overlay {
    display: none;
  }

  .mobile-sidebar-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999998;
    animation: fadeOverlay var(--duration-fast) ease;
  }

  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 18px;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 9999;
    pointer-events: none;
  }

  .bottom-nav .fab-button {
    pointer-events: auto;
  }

  .accordion-code-tag {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@keyframes slideRight {
  from {
    transform: translateX(-100%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-main);
}

.header-title p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 42ch;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Folder tabs
   -------------------------------------------------------------------------- */
.folder-tabs-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: thin;
  margin-bottom: var(--space-3);
}

.folder-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.folder-tab:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .folder-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-strong);
  }
}

.folder-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.folder-badge {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.folder-tab:not(.active) .folder-badge {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.folder-tab.active .folder-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.folder-tag-pill {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-soft-strong);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  min-height: 40px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border: none;
  padding: 10px 18px;
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  transform: scale(0.97);
  background: var(--accent-primary-pressed);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    box-shadow: var(--shadow-glow);
    filter: brightness(1.05);
  }
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: var(--bg-card-hover);
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 8px 12px;
  min-height: 40px;
}

.btn-ghost:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    color: var(--text-main);
    background: var(--bg-input);
  }
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
  padding: 10px 16px;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 8px;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.theme-toggle-btn {
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.stats-grid-mini {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (min-width: 480px) {
  .stats-grid-mini {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  min-width: 0;
}

.stat-mini-card.is-clickable {
  cursor: pointer;
}

.stat-mini-card.is-clickable:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .stat-mini-card.is-clickable:hover {
    border-color: var(--accent-soft-strong);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
  }
}

.stat-mini-card.is-active {
  border-color: var(--accent-soft-strong);
  background: var(--accent-soft);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.stat-icon.green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.stat-icon.orange {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stat-icon.red {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

@media (max-width: 479px) {
  .stats-grid-mini {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) and (max-width: 720px) {
  .stat-mini-card {
    padding: var(--space-3);
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}

/* --------------------------------------------------------------------------
   Toolbar & search
   -------------------------------------------------------------------------- */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

@media (min-width: 900px) {
  .toolbar-card {
    padding: var(--space-3) var(--space-4);
  }
}

/* Barra de inventário: sempre coluna (busca em cima, filtros embaixo) — evita sobreposição */
#toolbar-card {
  flex-direction: column;
  align-items: stretch;
}

#toolbar-card .search-box {
  width: 100%;
  flex: 0 0 auto;
  max-width: 100%;
}

#toolbar-card .filter-group {
  width: 100%;
  flex: 0 0 auto;
}

/* Histórico e barras com título + ação à direita */
.toolbar-card.flex-between {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.toolbar-card.flex-between h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  z-index: 1;
}

.search-box > i {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  font-size: 0.875rem;
  pointer-events: none;
  z-index: 2;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 10px 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.search-box input::placeholder {
  color: var(--text-subtle);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  z-index: 2;
}

.btn-clear-search:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  width: 100%;
}

.form-select-sm {
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  min-height: 40px;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color var(--duration-fast) ease;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
}

.form-select-sm:focus {
  border-color: var(--border-focus);
}

.view-toggle {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}

#btn-clear-filters-desktop {
  min-height: 40px;
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 899px) {
  #btn-clear-filters-desktop {
    display: none !important;
  }
}

/* Telas médias: selects um pouco mais compactos para caber sem quebrar feio */
@media (min-width: 900px) and (max-width: 1200px) {
  #toolbar-card .form-select-sm {
    flex: 1 1 120px;
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  #toolbar-card .toggle-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  #btn-clear-filters-desktop span {
    display: none;
  }

  #btn-clear-filters-desktop {
    min-width: 40px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  transition: var(--transition-fast);
}

.toggle-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

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

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
}

#btn-open-mobile-filter {
  min-height: 48px;
  font-weight: 600;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Accordion list (mobile-first inventory)
   -------------------------------------------------------------------------- */
.lens-accordion-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.accordion-item:active {
  transform: scale(0.995);
}

@media (hover: hover) and (pointer: fine) {
  .accordion-item:hover {
    border-color: var(--accent-soft-strong);
    box-shadow: var(--shadow-md);
  }
}

.accordion-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: var(--space-3);
  min-height: 72px;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.accordion-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: #0a0810;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.accordion-main-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.accordion-code-tag {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

.code-badge-pill,
.accordion-code-pill {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.accordion-mfg {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.accordion-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.accordion-diopter-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.accordion-diopter-line strong {
  color: var(--text-main);
  font-weight: 700;
}

.accordion-diopter-inline {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  margin-top: 4px !important;
  width: 100% !important;
  font-size: 0.82rem;
}

.grad-tag-title {
  color: var(--accent-primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}

.grad-sub-item {
  color: var(--text-main);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: nowrap;
}

.grad-sub-item strong {
  color: var(--accent-primary);
  font-weight: 800;
}

.grad-separator {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 0.75rem;
}

.accordion-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 52px;
}

.accordion-qty-number {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--accent-primary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.accordion-qty-number.text-danger {
  color: var(--color-danger) !important;
  background: var(--color-danger-bg);
  border-color: rgba(248, 113, 113, 0.3);
}

.accordion-qty-number.text-warning {
  color: var(--color-warning) !important;
  background: var(--color-warning-bg);
  border-color: rgba(251, 191, 36, 0.3);
}

.accordion-qty-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--text-subtle);
}

.chevron-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out);
}

.accordion-item.expanded .chevron-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-elevated);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.accordion-item.expanded .accordion-content {
  display: block;
}

.accordion-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

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

/* --------------------------------------------------------------------------
   Lens cards
   -------------------------------------------------------------------------- */
.lens-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .lens-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

.lens-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  box-shadow: var(--shadow-sm);
}

@media (hover: hover) and (pointer: fine) {
  .lens-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft-strong);
    box-shadow: var(--shadow-md);
  }
}

.lens-card.low-stock-alert {
  border-color: rgba(251, 191, 36, 0.35);
}

.lens-card.out-of-stock-alert {
  border-color: rgba(248, 113, 113, 0.35);
}

.lens-card-image-header {
  position: relative;
  width: 100%;
  height: 160px;
  background: linear-gradient(145deg, #120e1a, #1a1228);
  overflow: hidden;
}

.lens-card-image-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lens-code-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(12, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--accent-soft-strong);
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-full);
}

.stock-status-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.stock-status-badge.in-stock {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.stock-status-badge.low-stock {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stock-status-badge.out-of-stock {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.lens-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.lens-card-mfg {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lens-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.lens-graduation-box,
.lens-card-diopter {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-main);
}

.lens-graduation-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.grad-item {
  display: flex;
  flex-direction: column;
}

.grad-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.grad-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.lens-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lens-treatments-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.treatment-pill {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-soft-strong);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.lens-card-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  width: 100%;
}

.quantity-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qty-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-qty-action:active {
  transform: scale(0.94);
  background: var(--accent-soft);
  border-color: var(--accent-soft-strong);
  color: var(--accent-primary);
}

.qty-display {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.alert-min-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lens-card-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  justify-content: stretch;
  min-width: 0;
}

.lens-card-actions .btn-ghost,
.lens-card-actions .btn-delete-lens {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  justify-content: center;
  white-space: nowrap;
  padding: 6px 8px !important;
  font-size: 0.75rem !important;
  gap: 4px !important;
}

.lens-card-actions .btn-ghost i,
.lens-card-actions .btn-delete-lens i {
  flex-shrink: 0;
  font-size: 0.8em;
}

/* Em cards bem estreitos, esconde o texto e deixa só o ícone */
@media (max-width: 380px) {
  .lens-card-actions .btn-ghost,
  .lens-card-actions .btn-delete-lens {
    font-size: 0 !important;
    gap: 0 !important;
    padding: 8px 6px !important;
  }

  .lens-card-actions .btn-ghost i,
  .lens-card-actions .btn-delete-lens i {
    font-size: 0.9rem !important;
  }
}

.btn-delete-lens {
  color: var(--color-danger) !important;
  background: var(--color-danger-bg) !important;
  border: 1px solid rgba(248, 113, 113, 0.28) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.btn-delete-lens:hover {
  background: rgba(248, 113, 113, 0.22) !important;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-responsive-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.custom-table th {
  background-color: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: background-color var(--duration-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .custom-table tbody tr:hover {
    background: var(--bg-card-hover);
  }
}

.table-img-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: #0a0810;
  border: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 0;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-page-label {
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-heading);
  min-width: 4.5rem;
  text-align: center;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.pagination-controls .btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-size .form-select-sm {
  flex: 0 0 auto;
  min-width: 72px;
  width: auto;
}

@media (max-width: 640px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: var(--space-2);
  }

  .pagination-controls {
    justify-content: center;
  }

  .pagination-size {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.empty-state-card {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  margin-top: var(--space-2);
}

.empty-state-card .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.empty-state-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.empty-state-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 32ch;
  margin: 0 auto var(--space-4);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
/* Antes do JS: se há sessão salva, nunca mostre o login (evita flash no F5) */
html.has-session-hint #auth-modal {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out),
    visibility var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

@media (min-width: 600px) {
  .modal-backdrop {
    align-items: center;
    padding: var(--space-4);
  }
}

.modal-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-dialog {
  background-color: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 650px;
  max-height: 92dvh;
  overflow-y: auto !important;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) transparent;
  transform: translateY(12px) scale(0.98);
  opacity: 0.96;
  transition: transform var(--duration-slow) var(--ease-drawer),
    opacity var(--duration-normal) var(--ease-out);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (min-width: 600px) {
  .modal-dialog {
    border-radius: var(--radius-xl);
    max-height: 88vh;
  }
}

.modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: transparent;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: var(--accent-soft-strong);
  border-radius: 4px;
}

#auth-modal .modal-dialog {
  overflow: hidden !important;
  margin: auto;
  border-radius: var(--radius-xl);
  max-width: 400px;
}

.modal-dialog.modal-sm {
  max-width: 400px;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg-modal);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-header.text-center {
  flex-direction: column;
  text-align: center;
  justify-content: center;
  gap: var(--space-2);
  padding-top: var(--space-6);
  border-bottom: none;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.015em;
}

.modal-close-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
  line-height: 1;
}

.modal-close-btn:active {
  transform: scale(0.94);
}

@media (hover: hover) and (pointer: fine) {
  .modal-close-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
  }
}

.modal-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: 0;
  background: var(--bg-modal);
  flex-shrink: 0;
}

/* Footer dentro do body/form: não duplicar padding lateral */
.modal-body > .modal-footer,
.modal-body .modal-footer {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  margin-top: var(--space-2);
  background: transparent;
}

.modal-footer-split {
  justify-content: space-between;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Auth modal polish */
.auth-brand {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #471a64;
  box-shadow: var(--shadow-glow);
}

.auth-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label.required::after {
  content: ' *';
  color: var(--color-danger);
}

.form-label-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-control,
.form-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 42px;
  padding-right: 42px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

.input-with-button {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.input-with-button .form-control {
  flex: 1;
  min-width: 0;
}

.input-sign-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.btn-sign-toggle {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  min-width: 42px;
  min-height: 44px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transition: transform var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.btn-sign-toggle:active {
  transform: scale(0.94);
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .grid-2-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.grid-4-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (min-width: 500px) {
  .grid-4-cols {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid-4-cols.visa-simples {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.highlight-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-label input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

/* Image upload */
.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 500px) {
  .image-upload-wrapper {
    flex-direction: row;
    align-items: center;
  }
}

.image-preview-box {
  width: 112px;
  height: 112px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  background-color: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  gap: 6px;
  padding: 8px;
}

.image-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.treatments-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.checkbox-pill {
  cursor: pointer;
}

.checkbox-pill input {
  display: none;
}

.checkbox-pill span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
  min-height: 42px;
}

.checkbox-pill input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.number-input-stepper {
  display: flex;
  align-items: center;
}

.btn-step {
  width: 44px;
  height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-step:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-step:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md);
}

.btn-step:active {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.number-input-stepper input {
  border-radius: 0;
  text-align: center;
  border-left: none;
  border-right: none;
}

/* Segmented control */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segment-option {
  cursor: pointer;
}

.segment-option input {
  display: none;
}

.segment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.segment-option input:checked + .segment-btn.green {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.segment-option input:checked + .segment-btn.red {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.stock-item-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-1);
}

/* Lens details popup */
.lens-popup-image-box {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0a0810;
  border: 1px solid var(--border-color);
}

.lens-popup-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lens-popup-code-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(12, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-soft-strong);
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.lens-popup-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.lens-popup-mfg {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.lens-popup-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lens-popup-identity {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.lens-popup-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.lens-popup-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lens-popup-identity-text {
  min-width: 0;
  flex: 1;
}

.lens-popup-sku {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 4px;
}

.lens-popup-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.popup-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.popup-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.lens-popup-stock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  flex-wrap: wrap;
}

.lens-popup-stock.is-ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--color-success-bg);
}

.lens-popup-stock.is-low {
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--color-warning-bg);
}

.lens-popup-stock.is-out {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--color-danger-bg);
}

.stock-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stock-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 2px 0;
}

.lens-popup-stock.is-ok .stock-value {
  color: var(--color-success);
}

.lens-popup-stock.is-low .stock-value {
  color: var(--color-warning);
}

.lens-popup-stock.is-out .stock-value {
  color: var(--color-danger);
}

.stock-alert {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.video-container {
  width: 100%;
  max-width: 450px;
  height: 300px;
  background: #000;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-controls {
  display: flex;
  justify-content: center;
}

/* Delete confirm */
.delete-confirm-icon {
  font-size: 3rem;
  color: var(--color-danger);
  margin-bottom: var(--space-4);
  width: 72px;
  height: 72px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-danger-bg);
  border-radius: var(--radius-full);
}

.delete-confirm-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.delete-confirm-actions .btn-ghost,
.delete-confirm-actions .btn-primary {
  flex: 1;
}

.btn-danger-solid {
  background: var(--color-danger) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3) !important;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.dashboard-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.full-width-card {
  grid-column: 1 / -1;
}

.chart-bar-item {
  margin-bottom: 14px;
}

.chart-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  gap: 8px;
}

.chart-bar-track {
  height: 8px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.critical-list {
  overflow-x: auto;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: 16px;
  left: 16px;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
  margin-left: auto;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
  }
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  pointer-events: auto;
  animation: toastIn var(--duration-normal) var(--ease-out);
  max-width: 100%;
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

.toast.danger {
  border-left-color: var(--color-danger);
}

.toast-message {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.toast-count {
  flex-shrink: 0;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.toast.success .toast-count {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.toast.warning .toast-count {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.toast.danger .toast-count {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.toast.toast-bump {
  animation: toastBump 180ms var(--ease-out);
}

@keyframes toastBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   PWA banner
   -------------------------------------------------------------------------- */
.pwa-banner {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-soft-strong);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideUp var(--duration-slow) var(--ease-drawer);
}

@media (min-width: 900px) {
  .pwa-banner {
    bottom: 24px;
    right: 24px;
    left: auto;
    margin: 0;
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-banner-text strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.pwa-banner-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pwa-step-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.pwa-step-box h4 {
  color: var(--accent-primary);
  font-size: 0.95rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.pwa-step-box ol {
  padding-left: 20px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Mobile filter — bottom sheet
   -------------------------------------------------------------------------- */
.mobile-drawer-header {
  display: none;
}

.mobile-drawer-footer {
  display: none;
}

.filter-sheet-overlay {
  display: none;
}

body.filter-drawer-open {
  overflow: hidden;
}

@media (max-width: 899px) {
  .toolbar-card {
    display: none;
  }

  .filter-sheet-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeOverlay var(--duration-fast) ease;
  }

  /* Bottom sheet: só a altura do conteúdo, máx. ~88% da tela */
  .toolbar-card.mobile-drawer-open {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: min(88dvh, 88vh);
    height: auto;
    z-index: 99999;
    background: var(--bg-modal);
    margin: 0;
    padding: 8px 16px 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    animation: sheetSlideUp var(--duration-slow) var(--ease-drawer);
    gap: var(--space-3);
  }

  .mobile-drawer-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-color);
  }

  .sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    margin: 2px auto 4px;
    opacity: 0.9;
  }

  .mobile-drawer-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .mobile-drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  .mobile-drawer-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
  }

  .toolbar-card.mobile-drawer-open .search-box {
    flex-shrink: 0;
  }

  .toolbar-card.mobile-drawer-open .search-box input {
    min-height: 42px;
    font-size: 0.875rem;
  }

  .toolbar-card.mobile-drawer-open .filter-group {
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    gap: 8px;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }

  .toolbar-card.mobile-drawer-open .form-select-sm {
    width: 100%;
    flex: 0 0 auto;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.25;
  }

  .toolbar-card.mobile-drawer-open .view-toggle {
    width: 100%;
    flex: 0 0 auto;
  }

  .toolbar-card.mobile-drawer-open .toggle-btn {
    flex: 1;
    justify-content: center;
    min-height: 38px;
    height: 38px;
    padding: 6px 10px;
    font-size: 0.8125rem;
  }

  .mobile-drawer-footer {
    display: flex;
    gap: var(--space-2);
    width: 100%;
    flex-shrink: 0;
    margin-top: 0;
    padding: var(--space-2) 0 max(10px, env(safe-area-inset-bottom, 0px));
    background: var(--bg-modal);
    border-top: 1px solid var(--border-color);
  }

  .mobile-drawer-footer .btn-secondary,
  .mobile-drawer-footer .btn-primary {
    flex: 1;
    min-height: 44px;
    height: 44px;
    font-size: 0.9rem;
  }
}

@keyframes sheetSlideUp {
  from {
    opacity: 0.85;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header do sheet some no desktop */
@media (min-width: 900px) {
  .mobile-drawer-header {
    display: none !important;
  }

  .filter-sheet-overlay {
    display: none !important;
  }
}

@media (min-width: 900px) {
  .toolbar-card {
    display: flex !important;
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.text-center {
  text-align: center;
}

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

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

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

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

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

.font-weight-bold {
  font-weight: 700 !important;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

@media (max-width: 600px) {
  .desktop-only {
    display: none !important;
  }
}

/* Tab sections */
.tab-section {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .modal-dialog,
  .fab-button,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .accordion-item,
  .lens-card {
    transform: none !important;
  }
}

/* High contrast support */
@media (prefers-contrast: more) {
  body.dark-theme,
  body.light-theme {
    --border-color: currentColor;
  }

  .btn-primary,
  .folder-tab.active,
  .toggle-btn.active {
    border: 2px solid currentColor;
  }
}
