/* ============================================================
   SISTEMA ELIVRE — PREMIUM DESIGN SYSTEM
   Performance-first: só transform/opacity em animações
   Easing padrão: cubic-bezier(0.4, 0, 0.2, 1) (Material standard)
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Colors — Light mode (Linear/Vercel inspired) */
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;

  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --primary-soft: #ccfbf1;

  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-soft: #fef3c7;

  --success: #059669;
  --success-dark: #047857;
  --success-soft: #d1fae5;

  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-soft: #fee2e2;

  --warn: #d97706;
  --warn-dark: #b45309;
  --warn-soft: #fef3c7;

  --info: #2563eb;
  --info-soft: #dbeafe;

  --purple: #7c3aed;
  --purple-soft: #ede9fe;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* Spacing (8px base grid) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Shadows — LEVES para PCs fracos (blur <= 20px) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 16px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 16px 24px -8px rgba(15, 23, 42, 0.10), 0 6px 12px -6px rgba(15, 23, 42, 0.06);

  /* Transitions — CURTAS e em propiedades GPU-only */
  --duration-fast: 120ms;
  --duration-base: 160ms;
  --duration-slow: 220ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);

  /* Layout */
  --topbar-h: 60px;
  --side-w: 252px;
  --side-collapsed: 76px;
  --container-max: 1440px;
}

/* ---------- DARK MODE ---------- */
html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: #111827;
  --surface-2: #1e293b;
  --surface-hover: #1e293b;
  --ink: #f1f5f9;
  --ink-2: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --line: #1e293b;
  --line-2: #334155;

  --primary: #2dd4bf;
  --primary-dark: #14b8a6;
  --primary-light: #5eead4;
  --primary-soft: #0d3d3a;

  --accent: #fbbf24;
  --accent-dark: #f59e0b;
  --accent-soft: #422d0f;

  --success: #34d399;
  --success-dark: #10b981;
  --success-soft: #064e3b;

  --danger: #f87171;
  --danger-dark: #ef4444;
  --danger-soft: #450a0a;

  --warn: #fbbf24;
  --warn-dark: #f59e0b;
  --warn-soft: #422006;

  --info: #60a5fa;
  --info-soft: #1e3a8a;

  --purple: #a78bfa;
  --purple-soft: #2e1065;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.36), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.42), 0 2px 4px -2px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 10px 16px -4px rgba(0, 0, 0, 0.48), 0 4px 8px -4px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 16px 24px -8px rgba(0, 0, 0, 0.54), 0 6px 12px -6px rgba(0, 0, 0, 0.36);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100vh;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition: background-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard);
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
a:hover { color: var(--primary-dark); }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }

/* ---------- SCROLLBAR CUSTOMIZADA (LEVE) ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background-color: var(--line-2);
  border-radius: var(--radius-full);
  transition: background-color var(--duration-fast) var(--ease-standard);
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--muted-2); }

/* ---------- SELEÇÃO DE TEXTO ---------- */
::selection { background: var(--primary-soft); color: var(--ink); }
html[data-theme="dark"] ::selection { background: var(--primary-soft); color: var(--primary-light); }

