@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- DESIGN SYSTEM & VARIABLES --- */
:root {
  /* Tema Padrão - Baseado no site HardTechInfo (Claro) */
  --bg-app: #f7f7f7;
  /* Fundo claro do site */
  --bg-sidebar: #1b2f8a;
  /* Azul cobalto como cor principal do sidebar */
  --bg-panel: rgba(255, 255, 255, 0.85);
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfc;
  --bg-input: #ffffff;
  --border-glow: rgba(27, 47, 138, 0.15);
  --border-color: #e7e7e7;
  --text-main: #202428;
  --text-muted: #737b97;
  /* Cor de texto secundário do site */

  /* Cores da Identidade Visual */
  --color-primary: #1b2f8a;
  /* Azul Cobalto do site */
  --color-success: #00d864;
  /* Verde sucesso do site */
  --color-info: #702dfa;
  /* Roxo tech do site */
  --color-warning: #ffce00;
  /* Amarelo/Dourado do site */
  --color-danger: #f71b1b;
  /* Vermelho erro do site */
  --color-whatsapp: #25d366;
  /* Verde Whatsapp */

  /* Cores das Prioridades */
  --priority-baixa: #00d864;
  --priority-media: #702dfa;
  --priority-alta: #f71b1b;

  /* Tipografia */
  --font-title: 'Inter', 'Poppins', 'Segoe UI', -apple-system, sans-serif;
  --font-body: 'Inter', 'Poppins', 'Segoe UI', -apple-system, sans-serif;

  /* Configurações de Vidro (Glassmorphism) */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px 0 rgba(17, 18, 22, 0.04);

  --sidebar-width: 260px;
  --header-height: 70px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --card-radius: 12px;
}

/* Tema Escuro - Otimizado e Reestilizado no Estilo Grafana */
[data-theme="dark"] {
  /* Tema Escuro Tecnológico Grafana Style */
  --bg-app: #111217;
  --bg-sidebar: #090a0d;
  --bg-panel: #181b1f;
  --bg-card: #181b1f;
  --bg-card-hover: #222529;
  --bg-input: #090a0d;
  --border-glow: rgba(50, 116, 217, 0.18);
  --border-color: #202226;
  --text-main: #d8d9da;
  --text-muted: #7b7c7e;

  /* Paleta Técnica do Grafana */
  --color-primary: #3274d9;
  /* Azul clássico do Grafana */
  --color-success: #73bf69;
  /* Verde clássico do Grafana */
  --color-info: #a352fc;
  /* Roxo clássico do Grafana */
  --color-warning: #ff780a;
  /* Laranja clássico do Grafana */
  --color-danger: #f2495c;
  /* Vermelho clássico do Grafana */

  --priority-baixa: #73bf69;
  --priority-media: #ff780a;
  --priority-alta: #f2495c;

  --glass-bg: #181b1f;
  --glass-border: #202226;
  --glass-blur: none;
  --glass-shadow: none;

  --card-radius: 4px;
}

