/* ============================================================
   GESTÃO WEB - SISTEMA DE GESTÃO PARA ASSISTÊNCIA TÉCNICA
   Main Stylesheet v1.0
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Background Colors */
  --bg-root:      #070b13;
  --bg-sidebar:   #0c1118;
  --bg-header:    rgba(7, 11, 19, 0.95);
  --bg-card:      rgba(13, 20, 38, 0.8);
  --bg-card-hover:rgba(18, 27, 52, 0.9);
  --bg-input:     rgba(10, 15, 28, 0.8);
  --bg-modal:     rgba(5, 8, 16, 0.92);
  --bg-dropdown:  #0f1929;
  --bg-table-row: rgba(255,255,255,0.015);
  --bg-table-hover:rgba(91,94,246,0.06);

  /* Brand Colors */
  --primary:        #6366f1;
  --primary-light:  #818cf8;
  --primary-dark:   #4f46e5;
  --primary-glow:   rgba(99, 102, 241, 0.25);
  --primary-border: rgba(99, 102, 241, 0.4);

  /* Semantic Colors */
  --cyan:    #22d3ee;
  --cyan-bg: rgba(34, 211, 238, 0.1);
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.1);
  --amber:   #f59e0b;
  --amber-bg:rgba(245, 158, 11, 0.1);
  --rose:    #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.1);
  --violet:  #a78bfa;
  --violet-bg:rgba(167, 139, 250, 0.1);
  --orange:  #fb923c;
  --orange-bg:rgba(251, 146, 60, 0.1);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-disabled:  #334155;

  /* Border */
  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --border-active: rgba(99,102,241,0.5);
  --border-focus:  rgba(99,102,241,0.7);

  /* Shadows */
  --shadow-xs: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
  --shadow-primary: 0 4px 20px rgba(99,102,241,0.3);
  --shadow-cyan:    0 4px 20px rgba(34,211,238,0.2);

  /* Layout */
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --header-h: 64px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast:   120ms ease;
  --t-normal: 220ms ease;
  --t-slow:   380ms ease;

  /* Theme-responsive Hovers */
  --bg-hover:        rgba(255, 255, 255, 0.05);
  --bg-hover-strong: rgba(255, 255, 255, 0.1);
}

body.light-theme {
  /* Background Colors */
  --bg-root:      #f8fafc;
  --bg-sidebar:   #ffffff;
  --bg-header:    rgba(248, 250, 252, 0.95);
  --bg-card:      rgba(255, 255, 255, 0.85);
  --bg-card-hover:rgba(255, 255, 255, 0.95);
  --bg-input:     #ffffff;
  --bg-modal:     rgba(255, 255, 255, 0.98);
  --bg-dropdown:  #ffffff;
  --bg-table-row: rgba(0, 0, 0, 0.01);
  --bg-table-hover:rgba(79, 70, 229, 0.05);

  /* Brand Colors */
  --primary:        #4f46e5;
  --primary-light:  #6366f1;
  --primary-dark:   #3730a3;
  --primary-glow:   rgba(79, 70, 229, 0.1);
  --primary-border: rgba(79, 70, 229, 0.2);

  /* Semantic Colors */
  --cyan:    #0891b2;
  --cyan-bg: rgba(8, 145, 178, 0.1);
  --emerald: #059669;
  --emerald-bg: rgba(5, 150, 105, 0.1);
  --amber:   #d97706;
  --amber-bg:rgba(217, 119, 6, 0.1);
  --rose:    #e11d48;
  --rose-bg: rgba(225, 29, 72, 0.1);
  --violet:  #7c3aed;
  --violet-bg:rgba(124, 58, 237, 0.1);
  --orange:  #ea580c;
  --orange-bg:rgba(234, 88, 12, 0.1);

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  --text-disabled:  #94a3b8;

  /* Border */
  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --border-active: rgba(79, 70, 229, 0.4);
  --border-focus:  rgba(79, 70, 229, 0.6);

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 16px -2px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
  --shadow-primary: 0 4px 12px rgba(79, 70, 229, 0.15);

  /* Theme-responsive Hovers */
  --bg-hover:        rgba(0, 0, 0, 0.04);
  --bg-hover-strong: rgba(0, 0, 0, 0.08);
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.25);
}
body.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 70, 229, 0.45);
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(34,211,238,0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 90%, rgba(167,139,250,0.08) 0%, transparent 50%),
              var(--bg-root);
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}
body.light-theme .login-bg-grid {
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  animation: orbFloat 10s ease-in-out infinite;
}
.login-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.18), transparent);
  top: -150px; left: -150px;
}
.login-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,238,0.12), transparent);
  bottom: -100px; right: 10%;
  animation-delay: -5s;
}
.login-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(167,139,250,0.15), transparent);
  top: 45%; left: 55%;
  animation-delay: -2.5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-30px) scale(1.08) rotate(180deg); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 50px 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 
              0 0 60px -10px var(--primary-glow),
              inset 0 1px 0 rgba(255,255,255,0.05);
  animation: loginCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition: box-shadow 0.3s ease;
}

