/* =====================================================================
   IEBTM · Gestão acadêmica — identidade visual
   Conceito: "o livro aberto" do emblema. A barra lateral é a página azul,
   o conteúdo é a página clara, e o item ativo é marcado por um marcador
   de página amarelo. Tipografia: Bricolage Grotesque (títulos, calorosa e
   com personalidade) + Figtree (texto: aberta, amigável e muito legível).
   Fontes hospedadas no próprio servidor (sem envio de dados a terceiros).
   ===================================================================== */
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  /* Paleta do emblema */
  --navy-900: #141A52;   /* tinta do livro */
  --navy-800: #1B2470;
  --navy-700: #24308F;   /* azul institucional (ações) */
  --navy-600: #3442A8;
  --navy-100: #E3E6F6;
  --navy-50:  #F1F2FA;
  --gold-500: #F2C200;   /* página amarela / marcador */
  --gold-400: #F8D445;
  --gold-100: #FFF4C7;
  --gold-50:  #FFFAE6;
  /* Neutros com leve tom azulado, como papel sob luz fria */
  --ink:   #1A1D33;
  --ink-2: #444A66;
  --ink-3: #737896;
  --line:  #DFE2EE;
  --line-2:#ECEEF5;
  --bg:    #F3F4F9;
  --card:  #FFFFFF;
  /* Estados */
  --success: #1F7A55; --success-bg: #E2F3EA;
  --warning: #8A5A00; --warning-bg: #FFF1CC;
  --danger:  #B4382C; --danger-bg:  #FCE7E4;
  --info:    #24308F; --info-bg:    #E6E9F8;
  --muted:   #5E6380; --muted-bg:   #ECEDF3;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(27, 36, 112, .04), 0 10px 30px -18px rgba(27, 36, 112, .22);
  --font-head: "Bricolage", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15.5px; line-height: 1.55; font-feature-settings: "tnum" 0;
  color: var(--ink); background: var(--bg);
}
a { color: var(--navy-700); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; text-decoration-color: var(--gold-500); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy-900); margin: 0 0 .5rem; line-height: 1.15; font-variation-settings: "opsz" 48; }
h1 { font-size: 1.85rem; font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
small, .small { font-size: .86rem; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--gold-100); color: var(--navy-900); }

/* ---------- Estrutura: a página azul ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background-color: var(--navy-800);
  /* rabiscos escolares do material da instituição, bem discretos */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M24 30l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Cpath d='M120 22h26v32h-26z M120 30h26'/%3E%3Ccircle cx='140' cy='120' r='14'/%3E%3Cpath d='M128 114c6 4 18 4 24 0 M140 106v28'/%3E%3Cpath d='M30 120l40-14 4 10-40 14z M30 120l-6 6 10 4'/%3E%3Cpath d='M86 76c0-6 10-6 10 0 0 6-10 12-10 12s-10-6-10-12c0-6 10-6 10 0z'/%3E%3Cpath d='M70 160v-18l12-3v18 M70 160a4 3 0 1 1-8-2 M82 157a4 3 0 1 1-8-2'/%3E%3C/svg%3E");
  color: #D9DDF3; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 54px; height: 54px; background: #fff; border-radius: 16px 16px 16px 4px; display: grid; place-items: center; flex: 0 0 54px; padding: 6px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); }