/* --- RESET & GLOBAL STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- UTILITY CLASSES & ICONS --- */
.icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.icon-sm {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.icon-xs {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.icon-whatsapp {
  fill: currentColor;
}

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

.text-info {
  color: var(--color-info);
}

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

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

/* --- APP LAYOUT --- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 10;
  flex-shrink: 0;
  height: 100vh;
  box-sizing: border-box;
}

.sidebar nav {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-bottom: 8px;
}

.sidebar nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 32px;
}

.sidebar-logo-wrapper {
  position: relative;
  width: 140px;
  height: 50px;
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.sidebar-logo-wrapper::before,
.sidebar-logo-wrapper::after {
  display: none !important;
}

.panel-logo {
  max-height: 38px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  filter: none;
}

.logo-icon {
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 16px rgba(27, 47, 138, 0.4);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.menu-item-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.menu-item.active .menu-item-link {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  color: var(--text-main);
  border-left: 3px solid currentColor;
}

.menu-item.active .menu-item-link svg {
  filter: drop-shadow(0 0 5px currentColor);
}

/* Cores específicas das abas ativas (Alinhado com a paleta do Grafana) */
.menu-item.active .menu-item-link[data-target="dashboard"] {
  color: #a352fc;
  border-left-color: #a352fc;
}

.menu-item.active .menu-item-link[data-target="clients"] {
  color: #3274d9;
  border-left-color: #3274d9;
}

.menu-item.active .menu-item-link[data-target="suppliers"] {
  color: #ff780a;
  border-left-color: #ff780a;
}

.menu-item.active .menu-item-link[data-target="stock"] {
  color: #cca700;
  border-left-color: #cca700;
}

.menu-item.active .menu-item-link[data-target="quotes"] {
  color: #3274d9;
  border-left-color: #3274d9;
}

.menu-item.active .menu-item-link[data-target="tech-sheets"] {
  color: #f2495c;
  border-left-color: #f2495c;
}

.menu-item.active .menu-item-link[data-target="contacts"] {
  color: #a352fc;
  border-left-color: #a352fc;
}

.menu-item.active .menu-item-link[data-target="shipping"] {
  color: #f2495c;
  border-left-color: #f2495c;
}

.menu-item.active .menu-item-link[data-target="location-prospecting"] {
  color: #ff780a;
  border-left-color: #ff780a;
}

.menu-item.active .menu-item-link[data-target="whatsapp-web"] {
  color: #73bf69;
  border-left-color: #73bf69;
}

.menu-item.active .menu-item-link[data-target="calculator"] {
  color: #3274d9;
  border-left-color: #3274d9;
}

.menu-item.active .menu-item-link[data-target="dashboard"] svg {
  color: #a352fc;
}

.menu-item.active .menu-item-link[data-target="clients"] svg {
  color: #3274d9;
}

.menu-item.active .menu-item-link[data-target="suppliers"] svg {
  color: #ff780a;
}

.menu-item.active .menu-item-link[data-target="stock"] svg {
  color: #cca700;
}

.menu-item.active .menu-item-link[data-target="quotes"] svg {
  color: #3274d9;
}

.menu-item.active .menu-item-link[data-target="tech-sheets"] svg {
  color: #f2495c;
}

.menu-item.active .menu-item-link[data-target="contacts"] svg {
  color: #a352fc;
}

.menu-item.active .menu-item-link[data-target="shipping"] svg {
  color: #f2495c;
}

.menu-item.active .menu-item-link[data-target="location-prospecting"] svg {
  color: #ff780a;
}

.menu-item.active .menu-item-link[data-target="whatsapp-web"] svg {
  color: #73bf69;
}

.menu-item.active .menu-item-link[data-target="calculator"] svg {
  color: #3274d9;
}

/* Sidebar Footer / Theme Toggle */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-title);
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

/* --- MAIN WORKSPACE --- */
.main-workspace {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

/* --- HEADER --- */
.header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background-color: rgba(9, 13, 22, 0.2);
  backdrop-filter: blur(8px);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #181b1f;
  border: 1.5px solid #3274d9;
  padding: 8px 14px;
  border-radius: 4px;
  /* Caixa Quadrada estilo Grafana */
  width: 350px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.header-search:focus-within,
.header-search:hover {
  border-color: #5794f2;
  box-shadow: 0 0 0 2px rgba(50, 116, 217, 0.35);
  background-color: #22252b;
}

.header-search svg {
  color: #3274d9;
  flex-shrink: 0;
}

.header-search input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  width: 100%;
}

.header-search input::placeholder {
  color: #8e94a0;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* --- MAIN CONTENT & MODULE SECTIONS --- */
.content-area {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.module-section {
  display: none;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  height: 100%;
}

.module-section.active {
  display: flex;
  flex-direction: column;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.section-title p {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn:active {
  transform: translateY(0.5px);
}

/* --- KANBAN BOARD CONTAINER --- */
.kanban-board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  flex-grow: 1;
  padding-bottom: 16px;
  align-items: stretch;
  height: 100%;
  min-height: 450px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.kanban-column {
  width: 290px;
  min-width: 280px;
  max-width: 310px;
  background-color: rgba(15, 23, 42, 0.35);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kanban-column-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-color-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.kanban-column-title {
  font-size: 15px;
  font-weight: 600;
}

.kanban-column-count {
  background-color: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.kanban-column-actions {
  display: flex;
  gap: 4px;
}

.column-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.column-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Kanban Cards Stack */
.kanban-column-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 150px;
  background-color: rgba(0, 0, 0, 0.05);
}

/* --- KANBAN CARD --- */
.kanban-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 14px;
  cursor: grab;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card:hover {
  transform: translateY(-3px);
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.3;
  transform: scale(0.95);
  border: 1px dashed var(--color-primary);
}

/* Prioridades no Card */
.kanban-card.priority-alta {
  border-left: 3px solid var(--priority-alta);
}

.kanban-card.priority-media {
  border-left: 3px solid var(--priority-media);
}

.kanban-card.priority-baixa {
  border-left: 3px solid var(--priority-baixa);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

/* Categorias de Cartões */
.tag-clientes {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.tag-fornecedores {
  background-color: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.tag-estoque {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tag-contatos {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.priority-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.priority-alta .priority-badge {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

.priority-media .priority-badge {
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.08);
}

.priority-baixa .priority-badge {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.card-description {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.card-due-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.card-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.card-shortcut-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.card-shortcut-btn:hover {
  background-color: rgba(37, 211, 102, 0.15);
  border-color: var(--color-whatsapp);
  color: var(--color-whatsapp);
}

.card-action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.card-action-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Kanban Empty State Column */
.empty-kanban {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 300px;
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
}

/* --- CRUD VIEW TABLES & CARDS (GRID) --- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding-bottom: 24px;
}

/* Card Genérico dos Módulos */
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.item-card:hover {
  transform: translateY(-5px) scale(1.01);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-clients {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.badge-suppliers {
  background-color: rgba(249, 115, 22, 0.1);
  color: var(--color-warning);
}

.badge-stock {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-contacts {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--color-primary);
}

.item-actions {
  display: flex;
  gap: 8px;
}

.item-action-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.item-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.item-action-btn.btn-delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.item-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.item-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -6px;
}

.item-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-row span {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.detail-notes {
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.4;
}

/* Alertas de Estoque */
.stock-alert {
  border-left: 4px solid var(--color-danger);
}

.stock-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  display: inline-block;
  width: fit-content;
}

.stock-alert .stock-pill {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.btn-whatsapp-action {
  background-color: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  color: var(--color-whatsapp);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-whatsapp-action:hover {
  background-color: var(--color-whatsapp);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

/* Empty State para Módulos */
.empty-state-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px;
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
}

/* --- MODAIS (GLASSMORPHISM) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 8, 14, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  width: 500px;
  max-width: 94%;
  max-height: 88vh;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-body,
.modal-content>form {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Formulário do Modal */
.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--border-glow);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="color"].form-control {
  width: 50px;
  height: 38px;
  padding: 2px;
  border-radius: 6px;
  cursor: pointer;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Responsividade Básica */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
  }

  .sidebar-logo {
    margin-bottom: 12px;
  }

  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }

  .menu-item-link {
    padding: 8px 12px;
    font-size: 13px;
  }

  .header {
    padding: 0 16px;
  }

  .header-search {
    width: 200px;
  }

  .header-search:focus-within {
    width: 220px;
  }

  .content-area {
    padding: 16px;
  }
}

/* --- PANEL DE ESTATÍSTICAS --- */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.stat-card {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--glass-shadow);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  background: var(--bg-card-hover);
}

/* Indicadores de Status Laterais (Grafana style) */
.stat-card:has(.bg-blue) {
  border-left: 4px solid var(--color-primary) !important;
}

.stat-card:has(.bg-violet) {
  border-left: 4px solid var(--color-info) !important;
}

.stat-card:has(.bg-emerald) {
  border-left: 4px solid var(--color-success) !important;
}

.stat-card:has(.bg-danger) {
  border-left: 4px solid var(--color-danger) !important;
}

.stat-card:has(.bg-warning) {
  border-left: 4px solid var(--color-warning) !important;
}

.stat-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.stat-card-info {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-title);
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-card-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Cores específicas para os ícones das estatísticas */
.bg-violet {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #a78bfa !important;
}

.bg-blue {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa !important;
}

.bg-emerald {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399 !important;
}

.bg-orange {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #fb923c !important;
}

.bg-red {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171 !important;
  animation: pulseGlow 2s infinite;
}

/* --- GRÁFICOS INTERATIVOS --- */
.charts-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.sidebar-metrics-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.chart-card {
  flex: 1;
  min-width: 320px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--color-primary);
  /* Borda superior estilo Grafana */
  border-radius: var(--card-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.chart-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.chart-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.chart-card-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  position: relative;
}

.chart-container-flex {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  gap: 12px;
}

/* Gráfico de Rosca (Donut) */
.donut-svg {
  transform: rotate(-90deg);
  width: 160px;
  height: 160px;
}

.donut-segment {
  fill: none;
  stroke-width: 22;
  transition: stroke-dasharray 0.5s ease, stroke 0.3s ease;
  cursor: pointer;
}

.donut-segment:hover {
  stroke-width: 26;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
}

.donut-hole {
  fill: transparent;
}

.donut-center-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-title);
}

.donut-center-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Gráfico de Barras SVG */
.bar-svg {
  width: 100%;
  height: 180px;
}

.bar-rect {
  transition: height 0.5s ease, y 0.5s ease, fill 0.3s ease;
  cursor: pointer;
  rx: 4px;
}

.bar-rect:hover {
  filter: brightness(1.15) drop-shadow(0 0 4px var(--border-glow));
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- CALCULADORA DE FRETE --- */
.carrier-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition-smooth);
  margin-bottom: 12px;
}

.carrier-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-primary);
}

.carrier-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carrier-logo {
  width: 48px;
  height: 48px;
  background-color: #ffd100;
  /* Amarelo Correios */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #003366;
  /* Azul Correios */
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 11px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 10px rgba(255, 209, 0, 0.15);
}

.carrier-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.carrier-deadline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.carrier-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-title);
}

.shipping-header-detail {
  font-size: 14px;
  color: var(--text-main);
  background-color: rgba(195, 162, 117, 0.08);
  border-left: 3px solid var(--color-primary);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
}

@keyframes laserScan {
  0% {
    top: 0%;
  }

  50% {
    top: 100%;
  }

  100% {
    top: 0%;
  }
}

/* --- TELA DE LOGIN 3D ELEGANTE --- */
/* --- TELA DE LOGIN CORPORATIVA --- */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.12) 0%, #05080e 100%);
  perspective: 1000px;
  overflow: hidden;
}

.login-3d-scene {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  padding: 32px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.1s ease-out, box-shadow 0.3s ease;
  margin: auto;
}

.login-card-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-logo-wrapper {
  background: #ffffff;
  padding: 8px 18px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}

.login-logo {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

.login-brand {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card .input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-card .input-group label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-card .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-card .input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 6;
}

.login-card input {
  width: 100%;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 11px 14px 11px 42px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  position: relative;
  z-index: 5;
}

.login-card input:focus {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.01);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.login-card input:focus+.input-icon {
  color: #3b82f6;
}

.login-error {
  font-size: 12px;
  color: #f43f5e;
  background-color: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.15);
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}

.btn-login-submit {
  background: #2563eb;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  padding: 12px 16px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
  position: relative;
  z-index: 5;
}

.btn-login-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.secure-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

.secure-footer svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.login-credits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  text-align: center;
  z-index: 10;
}

.credits-text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  text-transform: none;
  letter-spacing: 0.2px;
}

