/* ═══════════════════════════════════════════════════════════════
   Raíz & Pixel — Design System
   Premium Dark Admin Panel
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Custom Properties ────────────────────────────────────── */
:root {
  /* ── Dark Theme Backgrounds ─────────────────────────────── */
  --bg-primary: #0d0d18;
  --bg-secondary: #12121f;
  --bg-card: #191926;
  --bg-card-hover: #1f1f30;
  --bg-gradient: linear-gradient(135deg, #0d0d18 0%, #13102a 50%, #0d0d18 100%);

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.07);
  --border-color-light: rgba(255, 255, 255, 0.04);

  /* Typography */
  --text-primary: #e8e0f5;
  --text-secondary: #b0a0cc;
  --text-muted: #6b5f80;

  /* Accents — mantidos dourado e lilás */
  --accent-gold: #d4af6a;
  --accent-gold-deep: #b8893f;
  --accent-gold-gradient: linear-gradient(135deg, #d4af6a, #e8c990, #d4af6a);
  --accent-lilac: #c9a0e0;
  --accent-lilac-deep: #9b6fc0;
  --accent-lilac-gradient: linear-gradient(135deg, #c9a0e0, #a87fd4);

  /* Semantic */
  --success: #4caf6b;
  --success-bg: rgba(76, 175, 107, 0.15);
  --danger: #e05a6f;
  --danger-bg: rgba(224, 90, 111, 0.12);
  --warning: #f0a830;
  --warning-bg: rgba(240, 168, 48, 0.15);
  --info: #5b9bd5;
  --info-bg: rgba(91, 155, 213, 0.12);

  /* Glassmorphism */
  --glass-bg: rgba(25, 25, 40, 0.85);
  --glass-blur: blur(20px);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 106, 0.2);
  --shadow-lilac: 0 4px 20px rgba(201, 160, 224, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-lilac);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold);
}

::selection {
  background: rgba(201, 160, 224, 0.3);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(201, 160, 224, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 160, 224, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

/* Animated background orbs */
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 8s ease-in-out infinite;
}

.login-page::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #7b3fcf 0%, #4a1a8c 100%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.login-page::after {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #b8893f 0%, #7a5020 100%);
  bottom: -80px;
  left: -80px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.6s var(--transition-slow) both;
}

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

.login-logo {
  margin-bottom: 8px;
}

.login-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-divider {
  width: 60px;
  height: 2px;
  background: var(--accent-gold-gradient);
  margin: 24px auto;
  border-radius: 2px;
}

.login-form {
  margin-top: 32px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-align: left;
}

.login-form input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-normal);
  outline: none;
}

.login-form input[type="password"]:focus {
  border-color: var(--accent-lilac);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 160, 224, 0.15);
}

.login-form input[type="password"]::placeholder {
  color: var(--text-muted);
}

.login-error {
  display: none;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid rgba(224, 90, 111, 0.2);
  animation: shake 0.4s ease;
}

.login-error.visible {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--accent-gold-gradient);
  color: #1a1025;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-login:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:active {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-gradient);
}

/* ── Sidebar ──────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(201, 160, 224, 0.3));
  transition: filter var(--transition-normal);
}

.sidebar-logo-img:hover {
  filter: drop-shadow(0 2px 12px rgba(212, 175, 106, 0.5));
}

.sidebar-logo-text h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  background: var(--accent-gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
}

.sidebar-logo-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent-gold-gradient);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition-normal);
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-card-hover);
  color: var(--accent-gold);
}

.nav-item.active::before {
  height: 24px;
}

.nav-item i,
.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-footer .nav-item {
  color: var(--text-muted);
}

.sidebar-footer .nav-item:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ── Mobile Hamburger ─────────────────────────────────────────── */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 99;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hamburger-btn:hover {
  background: var(--bg-card);
}

.mobile-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Main Content ─────────────────────────────────────────────── */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
  max-width: calc(100% - var(--sidebar-width));
}

.page-section {
  display: none;
  animation: fadeIn 0.4s ease both;
}

.page-section.active {
  display: block;
}

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