/* ---------- FOCUS RING ACESSÍVEL ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible {
  outline-color: var(--primary);
  outline-offset: 2px;
}

/* ---------- LAYOUT PRINCIPAL ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  background-color: var(--bg);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  padding: var(--space-6);
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: linear-gradient(180deg, #0c1a2b 0%, #0f2336 55%, #0c1e30 100%);
  color: #cbd5e1;
  padding: var(--space-5) var(--space-3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 30;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.5);
}
html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #070c18 0%, #0a1224 100%);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-5);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: inherit;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.brand:hover { opacity: 0.92; color: inherit; }
.brand img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  flex: 0 0 44px;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.brand-copy { min-width: 0; flex: 1; }
.brand strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #f1f5f9;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-size: var(--text-xs);
  opacity: 0.55;
  font-weight: 450;
  margin-top: 2px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  padding: var(--space-4) var(--space-3) var(--space-2);
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #cbd5e1;
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  position: relative;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.nav a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 0.85;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(1px);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.18), rgba(45, 212, 191, 0.06));
  color: #ffffff;
  font-weight: 600;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transform: translateY(-50%);
}
.nav a.active svg { opacity: 1; }
.nav .badge {
  margin-left: auto;
  background: var(--accent);
  color: #3f2806;
  font-size: 10.5px;
  font-weight: 750;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

.side-foot {
  margin-top: auto;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: var(--text-xs);
  color: #94a3b8;
  line-height: 1.45;
}
.side-foot b {
  color: #f1f5f9;
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

/* ---------- TOPBAR ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: var(--space-4);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  background-color: color-mix(in srgb, var(--surface) 92%, transparent);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--surface); }
}
html[data-theme="dark"] .topbar {
  background-color: color-mix(in srgb, var(--surface) 94%, transparent);
}

.top-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 0 1 auto;
}
.sidebar-toggle {
  width: 36px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 36px;
}

.crumb {
  font-size: var(--text-sm);
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb b {
  color: var(--ink);
  font-weight: 600;
}
.back-home {
  color: var(--primary);
  font-weight: 600;
  border-radius: var(--radius-xs);
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.back-home:hover {
  color: var(--primary-dark);
  background-color: var(--primary-soft);
}
html[data-theme="dark"] .back-home:hover { color: var(--primary-light); }
.crumb-separator {
  color: var(--line-2);
  margin: 0 var(--space-2);
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.clock {
  font-variant-numeric: tabular-nums;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 6px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 650;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
html[data-theme="dark"] .clock { color: var(--primary-light); }

.theme-toggle { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle span[aria-hidden="true"] { font-size: 16px; line-height: 1; }
.theme-label { font-size: var(--text-xs); }

.userchip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-2) 5px 5px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--line);
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.userchip:hover { border-color: var(--line-2); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  flex: 0 0 28px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

/* ---------- PAGE HEAD ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  font-weight: 650;
  color: var(--ink);
  line-height: var(--leading-tight);
}
.page-head p {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  max-width: 62ch;
}
.page-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.pill-soft {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 550;
}

.row-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ---------- BOTÕES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 9px var(--space-4);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.35;
  background: var(--primary);
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn:hover { transform: translateY(-1px); filter: none; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled], .btn:disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary, .btn:not([class*="btn-"]) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover, .btn:not([class*="btn-"]):hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line-2);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--muted-2);
  color: var(--ink);
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: transparent;
  box-shadow: none;
}
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary) 20%); }
html[data-theme="dark"] .btn-soft { color: var(--primary-light); }

.btn-gold, .btn-warn {
  background: var(--warn);
  border-color: var(--warn);
  color: #1c1917;
}
.btn-gold:hover, .btn-warn:hover { background: var(--warn-dark); border-color: var(--warn-dark); color: #fff; }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

.btn-ok {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-ok:hover { background: var(--success-dark); border-color: var(--success-dark); }

.btn-sm { padding: 6px var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-sm); font-weight: 650; }
.btn-sm:hover { transform: translateY(-0.5px); }

/* Ripple container (JS controlado) */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
  pointer-events: none;
  transform: scale(0);
  animation: btn-ripple 520ms var(--ease-exit) forwards;
}
@keyframes btn-ripple {
  to { transform: scale(3.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn .ripple { animation: none; display: none; }
}

/* ---------- CARD ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.card:hover { border-color: var(--line-2); }
.card-h {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}
.card-h h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
}
.card-h a {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.card-h a:hover { color: var(--primary-dark); }
.card-b { padding: var(--space-5); }
.card-subtitle { color: var(--muted); font-size: var(--text-xs); margin: 3px 0 0; }

/* ---------- GRID ---------- */
.grid { display: grid; gap: var(--space-4); }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-hub, .hub-grid { grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); }

/* ---------- HUB (PAINEL INICIAL) ---------- */
.hub-hero {
  text-align: center;
  padding: var(--space-6) var(--space-5) var(--space-8);
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.hub-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hub-kicker-line {
  width: 34px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.hub-hero h1 {
  margin: var(--space-4) 0 var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  letter-spacing: -0.025em;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.15;
}
.hub-hero p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.hub-summary-head {
  max-width: 1180px;
  margin: 0 auto var(--space-4);
  padding: 0 2px;
  align-items: flex-end;
}
.hub-summary-head h2 { margin: 2px 0 0; font-size: var(--text-xl); }
.hub-summary-head p { margin: 2px 0 0; font-size: var(--text-sm); }

.section-eyebrow {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hub-section-head {
  max-width: 1180px;
  margin: var(--space-8) auto var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hub-section-rule { height: 1px; background: var(--line); flex: 1; }

.hub-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  min-height: 188px;
  color: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hub-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.9;
  z-index: -1;
}
.hub-card:nth-child(1)::before { background: linear-gradient(90deg, #2dd4bf, #0d9488); }
.hub-card:nth-child(2)::before { background: linear-gradient(90deg, #34d399, #059669); }
.hub-card:nth-child(3)::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.hub-card:nth-child(4)::before { background: linear-gradient(90deg, #f87171, #dc2626); }
.hub-card:nth-child(5)::before { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.hub-card:nth-child(6)::before { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.hub-card:nth-child(7)::before { background: linear-gradient(90deg, #f472b6, #db2777); }

.hub-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.hub-card .ico {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.hub-card h3 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.hub-card .mini {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.module-empty { max-width: 680px; overflow: hidden; }
.module-empty .card-b { padding: var(--space-10); }
.module-empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xl);
  background: var(--primary-soft);
  font-size: 30px;
  margin-bottom: var(--space-4);
}
.module-empty h2 { margin: 0 0 var(--space-2); font-size: var(--text-2xl); }
.module-empty p { color: var(--muted); margin: 0 0 var(--space-5); max-width: 500px; font-size: var(--text-base); }

/* ---------- PILL / BADGE / CHIP ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.pill-red { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.pill-gold { background: var(--accent-soft); color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.pill-green { background: var(--success-soft); color: var(--success-dark); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.pill-teal { background: var(--primary-soft); color: var(--primary-dark); border-color: color-mix(in srgb, var(--primary) 20%, transparent); }
html[data-theme="dark"] .pill-teal { color: var(--primary-light); }
html[data-theme="dark"] .pill-green { color: var(--success); }
html[data-theme="dark"] .pill-gold { color: var(--accent); }
html[data-theme="dark"] .pill-red { color: var(--danger); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}
.ok-status { background: var(--success-soft); color: var(--success-dark); }
.ok-status::before { background: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 20%, transparent); }
.low-status { background: var(--warn-soft); color: var(--warn-dark); }
.low-status::before { background: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 20%, transparent); }
.empty-status { background: var(--danger-soft); color: var(--danger-dark); }
.empty-status::before { background: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 20%, transparent); }
html[data-theme="dark"] .ok-status { color: var(--success); }
html[data-theme="dark"] .low-status { color: var(--warn); }
html[data-theme="dark"] .empty-status { color: var(--danger); }

/* ---------- STAT CARD ---------- */
.stat {
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.6;
  z-index: -1;
}
.stat .k {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  line-height: 1.4;
}
.stat .v {
  font-size: 30px;
  font-weight: 750;
  margin-top: var(--space-2);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ---------- TABELAS ---------- */
.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 750;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr {
  transition: background-color var(--duration-fast) var(--ease-standard);
}
tbody tr:hover td { background: var(--surface-hover); }

.stock-table { font-size: var(--text-sm); }
.stock-table th { font-size: 10px; white-space: nowrap; }
.stock-table td { white-space: nowrap; }
.stock-table td:nth-child(2) { white-space: normal; min-width: 150px; }
.stock-number { color: var(--success-dark); font-weight: 650; }
.stock-number.critical { color: var(--danger); }
html[data-theme="dark"] .stock-number { color: var(--success); }

.table-action {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-standard);
  border: none;
  cursor: pointer;
  padding: 0;
}
.table-action:hover { transform: translateY(-2px); filter: brightness(0.95); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.table-action svg { display: block; }
html[data-theme="dark"] .table-action { color: var(--primary-light); }
html[data-theme="dark"] .table-action:hover { color: #0f172a; background: var(--primary-light); }

.table-muted { display: block; color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.quantity-entrada { color: var(--success-dark); font-weight: 650; }
.quantity-saida { color: var(--danger); font-weight: 650; }
html[data-theme="dark"] .quantity-entrada { color: var(--success); }

.pager {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-3) var(--space-4) 0;
  flex-wrap: wrap;
}
.pager a, .pager span {
  min-width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 550;
  padding: 0 var(--space-2);
  transition: all var(--duration-fast) var(--ease-standard);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pager .on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.empty {
  text-align: center;
  padding: var(--space-10) var(--space-5);
  color: var(--muted);
}
.empty::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  background-image: radial-gradient(circle at 35% 35%, var(--line-2) 1.5px, transparent 1.5px),
                    radial-gradient(circle at 65% 60%, var(--line-2) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  background-repeat: no-repeat;
  opacity: 0.8;
}
.empty h3 { color: var(--ink); margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.empty h3 + p, .empty p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

/* ---------- FORMULÁRIOS ---------- */
.form-grid { display: grid; gap: var(--space-3); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }

label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--muted);
  margin-bottom: var(--space-1);
  letter-spacing: 0.01em;
}
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  background: var(--surface);
  font-size: var(--text-sm);
  line-height: 1.45;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard);
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 88px; resize: vertical; font-family: inherit; }

input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--muted-2);
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

/* Select custom arrow */
select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.help { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-1); line-height: 1.5; }

/* Search fields */
.stock-search {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.stock-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.stock-search input {
  border: 0;
  width: 200px;
  padding: 8px 10px;
  border-radius: 0;
  box-shadow: none;
}
.stock-search input:focus { box-shadow: none; border: 0; }
.stock-search button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  padding: 0 12px;
  cursor: pointer;
  font-size: var(--text-base);
  transition: color var(--duration-fast) var(--ease-standard);
}
.stock-search button:hover { color: var(--primary); }

.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: flex-end; }
.filters .grow { flex: 1; min-width: 180px; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.inline-form input, .inline-form select { width: auto; min-width: 125px; }

/* ---------- TABS ---------- */
.subnav { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }

.tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.tab, [data-tab] {
  padding: 7px var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  box-shadow: var(--shadow-xs);
  user-select: none;
}
.tab:hover, [data-tab]:hover {
  border-color: var(--muted-2);
  background: var(--surface-hover);
}
.tab.on, [data-tab].on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.14);
}
.subnav .tab { padding: 8px var(--space-4); }

/* ---------- AUTOCOMPLETE ---------- */
.ac-box { position: relative; }
.ac-list, .ac-results {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
  display: none;
  animation: pop-in 140ms var(--ease-enter);
}
.ac-list.show, .ac-results.show { display: block; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-list, .ac-results { animation: none; }
}
.ac-item {
  padding: 9px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.ac-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
html[data-theme="dark"] .ac-item:hover { color: var(--primary-light); }
.ac-item small { color: var(--muted); font-size: var(--text-xs); }
.ac-item.susp { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); }
.ac-item.susp:hover { background: color-mix(in srgb, var(--danger-soft) 60%, var(--danger) 20%); }

/* ---------- TOAST ---------- */
.toast-wrap {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transform-origin: bottom right;
  border: 1px solid rgba(255, 255, 255, 0.10);
  animation: toast-in 260ms var(--ease-enter);
}
.toast.removing { animation: toast-out 200ms var(--ease-exit) forwards; }
.toast::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: rgba(255,255,255,0.35);
}
.toast.ok { background: linear-gradient(135deg, var(--success), var(--success-dark)); }
.toast.erro { background: linear-gradient(135deg, var(--danger), var(--danger-dark)); }
.toast.aviso { background: linear-gradient(135deg, var(--warn), var(--warn-dark)); color: #1c1917; }
.toast.aviso::before { background: rgba(0,0,0,0.18); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation-duration: 1ms; }
  .toast.removing { animation: none; opacity: 0; }
}
.flash-boot { display: none; }

/* ---------- MODAL ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  z-index: 90;
  padding: var(--space-5);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-bg { background: rgba(2, 6, 23, 0.72); }
}
.modal-bg.show {
  display: grid;
  opacity: 1;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: min(560px, 100%);
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform var(--duration-base) var(--ease-emphasized),
              opacity var(--duration-base) var(--ease-standard);
}
.modal-bg.show .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-h {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-h h3 { margin: 0; font-size: var(--text-lg); font-weight: 650; }
.modal-b { padding: var(--space-5); }

/* ---------- PC MAP ---------- */
.pc-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: var(--space-2);
}
.pc-card-shell { display: flex; flex-direction: column; gap: 6px; }
.pc {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  color: #fff;
  border: 0;
  width: 100%;
  padding: 6px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-align: center;
  transition: transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              filter var(--duration-fast) var(--ease-standard);
}
.pc:hover { transform: translateY(-2px) scale(1.04); box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.pc small { font-size: 9.5px; opacity: 0.85; font-weight: 550; }
.pc.disponivel { background: linear-gradient(160deg, #10b981, #059669); }
.pc.em_uso { background: linear-gradient(160deg, #ef4444, #dc2626); }
.pc.manutencao { background: linear-gradient(160deg, #f59e0b, #d97706); color: #1c1917; }

.mini-maintenance {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mini-maintenance input { padding: 4px 6px; font-size: 10px; border-radius: var(--radius-xs); }
.mini-maintenance button { padding: 3px 4px; font-size: 10px; }

/* ---------- CALENDÁRIO ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}
.cal-h {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 750;
  padding: 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cal-d {
  min-height: 100px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  transition: all var(--duration-fast) var(--ease-standard);
}
.cal-d:hover { border-color: var(--primary); background: var(--surface-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cal-d.out { opacity: 0.4; }
.cal-d.today { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-soft); }
html[data-theme="dark"] .cal-d.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.cal-d.selected { background: var(--primary-soft); border-color: var(--primary); }
html[data-theme="dark"] .cal-d.selected { background: var(--primary-soft); }

.cal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}
.cal-d .n {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.dots { display: flex; gap: 3px; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,0.5); }
.dot-at { background: var(--primary); }
.dot-pe { background: var(--purple); }
.dot-ta { background: var(--success); }
.dot-late { background: var(--danger); }

.cal-item {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  line-height: 1.4;
}
html[data-theme="dark"] .cal-item { color: var(--primary-light); }

.calendar-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }
.calendar-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--space-4); margin-bottom: var(--space-5); }
.calendar-side { display: grid; gap: var(--space-4); align-content: start; }

/* ---------- STOCK / WAREHOUSE ---------- */
.warehouse-dashboard { display: grid; gap: var(--space-4); }
.warehouse-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.warehouse-metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-standard);
}
.warehouse-metric:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.warehouse-metric > div { flex: 1; min-width: 0; }
.warehouse-metric span, .warehouse-metric small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}
.warehouse-metric strong {
  display: block;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.15;
  margin: 4px 0;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 750;
  flex: 0 0 46px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.metric-blue .metric-icon { background: #dbeafe; color: #2563eb; }
.metric-green .metric-icon { background: #d1fae5; color: #059669; }
.metric-orange .metric-icon { background: #fef3c7; color: #d97706; }
.metric-purple .metric-icon { background: #ede9fe; color: #7c3aed; }
html[data-theme="dark"] .metric-blue .metric-icon { background: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .metric-green .metric-icon { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .metric-orange .metric-icon { background: #422006; color: #fcd34d; }
html[data-theme="dark"] .metric-purple .metric-icon { background: #2e1065; color: #c4b5fd; }

.warehouse-main-grid { display: grid; grid-template-columns: 1.45fr 0.8fr; gap: var(--space-4); }

.chart-legend { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.chart-legend i {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  margin: 0 5px 0 10px;
}
.legend-in { background: var(--success); }
.legend-out { background: var(--accent); }

.warehouse-bars {
  min-height: 220px;
  padding: var(--space-5) var(--space-5) var(--space-3);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  background: linear-gradient(to top, var(--surface-2), transparent 70%);
  border-bottom: 1px dashed var(--line);
  margin: 0 var(--space-2);
}
.bar-group {
  height: 170px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  position: relative;
}
.bar {
  width: min(20px, 45%);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 10px;
  transition: transform var(--duration-base) var(--ease-standard),
              filter var(--duration-fast) var(--ease-standard);
}
.bar:hover { transform: scaleY(1.04); filter: brightness(1.06); transform-origin: bottom; }
.bar-in { background: linear-gradient(180deg, #34d399, #059669); box-shadow: inset 0 1px 0 rgba(255,255,255,0.24); }
.bar-out { background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: inset 0 1px 0 rgba(255,255,255,0.24); }
.bar-group small {
  position: absolute;
  bottom: -22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.section-list { padding: var(--space-2) var(--space-4) var(--space-3); }
.section-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.section-row:last-child { border-bottom: 0; }
.section-row strong { color: var(--muted); font-size: var(--text-xs); font-weight: 650; }
.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2563eb 18%, transparent);
}
.dot-2 { background: #059669; box-shadow: 0 0 0 3px color-mix(in srgb, #059669 18%, transparent); }
.dot-3 { background: #d97706; box-shadow: 0 0 0 3px color-mix(in srgb, #d97706 18%, transparent); }
.dot-4 { background: #7c3aed; box-shadow: 0 0 0 3px color-mix(in srgb, #7c3aed 18%, transparent); }
.dot-5 { background: #64748b; box-shadow: 0 0 0 3px color-mix(in srgb, #64748b 18%, transparent); }

.warehouse-lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.warehouse-lists .card-h h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); }
.warehouse-lists .card-h a { font-size: var(--text-xs); }
.title-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.icon-in { background: var(--success-soft); color: var(--success-dark); }
.icon-out { background: var(--accent-soft); color: var(--accent-dark); }
.icon-alert { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .icon-in { color: var(--success); }
html[data-theme="dark"] .icon-out { color: var(--accent); }

.compact-list { padding: 2px var(--space-4) var(--space-3); }
.compact-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.compact-row:last-child { border-bottom: 0; }
.compact-row > div { flex: 1; min-width: 0; }
.compact-row b, .compact-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-row b { font-size: var(--text-sm); font-weight: 600; }
.compact-row small { color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.compact-row > strong {
  font-size: var(--text-xs);
  color: var(--success-dark);
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .compact-row > strong { color: var(--success); }
.compact-row.alert-row > strong { color: var(--danger); }
.item-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-dark);
  flex: 0 0 32px;
  font-weight: 700;
}
html[data-theme="dark"] .item-avatar { color: var(--primary-light); }
.alert-avatar { background: var(--danger-soft); color: var(--danger); }

.warehouse-flow { display: grid; gap: var(--space-4); }
.flow-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.flow-form { max-width: 100%; }
.flow-form .card-b { padding-top: var(--space-5); }
.flow-badge {
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.flow-in { color: var(--success-dark); background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 20%, transparent); }
.flow-out { color: #92400e; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
html[data-theme="dark"] .flow-in { color: var(--success); }
html[data-theme="dark"] .flow-out { color: var(--accent); }

/* Stock metrics new */
.stock-dashboard { display: grid; gap: var(--space-4); }
.stock-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); }
.stock-metric {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-standard);
}
.stock-metric:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.stock-metric > div { min-width: 0; flex: 1; }
.stock-metric small, .stock-metric em {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  font-style: normal;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.4;
}
.stock-metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  margin: 3px 0;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.stock-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 750;
  flex: 0 0 42px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.stock-metric.blue .stock-icon { color: #2563eb; background: #dbeafe; }
.stock-metric.green .stock-icon { color: #059669; background: #d1fae5; }
.stock-metric.orange .stock-icon { color: #d97706; background: #fef3c7; }
.stock-metric.red .stock-icon { color: #dc2626; background: #fee2e2; }
.stock-metric.purple .stock-icon { color: #7c3aed; background: #ede9fe; }
html[data-theme="dark"] .stock-metric.blue .stock-icon { background: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .stock-metric.green .stock-icon { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .stock-metric.orange .stock-icon { background: #422006; color: #fcd34d; }
html[data-theme="dark"] .stock-metric.red .stock-icon { background: #450a0a; color: #fca5a5; }
html[data-theme="dark"] .stock-metric.purple .stock-icon { background: #2e1065; color: #c4b5fd; }

.stock-table-card { overflow: hidden; }
.stock-table-head { align-items: center; }
.stock-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.stock-bottom-grid { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: var(--space-4); }
.movement-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
}
.movement-summary > div {
  text-align: center;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-standard);
}
.movement-summary > div:hover { border-color: var(--line-2); background: var(--surface-hover); }
.movement-summary small, .movement-summary strong { display: block; }
.movement-summary small { color: var(--muted); font-size: var(--text-xs); margin-top: 5px; font-weight: 500; }
.movement-summary strong { font-size: var(--text-xl); margin-top: 3px; font-weight: 750; }
.movement-icon {
  width: 30px;
  height: 30px;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.icon-balance { background: var(--primary-soft); color: var(--primary-dark); }
html[data-theme="dark"] .icon-balance { color: var(--primary-light); }

/* ---------- ALUNOS / STUDENT ---------- */
.student-list { padding: 0; }
.student-row { border-bottom: 1px solid var(--line); }
.student-row:last-child { border-bottom: 0; }
.student-row summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  list-style: none;
  transition: background-color var(--duration-fast) var(--ease-standard);
  border-radius: 0;
}
.student-row summary::-webkit-details-marker { display: none; }
.student-row summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-standard);
  flex: 0 0 auto;
}
.student-row[open] summary::after { content: "−"; transform: rotate(0deg); }
.student-row summary:hover { background: var(--surface-hover); }
.student-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: var(--text-base);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
}
html[data-theme="dark"] .student-avatar { color: var(--primary-light); }
.student-main { flex: 1; min-width: 0; }
.student-main b, .student-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-main b { font-size: var(--text-base); font-weight: 600; }
.student-main small, .student-count { color: var(--muted); font-size: var(--text-xs); }
.student-count { white-space: nowrap; font-weight: 500; }
.student-bell {
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 750;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--danger) 16%, transparent);
}
.student-detail { padding: 0 var(--space-5) var(--space-5) 84px; }
.student-detail-grid {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.student-detail-grid > div {
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  flex: 1 1 140px;
  min-width: 0;
}
.student-detail-grid small, .student-detail-grid strong { display: block; }
.student-detail-grid small { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.student-detail-grid strong { font-size: var(--text-xl); margin-top: 3px; font-weight: 750; }
.student-actions { display: grid; gap: var(--space-2); }
.student-actions .inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.student-actions input, .student-actions select { width: auto; min-width: 125px; }
.student-history {
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}
.student-history h3 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
.history-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) 0;
  font-size: var(--text-xs);
}
.history-line:last-child { border-bottom: 0; }
.history-line span:first-child {
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.history-line b { flex: 1; font-weight: 600; color: var(--ink-2); }

/* ---------- STACKED LIST ---------- */
.stacked-list { display: flex; flex-direction: column; gap: 0; }
.stacked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stacked-item:last-child { border-bottom: 0; }
.stacked-item > div { flex: 1 1 200px; min-width: 0; }
.stacked-item b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.stacked-item small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: 2px;
  line-height: 1.45;
}
.stacked-item.danger-line {
  padding-left: var(--space-3);
  border-left: 3px solid var(--danger);
  padding-right: var(--space-3);
  margin: 0 calc(-1 * var(--space-5));
  padding: var(--space-4) calc(var(--space-5) - 3px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--danger-soft) 50%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.stacked-item.danger-line:first-child { margin-top: -8px; }
.stacked-item.danger-line:last-child { border-bottom: 0; margin-bottom: -8px; }

.overview-list { display: flex; flex-direction: column; gap: var(--space-3); }
.overview-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.overview-row b {
  color: var(--ink);
  font-weight: 650;
  font-size: var(--text-sm);
}
.overview-row span { color: var(--muted); line-height: var(--leading-relaxed); }

/* Ficha do aluno */
.student-summary { display: flex; flex-direction: column; gap: var(--space-4); }
.student-summary .student-main {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2);
}
.student-summary .student-main h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.student-summary .student-main p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.student-summary .student-main > div:last-child { flex: 1; min-width: 0; }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.metric-strip > div {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  text-align: center;
}
.metric-strip small { display: block; color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.metric-strip strong { display: block; margin-top: 3px; font-size: var(--text-xl); font-weight: 750; }
.alert-panel {
  padding: var(--space-4);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 4px solid var(--danger);
}
.alert-panel b { color: var(--danger); font-weight: 700; font-size: var(--text-sm); }
.alert-panel span { color: var(--ink-2); font-size: var(--text-sm); }

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--bg);
}
.login-art {
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    linear-gradient(160deg, #0b1a2e 0%, #0e2b3d 55%, #0c2533 100%);
  color: #e2e8f0;
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.login-art::before, .login-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.32;
}
.login-art::before {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.35), transparent 70%);
  bottom: -120px; right: -100px;
}
.login-art::after {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.30), transparent 70%);
  top: -80px; right: 40%;
}
.login-art > div:first-child { max-width: 460px; }
.login-art img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-lg);
  background: #fff;
  padding: 6px;
}
.login-art h1 {
  font-size: 44px;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.1;
  font-family: var(--font-serif);
}
.login-art p {
  opacity: 0.82;
  max-width: 460px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  margin: 0;
}
.login-art > div:last-child {
  opacity: 0.6;
  font-size: var(--text-sm);
  font-weight: 500;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-4);
}

.login-box { display: grid; place-items: center; padding: var(--space-8); background: var(--bg-2); }
.login-card { width: min(440px, 100%); }
.login-theme-toggle {
  position: fixed;
  right: var(--space-5);
  top: var(--space-4);
  z-index: 10;
}
.login-card h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-card p.help { margin-bottom: var(--space-5) !important; }
.cred {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-top: var(--space-5);
  line-height: 1.6;
}

/* ---------- SIDEBAR COLLAPSED ---------- */
html[data-sidebar="closed"] .app { grid-template-columns: var(--side-collapsed) 1fr; }
html[data-sidebar="closed"] .sidebar { padding-left: var(--space-2); padding-right: var(--space-2); }
html[data-sidebar="closed"] .brand { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-sidebar="closed"] .brand-copy { display: none !important; }
html[data-sidebar="closed"] .nav-label,
html[data-sidebar="closed"] .side-foot b,
html[data-sidebar="closed"] .side-foot span { font-size: 0; padding: 0; }
html[data-sidebar="closed"] .side-foot * { visibility: hidden; }
html[data-sidebar="closed"] .brand img { width: 40px; height: 40px; }
html[data-sidebar="closed"] .nav a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  font-size: 0;
}
html[data-sidebar="closed"] .nav a svg { margin: 0; }
html[data-sidebar="closed"] .nav a.active::before { left: -8px; }
html[data-sidebar="closed"] .nav .badge { display: none; }
html[data-sidebar="closed"] .side-foot {
  min-height: 44px;
  padding: var(--space-2);
  background: rgba(255,255,255,0.03);
}

/* ---------- SKELETON LOADING ---------- */
.skeleton {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 5%, transparent), transparent);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  transform: translateX(-50%);
}
@keyframes skeleton-shimmer {
  0% { transform: translateX(-50%); opacity: 0.5; }
  50% { opacity: 1; }
  100% { transform: translateX(50%); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; background: transparent; }
}
.skeleton-text { height: 14px; border-radius: 4px; }
.skeleton-text.sm { height: 11px; }
.skeleton-text.lg { height: 20px; }
.skeleton-text.xl { height: 28px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-md); }
.skeleton-card { height: 160px; border-radius: var(--radius-lg); }

/* ---------- ENTRADA DE ELEMENTOS (ONE-SHOT) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  animation: reveal 320ms var(--ease-enter) forwards;
}
.reveal-delay-1 { animation-delay: 40ms; }
.reveal-delay-2 { animation-delay: 80ms; }
.reveal-delay-3 { animation-delay: 120ms; }
.reveal-delay-4 { animation-delay: 160ms; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

/* ---------- CURSOR (apenas em botões, evitar custom cursor pesado) ---------- */
.btn, .tab, [data-tab], .hub-card, .pc, .cal-d, .nav a, .table-action,
.student-row summary, .ac-item, .back-home, .pager a { cursor: pointer; }

/* ---------- NOME SUSPENSO ---------- */
.name-susp { color: var(--danger); font-weight: 700; }

/* ---------- RESPONSIVIDADE ---------- */
@media (max-width: 1180px) {
  .warehouse-main-grid { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
  .warehouse-lists { grid-template-columns: repeat(2, 1fr); }
  .stock-metrics { grid-template-columns: repeat(3, 1fr); }
  .stock-bottom-grid { grid-template-columns: 1fr; }
  .calendar-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; max-height: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: var(--space-8); min-height: 48vh; }
  .g-2, .g-3, .g-4, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: var(--space-3) var(--space-4);
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions { gap: var(--space-2); width: 100%; }
  .content { padding: var(--space-4); }
  .warehouse-metrics, .warehouse-lists { grid-template-columns: repeat(2, 1fr); }
  .flow-metrics { grid-template-columns: repeat(3, 1fr); }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-hero h1 { font-size: var(--text-3xl); }
  .page-head h1 { font-size: var(--text-2xl); }
  .card-h { padding: var(--space-4); }
  .card-b { padding: var(--space-4); }
  .metric-strip { grid-template-columns: 1fr; }

  html[data-sidebar="closed"] .app { grid-template-columns: 0 1fr; }
  html[data-sidebar="closed"] .sidebar { padding: 0; border: 0; overflow: hidden; max-height: 0; box-shadow: none; }
  html[data-sidebar="closed"] .main { min-width: 0; }
}

@media (max-width: 720px) {
  .stock-metrics { grid-template-columns: 1fr 1fr; }
  .movement-summary { grid-template-columns: repeat(3, 1fr); }
  .calendar-stats { grid-template-columns: 1fr 1fr; }
  .top-actions { justify-content: flex-start; width: 100%; }
  .overview-row { grid-template-columns: 1fr; gap: var(--space-1); }
}

@media (max-width: 600px) {
  .top-actions { width: 100%; justify-content: flex-start; }
  .topbar { flex-direction: column; }
  .top-actions .userchip { order: -1; }
  .theme-label { display: none; }
  .login-art { padding: var(--space-6) var(--space-5); min-height: 44vh; }
  .login-art h1 { font-size: 32px; }
  .login-art img { width: 52px; height: 52px; margin-bottom: var(--space-4); }
  .login-box { padding: var(--space-5); }
  .warehouse-metrics, .warehouse-lists { grid-template-columns: 1fr; }
  .warehouse-bars { padding-left: var(--space-2); padding-right: var(--space-2); }
  .flow-metrics { grid-template-columns: 1fr; }
  .stock-metrics { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .stock-table-head { align-items: flex-start; flex-direction: column; }
  .stock-actions { flex-wrap: wrap; width: 100%; }
  .stock-search { flex: 1 1 100%; }
  .stock-search input { width: 100%; flex: 1; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-card { min-height: 168px; padding: var(--space-5); }
  .hub-hero { padding: var(--space-5) var(--space-4) var(--space-6); }
  .hub-hero h1 { font-size: var(--text-2xl); }
  .content { padding: var(--space-3) var(--space-2); }
  .card-h { padding: var(--space-3) var(--space-4); }
  .card-b { padding: var(--space-4); }
  .page-head h1 { font-size: var(--text-xl); }
  .login-card h2 { font-size: var(--text-2xl); }
  .cal { gap: 4px; }
  .cal-d { min-height: 82px; padding: 6px; }
  .student-detail { padding-left: var(--space-5); padding-right: var(--space-5); }
  .stacked-item.danger-line {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding-left: calc(var(--space-4) - 3px);
    padding-right: var(--space-3);
  }
  .hub-card:hover { transform: none; }
  .btn:hover { transform: none; box-shadow: var(--shadow-xs); }
}

@media (max-width: 420px) {
  .stock-metrics { grid-template-columns: 1fr; }
  .movement-summary { grid-template-columns: 1fr; }
  .calendar-stats { grid-template-columns: 1fr; }
  .clock { display: none; }
}

/* ---------- REDUÇÃO DE ANIMAÇÃO PARA ACESSIBILIDADE ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  body { scroll-behavior: auto; }
}

/* ---------- PRINT / OTIMIZAÇÃO ---------- */
@media print {
  .sidebar, .topbar, .toast-wrap, .top-actions, .subnav, .filters { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .content { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { background: #fff; color: #000; }
}

/* ---------- COMPATIBILIDADE LEGADA (manter classes antigas) ---------- */
html[data-theme="dark"] .btn-ghost { color: var(--ink); }
.app:has(.back-home) .content { max-width: 1480px; }
.app:has(.back-home) .topbar { border-bottom-color: color-mix(in srgb, var(--accent) 28%, transparent); }

.module-page .hub-card { min-height: 0; }

.page-head-rich h1 { font-size: var(--text-3xl); }
@media (max-width: 600px) {
  .page-head-rich h1 { font-size: var(--text-xl); }
}

/* Nome da classe adicional: pill-soft */
.pill-soft {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 550;
}

/* Evitar overflow horizontal em tabelas longas */
.table-wrap table { min-width: 640px; }

/* ============================================================
   MELHORIAS: BUSCA PREMIUM, CARDS DE ALUNOS, FILTROS
   ============================================================ */

/* ---------- SEARCH BAR PREMIUM ---------- */
.search-premium {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-standard);
  width: 100%;
}
.search-premium:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent), var(--shadow-md);
  transform: translateY(-1px);
}
.search-premium .search-icon {
  display: grid;
  place-items: center;
  padding: 0 14px 0 16px;
  color: var(--muted-2);
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}
html[data-theme="dark"] .search-premium .search-icon { color: var(--primary-light); }
.search-premium input {
  border: 0 !important;
  border-radius: 0 !important;
  padding: 13px 14px !important;
  font-size: var(--text-base) !important;
  font-weight: 500;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
}
.search-premium input::placeholder { font-weight: 450; }
.search-premium .search-clear {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  padding: 0 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  transition: color var(--duration-fast);
}
.search-premium .search-clear:hover { color: var(--ink); }
.search-premium.has-value .search-clear { display: inline-grid; place-items: center; }
.search-premium .search-btn {
  border: 0;
  border-radius: 0;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: filter var(--duration-fast);
  letter-spacing: 0.01em;
}
.search-premium .search-btn:hover { filter: brightness(1.06); }

.search-premium .search-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
html[data-theme="dark"] .search-premium .search-count { color: var(--primary-light); }

/* ---------- FILTER CHIPS (filtros rápidos) ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  user-select: none;
}
.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
html[data-theme="dark"] .filter-chip:hover { color: var(--primary-light); }
.filter-chip.on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.16);
}
.filter-chip.on:hover { filter: brightness(1.05); }
.filter-chip .chip-count {
  font-size: 10px;
  opacity: 0.75;
  font-weight: 700;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.18);
}
.filter-chip:not(.on) .chip-count {
  background: var(--bg-2);
  color: var(--muted);
  opacity: 1;
}

/* ---------- STUDENT GRID CARDS ---------- */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.student-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--duration-base) var(--ease-standard);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.student-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity var(--duration-base);
}
.student-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.student-card:hover::before { opacity: 1; }
.student-card.has-warnings::before { background: linear-gradient(90deg, var(--warn), var(--accent)); opacity: 1; }
.student-card.suspended::before { background: linear-gradient(90deg, var(--danger), #ef4444); opacity: 1; }
.student-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.student-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  flex-shrink: 0;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.2);
  letter-spacing: 0.02em;
}
.student-card.has-warnings .student-card-avatar { background: linear-gradient(135deg, var(--warn), var(--warn-dark)); }
.student-card.suspended .student-card-avatar { background: linear-gradient(135deg, var(--danger), var(--danger-dark)); }
.student-card-info { flex: 1; min-width: 0; }
.student-card-info h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-card-meta {
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}
.student-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}
.student-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.student-stat {
  text-align: center;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.student-stat small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.student-stat strong {
  display: block;
  font-size: var(--text-lg);
  font-weight: 750;
  margin-top: 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.student-stat.warn strong { color: var(--warn-dark); }
html[data-theme="dark"] .student-stat.warn strong { color: var(--warn); }
.student-stat.danger strong { color: var(--danger); }
.student-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.student-card-actions .btn { flex: 1; }

/* Search highlight */
.search-highlight {
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 650;
}
html[data-theme="dark"] .search-highlight { background: var(--accent); color: #1c1917; }

/* Result info bar */
.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.result-bar .result-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}
.result-bar .result-info b { color: var(--ink); font-weight: 700; }
.result-bar .view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 2px;
}
.result-bar .view-toggle button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  transition: all var(--duration-fast);
}
.result-bar .view-toggle button.on {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

/* ---------- FUNCIONÁRIOS: layout melhorado ---------- */
.func-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--duration-fast);
}
.func-card:last-child { border-bottom: 0; }
.func-card:hover { background: var(--surface-hover); }
.func-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark, #7c3aed));
  flex-shrink: 0;
  font-size: var(--text-base);
  box-shadow: var(--shadow-sm);
}
.func-info { flex: 1; min-width: 0; }
.func-info b {
  display: block;
  font-size: var(--text-base);
  font-weight: 650;
  color: var(--ink);
}
.func-info small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: 2px;
}
.func-search-box {
  position: relative;
  margin-bottom: var(--space-3);
}
.func-search-box .search-premium { border-radius: var(--radius-lg); }

/* ---------- EMPRÉSTIMO: layout melhorado ---------- */
.loan-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: var(--space-5);
}
.loan-hero {
  padding: var(--space-6);
  background:
    radial-gradient(ellipse at top right, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
    var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  margin-bottom: var(--space-4);
}
.loan-hero h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xl);
  font-family: var(--font-serif);
}
.loan-hero p {
  margin: 0;
  color: var(--muted);
}
.loan-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.loan-quick-item {
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}
.loan-quick-item small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.loan-quick-item strong {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 750;
  margin-top: 4px;
  color: var(--ink);
}

.select-premium {
  position: relative;
}
.select-premium label {
  margin-bottom: 6px;
}
.select-premium select {
  padding-top: 11px;
  padding-bottom: 11px;
  font-weight: 500;
}

/* Quick-select premium para campos maiores */
.form-premium label {
  font-size: 11px;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.form-premium input,
.form-premium select,
.form-premium textarea {
  padding: 11px 14px !important;
  font-size: var(--text-base) !important;
  border-radius: var(--radius-md) !important;
}

/* Rules card mais bonito */
.rules-card .overview-list { gap: var(--space-2); }
.rules-card .overview-row {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-2), transparent);
  position: relative;
  overflow: hidden;
}
.rules-card .overview-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}
.rules-card .overview-row:nth-child(2)::before { background: var(--warn); }
.rules-card .overview-row:nth-child(3)::before { background: var(--danger); }
.rules-card .overview-row:nth-child(4)::before { background: var(--success); }

/* Highlight de busca em tempo real */
.search-highlight {
  background: linear-gradient(transparent 60%, color-mix(in oklab, var(--warn) 55%, transparent) 60%);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
  color: var(--text-1);
}

/* Estilo premium para campos tipo select + autocomplete */
.select-premium { position: relative; display: block; }
.loan-autocomplete {
  width: 100%;
  padding: 11px 14px;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line-2);
  background: var(--surface-1);
  color: var(--text-1);
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.loan-autocomplete:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 15%, transparent);
}

/* ===========================================================
   ALMOXARIFADO PREMIUM — layout novo e organizado
   =========================================================== */
.almox-hero {
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 15%, transparent) 0%, color-mix(in oklab, var(--accent) 10%, transparent) 100%);
  border: 1px solid color-mix(in oklab, var(--primary) 20%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-7);
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
}
.almox-hero::before {
  content: "📦";
  position: absolute;
  right: -10px;
  top: -20px;
  font-size: 220px;
  opacity: .06;
  line-height: 1;
  pointer-events: none;
}
.almox-hero h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-1);
}
.almox-hero p {
  color: color-mix(in oklab, var(--text-2) 80%, transparent);
  margin: 0 0 18px 0;
  font-size: 13.5px;
  max-width: 600px;
}
.almox-hero .hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 10px;
}
.almox-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}
.almox-stat {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.almox-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.almox-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}

/* Busca de alunos do módulo Uniforme */
.uniforme-busca {
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.uniforme-busca > label,
.uniforme-busca label {
  color: var(--text-1);
}
.uniforme-filtros select,
.uniforme-filtros .btn {
  min-height: 42px;
}
.uniforme-autocomplete {
  z-index: 3;
}
.uniforme-autocomplete input[type="search"] {
  min-height: 48px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--ink) 5%, transparent);
}
.uniforme-autocomplete input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 13%, transparent);
}
.sugestoes-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 390px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 12px 30px rgba(20, 30, 50, .16));
}
.sugestoes-header,
.sugestoes-footer {
  padding: 10px 14px;
  color: var(--muted);
  font-size: var(--text-xs);
  background: var(--surface-2);
}
.sugestoes-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.sugestoes-footer {
  border-top: 1px solid var(--line);
}
#lista-sugestoes {
  margin: 0;
  padding: 4px;
  list-style: none;
}
#lista-sugestoes li[role="option"] {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
#lista-sugestoes li[role="option"]:hover,
#lista-sugestoes li[role="option"].ativo {
  background: var(--primary-soft);
}
.sug-avatar,
.aluno-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font-weight: 800;
}
.sug-info { min-width: 0; }
.sug-nome {
  overflow: hidden;
  color: var(--text-1);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug-nome mark {
  padding: 1px 2px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--warn) 45%, transparent);
  color: inherit;
}
.sug-meta {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.sug-chip {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.sug-chip-turma { color: var(--primary); }
.sugestao-vazia {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
}
.aluno-previa {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid color-mix(in oklab, var(--success) 35%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--success) 7%, var(--surface));
}
.aluno-info { min-width: 0; flex: 1; }
.aluno-nome { font-weight: 700; }
.aluno-meta { color: var(--muted); font-size: var(--text-xs); }
.aluno-meta .sep { padding: 0 4px; }
.aluno-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-md);
  color: var(--muted);
}
.ph-avatar { font-size: 20px; }
.ph-titulo { color: var(--text-1); font-weight: 650; }
.ph-sub { margin-top: 2px; font-size: var(--text-xs); }