.credits-logo {
  height: 24px;
  width: 24px;
  object-fit: contain;
  border-radius: 5px;
  opacity: 0.65;
  transition: opacity 0.2s ease, transform 0.2s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  display: inline-block;
}

.credits-logo:hover {
  opacity: 1;
  transform: scale(1.06);
}

/* Animação shake para erros de login */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

/* Otimização Responsiva da Tela de Login para Mobile e Notebooks */
@media (max-width: 576px) {
  .login-card {
    width: 92% !important;
    max-width: 350px !important;
    padding: 24px 20px !important;
    border-radius: 16px !important;
  }

  .login-card-inner {
    gap: 16px !important;
  }

  .login-logo-wrapper {
    padding: 6px 14px !important;
    margin-bottom: 10px !important;
  }

  .login-logo {
    height: 34px !important;
    max-width: 130px !important;
  }

  .login-brand {
    font-size: 19px !important;
  }

  .login-subtitle {
    font-size: 12px !important;
  }

  .login-card input {
    padding: 10px 14px 10px 38px !important;
    font-size: 13.5px !important;
  }

  .btn-login-submit {
    padding: 11px 14px !important;
    font-size: 13.5px !important;
  }
}

@media (max-height: 720px) {
  .login-card {
    padding: 22px 26px !important;
  }

  .login-card-inner {
    gap: 12px !important;
  }

  .login-logo-wrapper {
    margin-bottom: 8px !important;
    padding: 6px 14px !important;
  }

  .login-logo {
    height: 34px !important;
  }

  .login-credits {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }
}