body.light-theme .login-card {
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 
              0 0 50px -10px rgba(99, 102, 241, 0.06),
              inset 0 1px 0 rgba(255,255,255,0.5);
  background: rgba(255, 255, 255, 0.8);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.login-logo-icon-container {
  width: 200px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseLogo 3s infinite alternate;
}

.login-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes pulseLogo {
  0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--primary-glow)); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.6)); }
}




.login-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

/* Input with icon inside form */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--t-fast);
}
.input-with-icon .form-control {
  padding-left: 38px;
}
.input-with-icon .form-control:focus + i {
  color: var(--primary-light);
}

.login-demo-hint {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(99,102,241,0.05);
  border: 1px solid var(--primary-border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-demo-hint i {
  color: var(--primary-light);
  font-size: 13px;
}
.login-demo-hint strong { color: var(--primary-light); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--t-slow) cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .sidebar-header {
  padding: 0;
  justify-content: center;
  gap: 0;
}

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--t-normal), width var(--t-normal), height var(--t-normal), opacity var(--t-normal);
}
.sidebar-logo:hover { transform: scale(1.05); }

/* Lógica de Troca de Logo por Tema */
.logo-light-img {
  display: block;
}
.logo-dark-img {
  display: none;
}

body.light-theme .logo-light-img {
  display: none;
}
body.light-theme .logo-dark-img {
  display: block;
}

.sidebar.collapsed .sidebar-logo {
  width: 0;
  height: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-brand {
  overflow: hidden;
  transition: opacity var(--t-normal), width var(--t-normal);
}
.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

.sidebar-brand h2 {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
}

.sidebar-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--t-fast);
}
.sidebar-toggle:hover { background: var(--bg-hover-strong); color: var(--text-primary); }
.sidebar.collapsed .sidebar-toggle { margin: 0; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Custom thin scrollbar for sidebar nav */
.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: var(--r-full);
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--bg-hover-strong);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 10px 2px;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--t-normal);
}
.sidebar.collapsed .nav-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  white-space: nowrap;
  user-select: none;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: color var(--t-fast);
}

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05));
  color: var(--primary-light);
  border: 1px solid var(--primary-border);
}
body.light-theme .nav-item.active {
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(79,70,229,0.03));
  color: var(--primary);
  border-color: var(--primary-border);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

.nav-item span {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  transition: opacity var(--t-normal), width var(--t-normal);
}
.sidebar.collapsed .nav-item span { opacity: 0; width: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: opacity var(--t-normal);
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 8px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { overflow: hidden; transition: opacity var(--t-normal); }
.sidebar.collapsed .user-info { opacity: 0; width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-slow) cubic-bezier(0.4,0,0.2,1);
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.header-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
}

