/* ==============================================================
   MAIS EDUCAR - DESIGN SYSTEM & STYLESHEET
   Replicating the exact look & feel from the screenshots
============================================================== */

:root {
  --primary-blue: #1d4ed8;
  --primary-blue-hover: #1e40af;
  --header-gradient-start: #1e40af;
  --header-gradient-mid: #2563eb;
  --header-gradient-end: #1d4ed8;
  --caixa-blue: #1e3a8a;
  --gold-accent: #f59e0b;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-slate: #f1f5f9;
  --card-border: #e2e8f0;
  --card-radius: 14px;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-slate);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ==============================================================
   UTILITIES
============================================================== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.grid {
  display: grid;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.container-main {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==============================================================
   LOGIN SCREEN (Matches Image 1)
============================================================== */
#loginSection {
  background-color: #f0f4f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.login-title {
  color: #1e3a8a;
  font-size: 1.85rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 6px;
  transition: transform 0.15s ease;
}
.password-toggle:hover {
  transform: scale(1.15);
}

.btn-primary-blue {
  background-color: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary-blue:hover {
  background-color: #1e40af;
}

.btn-primary-blue:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}
.btn-secondary:hover {
  background-color: #e2e8f0;
}

.forgot-link {
  color: #2563eb;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.2s;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ==============================================================
   HEADER & USER BAR (Matches Image 3)
============================================================== */
.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%);
  color: #ffffff;
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
}

.brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.brand-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-icon {
  font-size: 1.85rem;
}

.pencil-icon {
  font-size: 1.5rem;
}

.badge-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.35rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.gold-line {
  height: 4px;
  background: #f59e0b;
  width: 100%;
}

.user-bar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
}

.user-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.btn-logout {
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s ease;
}

.btn-logout:hover {
  background-color: #b91c1c;
}

/* ==============================================================
   NAVIGATION TABS (Matches Image 3)
============================================================== */
.nav-tabs-wrapper {
  background-color: #ffffff;
  border-bottom: 2px solid #e2e8f0;
}

.nav-tabs-container {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav-tabs-scroll {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  background-color: #f1f5f9;
  color: #1e3a8a;
}

.nav-tab.active {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.05);
}

.tab-icon {
  font-size: 1.1rem;
}

/* Tab contents */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

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

/* ==============================================================
   DASHBOARD CARDS (Matches Image 2)
============================================================== */
.btn-toggle-mask {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.btn-toggle-mask:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

/* 4 KPI Top Stat Cards */
.stat-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.02em;
}

/* Caixa Total Acumulado Card */
.caixa-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-radius: var(--card-radius);
  padding: 1.5rem 1.6rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  display: flex;
  align-items: center;
}

.caixa-watermark {
  position: absolute;
  right: 1.5rem;
  font-size: 5rem;
  opacity: 0.15;
  pointer-events: none;
}

.caixa-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
}

.caixa-subtitle {
  font-size: 0.78rem;
  color: #93c5fd;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.caixa-value {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Status Pagamentos Card */
.card {
  background: #ffffff;
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.status-card {
  padding: 1.4rem 1.6rem;
}

.card-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 1.25rem;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.progress-item:last-child {
  margin-bottom: 0;
}

.progress-bar-bg {
  flex: 1;
  background-color: #f1f5f9;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease-in-out;
}

.fill-green { background-color: #10b981; }
.fill-yellow { background-color: #eab308; }
.fill-red { background-color: #ef4444; }

.progress-badge {
  min-width: 105px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: right;
}

.badge-green { color: #10b981; }
.badge-yellow { color: #ca8a04; }
.badge-red { color: #ef4444; }

/* Fluxo De Caixa Card (Green left border) */
.fluxo-card {
  padding: 1.4rem 1.6rem;
  border-left: 5px solid #10b981;
}

.fluxo-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 1.1rem;
}

.fluxo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}

.fluxo-label {
  color: #475569;
  font-weight: 500;
}

.fluxo-subrow {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.fluxo-val-green {
  color: #10b981;
  font-weight: 800;
}

.fluxo-val-normal {
  color: #dc2626;
  font-weight: 700;
}

.fluxo-val-orange {
  color: #d97706;
  font-weight: 700;
}

.fluxo-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1rem 0;
}

.fluxo-total-row {
  margin-top: 0.5rem;
}

.fluxo-label-total {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.fluxo-val-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1d4ed8;
}

/* Nossa Equipe Card (Purple left border) */
.equipe-card {
  padding: 1.4rem 1.6rem;
  border-left: 5px solid #8b5cf6;
  display: flex;
  flex-direction: column;
}

.equipe-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.equipe-icon {
  font-size: 1.25rem;
}

.equipe-badge-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.equipe-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: #7c3aed;
  line-height: 1;
}

.equipe-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: #6d28d9;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

/* ==============================================================
   TABLES & LISTS
============================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e3a8a;
}

.section-desc {
  font-size: 0.85rem;
  color: #64748b;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-pago {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-pendente {
  background-color: #fefce8;
  color: #b45309;
  border: 1px solid #fef08a;
}

.badge-atrasado {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-isento {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Pill Filter Buttons */
.pill-filter {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-filter:hover {
  background-color: #f1f5f9;
}

.pill-filter.active {
  background-color: #1d4ed8;
  color: #ffffff !important;
  border-color: #1d4ed8;
}

/* Agenda & Planning Cards */
.agenda-grid, .planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.agenda-card, .plan-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.agenda-card:hover, .plan-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Action button styles in tables */
.btn-action {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-action:hover {
  background: #f1f5f9;
}
.btn-action-green {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.btn-action-green:hover {
  background: #d1fae5;
}
.btn-action-wa {
  color: #047857;
  border-color: #6ee7b7;
  background: #f0fdf4;
}
.btn-action-wa:hover {
  background: #dcfce7;
}

/* ==============================================================
   MODALS
============================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}

.modal-card {
  background-color: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e3a8a;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.close-modal-btn:hover {
  color: #0f172a;
}

.modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* App Footer */
.app-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0;
  margin-top: auto;
}

