:root {
  --primary: #E31E24;
  --primary-dark: #b8161b;
  --accent: #F5C518;
  --accent-dark: #d4a812;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #F5C518;
  --info: #F5C518;
  --dark: #1a1a1a;
  --light: #f8f9fa;
  --gray: #6c757d;
  --border: #dee2e6;

  /* Tema escuro (padrão) */
  --bg-body: #121212;
  --bg-content: #1e1e1e;
  --bg-card: #252525;
  --bg-card-header: #2a2a2a;
  --bg-table-hover: #2f2f2f;
  --bg-input: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #777;
  --border-color: #333;
  --shadow-color: rgba(0,0,0,0.3);
}

[data-theme="light"] {
  --bg-body: #f0f2f5;
  --bg-content: #ffffff;
  --bg-card: #ffffff;
  --bg-card-header: #ffffff;
  --bg-table-hover: #f8f9fa;
  --bg-input: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #999;
  --border-color: #dee2e6;
  --shadow-color: rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  transition: background-color 0.3s, color 0.3s;
}

/* === VIDEO BACKGROUND GLOBAL (todas as abas admin) === */
.page-bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}
body.video-bg {
  background: #0a0a0a !important;
  --bs-body-bg: #0a0a0a;
  --bs-card-bg: rgba(20,20,20,0.72);
  --bs-card-border-color: rgba(255,255,255,0.08);
  --bs-list-group-bg: rgba(20,20,20,0.72);
  --bs-table-bg: transparent;
}
body.video-bg .sidebar { background: rgba(18,18,18,0.88) !important; backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); }
body.video-bg .main-content { background: transparent !important; }
body.video-bg .card { background-color: rgba(20,20,20,0.72) !important; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border-color: rgba(255,255,255,0.08) !important; }
body.video-bg .card-body { background: transparent !important; }
body.video-bg .card-header { background: rgba(25,25,25,0.85) !important; }
body.video-bg .stat-card { background-color: rgba(20,20,20,0.72) !important; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border-color: rgba(255,255,255,0.08) !important; }
body.video-bg .datetime-bar { background: rgba(20,20,20,0.72) !important; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
body.video-bg .navbar { background: rgba(8,8,8,0.92) !important; backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
body.video-bg .navbar-slideshow { display: none !important; }
body.video-bg .navbar::before { display: none !important; }
/* Catch-all: forçar transparência em layouts (não em elementos interativos) */
body.video-bg .row,
body.video-bg .col-md-10,
body.video-bg .col-md-6,
body.video-bg .col-md-4,
body.video-bg .container-fluid,
body.video-bg .low-stock-carousel,
body.video-bg .chart-container,
body.video-bg .card-body,
body.video-bg .empty-state,
body.video-bg .table,
body.video-bg .table > :not(caption) > * > * { background-color: transparent !important; }

/* Elementos interativos e list-group com fundo escuro legível */
body.video-bg .list-group-item { background-color: rgba(20,20,20,0.75) !important; border-color: rgba(255,255,255,0.08) !important; color: #f0f0f0 !important; }
body.video-bg .list-group-item:hover { background-color: rgba(30,30,30,0.85) !important; }
body.video-bg .form-control,
body.video-bg .form-select,
body.video-bg input,
body.video-bg select,
body.video-bg textarea { background-color: rgba(20,20,20,0.6) !important; color: #f0f0f0 !important; border-color: rgba(255,255,255,0.15) !important; }
body.video-bg .form-control::placeholder,
body.video-bg input::placeholder,
body.video-bg textarea::placeholder { color: rgba(255,255,255,0.4) !important; }
body.video-bg .form-control:focus,
body.video-bg .form-select:focus,
body.video-bg input:focus,
body.video-bg select:focus,
body.video-bg textarea:focus { background-color: rgba(25,25,25,0.75) !important; border-color: rgba(231,76,60,0.4) !important; box-shadow: 0 0 0 2px rgba(231,76,60,0.15) !important; }

/* Request cards e badges escuros */
body.video-bg .request-card { background: rgba(20,20,20,0.75) !important; border-color: rgba(255,255,255,0.1) !important; }
body.video-bg .request-card strong,
body.video-bg .request-card span { color: #f0f0f0; }

/* Nav tabs escuras */
body.video-bg .nav-tabs { border-bottom-color: rgba(255,255,255,0.1) !important; }
body.video-bg .nav-tabs .nav-link { color: rgba(255,255,255,0.6) !important; border-color: transparent !important; }
body.video-bg .nav-tabs .nav-link.active { background-color: rgba(20,20,20,0.75) !important; color: #fff !important; border-color: rgba(255,255,255,0.1) rgba(255,255,255,0.1) transparent !important; }
body.video-bg .nav-tabs .nav-link:hover:not(.active) { color: #fff !important; border-color: rgba(255,255,255,0.08) !important; }

@media (max-width: 768px) {
  body.video-bg .sidebar,
  body.video-bg .card,
  body.video-bg .stat-card,
  body.video-bg .datetime-bar,
  body.video-bg .navbar {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* Page transition */
body {
  animation: pageFadeIn 0.4s ease-out;
}
body.page-leaving {
  animation: pageSlideOut 0.3s ease-in forwards;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* Page transition overlay */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 50%, #1a1a1a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.page-transition-overlay .transition-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: transitionPulse 1s ease-in-out infinite;
  margin-bottom: 18px;
}
.page-transition-overlay .transition-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: transitionSpin 0.8s linear infinite;
  margin-bottom: 14px;
}
.page-transition-overlay .transition-text {
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1px;
  animation: transitionDots 1.5s steps(4, end) infinite;
}
@keyframes transitionSpin {
  to { transform: rotate(360deg); }
}
@keyframes transitionPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(227,30,36,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(227,30,36,0.2); }
}
@keyframes transitionDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* Welcome loading screen */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a0a0a 40%, #0d0d0d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.welcome-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.welcome-overlay .welcome-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: welcomeLogoIn 0.6s ease-out, transitionPulse 2s ease-in-out 0.6s infinite;
  margin-bottom: 24px;
}
.welcome-overlay .welcome-title {
  color: #f0f0f0;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  animation: welcomeFadeUp 0.6s ease-out 0.3s both;
}
.welcome-overlay .welcome-subtitle {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 30px;
  animation: welcomeFadeUp 0.6s ease-out 0.5s both;
}
.welcome-overlay .welcome-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  animation: welcomeFadeUp 0.6s ease-out 0.7s both;
}
.welcome-overlay .welcome-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.15s linear;
}
.welcome-overlay .welcome-message {
  color: #888;
  font-size: 0.8rem;
  margin-top: 16px;
  animation: welcomeFadeUp 0.6s ease-out 0.9s both;
}
@keyframes welcomeLogoIn {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes welcomeFadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Navbar */
.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
}
.navbar-brand img {
  border: 2px solid var(--accent);
}
.navbar-brand .brand-text {
  display: inline;
}
.navbar {
  background: linear-gradient(180deg, rgba(12,12,12,0.98), rgba(8,8,8,0.92)) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent, #E31E24, #F5C518, #E31E24, transparent) 1;
  padding: 14px 0;
}
.nav-title {
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 40%, #F5C518 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
.nav-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245,197,24,0.6);
  margin-top: 4px;
  position: relative;
  padding: 0 24px;
}
.nav-subtitle::before,
.nav-subtitle::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227,30,36,0.6));
}
.nav-subtitle::before {
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(227,30,36,0.6));
}
.nav-subtitle::after {
  right: 0;
  background: linear-gradient(270deg, transparent, rgba(227,30,36,0.6));
}

