:root {
  --bg-app: #090d16;
  --bg-sidebar: #05080f;
  --bg-card: #111726;
  --bg-card-hover: #161e31;
  --bg-input: #172033;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-logo-container {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}

.brand-logo-container:hover {
  transform: scale(1.05);
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.7);
  border-color: rgba(168, 85, 247, 0.8);
}

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

.preview-logo-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  object-fit: cover;
}

.brand-info h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title-text {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 40%, #818cf8 80%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.4px;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.badge-pro {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.subtext {
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 500;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 16px 10px 6px 10px;
}

.nav-section-divider {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.nav-icon {
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
  opacity: 0.75;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  transform: translateX(2px);
}

.nav-item:hover .nav-icon {
  opacity: 1;
  color: #818cf8;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0.03) 100%);
  color: #c7d2fe;
  font-weight: 600;
  border-left: 3px solid #6366f1;
  border-radius: 4px 10px 10px 4px;
}

.nav-item.active .nav-icon {
  color: #818cf8;
  opacity: 1;
  stroke-width: 2.2;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

.system-status-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.status-desc {
  font-size: 11px;
  color: var(--text-subtle);
}

/* MAIN WRAPPER */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.04), transparent 50%);
}

.topbar {
  padding: 24px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(8px);
}

.header-titles h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 2px;
}

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

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px 6px 8px;
  border-radius: 30px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.admin-info {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
}

.admin-role {
  font-size: 10px;
  color: var(--text-subtle);
}

