:root {
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --secondary: #7e3af2;
  --success: #0e9f6e;
  --danger: #e02424;
  --warning: #c27803;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --quarta: #3b82f6;
  --sabado: #8b5cf6;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: var(--primary-dark);
  color: #fff;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
nav .brand { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
nav .nav-links { display: flex; gap: .25rem; }
nav .nav-links a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: .4rem .85rem;
  border-radius: 6px;
  font-size: .9rem;
  transition: background .15s;
}
nav .nav-links a:hover, nav .nav-links a.active { background: rgba(255,255,255,.15); color: #fff; }
nav .nav-user { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
nav .nav-user span { opacity: .8; }
.btn-logout {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: none;
  padding: .35rem .85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.22); }

/* ── MAIN LAYOUT ── */
main { max-width: 1100px; margin: 2rem auto; padding: 0 1.25rem; }

h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .75rem; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  text-align: center;
}
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 7px;
  border: none;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }
input, select, textarea {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .9rem;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f9fafb; text-align: left; padding: .65rem .9rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-quarta { background: #dbeafe; color: #1d4ed8; }
.badge-sabado { background: #ede9fe; color: #6d28d9; }
.badge-admin  { background: #fef3c7; color: #92400e; }
.badge-membro { background: #d1fae5; color: #065f46; }
.badge-ativo  { background: #d1fae5; color: #065f46; }
.badge-inativo{ background: #fee2e2; color: #991b1b; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e429f 0%, #7e3af2 100%);
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo .icon { font-size: 2.5rem; }
.login-logo h1 { font-size: 1.3rem; color: var(--primary-dark); margin-top: .5rem; }
.login-logo p { font-size: .85rem; color: var(--text-muted); }

/* ── CALENDAR ── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cal-title { font-size: 1.2rem; font-weight: 700; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-name {
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: .4rem 0;
  text-transform: uppercase;
}
.cal-cell {
  min-height: 80px;
  background: #f9fafb;
  border-radius: 8px;
  padding: .4rem;
  font-size: .8rem;
}
.cal-cell.today { border: 2px solid var(--primary); }
.cal-cell.other-month { opacity: .35; }
.cal-cell .day-num { font-weight: 700; font-size: .85rem; margin-bottom: .2rem; }
.cal-event {
  border-radius: 4px;
  padding: .15rem .4rem;
  margin-bottom: .15rem;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event.quarta { background: #dbeafe; color: #1d4ed8; }
.cal-event.sabado { background: #ede9fe; color: #6d28d9; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  position: relative;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h2 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── ALERTS ── */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: .875rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 160px; }

@media (max-width: 640px) {
  nav .nav-links a { padding: .35rem .5rem; font-size: .8rem; }
  .form-row { grid-template-columns: 1fr; }
  .cal-cell { min-height: 50px; }
  .cal-event { display: none; }
  .cal-cell .has-event::after { content: '•'; display: block; color: var(--primary); font-size: 1rem; text-align: center; }
}