/* Export category select compacto */
.export-category-select {
  width: auto !important;
  min-width: 120px;
  max-width: 160px;
  font-size: 0.8rem;
  padding: 0.25rem 1.8rem 0.25rem 0.5rem;
}

/* Sidebar */
.sidebar {
  min-height: calc(100vh - 56px);
  background: #1a1a1a;
  border-right: none;
  box-shadow: 2px 0 15px rgba(0,0,0,0.2);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
}
.sidebar-nav {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sidebar-logout-item {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar .nav-link.sidebar-logout {
  color: rgba(239, 68, 68, 0.8);
}
.sidebar .nav-link.sidebar-logout:hover {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.sidebar .nav-link.sidebar-logout svg {
  opacity: 0.8;
}
.sidebar .nav-link {
  color: rgba(255,255,255,0.65);
  padding: 11px 16px;
  border-radius: 8px;
  margin: 2px 0;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar .nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.sidebar .nav-link span {
  white-space: nowrap;
}
.sidebar .nav-link:hover {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar .nav-link:hover svg {
  opacity: 1;
}
.sidebar .nav-link.active {
  background: var(--primary);
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(227, 30, 36, 0.35);
}
.sidebar .nav-link.active svg {
  opacity: 1;
}

/* Cards */
.stat-card {
  border: none;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-color);
}
.stat-card .card-body {
  padding: 1.25rem;
}
.stat-card .stat-icon {
  font-size: 2rem;
  opacity: 0.9;
}
.stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cards menores */
.stat-card-sm .stat-icon {
  font-size: 1.4rem;
}
.stat-card-sm .stat-number {
  font-size: 1.3rem;
}
.stat-card-sm .stat-label {
  font-size: 0.75rem;
}

/* Collapsible header */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.collapsible-header .collapse-chevron {
  transition: transform 0.3s;
}
.collapsible-header[aria-expanded="true"] .collapse-chevron {
  transform: rotate(180deg);
}

/* Relógio ao vivo */
.live-clock {
  font-weight: 700;
  font-size: inherit;
  color: var(--success);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Barra data/hora */
.datetime-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 1px 6px var(--shadow-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.datetime-item {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.datetime-sep {
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Badge online */
.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse-dot 1.5s ease-in-out infinite;
  box-shadow: 0 0 6px var(--success);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--success); }
  50% { opacity: 0.3; box-shadow: 0 0 2px var(--success); }
}

.card-primary { border-left: 4px solid var(--primary); }
.card-success { border-left: 4px solid var(--success); }
.card-danger { border-left: 4px solid var(--danger); }
.card-warning { border-left: 4px solid var(--accent); }
.card-info { border-left: 4px solid var(--accent); }

/* Card genérico */
.card {
  border: none;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: background-color 0.3s;
  color: var(--text-primary);
}
.card-body {
  color: var(--text-primary);
}
.card-header {
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 12px 12px 0 0 !important;
}

/* Bootstrap overrides para tema escuro */
.list-group-item {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.list-group-item:hover {
  background-color: var(--bg-table-hover);
}

/* Agenda de tarefas */
.task-item .task-check {
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.task-item.task-completed {
  opacity: 0.6;
}
.text-muted {
  color: var(--text-muted) !important;
}
strong, b {
  color: var(--text-primary);
}
.form-text {
  color: var(--text-muted) !important;
}
.form-check-label {
  color: var(--text-primary);
}
p {
  color: var(--text-primary);
}
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}
.table-active {
  --bs-table-active-bg: var(--bg-card-header);
  --bs-table-active-color: var(--text-primary);
}

/* Tabelas */
.table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}
.table td {
  vertical-align: middle;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--bg-table-hover);
}

/* Badges */
.badge-entrada {
  background-color: var(--success);
  color: white;
}
.badge-saida {
  background-color: var(--danger);
  color: white;
}
.badge-low-stock {
  color: white;
  animation: pulse 2s infinite;
}
.badge-low-stock.is-zero {
  background-color: #dc3545;
}
.badge-low-stock.is-low {
  background-color: #c98a00;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 40%, #3a1a1a 100%);
  position: relative;
  overflow: hidden;
}
.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(227, 30, 36, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(245, 197, 24, 0.1) 0%, transparent 50%);
  pointer-events: none;
}
.login-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  opacity: 0.4;
  pointer-events: none;
}
.login-card {
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  border: none;
  overflow: hidden;
}
.login-card::before,
.login-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #E31E24, #F5C518, #E31E24, transparent);
  z-index: 2;
}
.login-card::before { top: 0; border-radius: 20px 20px 0 0; }
.login-card::after { bottom: 0; border-radius: 0 0 20px 20px; }
.login-card .login-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid #F5C518;
  box-shadow: 0 4px 15px rgba(245, 197, 24, 0.3);
}
.login-card h2 {
  color: #f0f0f0;
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.login-card h2 .brand-highlight {
  color: #E31E24;
}
.login-card .subtitle {
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.login-card .form-label {
  color: #ccc;
}
.login-card .form-control {
  border-radius: 8px;
  padding: 10px 15px;
  border: 1.5px solid #3a3a3a;
  background: #1a1a1a;
  color: #f0f0f0;
  transition: border-color 0.2s;
}
.login-card .form-control::placeholder {
  color: #666;
}
.login-card .form-control:focus {
  border-color: #E31E24;
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.12);
}
.login-card .btn-primary {
  border-radius: 8px;
  padding: 10px;
  font-weight: 700;
  font-size: 1rem;
  background: #E31E24;
  border-color: #E31E24;
  letter-spacing: 0.3px;
}
.login-card .btn-primary:hover {
  background: #c4181d;
  border-color: #c4181d;
  box-shadow: 0 4px 15px rgba(227, 30, 36, 0.35);
}
.login-card #toggleForm {
  color: #E31E24;
  font-weight: 500;
}
.login-card #toggleForm:hover {
  color: #c4181d;
}
.login-card .separator-line {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 16px 0;
  position: relative;
}
.login-card .separator-line::after {
  content: 'ou';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #242424;
  padding: 0 12px;
  font-size: 0.8rem;
  color: #666;
}
.visitor-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Usuários Online */
.online-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
}
.online-user-item:last-child { border-bottom: none; }
.online-user-item:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .online-user-item { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .online-user-item:hover { background: rgba(0,0,0,0.02); }

.online-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.online-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
  flex-shrink: 0;
}
.online-user-icon { font-size: 1rem; flex-shrink: 0; }
.online-user-name {
  font-weight: 600;
  font-size: 0.88rem;
}
.online-user-role {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.online-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: #888;
  flex-shrink: 0;
}
.online-user-page { white-space: nowrap; }
.online-user-ago { white-space: nowrap; opacity: 0.7; }