.header-search {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}
.header-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}
.header-search input {
  width: 100%;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 0 16px 0 38px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--t-fast);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  outline: none;
  border-color: var(--border-active);
  background: rgba(99,102,241,0.05);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--t-fast);
  position: relative;
}
.header-btn:hover { background: var(--bg-hover-strong); color: var(--text-primary); }

.header-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--rose);
  border-radius: 50%;
  border: 2px solid var(--bg-root);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

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

.page-title h1 {
  font-size: 22px;
  font-weight: 700;
}
.page-title p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

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

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { grid-template-columns: repeat(5, 1fr); gap: 20px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  transition: all var(--t-normal);
  overflow: hidden;
}

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

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--primary-light); font-size: 13px; }

.card-body { padding: 20px; }

/* KPI Cards */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-normal);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-color, var(--primary));
}

.kpi-card:hover {
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--kpi-bg, var(--primary-glow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--kpi-color, var(--primary));
}

.kpi-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-full);
}
.kpi-trend.up { color: var(--emerald); background: var(--emerald-bg); }
.kpi-trend.down { color: var(--rose); background: var(--rose-bg); }
.kpi-trend.neutral { color: var(--amber); background: var(--amber-bg); }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 14px;
  border-radius: var(--r-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}
.btn-icon.btn-sm { width: 30px; height: 30px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 20px rgba(99,102,241,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

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

.btn-success {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,185,129,0.3);
}
.btn-success:hover { box-shadow: 0 4px 20px rgba(16,185,129,0.45); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--rose), #dc2626);
  color: #fff;
  box-shadow: 0 2px 12px rgba(244,63,94,0.3);
}
.btn-danger:hover { box-shadow: 0 4px 20px rgba(244,63,94,0.45); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, var(--amber), #d97706);
  color: #fff;
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(99,102,241,0.05); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required { color: var(--rose); }

.form-control {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--t-fast);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(99,102,241,0.04);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.input-group {
  display: flex;
  align-items: center;
}
.input-addon {
  height: 40px;
  padding: 0 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.input-addon-left { border-right: none; border-radius: var(--r-md) 0 0 var(--r-md); }
.input-addon-right { border-left: none; border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-addon-left + .form-control { border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-group .form-control:not(:last-child) { border-radius: var(--r-md) 0 0 var(--r-md); }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.form-error {
  font-size: 11px;
  color: var(--rose);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  position: relative;
  transition: background var(--t-normal);
  border: 1px solid var(--border-strong);
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--t-normal);
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); background: #fff; }
.toggle-label { font-size: 13px; color: var(--text-secondary); }

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px;
  appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.checkbox-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
}

/* Radio */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}
.radio-item:has(input:checked) {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  color: var(--primary-light);
}
.radio-item input[type="radio"] { display: none; }

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg-table-row);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-table-hover); }

tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-secondary { color: var(--text-secondary); font-size: 12px; }
.td-actions { display: flex; gap: 6px; }