@media (max-width: 620px) {
  .uniforme-busca { padding: var(--space-3); }
  .uniforme-filtros > div { min-width: 100% !important; }
  .uniforme-filtros .btn { width: 100%; }
  .aluno-previa .btn { padding-inline: 9px; }
}
.almox-stat.blue::before { background: var(--primary); }
.almox-stat.green::before { background: var(--success); }
.almox-stat.orange::before { background: var(--warn); }
.almox-stat.red::before { background: var(--danger); }
.almox-stat.purple::before { background: var(--accent); }
.almox-stat-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  font-size: 18px;
  flex-shrink: 0;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
}
.almox-stat.blue .almox-stat-icon { background: color-mix(in oklab, var(--primary) 14%, transparent); color: var(--primary); }
.almox-stat.green .almox-stat-icon { background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success-dark); }
.almox-stat.orange .almox-stat-icon { background: color-mix(in oklab, var(--warn) 16%, transparent); color: var(--warn-dark); }
.almox-stat.red .almox-stat-icon { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger-dark); }
.almox-stat.purple .almox-stat-icon { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
.almox-stat-info { flex: 1; min-width: 0; }
.almox-stat-info small {
  display: block;
  font-size: 10.5px;
  color: var(--text-2);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.almox-stat-info strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.1;
}
.almox-stat-info em {
  display: block;
  font-size: 10.5px;
  font-style: normal;
  color: var(--text-3);
  margin-top: 2px;
}

/* Filtros do almoxarifado */
.almox-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.almox-filter-bar .search-premium {
  flex: 1 1 400px;
  min-width: 260px;
}

/* Tabela premium do almoxarifado */
.stock-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.stock-table thead th {
  background: linear-gradient(to bottom, color-mix(in oklab, var(--primary) 8%, transparent), transparent);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--line);
}
.stock-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.stock-table tbody tr {
  transition: background .15s ease;
}
.stock-table tbody tr:hover {
  background: color-mix(in oklab, var(--primary) 5%, transparent);
}
.stock-table tbody tr:last-child td { border-bottom: 0; }
.stock-code {
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-block;
}
.product-cell-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 18%, transparent), color-mix(in oklab, var(--accent) 15%, transparent));
  color: var(--primary);
}
.product-meta-name {
  display: block;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}