/* Histórico de Acessos */
.access-history-scroll {
  max-height: 280px;
  overflow-y: auto;
}
.access-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.85rem;
}
.access-history-item:last-child { border-bottom: none; }
[data-theme="light"] .access-history-item { border-bottom-color: rgba(0,0,0,0.06); }
.access-history-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.access-history-icon { font-size: 0.95rem; flex-shrink: 0; }
.access-history-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.access-history-role {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.access-history-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #888;
  flex-shrink: 0;
}
.access-history-action {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
}
[data-theme="light"] .access-history-action { background: rgba(0,0,0,0.05); }
.access-history-time { white-space: nowrap; opacity: 0.8; }
.access-history-scroll::-webkit-scrollbar { width: 4px; }
.access-history-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
[data-theme="light"] .access-history-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

/* Botões */
.btn {
  border-radius: 8px;
  font-weight: 500;
}
.btn-primary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #e0e0e0;
}
.btn-primary:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

/* Movimentação rápida */
.quick-action-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}
.quick-action-btn:hover {
  transform: scale(1.1);
}
.btn-entrada {
  background-color: var(--success);
  color: white;
}
.btn-saida {
  background-color: var(--danger);
  color: white;
}

/* Botões de ações da tabela */
.action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.action-btn svg {
  flex-shrink: 0;
}

