/* ============================================================
   EDUCA — Design System
   ============================================================ */

:root {
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --primary-lt:  #dbeafe;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warning:     #d97706;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --white:       #ffffff;
  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-w:   240px;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Utility ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-sm { font-size: .875rem; }
.text-muted { color: var(--gray-400); }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.gap-2 { gap: .5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ---- Badge de perfil ---- */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-admin      { background: #fee2e2; color: #991b1b; }
.badge-gestao     { background: #fef3c7; color: #92400e; }
.badge-professor  { background: #dbeafe; color: #1e40af; }
.badge-responsavel{ background: #d1fae5; color: #065f46; }
.badge-aluno      { background: #ede9fe; color: #4c1d95; }
.badge-active     { background: #d1fae5; color: #065f46; }
.badge-inactive   { background: #fee2e2; color: #991b1b; }
.badge-warning    { background: #fef3c7; color: #92400e; }

/* ---- Form inputs ---- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: .375rem;
}
.form-input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-checkbox { width: 1rem; height: 1rem; accent-color: var(--primary); }
.form-error {
  font-size: .8125rem;
  color: var(--danger);
  margin-top: .25rem;
}
.errorlist { list-style: none; }
.errorlist li {
  font-size: .8125rem;
  color: var(--danger);
  margin-top: .25rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5625rem 1.125rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary   { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dk); opacity: 1; }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-success   { background: var(--success); color: var(--white); }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-icon { padding: .375rem; border-radius: 6px; }

/* ---- Messages ---- */
.messages { list-style: none; margin-bottom: 1rem; }
.messages li {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: .5rem;
}
.messages .success { background: #d1fae5; color: #065f46; }
.messages .error   { background: #fee2e2; color: #991b1b; }
.messages .warning { background: #fef3c7; color: #92400e; }
.messages .info    { background: var(--primary-lt); color: #1e40af; }

/* ---- Card ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

/* ---- Table ---- */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  background: var(--gray-50);
  padding: .75rem 1rem;
  text-align: left;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1.5px solid var(--gray-200);
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: .5rem; align-items: center; margin-top: 1.5rem; }
.pagination a, .pagination span {
  padding: .375rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
}
.pagination a:hover { background: var(--primary-lt); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ---- App layout (sidebar) ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-800);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
  letter-spacing: -.01em;
  color: var(--white);
  text-decoration: none;
  display: block;
}
.sidebar-brand span { color: var(--primary); }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-section {
  padding: .375rem 1rem .25rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  margin-top: .5rem;
}
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}
.sidebar-section-toggle * { cursor: pointer; }
.sidebar-section-toggle:hover {
  background: rgba(255,255,255,.08);
  color: var(--gray-300);
}
.sidebar-section-symbol {
  color: var(--gray-300);
  font-size: .95rem;
  line-height: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem 1.5rem;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,.08);
  color: var(--white);
  text-decoration: none;
}
.sidebar-link svg { flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .825rem;
  color: rgba(255,255,255,.5);
}
.sidebar-footer .user-name { font-weight: 600; color: rgba(255,255,255,.85); font-size: .9rem; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-weight: 600; font-size: 1rem; color: var(--gray-800); }
.page-body { padding: 2rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.375rem; font-weight: 700; }
.page-header p  { color: var(--gray-400); font-size: .9rem; margin-top: .25rem; }

/* ---- Filter bar ---- */
.filter-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-bar .form-input { width: auto; min-width: 160px; }

/* ---- Action group ---- */
.action-group { display: flex; gap: .375rem; }