.product-meta-tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.product-meta-tag.retornavel {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  border-color: transparent;
}
.stock-number {
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--success-dark);
}
.stock-number.critical {
  color: var(--danger);
}
.stock-number.warning {
  color: var(--warn-dark);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip.ok-status {
  background: color-mix(in oklab, var(--success) 15%, transparent);
  color: var(--success-dark);
}
.status-chip.low-status {
  background: color-mix(in oklab, var(--warn) 18%, transparent);
  color: var(--warn-dark);
}
.status-chip.empty-status {
  background: color-mix(in oklab, var(--danger) 15%, transparent);
  color: var(--danger-dark);
}

/* Bottom grid do almoxarifado — seções, movimentação, alertas */
.almox-bottom {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.section-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-1);
  transition: all .15s ease;
}
.section-card-item:hover {
  border-color: var(--line-2);
  transform: translateX(3px);
}
.section-card-item + .section-card-item {
  margin-top: 8px;
}
.section-dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.dot-1 { background: var(--primary); }
.dot-2 { background: var(--success); }
.dot-3 { background: var(--warn); }
.dot-4 { background: var(--danger); }
.dot-5 { background: var(--accent); }
.section-card-item b {
  flex: 1;
  font-size: 13px;
  color: var(--text-1);
}
.section-card-item strong {
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-1);
}
.flow-card-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-2) 0;
}
.flow-mini-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  text-align: center;
}
.flow-mini-card small {
  display: block;
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.flow-mini-card strong {
  font-size: 18px;
  font-weight: 700;
  display: block;
}
.flow-mini-card.in strong { color: var(--success-dark); }
.flow-mini-card.out strong { color: var(--warn-dark); }
.flow-mini-card.balance strong { color: var(--primary); }
.alert-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, color-mix(in oklab, var(--warn) 10%, transparent), transparent);
  border: 1px solid color-mix(in oklab, var(--warn) 25%, transparent);
}
.alert-compact + .alert-compact { margin-top: 8px; }
.alert-avatar-item {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--warn) 20%, transparent);
  color: var(--warn-dark);
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.alert-compact-body { flex: 1; min-width: 0; }
.alert-compact-body b {
  display: block;
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.2;
}
.alert-compact-body small {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}
.alert-compact strong {
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 14px;
  color: var(--warn-dark);
  font-weight: 700;
}

