@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* =============================================
   RESET E BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, sans-serif;
  background: #f8fafc;
  color: var(--primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

/* =============================================
   VARIÁVEIS CSS
   ============================================= */
:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --primary-hover: #0b1220;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #06b6d4;
  --info-bg: #ecfeff;
  --info-border: #a5f3fc;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --white: #ffffff;
  --sidebar-width: 260px;
  --header-height: 60px;
  --border-radius: 10px;
  --border-radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-chip {
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 170px;
  height: auto;
  display: block;
}

.sidebar-unidade {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-unidade label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 6px;
}

.sidebar-unidade select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.sidebar-unidade select option {
  background: var(--primary);
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-info .nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .perfil {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-transform: capitalize;
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}

.btn-logout:hover {
  background: rgba(239,68,68,0.2);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* =============================================
   CONTEÚDO PRINCIPAL
   ============================================= */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-breadcrumb span {
  color: var(--gray-300);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =============================================
   CONTEÚDO DA PÁGINA
   ============================================= */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* =============================================
   CARDS E PAINÉIS
   ============================================= */
.card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary-light);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* =============================================
   KPI CARDS (DASHBOARD)
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card-icon.blue { background: var(--info-bg); color: var(--accent); }
.kpi-card-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-card-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.kpi-card-icon.red { background: var(--danger-bg); color: var(--danger); }

.kpi-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.kpi-card-sub {
  font-size: 12px;
  color: var(--gray-400);
}

/* =============================================
   BOTÕES
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition),
    transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { opacity: 0.88; }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { opacity: 0.88; }

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-light);
  border: 1.5px solid var(--primary-light);
}
.btn-outline-primary:hover {
  background: var(--info-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: none;
  padding: 7px 12px;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 11px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  width: 34px;
  height: 34px;
}

/* =============================================
   FORMULÁRIOS
   ============================================= */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 9px;
  font-size: 14px;
  color: var(--primary);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-control.warning {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Checkbox e Switch */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check-label {
  font-size: 13.5px;
  color: var(--gray-700);
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 24px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* =============================================
   TABELAS
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody td {
  padding: 12px 14px;
  color: var(--gray-700);
  vertical-align: middle;
}

tfoot tr {
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
}

tfoot td {
  padding: 11px 14px;
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* =============================================
   BADGES E STATUS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: #059669;
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: #d97706;
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: #dc2626;
  border: 1px solid var(--danger-border);
}

.badge-info {
  background: var(--info-bg);
  color: #0e7490;
  border: 1px solid var(--info-border);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.badge-primary {
  background: #eff3ff;
  color: var(--primary-light);
  border: 1px solid #c7d2fe;
}

/* =============================================
   ALERTAS
   ============================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--border-radius);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  margin-top: 1px;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #065f46;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #991b1b;
}

.alert-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: #1e40af;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition);
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-lg {
  max-width: 720px;
}

.modal-xl {
  max-width: 900px;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--gray-100);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  transition: background var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--primary);
}

.modal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* =============================================
   TOAST / NOTIFICAÇÕES
   ============================================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success svg { color: var(--success); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error svg { color: var(--danger); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning svg { color: var(--warning); }

.toast-info { border-left: 4px solid var(--accent); }
.toast-info svg { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* =============================================
   LOADING
   ============================================= */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: var(--white);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--gray-400);
  font-size: 14px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  color: var(--gray-400);
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--gray-300);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.empty-state p {
  font-size: 14px;
  max-width: 280px;
  line-height: 1.5;
}

/* =============================================
   FILTROS E BUSCA
   ============================================= */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--gray-400);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: 9px;
  font-size: 13.5px;
  background: var(--white);
  color: var(--primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}

/* =============================================
   PAGINAÇÃO
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 4px;
}

.pagination-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--white);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =============================================
   AJUSTE MANUAL — INDICADOR
   ============================================= */
.ajuste-manual-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 2px 8px;
}

.ajuste-manual-indicator svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* =============================================
   UTILIDADES
   ============================================= */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-small { font-size: 12px; }
.text-bold { font-weight: 700; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-light); }
.w-full { width: 100%; }
.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 16px 0;
}

/* =============================================
   MENU MOBILE (HAMBÚRGUER + OVERLAY)
   ============================================= */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 110;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-menu-toggle .icone-fechar {
  display: none;
}

.mobile-menu-toggle.aberto .icone-abrir {
  display: none;
}

.mobile-menu-toggle.aberto .icone-fechar {
  display: block;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 95;
}

.sidebar-overlay.aberto {
  display: block;
}

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .page-header {
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 10px 16px 10px 60px;
  }

  .page-header-right {
    flex-wrap: wrap;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 16px;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    max-width: 100%;
  }
}