.brand-mark img { width: 100%; height: auto; }
.brand-text strong { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; letter-spacing: .01em; color: #fff; line-height: 1; }
.brand-text span { display: block; font-size: .8rem; line-height: 1.3; color: #AEB5E0; margin-top: 4px; }
.brand-stripe { display: none; }

.nav { padding: 4px 0 20px 12px; flex: 1; }
.nav-group { margin-top: 18px; }
.nav-label { font-size: .78rem; color: #8F97CC; padding: 0 12px 6px; font-weight: 700; letter-spacing: .01em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; margin-right: 0;
  border-radius: 12px 0 0 12px; color: #D9DDF3; font-size: .97rem; position: relative; text-decoration: none;
}
.nav a svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
/* item ativo: a página clara "aberta" + marcador amarelo */
.nav a.active { background: var(--bg); color: var(--navy-900); font-weight: 700; }
.nav a.active svg { color: var(--navy-700); opacity: 1; }
.nav a.active::after {
  content: ""; position: absolute; right: 18px; top: -4px; width: 12px; height: 26px;
  background: var(--gold-500); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}
.nav .count { margin-left: auto; margin-right: 26px; background: var(--gold-500); color: var(--navy-900); font-size: .76rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.nav a.active .count { margin-right: 38px; }
.sidebar-foot { padding: 16px 20px 20px; font-size: .8rem; color: #8F97CC; line-height: 1.4; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; background: rgba(243, 244, 249, .9); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 14px; padding: 0 32px; position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input[type=search] { padding-left: 42px; background: var(--card); border-color: var(--line); border-radius: 99px; height: 42px; }
.topbar-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar {
  --h: 232;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: hsl(var(--h) 60% 90%); color: hsl(var(--h) 50% 28%);
  font-family: var(--font-head); font-weight: 700; font-size: .9rem;
}
.topbar-user .avatar { background: var(--gold-500); color: var(--navy-900); }
.topbar-user .who { line-height: 1.2; font-size: .88rem; text-align: right; }
.topbar-user .who strong { display: block; color: var(--ink); }
.content { padding: 8px 32px 56px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; max-width: 70ch; }
.breadcrumb { font-size: .86rem; color: var(--ink-3); margin-bottom: 6px; }
.breadcrumb a { color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Boas-vindas (painel) ---------- */
.welcome { display: grid; grid-template-columns: 1fr auto; gap: 20px 32px; align-items: end; margin: 12px 0 28px; }
.welcome h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: 10px; }
.welcome .date { color: var(--ink-3); font-size: .95rem; margin-bottom: 4px; }
.welcome .summary { font-size: 1.12rem; line-height: 1.6; color: var(--ink-2); max-width: 62ch; margin: 0; }
.welcome .summary a { color: var(--navy-800); font-weight: 700; background: linear-gradient(transparent 62%, var(--gold-100) 62%); text-decoration: none; padding: 0 2px; }
.welcome .summary a:hover { background: linear-gradient(transparent 50%, var(--gold-400) 50%); }

/* ---------- Superfícies ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .week .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .small.muted { font-size: .84rem; }
.card-body { padding: 14px 22px 20px; }
.card-body.flush { padding: 4px 0 6px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* indicadores: número grande, rótulo humano embaixo — sem enfeites */
.stat { padding: 18px 22px; }
.stat .label { order: 2; color: var(--ink-2); font-size: .92rem; font-weight: 700; }
.stat .value { font-family: var(--font-head); font-size: 2.3rem; font-weight: 800; color: var(--navy-800); line-height: 1; letter-spacing: -.03em; margin: 2px 0 6px; }
.stat .hint { font-size: .86rem; color: var(--ink-3); margin-top: 2px; }
.stat { display: flex; flex-direction: column; }
.stat .value { order: 1; }
.stat .hint { order: 3; }
.stat.accent { background: var(--gold-50); border-color: #F6E7A6; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: 700 .95rem var(--font-body); cursor: pointer; text-decoration: none !important; white-space: nowrap;
  background: var(--navy-700); color: #fff; transition: background .15s, box-shadow .15s, transform .06s;
}
.btn:hover { background: var(--navy-600); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-accent { background: var(--gold-500); color: var(--navy-900); box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.btn-accent:hover { background: var(--gold-400); }
.btn-ghost { background: var(--card); color: var(--navy-800); border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-50); border-color: var(--navy-100); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #962D23; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 10px; }
.btn-link { background: none; border: 0; color: var(--navy-700); padding: 0; height: auto; font-weight: 700; }
.btn-link:hover { background: none; text-decoration: underline; text-decoration-color: var(--gold-500); }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; } .col-9 { grid-column: span 9; }
.field label, .label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field .help { font-size: .84rem; color: var(--ink-3); margin-top: 5px; }
.field .error { font-size: .86rem; color: var(--danger); margin-top: 5px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number],
input[type=search], input[type=tel], input[type=file], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: 400 1rem var(--font-body);
  transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 9px 12px; height: auto; }
textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9BA0B8; }
input:hover, select:hover, textarea:hover { border-color: #C9CDE0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(52, 66, 168, .14); }
.is-invalid { border-color: var(--danger) !important; background: #FFFBFA !important; }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: .95rem; cursor: pointer; padding: 3px 0; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--navy-700); flex: 0 0 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-input input { position: absolute; opacity: 0; pointer-events: none; }
.chip-input span { display: inline-block; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 99px; font-size: .9rem; font-weight: 700; color: var(--ink-2); cursor: pointer; background: #fff; transition: all .12s; }
.chip-input span:hover { border-color: var(--navy-100); background: var(--navy-50); }
.chip-input input:checked + span { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip-input input:focus-visible + span { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.form-section { font-family: var(--font-head); font-weight: 700; color: var(--navy-900); font-size: 1.05rem; grid-column: span 12; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.form-grid > .form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line-2); background: var(--navy-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 16px 22px 18px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 160px; flex: 1; }
.filters .field.grow { flex: 3; }
.filters label { font-size: .85rem; }

/* ---------- Tabelas (leitura calma, sem gritaria em maiúsculas) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .84rem; color: var(--ink-3); font-weight: 700; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--gold-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .person { display: flex; align-items: center; gap: 12px; }
.table .person .avatar { width: 36px; height: 36px; font-size: .85rem; }
.table .strong, .strong { font-weight: 700; color: var(--ink); }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: .95rem; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; color: var(--ink); }

/* ---------- Selos de situação ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.muted { color: var(--muted); background: var(--muted-bg); }
.badge.plain::before { display: none; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--navy-50); color: var(--navy-800); font-size: .82rem; font-weight: 700; border: 1px solid var(--navy-100); }
a.tag:hover { background: var(--navy-100); text-decoration: none; }
.tag.gold { background: var(--gold-100); color: #6B5000; border-color: #F3DF8C; }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; border: 1px solid transparent; border-left-width: 5px; }
.alert svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.success { background: var(--success-bg); color: #0F4F36; border-color: #BCE3CE; border-left-color: var(--success); }
.alert.error { background: var(--danger-bg); color: #7E1F16; border-color: #F3C8C2; border-left-color: var(--danger); }
.alert.warning { background: var(--warning-bg); color: #5F3E00; border-color: #F1DC9A; border-left-color: var(--gold-500); }
.alert.info { background: var(--info-bg); color: var(--navy-900); border-color: var(--navy-100); border-left-color: var(--navy-700); }

/* ---------- Estados vazios e progresso ---------- */
.empty { text-align: center; padding: 40px 24px 44px; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; color: var(--navy-700); background: var(--gold-100); border-radius: 50%; padding: 10px; box-sizing: content-box; margin-bottom: 12px; }
.empty strong { display: block; color: var(--ink); font-family: var(--font-head); font-size: 1.08rem; margin-bottom: 4px; }
.bar { height: 10px; background: var(--navy-50); border-radius: 99px; overflow: hidden; min-width: 80px; border: 1px solid var(--line-2); }
.bar > span { display: block; height: 100%; background: var(--navy-700); border-radius: 99px; }
.bar.warn > span { background: var(--gold-500); }
.bar.full > span { background: var(--danger); }

/* ---------- Linha do tempo ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-700); box-sizing: border-box; }
.timeline li:first-child::before { border-color: var(--gold-500); background: var(--gold-500); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }

/* ---------- Grade semanal: folhas de agenda ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 10px; overflow-x: auto; }
.week-day { background: var(--navy-50); border-radius: 14px; padding: 10px; min-height: 130px; }
.week-day h4 { font-family: var(--font-body); font-size: .86rem; color: var(--ink-2); font-weight: 700; margin: 2px 2px 10px; }
.week-day.today { background: var(--gold-100); }
.week-day.today h4 { color: var(--navy-900); }
.week-day.today h4::after { content: " · hoje"; font-weight: 400; color: #7A5D00; }
.slot { background: #fff; border-left: 4px solid var(--navy-700); border-radius: 4px 10px 10px 4px; padding: 8px 10px; margin-bottom: 8px; font-size: .84rem; line-height: 1.35; box-shadow: 0 1px 2px rgba(27,36,112,.06); display: block; color: var(--ink); text-decoration: none !important; }
.slot:hover { box-shadow: 0 4px 14px -6px rgba(27,36,112,.35); }
.slot strong { display: block; color: var(--navy-900); font-size: .88rem; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.slot.individual { border-left-color: var(--gold-500); }
.slot.cancelled { opacity: .5; text-decoration: line-through !important; }
.slot.done { border-left-color: var(--success); }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding: 4px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs a { padding: 8px 16px; font-weight: 700; color: var(--ink-2); border-radius: 10px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { background: var(--navy-50); }
.tabs a.active { color: var(--navy-900); background: var(--gold-100); }

/* ---------- Paginação ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line-2); font-size: .9rem; color: var(--ink-3); flex-wrap: wrap; gap: 8px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 700; padding: 0 8px; text-decoration: none; }
.pagination a:hover { background: var(--navy-50); }
.pagination span.cur { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Diálogos ---------- */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(580px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(20, 26, 82, .45); color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 26, 82, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 22px 24px 0; }
.modal-body { padding: 14px 24px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }

/* ---------- Entrada (login) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-art {
  background-color: var(--navy-800);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M24 30l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Cpath d='M120 22h26v32h-26z M120 30h26'/%3E%3Ccircle cx='140' cy='120' r='14'/%3E%3Cpath d='M128 114c6 4 18 4 24 0 M140 106v28'/%3E%3Cpath d='M30 120l40-14 4 10-40 14z M30 120l-6 6 10 4'/%3E%3Cpath d='M86 76c0-6 10-6 10 0 0 6-10 12-10 12s-10-6-10-12c0-6 10-6 10 0z'/%3E%3Cpath d='M70 160v-18l12-3v18 M70 160a4 3 0 1 1-8-2 M82 157a4 3 0 1 1-8-2'/%3E%3C/svg%3E");
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
  border-right: 6px solid var(--gold-500);
}
.auth-art h2 { color: #fff; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: -.035em; max-width: 16ch; line-height: 1.05; }
.auth-art p { color: #C8CEF0; max-width: 42ch; font-size: 1.08rem; }
.auth-logo { background: #fff; border-radius: 22px 22px 22px 6px; padding: 14px 20px; display: inline-flex; align-items: center; gap: 14px; align-self: flex-start; }
.auth-logo img { width: 86px; }
.auth-logo strong { font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; color: var(--navy-800); letter-spacing: .01em; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--card); }
.auth-form form { width: min(390px, 100%); }
.auth-form h1 { font-size: 2.1rem; }

/* ---------- Utilidades ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.text-right { text-align: right; }
.hr { height: 1px; background: var(--line-2); margin: 16px 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
details.inline summary { cursor: pointer; font-weight: 700; color: var(--navy-700); list-style: none; }
details.inline summary::-webkit-details-marker { display: none; }
details.inline summary::before { content: "+ "; color: var(--gold-500); font-weight: 800; }
details.inline[open] summary::before { content: "− "; }
details.inline[open] summary { margin-bottom: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #FCFCFE; }
.perm-group h3 { font-size: .95rem; margin-bottom: 8px; }
.perm-group .check { margin-bottom: 4px; }
.code-box { background: var(--navy-900); color: var(--gold-400); padding: 12px 14px; border-radius: 12px; font-family: ui-monospace, monospace; word-break: break-all; }

/* lista de pendências do painel */
.pending { list-style: none; margin: 0; padding: 0; }
.pending li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pending li:last-child { border-bottom: 0; }
.pending .who { min-width: 0; flex: 1; }
.pending .who a { font-weight: 700; color: var(--ink); }
.pending .who div { font-size: .86rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending .when { font-size: .82rem; color: var(--ink-3); text-align: right; white-space: nowrap; }

/* ---------- Responsivo ---------- */
.scrim { display: none; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20,26,82,.45); z-index: 35; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 8px 16px 40px; }
  .week { grid-template-columns: repeat(7, minmax(140px, 1fr)); }
  .welcome { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid > [class*=col-] { grid-column: span 12; }
  .topbar-user .who { display: none; }
  .topbar-search { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 10px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px; min-height: 280px; border-right: 0; border-bottom: 6px solid var(--gold-500); }
  h1 { font-size: 1.5rem; }
  .welcome h1 { font-size: 1.8rem; }
  .welcome .summary { font-size: 1.02rem; }
  .table.responsive, .table.responsive tbody { display: block; width: 100%; }
  .table.responsive thead { display: none; }
  .split.dash > :last-child { order: -1; }
  .table.responsive tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-weight: 700; color: var(--ink-3); font-size: .84rem; text-align: left; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .tabs { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .actions, .no-print { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}