/* Tela de movimentação */
.mov-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.mov-hero-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
}
.mov-hero-card.type-in { border-top: 3px solid var(--success); }
.mov-hero-card.type-out { border-top: 3px solid var(--warn); }
.mov-hero-head {
  padding: 18px 22px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--success) 8%, transparent), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.type-out .mov-hero-head {
  background: linear-gradient(135deg, color-mix(in oklab, var(--warn) 10%, transparent), transparent);
}
.mov-hero-title h2 {
  margin: 0 0 3px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mov-hero-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.mov-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}
.mov-badge.in {
  background: color-mix(in oklab, var(--success) 20%, transparent);
  color: var(--success-dark);
}
.mov-badge.out {
  background: color-mix(in oklab, var(--warn) 22%, transparent);
  color: var(--warn-dark);
}
.mov-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.mov-mini-stats > div {
  text-align: center;
}
.mov-mini-stats small {
  display: block;
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mov-mini-stats strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

/* Histórico premium */
.hist-filters-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.hist-table-row td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.hist-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.hist-type-pill.entrada {
  background: color-mix(in oklab, var(--success) 15%, transparent);
  color: var(--success-dark);
}
.hist-type-pill.saida {
  background: color-mix(in oklab, var(--warn) 18%, transparent);
  color: var(--warn-dark);
}
.hist-qtd {
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-weight: 700;
  font-size: 14px;
}
.hist-qtd.entrada { color: var(--success-dark); }
.hist-qtd.saida { color: var(--warn-dark); }

/* Cadastros do almoxarifado */
.cadastro-form-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.cadastro-form-card .card-h {
  padding: 14px 20px;
  background: linear-gradient(to right, var(--surface-2), transparent);
  border-bottom: 1px solid var(--line);
}
.list-cadastro-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.list-cadastro-item:hover {
  background: color-mix(in oklab, var(--primary) 4%, transparent);
}
.list-cadastro-item:last-child {
  border-bottom: 0;
}

/* Seletor rápido de seção para index do almoxarifado */
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1.5px solid var(--line);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.section-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.section-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.section-chip-count {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
}
.section-chip.on .section-chip-count {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* Responsividade do Almoxarifado */
@media (max-width: 1180px) {
  .almox-stats { grid-template-columns: repeat(3, 1fr); }
  .almox-bottom { grid-template-columns: 1fr 1fr; }
  .mov-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .almox-hero { padding: 20px; }
  .almox-hero h1 { font-size: 22px; }
  .almox-stats { grid-template-columns: repeat(2, 1fr); }
  .almox-bottom { grid-template-columns: 1fr; }
  .mov-mini-stats { grid-template-columns: 1fr 1fr; }
  .flow-card-group { grid-template-columns: 1fr; }
  .almox-filter-bar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .almox-stats { grid-template-columns: 1fr; }
  .mov-mini-stats { grid-template-columns: 1fr; }
  .almox-hero::before { display: none; }
}

/* Responsividade das novas classes gerais */
@media (max-width: 1100px) {
  .loan-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .student-grid { grid-template-columns: 1fr 1fr; }
  .loan-quick { grid-template-columns: 1fr 1fr; }
  .search-premium { flex-wrap: wrap; }
  .search-premium .search-icon { display: none; }
  .search-premium .search-count { border-left: 0; border-top: 1px solid var(--line); width: 100%; justify-content: center; padding: 8px; }
}
@media (max-width: 520px) {
  .student-grid { grid-template-columns: 1fr; }
  .loan-quick { grid-template-columns: 1fr; }
  .result-bar { flex-direction: column; align-items: stretch; }
}

/* ---------- AJUSTES EXTRAS DE RESPONSIVIDADE E CONSISTÊNCIA ---------- */
.almox-filter-bar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}
.almox-filter-bar .filters { margin: 0; }
.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--space-4) var(--space-3);
}
.calendar-actions .inline-form {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
#cal-event-modal .modal-b,
#almox-edit-modal .modal-b {
  max-height: 82vh;
  overflow-y: auto;
}
@media (max-width: 720px) {
  .calendar-actions { padding-left: var(--space-3); padding-right: var(--space-3); }
  #cal-event-modal .modal,
  #almox-edit-modal .modal { margin: var(--space-3); width: calc(100% - var(--space-6)); }
  .search-premium .search-btn { width: 100%; border-top: 1px solid var(--line); border-radius: 0; }
}
@media (max-width: 480px) {
  .almox-filter-bar > div:last-child { width: 100%; }
  .almox-filter-bar select[name=ordenar] { flex: 1; min-width: 0; width: 100%; }
  .almox-filter-bar > div:last-child .btn { flex: 1; text-align: center; }
  .cal-strong { overflow-x: auto; }
}

