:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #10B981;
  --primary-bg: #ECFDF5;
  --primary-ring: #A7F3D0;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --info: #2563EB;
  --info-bg: #EFF6FF;
  --purple: #7C3AED;
  --purple-bg: #F5F3FF;
  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; height: 60px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 18px; color: var(--text); }
.nav-logo i { color: var(--primary); font-size: 22px; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user-name { font-size: 14px; font-weight: 600; }
.nav-user-badge { font-size: 11px; background: var(--primary-bg); color: var(--primary-dark); padding: 2px 8px; border-radius: 20px; font-weight: 600; text-transform: uppercase; }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }

@media (max-width:768px) {
  .nav-links, .nav-actions { display: none !important; }
  .nav-toggle { display: block; }
}

/* MOBILE OVERLAY */
.mobile-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.4);
}
.mobile-overlay.active { display: block; }
.mobile-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-lg); animation: slideIn 0.2s ease;
}
.mobile-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.mobile-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.mobile-logo i { color: var(--primary); }
.mobile-menu a { color: var(--text-secondary); font-size: 15px; font-weight: 500; padding: 8px 0; }
.mobile-menu hr { border: none; border-top: 1px solid var(--border); }

@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* VIEWS */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* HERO */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 100px 24px 60px; }
.hero-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #ECFDF5 0%, #EFF6FF 50%, #F5F3FF 100%); z-index: 0; }
.hero-bg::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 50%, rgba(5,150,105,0.08) 0%, transparent 50%), radial-gradient(ellipse at 80% 50%, rgba(124,58,237,0.06) 0%, transparent 50%); }
.hero-content { position: relative; z-index: 1; max-width: 800px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-bg); color: var(--primary-dark); padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 24px; }
.hero h1 { font-size: clamp(32px,5vw,52px); font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 18px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-num { display: block; font-size: 28px; font-weight: 800; color: var(--text); }
.hero-stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* SECTIONS */
.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section.bg-dark { background: var(--text); color: #fff; max-width: 100%; }
.section.bg-dark .section-title p { color: rgba(255,255,255,0.6); }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.section-title p { color: var(--text-secondary); font-size: 16px; }

/* PANELS GRID */
.panels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.panel-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 32px;
  border: 1px solid var(--border); cursor: pointer;
  transition: var(--transition);
}
.panel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.panel-card-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; }
.panel-card-icon.admin { background: linear-gradient(135deg, #F59E0B, #F97316); color: #fff; }
.panel-card-icon.store { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.panel-card-icon.technician { background: linear-gradient(135deg, var(--purple), #8B5CF6); color: #fff; }
.panel-card h3 { font-size: 18px; margin-bottom: 4px; }
.panel-card-role { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 4px; margin-bottom: 16px; }
.panel-card-role.superadmin { background: #FEF3C7; color: #92400E; }
.panel-card-role.vendedor { background: var(--primary-bg); color: var(--primary-dark); }
.panel-card-role.tecnico { background: var(--purple-bg); color: var(--purple); }
.panel-card ul { list-style: none; }
.panel-card li { padding: 6px 0; font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.panel-card li i { width: 18px; color: var(--primary); }

/* PLANS */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 960px; margin: 0 auto; }
.plan-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: 32px; }
.plan-card.featured { background: rgba(5,150,105,0.1); border-color: var(--primary); position: relative; }
.plan-card.featured::before { content: 'Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 800; margin-bottom: 24px; color: var(--primary-light); }
.plan-price span { font-size: 16px; font-weight: 400; color: rgba(255,255,255,0.5); }
.plan-card ul { list-style: none; margin-bottom: 24px; }
.plan-card li { padding: 8px 0; font-size: 14px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 8px; }
.plan-card li::before { content: '✓'; color: var(--primary-light); font-weight: 700; }

/* FOOTER */
.footer { background: var(--text); color: rgba(255,255,255,0.5); padding: 40px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; }
.footer-brand i { color: var(--primary-light); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: rgba(255,255,255,0.5); font-size: 13px; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-copy { font-size: 12px; width: 100%; text-align: center; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; line-height: 1.4; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,0.3); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(5,150,105,0.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }

/* AUTH */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #ECFDF5 0%, #EFF6FF 100%); }
.auth-card { background: var(--surface); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; margin: 0 auto 16px; }
.auth-header h2 { font-size: 22px; margin-bottom: 4px; }
.auth-header p { color: var(--text-muted); font-size: 14px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group label i { width: 14px; }
.form-input, .form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: var(--transition); outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.form-section h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.form-section h3 i { color: var(--primary); }
.form-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.form-grid { max-width: 700px; }
.form-grid .btn-full { margin-top: 8px; }

/* DASHBOARD */
.dashboard { display: flex; min-height: 100vh; padding-top: 0; }
.sidebar {
  width: 220px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.sidebar-logo { padding: 20px 16px; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.sidebar-logo i { color: var(--primary); }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.sidebar-nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.sidebar-nav a.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.sidebar-nav a i { width: 18px; font-size: 15px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-role { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.sidebar-user { font-size: 13px; font-weight: 600; color: var(--text); }
.dashboard-content { flex: 1; margin-left: 220px; padding: 24px; }
.tab-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.tab-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width:768px) {
  .sidebar { display: none; }
  .dashboard-content { margin-left: 0; }
}

/* ADMIN TABS */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }
.admin-tab, .store-tab, .tech-tab { display: none; }
.admin-tab.active, .store-tab.active, .tech-tab.active { display: block; animation: fadeIn 0.2s ease; }

/* STATS */
.admin-stats, .stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* TABLE */
.table-container { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 12px 16px; font-weight: 600; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; background: var(--surface-hover); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-hover); }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active { background: var(--primary-bg); color: var(--primary-dark); }
.badge-inactive { background: var(--danger-bg); color: var(--danger); }
.badge-role { background: var(--info-bg); color: var(--info); }
.badge-status { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.badge-na_fila { background: #F3F4F6; color: #6B7280; }
.badge-em_analise { background: var(--warning-bg); color: var(--warning); }
.badge-aguardando_orcamento { background: var(--info-bg); color: var(--info); }
.badge-em_manutencao { background: var(--purple-bg); color: var(--purple); }
.badge-pronto_para_retirada { background: var(--primary-bg); color: var(--primary-dark); }
.badge-recusado_sem_conserto { background: var(--danger-bg); color: var(--danger); }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.modal h2, .modal h3 { margin-bottom: 16px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } }

/* OS DETAIL */
.os-detail-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; }
.os-detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.os-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:600px) { .os-detail-grid { grid-template-columns: 1fr; } }
.os-detail-section { margin-bottom: 16px; }
.os-detail-section h4 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.os-detail-section p { font-size: 14px; color: var(--text); line-height: 1.6; }
.os-detail-placeholder { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* TIMELINE */
.timeline { border-left: 2px solid var(--border); padding-left: 20px; margin: 16px 0; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.tl-time { font-size: 11px; color: var(--text-muted); }
.tl-action { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-detail { font-size: 12px; color: var(--text-secondary); }

/* CHECKLIST VENDEDOR */
#checklistVendedor { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 6px; font-size: 13px; cursor: pointer; transition: var(--transition); }
.cl-item:hover { border-color: var(--primary); background: var(--primary-bg); }
.cl-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.cl-item input[type="checkbox"]:checked + span { color: var(--primary-dark); font-weight: 600; }

/* CHECKLIST */
.checklist-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius);
  margin-bottom: 8px;
}
.checklist-item span { flex: 1; font-size: 14px; font-weight: 500; min-width: 140px; }
.checklist-item select { padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); cursor: pointer; }

/* WHATSAPP */
.whatsapp-info { padding: 20px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.whatsapp-ok { background: var(--primary-bg); color: var(--primary-dark); }
.whatsapp-qr { background: var(--warning-bg); color: var(--warning); }
.whatsapp-error { background: var(--danger-bg); color: var(--danger); }
.whatsapp-warn { background: var(--info-bg); color: var(--info); }
#qrContainer { margin: 16px 0; display: flex; justify-content: center; }
#qrContainer img { image-rendering: pixelated; }

/* DASHBOARD */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.dashboard-stats .stat-card { padding: 16px; text-align: center; }
.dashboard-stats .stat-num { font-size: 28px; }
.dash-section { margin-top: 24px; }
.dash-section h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.quick-actions { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.qa-btn { display: flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); color: #fff; }
.qa-btn:hover { transform: translateY(-2px); }
.qa-new { background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: 0 2px 8px rgba(5,150,105,0.3); }
.qa-today { background: linear-gradient(135deg, #F59E0B, #F97316); box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.qa-search { background: linear-gradient(135deg, var(--info), #60A5FA); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.qa-print { background: linear-gradient(135deg, #8B5CF6, #A78BFA); box-shadow: 0 2px 8px rgba(139,92,246,0.3); }
.dash-os-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: var(--transition); margin-bottom: 8px; }
.dash-os-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.dash-os-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dash-os-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.dash-os-bottom { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* SIDEBAR BADGE */
.sidebar-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 700; }

/* CHART */
.chart-container { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; max-width: 500px; margin: 0 auto; }

/* MEDIA PREVIEW */
#mediaPreview img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; max-width: 360px; }
.toast-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }
.toast-success { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid var(--primary); }
.toast-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }

/* =============================================
   PROFESSIONAL DASHBOARD — Visão Geral
   ============================================= */

/* Header */
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-header h2 { font-size: 22px; font-weight: 700; margin: 0; }
.dash-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.dash-header-actions { display: flex; align-items: center; gap: 12px; }
.dash-last-update { font-size: 12px; color: var(--text-muted); }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius-md); padding: 20px;
  border: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--primary));
}
.kpi-primary::before { background: var(--primary); }
.kpi-success::before { background: #10B981; }
.kpi-danger::before { background: var(--danger); }
.kpi-warning::before { background: var(--warning); }
.kpi-revenue::before { background: linear-gradient(90deg, #F59E0B, #10B981); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.kpi-primary .kpi-icon { background: var(--primary-bg); color: var(--primary-dark); }
.kpi-success .kpi-icon { background: #ECFDF5; color: #065F46; }
.kpi-danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi-revenue .kpi-icon { background: linear-gradient(135deg, #FFFBEB, #ECFDF5); color: #D97706; }
.kpi-info { flex: 1; min-width: 0; }
.kpi-num { display: block; font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.2; }
.kpi-label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.kpi-trend {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--surface-hover); color: var(--text-secondary); white-space: nowrap;
}
.kpi-revenue .kpi-num { background: linear-gradient(135deg, #D97706, #059669); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Dashboard Grid */
.dash-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1200px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); overflow: hidden;
  transition: var(--transition);
}
.dash-card:hover { box-shadow: var(--shadow-hover); }
.dash-card-wide { grid-column: span 2; }
@media (max-width: 768px) { .dash-card-wide { grid-column: span 1; } }
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.dash-card-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.dash-card-header h3 i { color: var(--primary); font-size: 15px; }
.dash-card-body { padding: 16px 20px; }
.dash-loading { text-align: center; padding: 24px; color: var(--text-muted); font-size: 20px; }
.dash-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; }
.dash-empty i { display: block; font-size: 28px; margin-bottom: 8px; color: var(--border); }

/* Status Bar Items */
.status-bar-item { margin-bottom: 12px; }
.status-bar-item:last-child { margin-bottom: 0; }
.status-bar-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.status-bar-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.status-bar-count { font-size: 13px; font-weight: 700; color: var(--text); }
.status-bar-track { height: 6px; background: var(--surface-hover); border-radius: 3px; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

/* Ranking Items */
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.rank-item:last-child { border-bottom: none; }
.rank-pos { width: 24px; text-align: center; font-size: 14px; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { flex: 2; height: 6px; background: var(--surface-hover); border-radius: 3px; overflow: hidden; }
.rank-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 3px; transition: width 0.6s ease; }
.rank-num { font-size: 13px; font-weight: 700; color: var(--text-secondary); width: 32px; text-align: right; }

/* Payment Items */
.pag-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.pag-item:last-child { border-bottom: none; }
.pag-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pag-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pag-bar { flex: 1; height: 6px; background: var(--surface-hover); border-radius: 3px; overflow: hidden; }
.pag-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.pag-num { font-size: 13px; font-weight: 700; color: var(--text); width: 28px; text-align: right; }
.pag-pct { font-size: 11px; color: var(--text-muted); width: 40px; text-align: right; }

/* Recent OS Table */
.recent-table { margin: -8px -4px; }
.table-compact th { padding: 8px 12px; font-size: 11px; }
.table-compact td { padding: 8px 12px; font-size: 12px; }
.table-compact td strong { font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* Mini Stats Grid */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stat { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); background: var(--surface-hover); }
.mini-stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.mini-green { background: var(--primary-bg); color: var(--primary-dark); }
.mini-gray { background: #F3F4F6; color: #6B7280; }
.mini-blue { background: var(--info-bg); color: var(--info); }
.mini-purple { background: var(--purple-bg); color: var(--purple); }
.mini-orange { background: var(--warning-bg); color: var(--warning); }
.mini-indigo { background: #EEF2FF; color: #4F46E5; }
.mini-red { background: var(--danger-bg); color: var(--danger); }
.mini-teal { background: #ECFDF5; color: #065F46; }
.mini-num { display: block; font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.mini-label { display: block; font-size: 11px; color: var(--text-muted); }

/* WhatsApp Status */
.ws-status { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.ws-ok { background: var(--primary-bg); color: var(--primary-dark); }
.ws-warn { background: var(--warning-bg); color: var(--warning); }
.ws-off { background: var(--danger-bg); color: var(--danger); }

/* =============================================
   LOJA PANEL — Additional Components
   ============================================= */

/* Quick Actions Grid */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 24px; }
.qa-new { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.qa-today { background: linear-gradient(135deg, #F59E0B, #F97316); }
.qa-search { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.qa-print { background: linear-gradient(135deg, #6B7280, #4B5563); }

/* KPI Info Color Variant */
.kpi-info-color::before { background: var(--info); }

/* Form Step Badge */
.form-step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}

/* Form Footer */
.form-footer-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-footer-actions .btn-full { flex: 1; }

/* Media Upload Area */
.media-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--surface-hover);
}
.media-upload-area:hover { border-color: var(--primary); background: var(--primary-bg); }

/* OS Card Bottom Icons */
.dash-os-bottom i { width: 14px; text-align: center; }
.dash-os-info i { width: 14px; text-align: center; color: var(--text-muted); }

/* Table action icons */
.table td .btn-ghost i { font-size: 14px; }

/* =============================================
   NEW OS FORM — Professional Design
   ============================================= */

/* Steps Indicator */
.os-steps {
  display: flex; gap: 0; margin: 0 auto 8px;
  max-width: 800px; background: var(--surface);
  border-radius: var(--radius-md); padding: 6px;
  border: 1px solid var(--border);
}
.os-step {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 8px;
  border-radius: 8px; font-size: 12px; font-weight: 500;
  color: var(--text-muted); transition: var(--transition);
  cursor: default; white-space: nowrap;
}
.os-step.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.os-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
}
.os-step.active .os-step-num { background: var(--primary); color: #fff; }
.os-step-label { display: none; }
@media (min-width: 600px) { .os-step-label { display: inline; } }

/* Form Cards */
.os-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 20px; transition: var(--transition);
}
.os-form-card:hover { box-shadow: var(--shadow-hover); }

/* Card Head */
.os-card-head {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border-light);
}
.os-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.os-card-head h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text); }
.os-card-desc { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

/* Card Body */
.os-card-body { padding: 20px 24px 24px; }
.os-card-body .form-group { margin-bottom: 18px; }
.os-card-body .form-group:last-child { margin-bottom: 0; }
.os-card-body .form-group label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px;
}
.os-card-body .form-group label i { width: 16px; color: var(--text-muted); font-size: 13px; }
.os-card-body input, .os-card-body select, .os-card-body textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--surface);
  transition: var(--transition); outline: none;
}
.os-card-body input:focus, .os-card-body select:focus, .os-card-body textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.os-card-body textarea { resize: vertical; min-height: 80px; }

/* Required asterisk */
.required { color: var(--danger); }

/* 3-column row */
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .form-row-3 { grid-template-columns: 1fr; } }

/* Checklist inside card */
.os-card-body .checklist-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-hover); border: 1px solid var(--border-light);
  border-radius: var(--radius); margin-bottom: 6px;
}
.os-card-body .checklist-item span { flex: 0 0 auto; font-size: 13px; font-weight: 500; min-width: 140px; }
.os-card-body .checklist-item select { width: auto; min-width: 130px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); cursor: pointer; }
.os-card-body .checklist-item select:focus { border-color: var(--primary); }
.os-card-body .checklist-item input { width: auto; flex: 1; min-width: 100px; padding: 6px 10px; border: 1px solid var(--border-light); border-radius: 6px; font-size: 12px; }
.os-card-body .checklist-item input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px var(--primary-ring); }

/* Form error inside new OS */
#osError { margin-bottom: 12px; }