/* ── Page Header ──────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: var(--accent-gold-gradient);
  color: #1a1025;
}

.btn-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-light);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224, 90, 111, 0.2);
}

.btn-danger:hover {
  background: rgba(224, 90, 111, 0.2);
  box-shadow: 0 4px 15px rgba(224, 90, 111, 0.15);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  margin-bottom: 20px;
}

.card:hover {
  border-color: var(--border-color-light);
}

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

.card-header h2,
.card-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.card-body {
  padding: 20px 24px;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 18px 24px 0;
  margin-bottom: 0;
  letter-spacing: 0.3px;
}

/* ── Stat Cards ───────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-lilac-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-light);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.stat-card.stat-success::before {
  background: linear-gradient(135deg, var(--success), #6dd58b);
  opacity: 1;
}

.stat-card.stat-success .stat-value {
  color: var(--success);
}

.stat-card.stat-danger::before {
  background: linear-gradient(135deg, var(--danger), #f08090);
  opacity: 1;
}

.stat-card.stat-danger .stat-value {
  color: var(--danger);
}

.stat-card.stat-warning::before {
  background: linear-gradient(135deg, var(--warning), #f8c060);
  opacity: 1;
}

.stat-card.stat-info::before {
  background: linear-gradient(135deg, var(--info), #80b8e8);
  opacity: 1;
}

/* ── Dashboard Grid ───────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Card hint no header */
.card-header-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Estado vazio dos painéis do dashboard */
.dashboard-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Nome do cliente nos painéis */
.pedido-cliente-nome {
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Badges de Prazo / Deadline ───────────────────────────── */

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: transform var(--transition-fast);
}

/* OK — mais de 4 dias úteis */
.deadline-ok {
  background: rgba(76, 175, 107, 0.12);
  color: #5dba7d;
  border: 1px solid rgba(76, 175, 107, 0.2);
}

/* Atenção — 3 a 4 dias úteis */
.deadline-atencao {
  background: rgba(240, 168, 48, 0.14);
  color: #e8a020;
  border: 1px solid rgba(240, 168, 48, 0.25);
}

/* Urgente — 0 a 2 dias úteis */
.deadline-urgente {
  background: rgba(224, 90, 111, 0.14);
  color: #e8607a;
  border: 1px solid rgba(224, 90, 111, 0.25);
  animation: pulseUrgente 1.8s ease-in-out infinite;
}

@keyframes pulseUrgente {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 90, 111, 0); }
  50% { box-shadow: 0 0 0 4px rgba(224, 90, 111, 0.18); }
}

/* Vencido */
.deadline-vencido {
  background: rgba(150, 30, 50, 0.25);
  color: #f08090;
  border: 1px solid rgba(224, 90, 111, 0.35);
  text-decoration: none;
  animation: pulseVencido 1.2s ease-in-out infinite;
}