/* ===========================================================
   COORDENAÇÃO — Busca e Seleção de Alunos Premium
   =========================================================== */
.aluno-search-wrapper {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--primary) 6%, transparent) 0%,
    var(--surface) 45%);
  border: 1px solid color-mix(in oklab, var(--primary) 18%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}
.aluno-search-wrapper::before {
  content: "👨‍🎓";
  position: absolute;
  right: -6px;
  top: -14px;
  font-size: 110px;
  opacity: .05;
  line-height: 1;
  pointer-events: none;
}

.aluno-search-head {
  display: flex;
  gap: var(--space-5);
  align-items: flex-end;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.aluno-search-head > div:first-child {
  flex: 1 1 300px;
  min-width: 0;
}
.aluno-search-head label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.aluno-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.aluno-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  pointer-events: none;
  z-index: 1;
}
.aluno-search-input-wrap input[type="search"] {
  padding-left: 42px !important;
  padding-right: 42px !important;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  transition: all var(--duration-base) var(--ease-standard);
  font-size: 14.5px !important;
}
.aluno-search-input-wrap input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 14%, transparent);
  outline: none;
}
.aluno-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  color: var(--muted);
  border: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-standard);
  z-index: 2;
}
.aluno-clear-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
  transform: translateY(-50%) scale(1.08);
}