.action-btn-entrada {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.action-btn-entrada:hover {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.35);
}

.action-btn-saida {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.action-btn-saida:hover {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35);
}

.action-btn-edit {
  background-color: #fef9e7;
  color: #7d6608;
  border: 1px solid #f5e6a3;
  padding: 6px 8px;
}
.action-btn-edit:hover {
  background-color: #F5C518;
  color: #1a1a1a;
  border-color: #F5C518;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(245, 197, 24, 0.4);
}

.action-btn-delete {
  background-color: #fce4e4;
  color: #a71d2a;
  border: 1px solid #f5c6cb;
  padding: 6px 8px;
}
.action-btn-delete:hover {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35);
}

/* Search */
.search-box {
  position: relative;
}
.search-box input {
  padding-left: 40px;
  border-radius: 20px;
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-state .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

/* Botão de ações (3 pontos) */
.btn-action-dots {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0;
  width: 24px;
  height: 24px;
  min-width: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-action-dots:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
[data-theme="light"] .btn-action-dots:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* ===== CATEGORY SUMMARY ===== */
/* Category color palette */
.cat-color-0 { color: #3B82F6; }
.cat-color-1 { color: #EC4899; }
.cat-color-2 { color: #F59E0B; }
.cat-color-3 { color: #EF4444; }
.cat-color-4 { color: #8B5CF6; }
.cat-color-5 { color: #10B981; }
.cat-color-6 { color: #F97316; }
.cat-color-7 { color: #06B6D4; }
.cat-color-8 { color: #84CC16; }
.cat-color-9 { color: #E11D48; }

.category-name-colored {
  font-weight: 700;
  font-size: 0.85rem;
}

/* Period filter buttons */
.period-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.category-summary-grid {
  display: flex;
  flex-direction: column;
}
.cat-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  transition: background 0.18s, border-color 0.18s;
  position: relative;
}
.cat-summary-item:last-of-type {
  border-bottom: none;
}
.cat-summary-item:hover {
  background: var(--bg-table-hover);
  border-bottom-color: rgba(255,255,255,0.18);
}
.cat-summary-item:hover .cat-expand-arrow {
  background: rgba(255,255,255,0.15);
  transform: scale(1.15);
}
.cat-summary-color {
  width: 4px;
  height: 36px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cat-expand-arrow {
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.15);
}
.cat-products-detail {
  background: rgba(0,0,0,0.18);
  border-bottom: 2px solid rgba(255,255,255,0.06);
}
.cat-summary-info {
  flex: 1;
  min-width: 0;
}
.cat-summary-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-summary-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.cat-summary-qty {
  text-align: right;
  flex-shrink: 0;
}
.cat-summary-qty strong {
  font-size: 1.1rem;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}
.cat-summary-qty span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cat-summary-total {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card-header);
  border-top: 2px solid var(--border-color);
  border-radius: 0 0 12px 12px;
}

/* ===== MOVEMENTS LIST ===== */
.movements-list {
  max-height: 600px;
  overflow-y: auto;
  padding: 0;
}
.mov-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.mov-item:last-child {
  border-bottom: none;
}
.mov-item:hover {
  background: var(--bg-table-hover);
}
.mov-item.mov-entrada {
  border-left-color: var(--success);
}
.mov-item.mov-saida {
  border-left-color: var(--danger);
}
.mov-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.mov-item-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mov-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.mov-item-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mov-item-product {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.mov-item-qty {
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.mov-entrada .mov-item-qty {
  color: var(--success);
}
.mov-saida .mov-item-qty {
  color: var(--danger);
}
.mov-item-qty small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 2px;
}
.mov-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mov-item-user {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.mov-item-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

#currentStock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(40, 167, 69, 0.14);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: #67df8b !important;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 0.82rem !important;
  font-weight: 700;
}

.product-name-highlight {
  color: #28a745;
  font-weight: 800;
}

#productsFiltersCard {
  z-index: 20;
}

.stock-row {
  cursor: pointer;
}

.stock-row:hover {
  background: var(--bg-table-hover);
}

.stock-actions {
  min-width: 210px;
}

/* Responsivo */

/* Desktop: esconder toggler (sidebar sempre visível) */
.navbar-toggler {
  display: none !important;
}

@media (max-width: 768px) {
  /* Container e layout */
  .container-fluid {
    padding: 0;
  }
  
  /* Navbar - Hero Banner Slideshow Mobile */
  .navbar {
    padding: 0;
    position: relative;
    min-height: 130px;
    background: #1a1a1a !important;
    border-bottom: 3px solid var(--primary);
    overflow: hidden;
  }
  /* Video-bg: navbar compacto no mobile */
  body.video-bg .navbar {
    min-height: auto !important;
    padding: 10px 0 !important;
    background: rgba(18,18,18,0.88) !important;
    overflow: visible;
  }
  body.video-bg .navbar-slideshow { display: none !important; }
  body.video-bg .navbar::before { display: none !important; }
  body.video-bg .navbar > .container-fluid { min-height: auto !important; padding: 0 14px !important; }
  body.video-bg .navbar-brand { display: flex !important; align-items: center; }
  .navbar-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
  }
  .navbar-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
  }
  .navbar-slideshow .slide.active {
    opacity: 1;
  }
  .navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.35) 50%,
      rgba(0, 0, 0, 0.65) 100%
    );
    z-index: 1;
  }
  .navbar > .container-fluid {
    position: relative;
    z-index: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    min-height: 110px;
  }
  .navbar-brand {
    display: none;
  }
  .navbar-toggler {
    display: flex !important;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: 16px;
    top: auto;
    z-index: 1100;
    width: auto;
    height: 48px;
    border-radius: 24px;
    border: 1px solid rgba(227,30,36,0.4);
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(227,30,36,0.15);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
    padding: 0 18px;
    align-items: center;
    gap: 8px;
  }
  .navbar-toggler::after {
    content: 'Menu';
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
  }
  .navbar-toggler:active {
    transform: translateX(-50%) scale(0.95);
    border-color: rgba(227,30,36,0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  }
  .navbar-toggler .navbar-toggler-icon {
    width: 1.1em;
    height: 1.1em;
    filter: brightness(0) invert(1);
  }
  .navbar-collapse {
    display: none !important;
  }
  
  /* Sidebar - oculto por padrão, drawer ao abrir */
  .sidebar {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: -90vh;
    width: auto;
    max-width: none;
    height: auto;
    max-height: 72vh;
    background: #1a1a1a;
    border-right: 1px solid var(--border-color);
    z-index: 999;
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    overflow-y: auto;
    padding-top: 0;
    min-height: 0;
    border-bottom: none !important;
    border-radius: 16px;
    opacity: 0;
  }
  
  /* Sidebar aberto */
  .sidebar.show {
    bottom: 74px;
    opacity: 1;
  }
  
  /* Overlay para fechar sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.35);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }
  
  /* Layout principal */
  .row {
    margin: 0;
  }
  
  /* Main content - full width em mobile */
  .main-content {
    padding: 1rem !important;
    width: 100%;
    max-width: 100%;
  }

  #productsFiltersCard {
    top: 8px;
  }
  
  /* Cards e conteúdo */
  .card {
    margin-bottom: 1rem;
    border: none;
  }
  
  /* Grid de stat cards - 1 coluna */
  .row > .col-md-3, .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Stat cards */
  .stat-card {
    padding: 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
  }
  .stat-card .stat-label {
    font-size: 0.8rem;
  }
  .stat-card .stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.5rem;
  }
  .stat-card .stat-icon {
    font-size: 1.8rem;
  }
  
  /* Tabelas responsivas */
  .table {
    font-size: 0.9rem;
  }
  .table thead {
    display: none;
  }
  .table tbody, .table tr, .table td {
    display: block;
    width: 100%;
  }
  .table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-card);
  }
  .table td {
    padding: 0.75rem 0;
    text-align: right;
    position: relative;
    padding-left: 40%;
  }
  .table td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
  }
  
  /* Action buttons - wrap em mobile */
  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .action-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.7rem;
    gap: 3px;
  }
  .action-btn:nth-child(n+3) {
    grid-column: span 1;
  }
  
  /* Botões - maiores em mobile */
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 8px;
    font-weight: 500;
  }
  .btn-primary, .btn-danger {
    padding: 0.85rem 1.5rem;
  }
  
  /* Action buttons */
  .action-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 1.25rem;
  }
  .form-control, .form-select {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  .form-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
  }
  
  /* Search/Filter area */
  .search-filters {
    flex-direction: column;
    gap: 0.75rem;
  }
  .search-filters input, 
  .search-filters select, 
  .search-filters > div {
    width: 100%;
  }
  
  /* Modal responsivo */
  .modal-dialog {
    margin: 2rem 1rem;
  }
  .modal-content {
    border-radius: 12px;
  }
  
  /* Sidebar nav */
  .sidebar-nav {
    padding: 0.5rem;
  }
  .sidebar-nav .nav-link {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .sidebar-nav .nav-link svg {
    width: 20px;
    height: 20px;
  }
  .sidebar-nav .nav-link span {
    flex-grow: 1;
  }
  
  /* Theme toggle */
  .theme-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    gap: 4px;
  }
  .theme-toggle svg {
    width: 14px;
    height: 14px;
  }
  
  /* Alert/Toast em mobile */
  .alert-floating {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: calc(100vw - 20px);
    top: 70px;
    z-index: 10000;
  }
  
  /* Espaçamento geral */
  .p-4 {
    padding: 1rem !important;
  }
  
  /* Colunase displays */
  .col-md-2, .col-md-10 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  body {
    font-size: 0.95rem;
  }
  
  .navbar-brand {
    display: none;
  }
  
  .stat-card .stat-number {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }
  
  .action-btn {
    width: 32px;
    height: 32px;
  }
  
  .table td {
    padding: 0.6rem 0;
    padding-left: 35%;
    font-size: 0.85rem;
  }
  
  .main-content {
    padding: 0.75rem !important;
  }
}

