/* =============================================
   GESTESCOLAR – ESTILOS PRINCIPAIS (Responsivo)
   ============================================= */

/* ---------- Reset e Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #1a73e8;
  --primary-dk: #1557b0;
  --secondary:  #34a853;
  --danger:     #ea4335;
  --warning:    #fbbc04;
  --info:       #4285f4;
  --bg:         #f0f4f8;
  --surface:    #ffffff;
  --sidebar-bg: #0d1b2a;
  --sidebar-tx: #b0bec5;
  --sidebar-ac: #1a73e8;
  --text:       #202124;
  --text-muted: #5f6368;
  --border:     #dadce0;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.16);
  --font:       'Segoe UI', system-ui, sans-serif;
  --sidebar-w:  240px;
  --topbar-h:   56px;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }
#app { height: 100%; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* overlay quando sidebar aberta no mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
}
.layout.sidebar-open .sidebar-overlay { display: block; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease, transform .25s ease;
  z-index: 200;
  position: relative;
}

.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 15px; }
.sidebar-brand .brand-sub  { color: var(--sidebar-tx); font-size: 11px; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section-title {
  color: #ffffff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px;
  padding: 12px 16px 4px;
  text-transform: uppercase;
  border-radius: 6px;
  transition: background .18s, color .18s;
}
.nav-section-title:hover {
  background: rgba(255,255,255,.12);
  color: #ffffff;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  color: var(--sidebar-tx);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .2s;
  font-size: 13.5px;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(26,115,232,.15); color: #fff; border-left-color: var(--primary); }
.nav-item i      { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s;
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { color: var(--sidebar-tx); font-size: 11px; }
.btn-logout { background: none; border: none; color: var(--sidebar-tx); padding: 4px; font-size: 14px; flex-shrink: 0; }
.btn-logout:hover { color: var(--danger); }

/* Sidebar colapsada */
.layout.sidebar-collapsed .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  padding: 0;
}
.layout.sidebar-collapsed .sidebar .sidebar-brand,
.layout.sidebar-collapsed .sidebar .sidebar-nav,
.layout.sidebar-collapsed .sidebar .sidebar-footer,
.layout.sidebar-collapsed .sidebar > div {
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.layout.sidebar-collapsed #sidebar-collapse-btn {
  position: fixed !important;
  left: 8px;
  top: 12px;
  right: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 1000;
}

/* =============================================
   CONTEÚDO PRINCIPAL
   ============================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Topbar (só visível no mobile) */