/* --- MOBILIDADE E RESPONSIVIDADE ADICIONAL --- */

/* Estilos de topo e menu lateral mobile */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(10, 16, 30, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-color);
  z-index: 9999;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
}

.mobile-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.mobile-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-logo img {
  height: 32px;
  object-fit: contain;
}

.mobile-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.mobile-close-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.mobile-active {
  opacity: 1;
  pointer-events: auto;
  display: block;
}

/* Responsividade Média (Telas de Tablets e Notebooks Pequenos) */
@media (max-width: 992px) {

  /* Alinhamento responsivo do gerador de orçamentos */
  #quotes-section .module-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-row {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  .stats-row .stat-card {
    flex: 1 1 calc(50% - 12px) !important;
    min-width: 160px !important;
  }

  .charts-row {
    flex-direction: column !important;
  }
}

/* Otimização Específica para Altura de Notebooks (max-height: 820px) */
@media (max-height: 820px) and (min-width: 769px) {
  .header {
    height: 52px !important;
    padding: 0 20px !important;
  }

  .sidebar {
    padding: 16px 12px !important;
  }

  .sidebar-logo {
    margin-bottom: 12px !important;
  }

  .sidebar-logo-wrapper {
    height: 42px !important;
    padding: 4px 10px !important;
  }

  .panel-logo {
    max-height: 32px !important;
  }

  .menu-item-link {
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    gap: 10px !important;
  }

  .content-area {
    padding: 18px 22px !important;
  }

  .section-header {
    margin-bottom: 14px !important;
  }

  .section-title h2 {
    font-size: 22px !important;
  }

  .stats-row {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 10px 14px !important;
  }

  .charts-row {
    margin-bottom: 12px !important;
    gap: 12px !important;
  }

  .kanban-column {
    max-height: calc(100vh - 200px) !important;
  }
}