/* Toast/Alert customizado */
.alert-floating {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  border-radius: 10px;
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Low stock row highlight */
.row-low-stock {
  background-color: rgba(245, 158, 11, 0.1) !important;
}
.row-low-stock td {
  color: var(--accent);
}
.row-zero-stock {
  background-color: rgba(220, 53, 69, 0.12) !important;
}
.row-zero-stock td {
  color: #f07178;
}

/* Charts container */
.chart-container {
  position: relative;
  height: 300px;
}

/* Formulários - tema */
.form-control, .form-select {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-color);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.form-control:focus, .form-select:focus {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.15);
}
.form-control::placeholder {
  color: var(--text-muted);
}
.form-label {
  color: var(--text-primary);
  font-weight: 500;
}
.form-check-label {
  color: var(--text-primary);
}

/* Modal - tema */
.modal-content {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.modal-header {
  border-bottom-color: var(--border-color);
}
.modal-footer {
  border-top-color: var(--border-color);
}

/* Dropdown / Select2 */
.dropdown-menu {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}
.dropdown-item {
  color: var(--text-primary);
}
.dropdown-item:hover {
  background-color: var(--bg-table-hover);
}

/* Main content area */
.main-content {
  background-color: var(--bg-content);
  transition: background-color 0.3s;
}

/* Headings no conteúdo */
.main-content h4 {
  color: var(--text-primary);
}

/* Toggle tema */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

/* Toggle tema dentro de card (Configurações) */
.card .theme-toggle {
  border: 1px solid var(--border-color);
  background: var(--bg-card-header);
  color: var(--text-primary);
}
.card .theme-toggle:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}
.theme-toggle:hover svg {
  transform: rotate(30deg);
}