.topbar {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: var(--topbar-h);
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Botão hamburguer */
.btn-menu {
  background: none; border: none;
  color: var(--text); font-size: 20px;
  padding: 6px; border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-menu:hover { background: #f1f3f4; }

/* Área de conteúdo */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

/* =============================================
   CARTÕES / CARDS
   ============================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 700; }

/* =============================================
   STATS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f0fe; color: #1a73e8; }
.stat-icon.green  { background: #e6f4ea; color: #34a853; }
.stat-icon.red    { background: #fce8e6; color: #ea4335; }
.stat-icon.yellow { background: #fef9e3; color: #f9ab00; }
.stat-icon.purple { background: #f3e8fd; color: #8e24aa; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* =============================================
   BOTÕES
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13.5px; font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #2d9148; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #e8f0fe; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
.btn-present { background: #e6f4ea; color: #2d9148; border: 1.5px solid #a8d5b5; }
.btn-present:hover, .btn-present.active { background: #34a853; color: #fff; }
.btn-absent  { background: #fce8e6; color: #c62828; border: 1.5px solid #f4aea8; }
.btn-absent:hover, .btn-absent.active  { background: #ea4335; color: #fff; }

/* =============================================
   TABELAS
   ============================================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead th {
  background: #f8f9fa;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: none; }

/* =============================================
   BADGE
   ============================================= */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
}
.badge-blue   { background: #e8f0fe; color: #1a73e8; }
.badge-green  { background: #e6f4ea; color: #2d9148; }
.badge-red    { background: #fce8e6; color: #c62828; }
.badge-yellow { background: #fef9e3; color: #b06000; }
.badge-purple { background: #f3e8fd; color: #7b1fa2; }
.badge-gray   { background: #f1f3f4; color: #5f6368; }

/* =============================================
   FORMULÁRIOS
   ============================================= */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .2s;
  background: var(--surface);
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.form-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s;
}
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
  gap: 10px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); padding: 4px; border-radius: 50%; }
.modal-close:hover { background: #f1f3f4; color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  position: sticky; bottom: 0;
  background: var(--surface);
}

/* =============================================
   LOGIN
   ============================================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
  padding: 16px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin-bottom: 10px;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.login-logo p  { color: var(--text-muted); font-size: 13px; }
.login-divider { text-align: center; margin: 18px 0; position: relative; }
.login-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.login-divider span { background: var(--surface); padding: 0 12px; color: var(--text-muted); font-size: 12px; position: relative; }
.demo-accounts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.demo-btn {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fafbff;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: all .2s;
  font-size: 12.5px;
  text-align: left;
}
.demo-btn:hover { border-color: var(--primary); background: #e8f0fe; }
.demo-btn .demo-role { font-weight: 700; }
.demo-btn .demo-cred { color: var(--text-muted); font-size: 11px; }

/* =============================================
   ALERTAS
   ============================================= */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-danger  { background: #fce8e6; color: #c62828; border-left: 4px solid var(--danger); }
.alert-success { background: #e6f4ea; color: #2d9148; border-left: 4px solid var(--secondary); }
.alert-info    { background: #e8f0fe; color: #1a73e8; border-left: 4px solid var(--primary); }
.alert-warning { background: #fef9e3; color: #b06000; border-left: 4px solid var(--warning); }

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 9px 16px;
  background: none; border: none;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover   { color: var(--primary); }
.tab-btn.active  { color: var(--primary); border-bottom-color: var(--primary); }

/* =============================================
   FINANCEIRO
   ============================================= */
.financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.fin-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.fin-card-label { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fin-card-value { font-size: 24px; font-weight: 800; margin: 6px 0 2px; }
.fin-card-sub   { font-size: 12px; color: var(--text-muted); }

/* Gráfico de Evolução Mensal */
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px 8px 0;
  overflow-x: auto;
}
.month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 70px;
}
.month-bars-wrap {
  display: flex;
  align-items: flex-end;
  height: 150px;
  width: 100%;
  justify-content: center;
}
.bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.month-bar {
  width: 20px;
  border-radius: 4px 4px 0 0;
  transition: height .4s ease;
  cursor: default;
  position: relative;
}
.month-bar:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.bar-rec  { background: var(--secondary); }
.bar-desp { background: var(--danger); opacity: .85; }
.month-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}
.month-vals {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
}
.mv-rec  { font-size: 10px; color: var(--secondary); font-weight: 700; }
.mv-desp { font-size: 10px; color: var(--danger); font-weight: 700; }
.chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 14px 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* =============================================
   PRESENÇA / CHAMADA
   ============================================= */
.attendance-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* =============================================
   NOTAS
   ============================================= */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-weight: 800; font-size: 13px;
}
.grade-A { background: #e6f4ea; color: #2d9148; }
.grade-B { background: #e8f0fe; color: #1557b0; }
.grade-C { background: #fef9e3; color: #b06000; }
.grade-D { background: #fce8e6; color: #c62828; }
.grade-F { background: #f1f3f4; color: #5f6368; }

/* =============================================
   PIX / MENSAGENS
   ============================================= */
.pix-code-box {
  background: #f8f9fa;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  margin: 12px 0;
}
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item {
  background: #f8f9fa;
  border-radius: var(--radius);
  padding: 11px 13px;
  border-left: 4px solid var(--primary);
}
.msg-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.msg-from   { font-weight: 700; font-size: 13px; }
.msg-date   { font-size: 11px; color: var(--text-muted); }
.msg-text   { font-size: 13.5px; }
.msg-unread { background: #e8f0fe; border-left-color: var(--secondary); }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar-wrap { background: #f0f0f0; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 8px; border-radius: 20px; background: var(--primary); transition: width .4s; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 44px; margin-bottom: 10px; opacity: .4; display: block; }
.empty-state p { font-size: 14px; }

/* =============================================
   TOAST
   ============================================= */
.toast-container {
  position: fixed; bottom: 20px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #323232;
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  animation: slideRight .25s;
  max-width: 320px;
  word-break: break-word;
}
.toast.success { background: var(--secondary); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }

/* =============================================
   CADASTRO DE FUNCIONÁRIO
   ============================================= */
.register-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.register-card {
  background: var(--surface);
  border-radius: 16px;
  width: 100%; max-width: 660px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.register-header {
  background: var(--primary);
  color: #fff;
  padding: 22px 28px;
}
.register-header h2 { font-size: 19px; font-weight: 800; }
.register-header p  { opacity: .85; font-size: 13px; margin-top: 4px; }
.register-body { padding: 24px 28px; }

.role-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.role-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.role-option:hover   { border-color: var(--primary); background: #f0f4ff; }
.role-option.selected{ border-color: var(--primary); background: #e8f0fe; }
.role-option .role-icon { font-size: 26px; margin-bottom: 5px; }
.role-option .role-name { font-weight: 700; font-size: 13px; }
.role-option .role-desc { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

/* =============================================
   ANIMAÇÕES
   ============================================= */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight{ from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =============================================
   UTILITÁRIOS
   ============================================= */
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-16  { margin-bottom: 16px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); font-size: 12.5px; }
.fw-700  { font-weight: 700; }
.w-100   { width: 100%; }
.hidden  { display: none !important; }
.green   { color: var(--secondary); }
.red     { color: var(--danger); }
.blue    { color: var(--primary); }

/* =============================================
   RESPONSIVO — TABLET (≤ 900px)
   ============================================= */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .financial-summary { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard grids lado a lado → empilhado */
  div[style*="grid-template-columns:1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* =============================================
   RESPONSIVO — MOBILE (≤ 640px)
   ============================================= */
@media (max-width: 640px) {
  /* Sidebar vira drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Mostrar topbar com hamburguer */
  .topbar { display: flex; }

  /* Conteúdo ocupa 100% */
  .main-content { width: 100%; }
  .page-content { padding: 14px; }

  /* Cards */
  .card { padding: 14px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-header > div { width: 100%; }

  /* Formulários em coluna única */
  .form-row, .form-row-3 { grid-template-columns: 1fr !important; gap: 0 !important; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card  { padding: 12px; }
  .stat-value { font-size: 18px; }
  .stat-icon  { width: 38px; height: 38px; font-size: 17px; }

  /* Financeiro */
  .financial-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fin-card { padding: 14px; }
  .fin-card-value { font-size: 18px; }

  /* Modal full-screen no mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    animation: slideUpMobile .25s ease;
  }

  /* Role selector 1 coluna */
  .role-selector { grid-template-columns: 1fr 1fr; gap: 8px; }
  .register-body { padding: 18px; }
  .register-header { padding: 18px; }

  /* Login */
  .login-card { padding: 24px 18px; }

  /* Chamada: botões lado a lado menores */
  .btn-present, .btn-absent { padding: 5px 8px; font-size: 11.5px; }

  /* Topbar */
  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 14px; }

  /* Tabela */
  thead th { padding: 8px 10px; font-size: 10px; }
  tbody td { padding: 9px 10px; font-size: 13px; }

  /* Botões de ação em tabela */
  .btn-sm { padding: 4px 8px; font-size: 11.5px; }

  /* Busca alunos */
  #studentSearch { width: 100% !important; }
}

/* =============================================
   RESPONSIVO — TELAS MUITO PEQUENAS (≤ 380px)
   ============================================= */
@media (max-width: 380px) {
  .stats-grid        { grid-template-columns: 1fr; }
  .financial-summary { grid-template-columns: 1fr; }
  .role-selector     { grid-template-columns: 1fr; }
  .stat-value        { font-size: 20px; }
}

@keyframes slideUpMobile {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