.aluno-search-tips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-xs);
  min-width: 200px;
}
.aluno-search-tips .tip-label {
  font-weight: 800;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10px;
}
.aluno-search-tips .tip-text {
  color: var(--muted);
  line-height: 1.5;
}

.aluno-count-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-2);
}
.aluno-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

.aluno-select-block {
  position: relative;
}
.aluno-select-list {
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 4px 0 !important;
  outline: none;
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard);
}
.aluno-select-list:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 14%, transparent);
}
.aluno-select-list option {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
}
.aluno-select-list option:last-child {
  border-bottom: 0;
}
.aluno-select-list option:hover,
.aluno-select-list option:checked {
  background: color-mix(in oklab, var(--primary) 14%, transparent);
  color: var(--ink);
}
.aluno-select-list option:first-child {
  color: var(--muted);
  font-style: italic;
}

.aluno-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-md);
}
.aluno-empty-state svg {
  color: var(--muted-2);
  opacity: .7;
}
.aluno-empty-state p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
}
.aluno-empty-state small {
  font-size: var(--text-xs);
  color: var(--muted-2);
}

@media (max-width: 720px) {
  .aluno-search-wrapper { padding: var(--space-4); }
  .aluno-search-head {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .aluno-search-tips { min-width: 0; }
  .aluno-select-list option { padding: 10px 12px; }
}



@keyframes autoPickPulse {
  0%   { box-shadow: 0 0 0 0    color-mix(in oklab, var(--primary) 45%, transparent); border-color: var(--primary); }
  70%  { box-shadow: 0 0 0 10px color-mix(in oklab, var(--primary) 0%,  transparent); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 0    color-mix(in oklab, var(--primary) 0%,  transparent); border-color: var(--line-2); }
}
.aluno-select-list.auto-picked {
  animation: autoPickPulse 1.1s ease-out 1;
}

.auto-picked-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: var(--space-3);
  background: color-mix(in oklab, var(--success) 14%, transparent);
  color: var(--success-dark);
  border: 1px solid color-mix(in oklab, var(--success) 30%, transparent);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  animation: autoPickPop 380ms cubic-bezier(0.2, 0, 0, 1) both;
}
.auto-picked-info b {
  color: var(--ink-2);
  font-weight: 750;
}
@keyframes autoPickPop {
  0%   { opacity: 0; transform: translateY(-4px) scale(.98); }
  100% { opacity: 1; transform: translateY(0)     scale(1); }
}