/* Sidebar ajuste para tema claro */
[data-theme="light"] .sidebar {
  background: #1a1a1a;
}

/* Action buttons no tema escuro */
.action-btn-entrada {
  background-color: rgba(40, 167, 69, 0.15);
  color: #5dd57a;
  border: 1px solid rgba(40, 167, 69, 0.3);
}
.action-btn-saida {
  background-color: rgba(220, 53, 69, 0.15);
  color: #f07178;
  border: 1px solid rgba(220, 53, 69, 0.3);
}
.action-btn-edit {
  background-color: rgba(245, 197, 24, 0.12);
  color: #F5C518;
  border: 1px solid rgba(245, 197, 24, 0.3);
  padding: 6px 8px;
}
.action-btn-delete {
  background-color: rgba(220, 53, 69, 0.1);
  color: #f07178;
  border: 1px solid rgba(220, 53, 69, 0.2);
  padding: 6px 8px;
}

[data-theme="light"] .action-btn-entrada {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
[data-theme="light"] .action-btn-saida {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
[data-theme="light"] .action-btn-edit {
  background-color: #fef9e7;
  color: #7d6608;
  border: 1px solid #f5e6a3;
}
[data-theme="light"] .action-btn-delete {
  background-color: #fce4e4;
  color: #a71d2a;
  border: 1px solid #f5c6cb;
}

/* Badge OK tema escuro */
.badge.bg-success {
  background-color: rgba(40, 167, 69, 0.2) !important;
  color: #5dd57a;
}
[data-theme="light"] .badge.bg-success {
  background-color: #28a745 !important;
  color: #fff;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #ccc;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ========== ESTOQUE BAIXO - CAROUSEL ========== */
.low-stock-carousel {
  min-height: 100px;
}
.low-stock-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.low-stock-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.low-stock-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.low-stock-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.low-stock-page {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 28px;
  text-align: center;
}
.low-stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}
.low-stock-item:last-child {
  border-bottom: none;
}
.low-stock-item:hover {
  background: var(--bg-table-hover);
}
.low-stock-info {
  flex: 1;
  min-width: 0;
}
.low-stock-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.low-stock-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.low-stock-qty {
  text-align: right;
  min-width: 90px;
}
.low-stock-current {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--danger);
}
.low-stock-bar {
  width: 80px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 4px 0 2px auto;
  overflow: hidden;
}
.low-stock-bar-fill {
  height: 100%;
  background: var(--danger);
  border-radius: 2px;
  transition: width 0.3s;
}
.low-stock-min {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Status badges - Zerado vs Baixo */
.low-stock-zero {
  border-left: 3px solid #dc3545;
}
.low-stock-low {
  border-left: 3px solid #F5C518;
}
.low-stock-current-zero {
  color: #dc3545 !important;
  font-weight: 700;
}
.low-stock-status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  text-align: center;
}
.badge-zero {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}
.badge-low {
  background: rgba(245, 197, 24, 0.15);
  color: #F5C518;
}

/* ========== CATEGORIAS SETTINGS - NOVO DESIGN ========== */
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  margin: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.cat-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.cat-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.cat-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.cat-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.cat-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cat-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-btn-edit {
  background: rgba(255, 193, 7, 0.15);
  color: #f0ad4e;
}
.cat-btn-edit:hover {
  background: #f0ad4e;
  color: #fff;
}
.cat-btn-delete {
  background: rgba(220, 53, 69, 0.15);
  color: var(--danger);
}
.cat-btn-delete:hover {
  background: var(--danger);
  color: #fff;
}

[data-theme="light"] .cat-btn-edit {
  background: rgba(255, 193, 7, 0.2);
  color: #856404;
}
[data-theme="light"] .cat-btn-delete {
  background: rgba(220, 53, 69, 0.15);
  color: #721c24;
}

/* 3-dot menu */
.cat-menu-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cat-menu-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.cat-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px;
  z-index: 50;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  flex-direction: column;
  gap: 2px;
}
.cat-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.cat-dropdown-item:hover {
  background: rgba(255,255,255,0.08);
}
.cat-dropdown-danger:hover {
  background: rgba(220,53,69,0.15);
  color: #ef4444;
}
.collapse-arrow {
  transition: transform 0.25s;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
}
.collapse-arrow.open {
  transform: rotate(180deg);
}
