/* ============================================================
   ESTILOS GERAIS - MENTALE ESCOLA (DESIGN SYSTEM LINEAR / SHADCN)
   100% Purple Ban Compliant — Inter Typography & Slate Palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Slate Scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Accent Scale (No Purple / Violet) */
  --blue-600: #0284c7;
  --blue-700: #0369a1;
  --blue-50: #f0f9ff;
  --blue-100: #e0f2fe;

  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-50: #ecfdf5;
  --emerald-100: #dcfce7;

  --amber-600: #d97706;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;

  --rose-600: #e11d48;
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;

  /* Semantic compatibility tokens */
  --azul-sobrio: var(--slate-900);
  --verde-suave: #dbeafe;
  --verde-oliva: var(--emerald-600);
  --bege-neutro: #f1f5f9;
  --white: #ffffff;
  --text-dark: var(--slate-900);
  --text-muted: var(--slate-500);
  --border-radius: 12px;
  --border-color: var(--slate-200);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body) !important;
  background-color: var(--bege-neutro) !important;
  color: var(--slate-800) !important;
  line-height: 1.55;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .title {
  font-family: var(--font-title) !important;
  color: var(--slate-900);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* HEADER PRINCIPAL */
.main-header {
  background-color: var(--slate-900) !important;
  color: #fff;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background-color: var(--blue-600);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.logo-text {
  font-family: var(--font-title) !important;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-logout {
  color: #fca5a5;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(225, 29, 72, 0.2);
  color: #fff;
}

/* LAYOUT DASHBOARD COM SIDEBAR (FLUIDO & AUTO-AJUSTÁVEL) */
.dashboard-layout {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 1.25rem 2rem;
  gap: 1.5rem;
  flex: 1;
}

@media (max-width: 992px) {
  .dashboard-layout {
    flex-direction: column;
    padding: 1rem 1rem;
  }
}

.sidebar {
  width: 285px;
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .sidebar {
    width: 100%;
  }
}

.sidebar-nav {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  color: var(--slate-700);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.15s ease;
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--slate-400);
}

.sidebar-nav a:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.sidebar-nav a:hover i {
  color: var(--slate-700);
}

.sidebar-nav a.active {
  background-color: var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
  border-left: 3px solid var(--blue-600);
}

.sidebar-nav a.active i {
  color: var(--blue-600);
}

.content-area {
  flex-grow: 1;
  width: 100%;
  min-width: 0;
}

/* CARDS & CONTAINERS */
.card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .card-grid-2 {
    grid-template-columns: 1fr;
  }
}

.margin-top {
  margin-top: 1.5rem;
}

/* FORMULÁRIOS & CONTROLES */
.form-group, .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label, .filter-group label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--slate-700);
}

.form-control, 
.filter-group input, 
.filter-group select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  font-family: var(--font-body) !important;
  font-size: 0.88rem;
  color: var(--slate-800);
  background-color: #ffffff;
  transition: all 0.15s ease;
  outline: none;
}

.form-control:focus, 
input:focus, 
select:focus, 
textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* BOTÕES MODERNOS */
.btn, .btn-primary, .btn-secondary, .btn-success, .btn-outline, .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.58rem 1.15rem;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary, .btn-submit {
  background: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover, .btn-submit:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
}

.btn-secondary:hover {
  background: var(--slate-50);
  color: var(--slate-900);
  border-color: var(--slate-400);
}

.btn-success {
  background: var(--emerald-600);
  color: #ffffff;
}

.btn-success:hover {
  background: var(--emerald-700);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
}

.btn-outline:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.btn-action-view {
  background: var(--blue-100);
  color: var(--blue-700);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-action-view:hover {
  background: var(--blue-600);
  color: #fff;
}

.btn-action-test {
  background: var(--emerald-100);
  color: var(--emerald-700);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-action-test:hover {
  background: var(--emerald-600);
  color: #fff;
}

/* MÉTRICAS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.color-blue { background: var(--blue-100); color: var(--blue-600); }
.color-green { background: var(--emerald-100); color: var(--emerald-600); }
.color-yellow { background: var(--amber-100); color: var(--amber-600); }
.color-red { background: var(--rose-100); color: var(--rose-600); }
.color-purple { background: var(--slate-100); color: var(--slate-700); } /* Neutral fallback */

.metric-number {
  font-family: var(--font-title) !important;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.1;
  display: block;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* TABELAS */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.data-table th {
  background-color: var(--slate-50);
  color: var(--slate-600);
  font-family: var(--font-title) !important;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--slate-200);
}

.data-table tbody tr:hover {
  background-color: var(--slate-50);
}

/* BADGES & PILLS */
.badge, .count-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-success { background: var(--emerald-100); color: var(--emerald-700); }
.badge-warning { background: var(--amber-100); color: var(--amber-600); }
.badge-danger { background: var(--rose-100); color: var(--rose-600); }
.badge-info { background: var(--blue-100); color: var(--blue-700); }
.badge-secondary { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200); }
.badge-outline { border: 1px solid var(--slate-300); color: var(--slate-700); background: transparent; }

/* ALERTAS */
.alert, .alert-success, .alert-danger, .alert-error {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-weight: 500;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success { background: var(--emerald-50); color: var(--emerald-700); border: 1px solid #bbf7d0; }
.alert-danger, .alert-error { background: var(--rose-50); color: var(--rose-600); border: 1px solid #fecdd3; }

/* MODAIS */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.25rem;
}

.modal-overlay.active { display: flex; }

.modal-box, .modal-container {
  background: #ffffff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-200);
}

/* FOOTER */
footer {
  margin-top: auto;
  background: var(--slate-900);
  color: var(--slate-400);
  text-align: center;
  padding: 1.2rem;
  font-size: 0.82rem;
}

/* ============================================================
   GRID DE FILTROS COMPACTO (DASHBOARD & RELATÓRIOS)
   ============================================================ */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
}
.filters-grid label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.filters-grid select,
.filters-grid input[type="text"] {
  width: 100%;
  height: 34px;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  font-size: 0.81rem;
  background: #fff;
  color: var(--slate-800);
  outline: none;
}
.filters-grid select:focus,
.filters-grid input[type="text"]:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
.filters-col-1 { grid-column: span 1; }
.filters-col-2 { grid-column: span 2; }
.filters-col-3 { grid-column: span 3; }
.filters-col-4 { grid-column: span 4; }
@media (max-width: 1200px) {
  .filters-col-1 { grid-column: span 3; }
  .filters-col-2 { grid-column: span 4; }
  .filters-col-3 { grid-column: span 6; }
  .filters-col-4 { grid-column: span 6; }
}
@media (max-width: 768px) {
  .filters-grid { grid-template-columns: 1fr; }
  .filters-col-1, .filters-col-2, .filters-col-3, .filters-col-4 { grid-column: span 1; }
}