/* Responsividade Estrita (Telas de Celulares) */
@media (max-width: 768px) {
  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px !important;
    height: 56px !important;
    background-color: rgba(9, 13, 22, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 9999;
    box-sizing: border-box;
  }

  .mobile-close-btn {
    display: block !important;
  }

  .app-container {
    padding-top: 56px !important;
    flex-direction: column !important;
  }

  /* Transforma a sidebar em uma gaveta off-canvas */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 290px !important;
    height: 100vh !important;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    background-color: #0b1120 !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 18px 16px !important;
    box-sizing: border-box;
  }

  .sidebar.mobile-active {
    transform: translateX(0) !important;
  }

  .sidebar-logo {
    margin-bottom: 18px !important;
  }

  .sidebar-menu {
    flex-direction: column !important;
    overflow-x: visible !important;
  }

  .menu-item-link {
    padding: 11px 14px !important;
    font-size: 14px !important;
  }

  /* Ocultar cabeçalho do desktop */
  .header {
    display: none !important;
  }

  /* Ajustes da área de conteúdo principal */
  .content-area {
    padding: 14px !important;
    height: auto !important;
    overflow-y: visible !important;
  }

  .section-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .section-header>div:last-child {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .section-header>div:last-child .btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 12.5px !important;
  }

  /* Kanban Snap Carousel no Celular */
  .kanban-board-container {
    height: auto !important;
    min-height: 480px !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 4px 20px 4px !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  .kanban-column {
    scroll-snap-align: center !important;
    width: 85vw !important;
    min-width: 270px !important;
    max-width: 330px !important;
    max-height: 68vh !important;
  }

  /* Stats em Grid 2x2 no Celular */
  .stats-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    overflow-x: visible !important;
    margin-bottom: 14px !important;
  }

  .stats-row .stat-card {
    min-width: unset !important;
    padding: 12px !important;
  }

  .charts-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .charts-row .chart-card {
    min-width: 100% !important;
  }

  /* Ajuste de listas e cartões de itens no celular */
  .module-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .item-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  /* Modais no Mobile */
  .modal-content {
    width: 95% !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    margin: auto !important;
  }
}

/* --- BADGE SSL DOURADO BRILHANTE --- */
.ssl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #ffd700;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 12px;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
  animation: goldGlow 2s infinite ease-in-out;
  position: relative;
  z-index: 1;
}

.icon-ssl {
  width: 12px;
  height: 12px;
  stroke: #ffd700;
  filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.7));
}

@keyframes goldGlow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.2);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    border-color: rgba(212, 175, 55, 0.5);
    transform: scale(1.02);
  }
}