@keyframes pulseVencido {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Sem data */
.deadline-sem-data {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════════════════════ */

.table-wrapper,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table thead th {
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table .td-actions {
  display: flex;
  gap: 6px;
}

.data-table .td-value {
  font-weight: 600;
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH & FILTER BAR
   ═══════════════════════════════════════════════════════════════ */

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  padding-left: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  transition: all var(--transition-normal);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a6b85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input:focus {
  border-color: var(--accent-lilac);
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 160, 224, 0.1);
}

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

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.filter-bar select {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6b85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.filter-bar select:focus {
  border-color: var(--accent-lilac);
  box-shadow: 0 0 0 3px rgba(201, 160, 224, 0.1);
}

.filter-bar select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-novo {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(91, 155, 213, 0.2);
}

.badge-fechado {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(240, 168, 48, 0.2);
}

.badge-producao {
  background: rgba(201, 160, 224, 0.12);
  color: var(--accent-lilac);
  border: 1px solid rgba(201, 160, 224, 0.2);
}

.badge-aprovacao {
  background: rgba(212, 175, 106, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 106, 0.2);
}

.badge-aprovado {
  background: rgba(76, 175, 107, 0.12);
  color: #6dd58b;
  border: 1px solid rgba(76, 175, 107, 0.2);
}

.badge-entregue {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(76, 175, 107, 0.2);
}

.badge-cancelado {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224, 90, 111, 0.2);
}

.badge-entrada {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(76, 175, 107, 0.2);
}

.badge-saida {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224, 90, 111, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-lilac);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 160, 224, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6b85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group .form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   INFO GRID (Detail pages)
   ═══════════════════════════════════════════════════════════════ */

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all var(--transition-fast);
}

.info-card:hover {
  border-color: var(--border-color-light);
}

.info-label {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.info-value a {
  color: var(--accent-lilac);
  text-decoration: underline;
  text-decoration-color: rgba(201, 160, 224, 0.3);
  text-underline-offset: 3px;
}

.info-value a:hover {
  color: var(--accent-gold);
  text-decoration-color: rgba(212, 175, 106, 0.4);
}

/* ── Detail Grid (two-column layout for pedido detalhe) ─────── */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.detail-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalBgIn 0.3s ease;
}

.modal-overlay.active,
.modal-overlay.show {
  display: flex;
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.modal-lg {
  max-width: 700px;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

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

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 440px;
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast.toast-success::before {
  background: var(--success);
}

.toast.toast-error::before {
  background: var(--danger);
}

.toast .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

.toast.toast-error .toast-icon {
  color: var(--danger);
}

.toast .toast-message {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state .empty-description {
  font-size: 0.88rem;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════ */

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-lilac);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

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

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.loading-overlay .loading-text {
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   RECEIVE ORDER PAGE
   ═══════════════════════════════════════════════════════════════ */

.receive-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

.receive-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 160, 224, 0.1), transparent 70%);
  top: -150px;
  right: -150px;
}

.receive-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 48px 40px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.receive-card .status-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
}

.receive-card .status-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.receive-card .status-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.receive-card .status-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}

.receive-card .status-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.receive-card .status-details .detail-row:last-child {
  border-bottom: none;
}

.receive-card .status-details .detail-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.receive-card .status-details .detail-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.receive-card.success .status-icon {
  color: var(--success);
}

.receive-card.error .status-icon {
  color: var(--danger);
}

.receive-card.loading .status-icon {
  animation: pulse 1.5s ease-in-out infinite;
  color: var(--accent-lilac);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.text-gold { color: var(--accent-gold); }
.text-lilac { color: var(--accent-lilac); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.font-display { font-family: 'Cinzel', serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-none { display: none; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

@media (max-width: 768px) {
  /* Mobile header visible */
  .mobile-header {
    display: flex;
  }

  /* Sidebar hidden, slides in */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Main content full width */
  .main-content {
    margin-left: 0;
    padding: 80px 16px 24px;
    max-width: 100%;
  }

  /* Stat grid single column */
  .stat-grid {
    grid-template-columns: 1fr;
  }

  /* Tables scroll horizontally */
  .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  /* Page header stack */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Login card responsive */
  .login-card,
  .receive-card {
    margin: 16px;
    padding: 32px 24px;
  }

  /* Filter bar stack */
  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-input,
  .filter-bar select {
    width: 100%;
  }

  /* Form rows stack */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Modal full-width */
  .modal {
    max-width: calc(100% - 32px);
    max-height: 90vh;
  }

  /* Toast full-width */
  .toast-container {
    left: 16px;
    right: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.3rem;
  }

  .stat-card .stat-value {
    font-size: 1.3rem;
  }

  .login-logo h1 {
    font-size: 1.6rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS & MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.fade-enter {
  animation: fadeIn 0.3s ease both;
}

.slide-up-enter {
  animation: slideUp 0.4s var(--transition-slow) both;
}

/* ── Success animation (for receive page) ─────────────────────── */
@keyframes successBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.success-animate {
  animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Glow effects ─────────────────────────────────────────────── */
.glow-gold {
  box-shadow: 0 0 20px rgba(212, 175, 106, 0.2),
              0 0 40px rgba(212, 175, 106, 0.1);
}

.glow-lilac {
  box-shadow: 0 0 20px rgba(201, 160, 224, 0.2),
              0 0 40px rgba(201, 160, 224, 0.1);
}

/* ── Print styles ─────────────────────────────────────────────── */
@media print {
  .sidebar,
  .mobile-header,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
    max-width: 100%;
  }

  body {
    background: white;
    color: #333;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    background: white;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Notification Badge (Sidebar)
   ═══════════════════════════════════════════════════════════════ */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: auto;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ═══════════════════════════════════════════════════════════════
   Itens / Serviços Extras
   ═══════════════════════════════════════════════════════════════ */
.extras-add-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.extras-list {
  margin-bottom: 16px;
}

.extras-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.extras-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card-hover);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.extras-item:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(212, 175, 106, 0.15);
}

.extras-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.extras-item-desc {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.extras-item-valor {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-gold-deep);
}

.extras-item-remove {
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  min-width: auto !important;
  border-radius: 6px !important;
  flex-shrink: 0;
  margin-left: 10px;
}

.extras-totals {
  padding-top: 14px;
  border-top: 1.5px solid var(--border-color);
}

.extras-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.extras-total-final {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1.5px solid var(--accent-gold);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-gold-deep);
}

.extras-total-final span:last-child {
  font-size: 1.15rem;
}