/* ---------- BALÃO FLUTUANTE: SOLICITAR REABASTECIMENTO (ALMOXARIFADO) ---------- */
.reb-fab {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px 12px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: var(--shadow-xl), 0 10px 24px -10px color-mix(in oklab, var(--primary) 65%, transparent);
  transition: transform var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              filter var(--duration-base) var(--ease-standard);
  animation: reb-fab-in 340ms var(--ease-emphasized) both;
  max-width: calc(100vw - 32px);
  -webkit-tap-highlight-color: transparent;
}
.reb-fab:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-xl), 0 16px 30px -10px color-mix(in oklab, var(--primary) 75%, transparent);
}
.reb-fab:active { transform: translateY(-1px) scale(.985); }
.reb-fab:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary) 45%, transparent);
  outline-offset: 3px;
}
.reb-fab-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.reb-fab-icon svg { width: 19px; height: 19px; display: block; }
.reb-fab-label { white-space: nowrap; }

@keyframes reb-fab-in {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Avisos (toasts) sobem para não cobrir o balão */
.reb-fab ~ .toast-wrap { bottom: calc(var(--space-5) + 76px); }

@media (max-width: 640px) {
  .reb-fab { right: var(--space-4); bottom: var(--space-4); padding: 11px; }
  .reb-fab-label { display: none; }
  .reb-fab ~ .toast-wrap { bottom: calc(var(--space-4) + 66px); }
}

@media (prefers-reduced-motion: reduce) {
  .reb-fab { animation: none; }
  .reb-fab:hover { transform: none; }
}