/* MAIN CONTAINER */
.main-container {
  padding: 36px;
  flex: 1;
  overflow-y: auto;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* DASHBOARD FILTER BAR */
.dashboard-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-md);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-group {
  display: flex;
  background-color: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-filter {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-filter.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

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

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.metric-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-purple { background: rgba(99, 102, 241, 0.12); color: #a5b4fc; }
.icon-blue { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.icon-green { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.icon-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-value-row h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.trend-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.trend-badge.positive { background: var(--success-bg); color: var(--success); }
.trend-badge.info { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }

/* CHARTS GRID */
.charts-grid {
  display: flex;
  gap: 24px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.chart-card {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row !important;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
}

.doughnut-wrapper {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-body {
  padding: 24px;
}

/* NAVBAR ACTIONS & SEARCH */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  color: var(--text-subtle);
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14px;
  width: 100%;
}

/* TABLES */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: var(--text-muted);
}

.custom-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon {
  width: 36px;
  height: 36px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  font-weight: 700;
  font-size: 14px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

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

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-danger-soft {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-soft:hover {
  background-color: var(--danger);
  color: #fff;
}

/* BADGES */
.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }

/* MODALS */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 24px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* CONFIG TAB */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.config-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
}

.config-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-details h4 {
  font-size: 15px;
  font-weight: 700;
}

.info-alert {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #a5b4fc;
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-promo { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* CHECKBOX FLEX & TOGGLE */
.flex-checkbox {
  display: flex;
  align-items: center;
  margin-top: 24px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.btn-promo-active {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-promo-active:hover {
  background: rgba(245, 158, 11, 0.3);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.ml-2 { margin-left: 8px; }
.block { display: block; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* TELA DE LOGIN GLASSMORPHISM */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, rgba(30, 27, 75, 0.95), rgba(15, 12, 41, 0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInLogin 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInLogin {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.login-glass-card {
  width: 100%;
  max-width: 440px;
  background: rgba(30, 35, 60, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.login-glass-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1), transparent 70%);
  pointer-events: none;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-circle {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.login-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.4;
}

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

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 44px !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  color: #fff !important;
  font-size: 0.95rem !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
  outline: none;
}

.input-with-icon input:focus + .input-icon,
.input-with-icon input:focus ~ .input-icon {
  color: #6366f1;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-toggle-password:hover {
  color: #94a3b8;
}

.btn-toggle-password svg {
  width: 18px;
  height: 18px;
}

.btn-login-submit {
  padding: 14px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
}

/* ESTILIZAÇÃO DOS BOTÕES DE SAIR (LOGOUT) */
.btn-logout-header {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 16px !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-logout-header:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-sidebar-logout {
  transition: all 0.2s ease !important;
}

.btn-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
}

/* CARD DE DESCONTO POR VOLUME / ATACADO */
.volume-discount-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}

.volume-discount-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.2);
}

.volume-discount-icon {
  font-size: 1.15rem;
  background: rgba(99, 102, 241, 0.15);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.volume-discount-title-group {
  display: flex;
  flex-direction: column;
}

.volume-discount-title-group strong {
  font-size: 0.875rem;
  color: #c7d2fe;
}

.volume-discount-title-group small {
  font-size: 0.75rem;
  color: #94a3b8;
}

.align-items-end {
  align-items: flex-end !important;
}

.volume-discount-card .form-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.volume-discount-card .form-group label {
  color: #a5b4fc !important;
  font-size: 0.825rem !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volume-discount-card input {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.volume-discount-card input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

/* ==========================================================================
   REGRAS DE RESPONSIVIDADE MOBILE & TABLES TOUCH
   ========================================================================== */

/* HEADER MOBILE (OCULTO EM DESKTOP) */
.mobile-nav-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 99;
}

.btn-mobile-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-mobile-toggle:hover,
.btn-mobile-toggle:active {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: #818cf8;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.mobile-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-status-dot-wrap {
  display: flex;
  align-items: center;
  padding: 6px;
}

/* OVERLAY / BACKDROP DO DRAWER MOBILE */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* --------------------------------------------------------------------------
   MEDIA QUERY: TABLETS E SMARTPHONES (≤ 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  body {
    height: auto;
    overflow-y: auto;
  }

  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .mobile-nav-header {
    display: flex;
  }

  /* SIDEBAR RECOLHÍVEL (DRAWER OFF-CANVAS) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    padding: 20px 16px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    flex: 1;
    overflow: visible;
    width: 100%;
  }

  .topbar {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .main-container {
    padding: 16px 18px 36px 18px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .charts-grid {
    flex-direction: column;
    gap: 18px;
  }

  .card-header.flex-row,
  .page-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .btn-group {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    display: flex;
  }

  .chart-canvas-wrapper {
    min-height: 260px;
    height: 280px;
  }

  .doughnut-wrapper {
    max-width: 100%;
    height: 260px;
  }

  /* MODAIS ADAPTATIVOS */
  .modal-box {
    max-width: 90vw;
    padding: 22px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   MEDIA QUERY: SMARTPHONES PEQUENOS E MÉDIOS (≤ 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .header-titles h1 {
    font-size: 1.25rem;
  }

  .header-subtitle {
    font-size: 0.8rem;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-outline,
  .btn-logout-header {
    width: 100%;
    justify-content: center;
  }

  .admin-profile {
    width: 100%;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
  }

  .main-container {
    padding: 12px 12px 28px 12px;
  }

  /* TABELAS RESPONSIVAS TOUCH */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .custom-table {
    min-width: 650px;
  }

  .custom-table th,
  .custom-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  /* MODAL MOBILE DE TELA CHEIA COMPACTA */
  .modal-backdrop {
    padding: 12px;
  }

  .modal-box {
    width: 96% !important;
    max-width: 100% !important;
    padding: 18px !important;
    border-radius: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-footer .btn,
  .modal-footer button {
    width: 100%;
    justify-content: center;
  }

  /* FORMULÁRIOS SINGLE COLUMN EM SMARTPHONES */
  .form-grid-2,
  .form-grid-3,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* FONTE DE INPUT (16PX PREVINE AUTO-ZOOM NO IOS SAFARI) */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* TELA DE LOGIN GLASSMORPHISM EM SMARTPHONES */
  .login-overlay {
    padding: 12px;
  }

  .login-glass-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .login-header h2 {
    font-size: 1.25rem;
  }
}