/* ============================================================
   BADGES / STATUS TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: rgba(99,102,241,0.15); color: var(--primary-light); border: 1px solid rgba(99,102,241,0.25); }
.badge-success { background: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(16,185,129,0.25); }
.badge-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.badge-danger  { background: var(--rose-bg); color: var(--rose); border: 1px solid rgba(244,63,94,0.25); }
.badge-cyan    { background: var(--cyan-bg); color: var(--cyan); border: 1px solid rgba(34,211,238,0.25); }
.badge-violet  { background: var(--violet-bg); color: var(--violet); border: 1px solid rgba(167,139,250,0.25); }
.badge-muted   { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-orange  { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(251,146,60,0.25); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
}

.tab-item {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
  background: rgba(99,102,241,0.04);
}
body.light-theme .tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(79,70,229,0.04);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--t-normal);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-sm { max-width: 420px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1100px; }

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title i { color: var(--primary-light); }

.modal-close {
  width: 30px; height: 30px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--rose-bg); color: var(--rose); border-color: rgba(244,63,94,0.3); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}
.search-input input {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 14px 0 38px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--t-fast);
}
.search-input input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-input input::placeholder { color: var(--text-muted); }

.filter-select {
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 32px 0 12px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--border-focus); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: between;
  gap: 6px;
  margin-top: 20px;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: auto;
}

.page-btn {
  width: 32px; height: 32px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}
.page-btn:hover { background: var(--bg-hover-strong); color: var(--text-primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(99,102,241,0.15);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--primary-light);
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content { flex: 1; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timeline-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

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

.toast {
  background: var(--bg-dropdown);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s ease;
}

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

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { font-size: 13px; font-weight: 500; }
.toast-success { border-left: 3px solid var(--emerald); }
.toast-success .toast-icon { color: var(--emerald); }
.toast-error { border-left: 3px solid var(--rose); }
.toast-error .toast-icon { color: var(--rose); }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-warning .toast-icon { color: var(--amber); }
.toast-info { border-left: 3px solid var(--primary); }
.toast-info .toast-icon { color: var(--primary-light); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  width: 64px; height: 64px;
  background: var(--bg-table-row);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 280px; line-height: 1.6; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 0.6s ease;
}

/* ============================================================
   CHART WRAPPERS
   ============================================================ */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ============================================================
   STATUS DOT
   ============================================================ */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.dot-amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-rose  { background: var(--rose); box-shadow: 0 0 6px var(--rose); }
.dot-cyan  { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-gray  { background: var(--text-muted); }

/* ============================================================
   PRODUCT / OS LIST ITEM
   ============================================================ */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.list-item:hover { background: var(--bg-table-hover); }
.list-item:last-child { border-bottom: none; }

/* ============================================================
   FINANCIAL STYLES
   ============================================================ */
.money-in  { color: var(--emerald); font-weight: 600; }
.money-out { color: var(--rose); font-weight: 600; }
.money-neutral { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-text { flex: 1; }
.activity-text p { font-size: 13px; line-height: 1.5; }
.activity-text span { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   PDV (POINT OF SALE)
   ============================================================ */
.pdv-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - var(--header-h) - 48px);
}

/* Otimização de altura para o PDV */
.page-view.pdv-mode {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
  overflow: hidden;
}
.page-view.pdv-mode .page-header {
  margin-bottom: 12px;
}
.page-view.pdv-mode .page-header .page-title p {
  display: none;
}
.page-view.pdv-mode #vendasContent {
  flex: 1;
  min-height: 0;
}
.page-view.pdv-mode .pdv-layout {
  height: 100%;
}

.pdv-products {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  height: 100%;
}

.pdv-cart {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  height: 100%;
}

.pdv-cart-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.cart-item:hover { background: var(--bg-hover); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 24px; height: 24px;
  border-radius: var(--r-xs);
  background: var(--bg-hover-strong);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}
.qty-btn:hover { background: var(--primary-glow); }

