/* =====================================================
   MAQLOG v3.0 PRO — CSS Principal
   Modo claro fixo — sem dark mode
   ===================================================== */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --secondary: #34a853;
  --danger: #ea4335;
  --warning: #fbbc04;
  --info: #4285f4;

  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --bg-sidebar: #1e2a3b;
  --bg-sidebar-hover: #2d3e54;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --bg-table-head: #f8f9fa;
  --bg-table-hover: #f1f3f5;

  --text-primary: #1a1a2e;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --text-sidebar: #c5d0e0;
  --text-sidebar-active: #ffffff;

  --border: #e0e0e0;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --sidebar-width: 248px;
  --sidebar-collapsed: 68px;
  --header-height: 64px;

  --transition: 0.2s ease;
  --font: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =====================
   LOGIN
   ===================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2a3b 0%, #1a73e8 100%);
  padding: 1rem;
}

.login-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.login-logo-icon i { font-size: 1.8rem; color: #fff; }

.login-logo-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.login-logo-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-error {
  background: #fce8e6;
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--danger);
}

.login-hint {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.login-hint code {
  background: #e8f0fe;
  color: var(--primary);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.82rem;
}

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

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-details-sidebar { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo i {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 1rem;
  padding: 0.25rem;
  transition: color var(--transition);
}

.sidebar-toggle:hover { color: #fff; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-section { margin-bottom: 0.5rem; }

.nav-section-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  padding: 0.5rem 1.1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: var(--text-sidebar);
  text-decoration: none;
  border-radius: 0;
  transition: all var(--transition);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

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

.nav-item.active {
  background: var(--bg-sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}

.nav-item i {
  width: 18px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-sidebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-details-sidebar span:first-child {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.68rem;
  color: var(--primary);
  background: rgba(26, 115, 232, 0.2);
  padding: 1px 6px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 2px;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 1rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-logout:hover { color: var(--danger); background: rgba(234,67,53,0.1); }

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--transition);
}

.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

.top-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-breadcrumb i { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 1rem; }

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* =====================
   CARDS E GRID
   ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title i { color: var(--primary); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #e8f0fe; color: var(--primary); }
.stat-icon.green { background: #e6f4ea; color: var(--secondary); }
.stat-icon.red { background: #fce8e6; color: var(--danger); }
.stat-icon.yellow { background: #fef7e0; color: #f29900; }
.stat-icon.purple { background: #f3e8fd; color: #9c27b0; }
.stat-icon.orange { background: #fef3e2; color: #e37400; }

.stat-info { min-width: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* =====================
   FILTROS COMPACTOS
   ===================== */
.filters-bar {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-input {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition);
  height: 34px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.filter-input-search { min-width: 220px; flex: 1; }
.filter-input-select { min-width: 150px; }
.filter-input-date { min-width: 130px; }

.filter-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* =====================
   TABELAS
   ===================== */
.table-responsive { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: var(--bg-table-head);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:hover td { background: var(--bg-table-hover); }
tbody tr:last-child td { border-bottom: none; }

.actions-cell { display: flex; gap: 0.4rem; flex-wrap: nowrap; }

/* =====================
   BADGES / STATUS
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-rascunho { background: #f1f3f4; color: #5f6368; }
.badge-aguardando_analise { background: #fff3cd; color: #856404; }
.badge-em_analise { background: #cce5ff; color: #004085; }
.badge-aprovada { background: #d4edda; color: #155724; }
.badge-negada { background: #f8d7da; color: #721c24; }
.badge-cancelada { background: #f1f3f4; color: #5f6368; }

.badge-admin { background: #fce8e6; color: var(--danger); }
.badge-operador { background: #e8f0fe; color: var(--primary); }
.badge-cliente { background: #e6f4ea; color: var(--secondary); }

/* =====================
   BOTÕES
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #f1f3f4; color: var(--text-secondary); }
.btn-secondary:hover { background: #e8eaed; }
.btn-success { background: var(--secondary); color: #fff; }
.btn-success:hover { background: #2d9148; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c5221f; }
.btn-warning { background: var(--warning); color: #212529; }
.btn-warning:hover { background: #f5a623; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-info { background: #e8f0fe; color: var(--primary); }
.btn-info:hover { background: #d2e3fc; }

/* =====================
   FORMULÁRIOS
   ===================== */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =====================
   TELA DE ANÁLISE (campos MAQLOG internos)
   ===================== */
.analise-container {
  max-width: 960px;
  margin: 0 auto;
}

.analise-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .analise-split { grid-template-columns: 1fr; }
}

.section-cliente-dados {
  border-left: 3px solid var(--info);
}

.section-maqlog-dados {
  border-left: 3px solid var(--secondary);
}

.section-titulo-maqlog {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.financial-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.financial-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.financial-input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: #fff;
  font-family: var(--font);
  transition: border-color var(--transition);
}

.financial-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52,168,83,0.1);
}

.financial-total {
  background: #e6f4ea;
  border-color: var(--secondary);
  color: var(--secondary);
  font-size: 1rem;
}

.analise-actions {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.analise-status-atual {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.analise-btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =====================
   MODAL
   ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal-box-sm { max-width: 480px; }
.modal-box-lg { max-width: 960px; }

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-page);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 1;
}

.modal-close:hover { background: var(--danger); color: #fff; }

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title i { color: var(--primary); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* =====================
   TOASTS
   ===================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 380px;
  animation: slideIn 0.25s ease;
}

.toast.success { border-left-color: var(--secondary); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast i.success { color: var(--secondary); }
.toast i.error { color: var(--danger); }
.toast i.warning { color: var(--warning); }
.toast i.info { color: var(--primary); }

/* =====================
   CHARTS
   ===================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.chart-wrapper { height: 220px; position: relative; }

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

.tab-btn {
  padding: 0.65rem 1.1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =====================
   LOADING E EMPTY STATE
   ===================== */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  gap: 0.75rem;
}

.loading-state i, .empty-state i { font-size: 2rem; }
.empty-state i { color: var(--border); }
.empty-state p { font-size: 0.9rem; }

/* =====================
   PORTAL CLIENTE — visual específico
   ===================== */
.portal-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.portal-header h2 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.portal-header p { font-size: 0.85rem; opacity: 0.85; }

/* =====================
   COTAÇÃO DETALHE — PARA O CLIENTE
   ===================== */
.cotacao-detalhe-header {
  background: linear-gradient(135deg, #1e2a3b 0%, #1a73e8 100%);
  color: #fff;
  padding: 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.cotacao-detalhe-body { padding: 1.5rem; }

.detalhe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.detalhe-item { display: flex; flex-direction: column; gap: 0.2rem; }
.detalhe-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.detalhe-value { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }

/* =====================
   RESPONSIVO
   ===================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: block; }
  .page-content { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-input-search { min-width: unset; }
  .filter-input-select, .filter-input-date { min-width: unset; }
  .analise-split { grid-template-columns: 1fr; }
}

/* =====================
   ANIMAÇÕES
   ===================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* =====================
   PRINT
   ===================== */
/* =====================
   ORDENS DE SERVIÇO (OS)
   ===================== */

/* Seletor de tipo de operação */
.os-tipo-btn {
  transition: all var(--transition);
}
.os-tipo-btn:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* Resumo financeiro da OS */
.os-financeiro-resumo {
  margin-top: 0.75rem;
}

/* Linha de custo extra */
.custo-extra-linha {
  background: #fafafa;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.custo-extra-linha:hover {
  background: #f0f7ff;
}

/* Badge OS status */
.badge-aberta       { background: #fff3cd; color: #856404; }
.badge-em_execucao  { background: #cce5ff; color: #004085; }
.badge-concluida    { background: #d4edda; color: #155724; }

/* Seção de operação destacada */
.section-terceiros {
  border-left: 3px solid var(--warning);
}

.section-frota {
  border-left: 3px solid var(--primary);
}

/* Tabela OS — coluna resultado */
.resultado-positivo { color: var(--secondary); font-weight: 700; }
.resultado-negativo { color: var(--danger);    font-weight: 700; }

/* =====================
   TABELA DE PREÇOS — ADMIN
   ===================== */
.tabela-precos-input {
  width: 100px;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.tabela-precos-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

/* Simulador resultado */
#sim_resultado .financial-input {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Destaque linha hover na tabela de preços */
#tabelaPrecosBody tr:hover td {
  background: #f0f7ff;
}

/* Botão de busca de CEP */
.btn-cep-buscar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, transform 0.1s;
}
.btn-cep-buscar:hover  { background: #1558b0; }
.btn-cep-buscar:active { transform: scale(0.95); }

/* =============================================
   WIDGET DE BUSCA DE CEP
   ============================================= */
.cep-widget-panel {
  position: fixed;
  z-index: 99999;
  width: 420px;
  max-width: calc(100vw - 20px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  animation: cepSlideIn 0.18s ease;
  overflow: hidden;
}
@keyframes cepSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cep-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
}
.cep-widget-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.15s;
}
.cep-widget-close:hover { background: rgba(255,255,255,0.4); }

/* Abas */
.cep-widget-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  background: #f8f9fa;
}
.cep-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.cep-tab:hover  { color: var(--primary); background: #f0f7ff; }
.cep-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: #fff; }

/* Corpo da aba */
.cep-widget-body {
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
}
.cep-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Linha de input + botão */
.cep-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Estados dos resultados */
.cep-loading {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.cep-aviso {
  padding: 0.75rem;
  background: #fff3cd;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #856404;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cep-nao-encontrado {
  padding: 1rem;
  background: #fce8e6;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.6;
}

/* Resultado encontrado (busca por número) */
.cep-encontrado {
  margin-top: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 0.85rem;
}
.cep-encontrado-titulo {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cep-encontrado-dados {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.cep-dado-item {
  display: flex;
  flex-direction: column;
}
.cep-dado-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.cep-dado-valor {
  font-size: 0.82rem;
  color: var(--text-primary);
}

/* Lista de resultados (busca por endereço) */
.cep-lista-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.25rem;
}
.cep-lista {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cep-lista-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  font-size: 0.8rem;
  background: #fff;
}
.cep-lista-item:hover {
  background: #e8f0fe;
  border-color: var(--primary);
  box-shadow: 0 1px 6px rgba(26,115,232,0.12);
}
.cep-item-cep {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.78rem;
  white-space: nowrap;
}
.cep-item-end {
  color: var(--text-primary);
  line-height: 1.4;
}
.cep-item-comp {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.cep-item-cidade {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

/* Scrollbar do widget */
.cep-widget-body::-webkit-scrollbar { width: 5px; }
.cep-widget-body::-webkit-scrollbar-track { background: transparent; }
.cep-widget-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* =============================================
   GESTÃO DE FUNCIONÁRIOS POR EMPRESA CLIENTE
   ============================================= */

/* Botão de contagem de funcionários na tabela de empresas */
.btn-func-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-func-count:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.func-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}
.func-badge-active {
  background: var(--primary);
  color: #fff;
}
.func-badge-empty {
  background: var(--border);
  color: var(--text-muted);
}
.func-label {
  font-size: 0.78rem;
}

/* Info box explicativa */
.info-box-func {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f0f7ff;
  border: 1px solid #c5d9f8;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.83rem;
  line-height: 1.6;
}
.info-box-func ul { margin-top: 0.25rem; }

/* Título de grupo de funcionários */
.func-grupo-titulo {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

/* Lista de funcionários */
.func-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card de funcionário */
.func-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}
.func-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.func-card-inativo {
  opacity: 0.55;
  background: #f8f9fa;
}

/* Avatar do funcionário */
.func-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Info do funcionário */
.func-info {
  flex: 1;
  min-width: 0;
}
.func-nome {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.func-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.func-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Botões de ação do funcionário */
.func-acoes {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Botões de tipo gerente/funcionário */
.func-tipo-btn {
  transition: all 0.15s;
}
.func-tipo-btn:hover {
  box-shadow: 0 2px 8px rgba(26,115,232,0.15);
}

/* Badge de perfil no portal do cliente */
.portal-perfil-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.portal-perfil-badge.perfil-gerente {
  background: #e8f0fe;
  border: 1px solid #c5d9f8;
  color: var(--primary);
}
.portal-perfil-badge.perfil-funcionario {
  background: #e6f4ea;
  border: 1px solid #a8d5b5;
  color: var(--secondary);
}
.perfil-empresa {
  font-weight: 400;
  opacity: 0.8;
}
.perfil-depto {
  background: rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.72rem;
}

/* =============================================
   MÓDULOS OS — MUNK / SERVIÇOS DIVERSOS / RASTREIO
   ============================================= */

/* Banner de OS originada de cotação */
.os-origem-cotacao {
  padding: 0.75rem 1rem;
  background: #e8f0fe;
  border-radius: var(--radius);
  border: 1px solid #c5d9f8;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Sub-seção de dados (terceiros / frota) */
.subsecao-titulo {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Seção Munk — fundo amarelo-âmbar */
.section-munk {
  border-left: 4px solid #d97706 !important;
  background: linear-gradient(135deg, #fffbeb, #fff) !important;
}

/* Seção Serviços Diversos — fundo índigo */
.section-servicos-diversos {
  border-left: 4px solid #6366f1 !important;
  background: linear-gradient(135deg, #eef2ff, #fff) !important;
}

/* Chips de seleção rápida de tipo de serviço Munk */
.chip-munk {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  background: #fef3c7;
  border: 1px solid #d97706;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #92400e;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.chip-munk:hover {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

/* Badge Munk na tabela de OS */
.badge-munk {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: #fef3c7;
  border: 1px solid #d97706;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #92400e;
  font-weight: 600;
}

/* Badge de rastreio da carga */
.rastreio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: #e0f2fe;
  border: 1px solid #0284c7;
  border-radius: 12px;
  font-size: 0.72rem;
  color: #0369a1;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Linha de serviço (Munk / Diversos) */
.servico-linha {
  transition: background 0.1s;
}
.servico-linha:hover {
  outline: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
}

/* Mensagem lista vazia */
.lista-vazia-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  font-style: italic;
}

/* Resumo financeiro OS */
.os-financeiro-resumo {
  background: linear-gradient(135deg, #f8f9fa, #e8f0fe);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
}

/* Cards do resumo financeiro */
.resumo-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border: 1px solid var(--border-light);
}
.resumo-card-destaque {
  border: 2px solid var(--primary) !important;
}
.resumo-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.resumo-valor {
  font-size: 1rem;
  font-weight: 700;
}

/* Coluna de stat-icon laranja */
.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

@media print {
  .sidebar, .top-header, .btn, .filters-bar { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
}
