:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --sidebar: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #0f766e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: .95rem; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: .93rem;
  text-align: left;
  transition: background .15s, color .15s;
}

.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.space-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 6px 10px;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
}

.space-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.space-btn span { font-size: .9rem; }
.space-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.space-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

.space-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.space-badge.auditorio { background: #e0f2fe; color: #0369a1; }
.space-badge.biblioteca { background: #fef3c7; color: #b45309; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: #fff;
  font-size: .88rem;
}

.user-chip .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
}

.user-chip small { display: block; color: var(--sidebar-text); font-size: .76rem; }

.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: transparent;
  color: #fda4af;
  font-size: .85rem;
}

.logout-btn:hover { background: rgba(220,38,38,.15); }

.pass-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: transparent;
  color: #93c5fd;
  font-size: .85rem;
}

.pass-btn:hover { background: rgba(15,118,110,.25); }

.main { flex: 1; padding: 28px 32px; max-width: 1200px; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

.page-header h1 { font-size: 1.45rem; font-weight: 700; }
.page-header .sub { color: var(--text-muted); font-size: .9rem; margin-top: 2px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 { font-size: 1.05rem; margin-bottom: 14px; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Room status card ---------- */
.room-card { padding: 22px; border-left: 6px solid var(--border); }
.room-card.free { border-left-color: var(--success); }
.room-card.occupied { border-left-color: var(--danger); }

.room-card .room-top { display: flex; align-items: center; justify-content: space-between; }
.room-card h3 { font-size: 1.1rem; }
.room-card .room-icon { font-size: 1.6rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.status-pill.free { background: var(--success-bg); color: var(--success); }
.status-pill.occupied { background: var(--danger-bg); color: var(--danger); }
.status-pill.busy { background: var(--warning-bg); color: var(--warning); }

.occupied-banner {
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-info { margin-top: 14px; color: var(--text-muted); font-size: .92rem; }
.room-info strong { color: var(--text); }
.room-next { margin-top: 10px; font-size: .88rem; }

/* ---------- Clock ---------- */
.clock { text-align: right; }
.clock .time { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock .date { color: var(--text-muted); font-size: .9rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #f8fafc; }
td .tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tag.admin { background: #ede9fe; color: #6d28d9; }
.tag.professor { background: #dbeafe; color: #1d4ed8; }
.tag.aluno { background: #ccfbf1; color: #0f766e; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.form-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 14px;
  border-radius: 9px;
  font-size: .9rem;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.alert.error { background: var(--danger-bg); color: #991b1b; }
.alert.success { background: var(--success-bg); color: #166534; }
.alert .close { background: none; border: none; font-size: 1rem; color: inherit; cursor: pointer; }

/* ---------- Reservation list ---------- */
.res-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.res-item:last-child { border-bottom: none; }
.res-item .time-block { text-align: center; min-width: 74px; }
.res-item .time-block .t { font-weight: 700; font-size: .95rem; }
.res-item .time-block .sep { color: var(--text-muted); font-size: .8rem; }
.res-item .res-body { flex: 1; }
.res-item .res-body .res-title { font-weight: 600; font-size: .93rem; }
.res-item .res-body .res-meta { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.res-item .room-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.res-item.now { background: var(--primary-light); border-radius: 9px; padding: 12px; border-bottom: none; }

.empty-state { text-align: center; padding: 30px 10px; color: var(--text-muted); }
.empty-state .big { font-size: 2rem; margin-bottom: 8px; }
.empty-state .empty-logo { width: 44px; height: 44px; margin: 0 auto 10px; opacity: .9; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-card .logo { width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 16px; }
.login-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.login-card p { color: var(--text-muted); font-size: .9rem; margin-bottom: 24px; }
.login-hint { margin-top: 18px; background: var(--primary-light); padding: 10px 12px; border-radius: 9px; font-size: .78rem; color: var(--primary-dark); text-align: center; }

.notice {
  background: var(--warning-bg);
  color: #92400e;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: .84rem;
  margin-top: 14px;
}

.tag.solicitada { background: var(--warning-bg); color: var(--warning); }

/* ---------- EspaçoEspab ---------- */
.brand-sub { display: block; font-size: .68rem; font-weight: 500; color: var(--sidebar-text); letter-spacing: .08em; text-transform: uppercase; }

.nav-badge {
  margin-left: auto;
  background: #f59e0b;
  color: #111827;
  font-size: .72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin-bottom: 0; }

.modal-wide { max-width: 680px; }
.modal-text { color: var(--text-muted); font-size: .92rem; margin-bottom: 16px; }

.notice-success { background: var(--success-bg); color: #166534; }
.notice-warning { background: var(--warning-bg); color: #92400e; }
.notice-error { background: var(--danger-bg); color: #991b1b; }

/* ---------- Calendar ---------- */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.calendar-toolbar .day-nav { margin-bottom: 0; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-legend .dot.confirmado { background: var(--success); }
.cal-legend .dot.pendente { background: var(--warning); }
.cal-legend .dot.recusado { background: var(--danger); }

.calendar-scroll { overflow-x: auto; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; min-width: 660px; }
.calendar-weekdays { margin-bottom: 6px; }
.calendar-weekdays div { text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 4px 0; }

.cal-day {
  min-height: 94px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--primary); background: #f8fafc; }
.cal-day.empty { background: #f8fafc; border-style: dashed; cursor: default; }
.cal-day.empty:hover { border-color: var(--border); }
.cal-day.today { border-color: var(--primary); }
.cal-day.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.cal-day .day-num { font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.cal-day.today .day-num { color: var(--primary-dark); }
.cal-day.has-events .day-num { color: var(--text); }

.cal-chip {
  display: block;
  font-size: .68rem;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.cal-chip.confirmado { background: var(--success-bg); color: #166534; }
.cal-chip.pendente { background: var(--warning-bg); color: #92400e; }
.cal-chip.recusado { background: var(--danger-bg); color: #991b1b; text-decoration: line-through; }
.cal-chip.cancelado { background: #f1f5f9; color: var(--text-muted); text-decoration: line-through; }
.cal-more { display: block; font-size: .68rem; font-weight: 700; color: var(--primary-dark); padding-left: 4px; }

/* ---------- Event list ---------- */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
}
.event-item:last-child { border-bottom: none; }
.event-item.border-confirmado { border-left-color: var(--success); }
.event-item.border-pendente { border-left-color: var(--warning); }
.event-item.border-recusado { border-left-color: var(--danger); }
.event-item.border-cancelado { border-left-color: #cbd5e1; }

.event-item .time-block { text-align: center; min-width: 64px; padding-top: 2px; }
.event-item .time-block .t { font-weight: 700; font-size: .92rem; }
.event-item .time-block .sep { color: var(--text-muted); font-size: .78rem; }

.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-meta { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.event-desc { font-size: .85rem; margin-top: 6px; color: var(--text); }
.event-equip { font-size: .8rem; color: var(--primary-dark); margin-top: 5px; }

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.status-tag.confirmado { background: var(--success-bg); color: #166534; }
.status-tag.pendente { background: var(--warning-bg); color: #92400e; }
.status-tag.recusado { background: var(--danger-bg); color: #991b1b; }
.status-tag.cancelado { background: #f1f5f9; color: var(--text-muted); }

.event-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 300px; }

.admin-note { margin-top: 6px; font-size: .82rem; background: var(--danger-bg); color: #991b1b; padding: 6px 10px; border-radius: 7px; }

/* ---------- Dashboard hero ---------- */
.hero-event { display: flex; align-items: flex-start; gap: 18px; padding: 8px 0 4px; }
.hero-date { background: var(--primary-light); color: var(--primary-dark); border-radius: 12px; min-width: 70px; padding: 10px 6px; text-align: center; }
.hero-day { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.hero-month { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.hero-body { flex: 1; min-width: 0; }
.hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.hero-time { font-weight: 700; font-size: .9rem; color: var(--primary-dark); }
.hero-body h2 { font-size: 1.2rem; margin: 0 0 4px; }
.hero-actions { align-self: center; }
.pending-card { border-left: 5px solid var(--warning); }
.pending-card .card-head h2 { color: #92400e; }

/* ---------- Detail modal ---------- */
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h3 { font-size: 1.1rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-grid > div > span { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 2px; }
.detail-grid p { font-size: .9rem; }
.detail-actions { flex-wrap: wrap; }

/* ---------- Approvals ---------- */
.approve-card { border: 1px solid var(--border); border-left: 4px solid var(--warning); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fffdf5; }
.approve-card:last-child { margin-bottom: 0; }
.approve-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.approve-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Equipment inline ---------- */
.equipment-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; border: 1px solid var(--border); border-radius: 9px; padding: 8px; }
@media (max-width: 620px) { .equipment-inline { grid-template-columns: 1fr; } }

.report-note { color: var(--text-muted); font-size: .82rem; margin-top: 10px; }

@media (max-width: 760px) {
  .event-item { flex-wrap: wrap; }
  .event-actions { max-width: none; width: 100%; justify-content: flex-start; padding-left: 78px; }
  .hero-event { flex-wrap: wrap; }
  .hero-actions { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .calendar-grid, .calendar-weekdays { min-width: 620px; }
  .cal-day { min-height: 80px; }
}

/* ---------- Charts (CSS bars) ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar-track { width: 100%; max-width: 42px; background: #f1f5f9; border-radius: 6px; height: 100%; display: flex; align-items: flex-end; overflow: hidden; }
.chart .bar { width: 100%; background: var(--primary); border-radius: 6px; min-height: 3px; transition: height .4s; }
.chart .bar.alt { background: #10b981; }
.chart .bar-label { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.chart .bar-value { font-size: .76rem; font-weight: 700; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stat-cards { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat .stat-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .stat-value { font-size: 1.7rem; font-weight: 700; margin-top: 6px; }
.stat .stat-sub { color: var(--text-muted); font-size: .8rem; margin-top: 2px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: grid; place-items: center; padding: 20px; z-index: 100;
}
.modal { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { font-size: 1.15rem; margin-bottom: 18px; }

.day-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.day-nav .day-label { font-weight: 700; font-size: 1rem; min-width: 220px; text-align: center; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-header-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- Print sheet (Biblioteca) ---------- */
#print-sheet-root { display: none; }

.print-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.print-table th, .print-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.print-table th {
  background: #e6f4f1;
  color: #0f766e;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.print-table tbody tr:nth-child(even) { background: #f8fafc; }
.print-empty { color: var(--text-muted); font-size: .95rem; padding: 18px 0; }

.print-header { display: none; }

@media print {
  @page { size: A4; margin: 1.5cm; }

  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar, .page-header, .toolbar, #alert-zone, .modal-backdrop, .btn { display: none !important; }

  .main { padding: 0; max-width: none; }

  .print-header {
    display: block;
    text-align: center;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 14px;
  }
  .print-school { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
  .print-title { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
  .print-period { font-size: .9rem; color: var(--text-muted); margin-top: 2px; }

  .card { box-shadow: none; border: 1px solid #cbd5e1; break-inside: avoid; margin-bottom: 14px; }
  .grid-2, .grid-3, .stat-cards { break-inside: avoid; }

  .chart .bar, .status-pill, .tag, .room-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Impressão da biblioteca: mostra apenas a folha gerada */
  body.printing-library .main { display: none !important; }
  body.printing-library #print-sheet-root { display: block; }
  body.printing-library .print-header { display: block; }
  body.printing-library .report-note { margin-top: 14px; font-size: .8rem; color: #64748b; }

  .print-table { font-size: .82rem; }
  .print-table thead { display: table-header-group; }
  .print-table tr { break-inside: avoid; }
  .print-table th, .print-table td { border: 1px solid #cbd5e1; padding: 7px 8px; }
  .print-table th { background: #e6f4f1 !important; }
}

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .nav { flex-direction: row; margin: 0; }
  .nav button { width: auto; }
  .sidebar-footer { margin: 0 0 0 auto; display: flex; align-items: center; gap: 10px; border: none; }
  .logout-btn, .pass-btn { width: auto; margin: 0; }
  .user-chip { display: none; }
  .main { padding: 20px 16px; }
}

/* ---------- Equipment selection ---------- */
.equipment-group { margin-bottom: 12px; }
.equipment-group strong { display: block; font-size: .85rem; color: var(--primary-dark); margin-bottom: 6px; }
.equipment-option {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem;
  transition: background .15s;
}
.equipment-option:hover { background: var(--primary-light); }
.equipment-option input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.res-equipment { margin-top: 4px; font-size: .82rem; color: var(--primary-dark); }