.pdv-totals {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pdv-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}
.pdv-total-final {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   STOCK / INVENTORY
   ============================================================ */
.stock-level {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stock-value {
  font-weight: 700;
  font-size: 14px;
}
.stock-min { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   REPORTS
   ============================================================ */
.report-metric {
  text-align: center;
  padding: 20px;
}
.report-metric-value {
  font-size: 32px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 4px;
}
.report-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary-light); }
.text-success { color: var(--emerald); }
.text-danger  { color: var(--rose); }
.text-warning { color: var(--amber); }
.text-cyan    { color: var(--cyan); }

.w-full { width: 100%; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

.animate-fade { animation: fadeIn 0.3s ease; }
.animate-slide { animation: slideUp 0.3s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

.page-view { animation: slideUp 0.25s ease; }

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
/* ============================================================
   RESPONSIVE & MOBILE OPTIMIZATIONS
   ============================================================ */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
  .pdv-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  /* Reset layout de margem lateral */
  .main-content {
    margin-left: 0 !important;
  }

  /* Gaveta (Drawer) para o menu lateral */
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 1000;
    transition: left var(--t-normal) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--border);
  }

  .sidebar.mobile-active {
    left: 0;
  }

  /* Oculta botão interno de colapso no mobile */
  .sidebar-toggle {
    display: none !important;
  }

  /* Exibe o logotipo no mobile sempre */
  .sidebar.collapsed .sidebar-logo {
    width: 36px;
    height: 36px;
    opacity: 1;
    margin: 0;
  }

  /* Ajustes de Grids */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Linhas de formulários empilhadas */
  .form-row-2, .form-row-3, .form-row-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Espaçamento da área principal */
  .page-content {
    padding: 16px;
  }

  /* Esconde o breadcrumb longo (mostra só seção atual) */
  .header-breadcrumb span:first-child,
  .header-breadcrumb i {
    display: none !important;
  }

  /* Compactar ações no cabeçalho */
  .header-search {
    max-width: 130px;
  }
  
  .header-actions .btn {
    padding: 0 10px;
    height: 34px;
    font-size: 11px;
  }

  /* Modais ocupando 100% de largura */
  .modal-overlay {
    padding: 10px;
  }
  
  .modal {
    max-height: 95vh;
  }
}

@media (max-width: 576px) {
  /* Esconde a barra de busca no topo em telas muito pequenas para não encavalar */
  .header-search {
    display: none !important;
  }
  
  /* KPIs de Dashboard ocupam largura total */
  .kpi-card {
    padding: 16px;
  }

  /* Ajuste no cabeçalho da página (Título e Ações empilhados) */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .page-actions .btn, 
  .page-actions input, 
  .page-actions select {
    flex: 1;
    min-width: 100px;
  }
}

/* Classe utilitária para colunas responsivas em tabelas */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

/* ============================================================
   OS STATUS SPECIFIC COLORS
   ============================================================ */
.os-status-aguardando   { --kpi-color: var(--amber); }
.os-status-diagnostico  { --kpi-color: var(--cyan); }
.os-status-aprovacao    { --kpi-color: var(--violet); }
.os-status-peca         { --kpi-color: var(--orange); }
.os-status-execucao     { --kpi-color: var(--primary); }
.os-status-concluido    { --kpi-color: var(--emerald); }
.os-status-entregue     { --kpi-color: var(--emerald); }
.os-status-cancelado    { --kpi-color: var(--rose); }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, .app-header, .page-actions, .btn { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: white !important; color: black !important; }
}

/* ============================================================
   SELECT OPTIONS FIX & SEARCHABLE SELECT
   ============================================================ */
select option {
  background: var(--bg-dropdown);
  color: var(--text-primary);
}

.searchable-select {
  position: relative;
  width: 100%;
}
.searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast);
}
.searchable-select-trigger:focus,
.searchable-select-trigger.active {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.searchable-select-trigger i {
  color: var(--text-muted);
  font-size: 11px;
  transition: transform var(--t-normal);
}
.searchable-select-trigger.active i {
  transform: rotate(180deg);
}

.searchable-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 150ms ease;
}
.searchable-select-menu.active {
  display: flex;
}

.searchable-select-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.searchable-select-search-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}
.searchable-select-search {
  width: 100%;
  height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0 10px 0 28px;
  color: var(--text-primary);
  font-size: 12px;
}
.searchable-select-search:focus {
  outline: none;
  border-color: var(--border-focus);
}

.searchable-select-options {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.searchable-select-option {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.searchable-select-option:hover {
  background: var(--bg-table-hover);
  color: var(--text-primary);
}
.searchable-select-option.selected {
  background: var(--primary-glow);
  color: var(--primary-light);
  font-weight: 600;
}
body.light-theme .searchable-select-option.selected {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}
.searchable-select-no-results {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