/* --- PREVIEW DE IMAGEM COM ZOOM AO PASSAR O MOUSE (HOVER ZOOM) --- */
.product-thumb-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.product-thumb-preview {
  display: none;
  position: absolute;
  top: -70px;
  left: 50px;
  width: 180px;
  height: 180px;
  background-color: var(--bg-panel);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  pointer-events: none;
  justify-content: center;
  align-items: center;
  animation: popScaleIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
}

.product-thumb-preview img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.product-thumb-container:hover .product-thumb-preview {
  display: flex;
}

/* Zoom na imagem dentro do card do Kanban principal */
.card-product-image-wrapper {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.card-product-image-wrapper:hover {
  transform: scale(1.03);
}

.card-product-image-wrapper .product-thumb-preview {
  top: -190px;
  left: calc(50% - 90px);
  /* Centraliza o zoom de 180px no card */
}

.card-product-image-wrapper:hover .product-thumb-preview {
  display: flex;
}

@keyframes popScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- ESTILO QUADRO KANBAN DE ESTOQUE --- */
.stock-kanban-board {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  width: 100%;
  padding: 10px 0 20px 0;
  align-items: flex-start;
}

.stock-kanban-column {
  flex: 1;
  min-width: 320px;
  background-color: var(--bg-panel);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  max-height: 800px;
  overflow: hidden;
}

.stock-kanban-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.01);
}

.stock-kanban-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-kanban-count {
  background-color: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.stock-kanban-cards {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 720px;
}

.stock-unified-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.stock-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 16px;
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  width: 100%;
}

.stock-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border-color: var(--color-primary);
  background-color: var(--bg-card-hover);
}

.stock-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.stock-card-category {
  font-size: 10px;
  text-transform: uppercase;
  color: #00d864;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.stock-card-margin {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.stock-card-image-box {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.stock-card-image-box img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  padding: 4px;
}

.stock-card-content-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 6px;
  min-width: 0;
}

/* Responsividade Mobile para Cartões de Estoque */
@media (max-width: 576px) {
  .stock-unified-list {
    grid-template-columns: 1fr;
  }

  .stock-card {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-card-image-box {
    width: 100%;
    height: 160px;
  }
}

.stock-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.stock-card-prices {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stock-card-prices .price-sale {
  color: var(--text-main);
  font-weight: 700;
}

.stock-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: 4px;
}

.stock-card-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-card-indicator-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.stock-card-bar-bg {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.stock-card-bar {
  height: 100%;
  border-radius: 3px;
}

.stock-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.stock-card-supplier {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-card-buttons {
  display: flex;
  gap: 6px;
}

/* Seletor de Tamanhos de Camiseta */
.size-badge-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 42px;
  text-align: center;
}

.size-badge-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.size-badge-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
}


@keyframes pulse-led {
  from {
    opacity: 0.35;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

.pulse-dot {
  animation: pulse-green 2.0s infinite ease-in-out;
  transform-origin: center;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(0, 216, 100, 0.4));
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(0, 216, 100, 0.8));
  }

  100% {
    transform: scale(0.9);
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(0, 216, 100, 0.4));
  }
}

/* --- GRAFANA OVERRIDES FOR GAUGES --- */
#gauge-ram-ring {
  stroke: var(--color-primary) !important;
}

#gauge-cpu-ring {
  stroke: var(--color-success) !important;
}

#gauge-db-ring {
  stroke: var(--color-info) !important;
}

/* --- TAMANHOS & STEPPERS (+ / -) ORÇAMENTOS E FICHA TÉCNICA --- */
.quote-size-qty-input::-webkit-inner-spin-button,
.quote-size-qty-input::-webkit-outer-spin-button,
.tech-size-qty-input::-webkit-inner-spin-button,
.tech-size-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quote-size-qty-input,
.tech-size-qty-input {
  -moz-appearance: textfield;
}

.size-card-container {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.size-card-container:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-step-minus,
.btn-step-plus {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease-in-out;
}

.btn-step-minus:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  transform: scale(1.08);
}

.btn-step-minus:active {
  transform: scale(0.92);
}

.btn-step-plus:hover {
  background: rgba(0, 255, 204, 0.3) !important;
  color: #ffffff !important;
  border-color: rgba(0, 255, 204, 0.7) !important;
  transform: scale(1.08);
}

.btn-step-plus:active {
  transform: scale(0.92);
}