/* =====================================================================
   Omni Sonora — tema visual
   ===================================================================== */
:root {
  --bg: #f4f4f7;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f9;
  --surface-3: #eeeef3;
  --border: #e6e6ee;
  --border-strong: #d6d6e1;
  --text: #11121c;
  --text-2: #3d3f50;
  --muted: #6f7186;
  --primary: #6c47ff;
  --primary-hover: #5a35f0;
  --primary-soft: #f0ecff;
  --primary-ring: rgba(108, 71, 255, .22);
  --grad: linear-gradient(135deg, #6c47ff 0%, #a347ff 55%, #ff6fae 100%);
  --pos: #0f8a4b;
  --neg: #d4314c;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 18, 28, .05);
  --shadow: 0 1px 2px rgba(17, 18, 28, .04), 0 6px 24px -8px rgba(17, 18, 28, .08);
  --shadow-lg: 0 24px 64px -16px rgba(17, 18, 28, .28);
  --aula: #6c47ff;
  --reserva: #f2711c;

  --t-violet: #6c47ff; --t-violet-bg: #f0ecff;
  --t-blue: #2563eb;   --t-blue-bg: #e8f0ff;
  --t-teal: #0d9488;   --t-teal-bg: #e1f7f4;
  --t-orange: #ea6a12; --t-orange-bg: #fff0e3;
  --t-green: #0f8a4b;  --t-green-bg: #e3f7ec;
  --t-red: #d4314c;    --t-red-bg: #fde8ec;
  --t-amber: #b45309;  --t-amber-bg: #fef3dc;
  --t-gray: #5d6074;   --t-gray-bg: #efeff4;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b12; --canvas: #12121b; --surface: #171723; --surface-2: #1c1c2a; --surface-3: #242436;
    --border: #262637; --border-strong: #34344a; --text: #ecebf5; --text-2: #c6c5d6; --muted: #8d8ca6;
    --primary: #8b6dff; --primary-hover: #9d84ff; --primary-soft: #241d45; --primary-ring: rgba(139, 109, 255, .3);
    --pos: #3ddc84; --neg: #ff6b81;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.5);
    --t-violet: #a48bff; --t-violet-bg: #251e47; --t-blue: #7aa7ff; --t-blue-bg: #18264a;
    --t-teal: #4fd1c5; --t-teal-bg: #10302e; --t-orange: #ffa25c; --t-orange-bg: #3a2414;
    --t-green: #4ade80; --t-green-bg: #12301f; --t-red: #ff7b8f; --t-red-bg: #3a1720;
    --t-amber: #fbbf24; --t-amber-bg: #352811; --t-gray: #a7a6bd; --t-gray-bg: #232333;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b12; --canvas: #12121b; --surface: #171723; --surface-2: #1c1c2a; --surface-3: #242436;
  --border: #262637; --border-strong: #34344a; --text: #ecebf5; --text-2: #c6c5d6; --muted: #8d8ca6;
  --primary: #8b6dff; --primary-hover: #9d84ff; --primary-soft: #241d45; --primary-ring: rgba(139, 109, 255, .3);
  --pos: #3ddc84; --neg: #ff6b81;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.5);
  --t-violet: #a48bff; --t-violet-bg: #251e47; --t-blue: #7aa7ff; --t-blue-bg: #18264a;
  --t-teal: #4fd1c5; --t-teal-bg: #10302e; --t-orange: #ffa25c; --t-orange-bg: #3a2414;
  --t-green: #4ade80; --t-green-bg: #12301f; --t-red: #ff7b8f; --t-red-bg: #3a1720;
  --t-amber: #fbbf24; --t-amber-bg: #352811; --t-gray: #a7a6bd; --t-gray-bg: #232333;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
}
h1, h2, h3 { margin: 0; color: var(--text); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
::selection { background: var(--primary-ring); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.error { color: var(--neg); }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
details summary { cursor: pointer; font-weight: 600; margin: 12px 0 6px; }

/* ---------- Splash ---------- */
.splash { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marca ---------- */
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-mark rect { fill: var(--primary); }
.logo-mark path { fill: #fff; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.brand span { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- Autenticação ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 0% 0%, rgba(255,255,255,.18), transparent 60%), var(--grad);
}
.auth-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 400px at 100% 100%, rgba(17,18,28,.35), transparent 70%); }
.hero-copy { position: relative; z-index: 1; max-width: 480px; }

/* Logo em destaque na tela de login */
.logo-pulse { position: relative; display: grid; place-items: center; width: 68px; height: 68px; flex: none; }
.logo-pulse .logo-mark { position: relative; z-index: 1; width: 68px; height: 68px; border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.34), rgba(255,255,255,.1));
  border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px -8px rgba(40, 10, 90, .55), inset 0 1px 0 rgba(255,255,255,.5);
  padding: 6px; overflow: visible; }
.logo-pulse .logo-mark rect { fill: transparent; }
.logo-pulse .logo-mark path { filter: drop-shadow(0 2px 6px rgba(40, 10, 90, .35)); transform-origin: 16px 16px;
  animation: nota 3.2s ease-in-out infinite; }
/* ondas sonoras saindo do logo */
.logo-pulse i { position: absolute; inset: 0; border-radius: 22px; border: 2px solid rgba(255,255,255,.55);
  animation: onda 3s cubic-bezier(.2,.6,.3,1) infinite; opacity: 0; }
.logo-pulse i:nth-child(2) { animation-delay: 1s; }
.logo-pulse i:nth-child(3) { animation-delay: 2s; }
@keyframes onda { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; border-radius: 32px; } }
@keyframes nota { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) {
  .logo-pulse i, .logo-pulse .logo-mark path { animation: none; }
}
.hero-copy h1 { color: #fff; font-size: 40px; line-height: 1.1; letter-spacing: -.035em; margin-bottom: 14px; }
.hero-copy p { color: rgba(255,255,255,.85); font-size: 16px; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 380px; }
.auth-title { margin-bottom: 22px; }
.auth-title h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; }
.auth-card > h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.auth-card > p { margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; font-weight: 600; padding: 4px; }
.link:hover { text-decoration: underline; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 20px 14px 14px; overflow-y: auto; }
.sidebar > .brand { padding: 2px 8px 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
.sidebar nav a .i { color: var(--muted); transition: color .15s; }
.sidebar nav a:hover { background: var(--surface-3); color: var(--text); }
.sidebar nav a.active { background: var(--canvas); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.sidebar nav a.active .i { color: var(--primary); }
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  opacity: .8; padding: 18px 10px 6px; }
.sidebar-foot { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px; border-radius: 14px;
  background: var(--canvas); box-shadow: 0 0 0 1px var(--border); }
.user-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; color: var(--text); }
.user-chip:hover, .user-chip.active { background: var(--surface-2); }
.user-chip span:last-child { min-width: 0; }
.user-chip b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 10px 10px 10px 0; display: flex; flex-direction: column; }
.content { background: var(--canvas); }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 28px; border: 1px solid var(--border);
  border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: sticky; top: 10px; z-index: 20;
  background: color-mix(in srgb, var(--canvas) 85%, transparent); backdrop-filter: blur(12px); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs .i { width: 14px; height: 14px; }
.crumbs b { color: var(--text); font-weight: 700; }
.today-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  padding: 6px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.today-chip .i { width: 15px; height: 15px; color: var(--muted); }
.content { flex: 1; padding: 22px 28px 48px; border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); min-width: 0; }
.content > * { max-width: 1320px; }
.overlay { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p.muted { margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.eyebrow::first-letter { text-transform: uppercase; }
.hero-head h1 { font-size: 30px; }
.section-title { margin: 28px 0 12px; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(17,18,28,.1), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-ghost-danger { border-color: transparent; background: none; color: var(--neg); box-shadow: none; }
.btn-ghost-danger:hover { background: var(--t-red-bg); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 32px; padding: 0; }
.btn-block { width: 100%; height: 42px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy .i { opacity: 0; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.btn-primary).busy::after { border-color: var(--border); border-top-color: var(--primary); }
.icon-btn { display: inline-grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--muted);
  width: 36px; height: 36px; border-radius: 10px; flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.seg { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); }
.seg .btn { box-shadow: none; border-color: transparent; background: transparent; }
.seg .btn:hover { background: var(--canvas); box-shadow: var(--shadow-sm); }
.seg-label { padding: 0 10px; min-width: 150px; text-align: center; font-size: 13.5px; }
.range-title { font-size: 14px; margin-left: 6px; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.req { color: var(--neg); }
.help { color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px 12px; min-height: 40px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
select { appearance: none; padding-right: 34px; background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8ca0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; align-self: end; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.col-2 { grid-column: span 2; }
.form-error { color: var(--t-red); background: var(--t-red-bg); padding: 10px 12px; border-radius: 10px; margin-top: 16px; font-weight: 500; }
.form-error[hidden] { display: none; }
form > .btn-primary:last-child { margin-top: 18px; }
.stack .btn-primary { margin-top: 4px; }
.ok-msg { color: var(--t-green); background: var(--t-green-bg); padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-top: 16px; }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input[type=date] { width: auto; min-height: 38px; font-size: 13.5px; }
.search { position: relative; display: flex; align-items: center; width: 280px; max-width: 100%; }
.search .i { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; min-height: 38px; }
.periodo { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-left: 8px; }
.dot-aula { background: var(--aula); }
.dot-reserva { background: var(--reserva); }

/* ---------- Cartões e tabelas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.card.pad h2 { margin-bottom: 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.link-sm { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12.5px; }
.link-sm .i { width: 14px; height: 14px; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table td strong { color: var(--text); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable td { transition: background .12s; }
.table tr.clickable:hover td { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .acoes { text-align: right; white-space: nowrap; }
.table .acoes .btn + .btn { margin-left: 6px; }
.cell-person { display: inline-flex; align-items: center; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); padding: 32px 16px; text-align: center; }
.empty-state .i { width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: var(--surface-2); color: var(--muted); stroke-width: 1.6; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 16px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pager span { margin-right: auto; }

/* Avatar */
.avatar { --h: 262; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: hsl(var(--h) 65% 38%); background: hsl(var(--h) 85% 93%); }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 90% 80%); background: hsl(var(--h) 35% 22%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 90% 80%); background: hsl(var(--h) 35% 22%); }
}
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-green { background: var(--t-green-bg); color: var(--t-green); }
.badge-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.badge-amber { background: var(--t-amber-bg); color: var(--t-amber); }
.badge-red { background: var(--t-red-bg); color: var(--t-red); }
.badge-gray { background: var(--t-gray-bg); color: var(--t-gray); }
.badge-violet { background: var(--t-violet-bg); color: var(--t-violet); }

/* ---------- Indicadores ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px;
  display: flex; align-items: flex-start; gap: 14px; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s; }
a.stat:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); transform: translateY(-1px); }
.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value { font-size: clamp(20px, 1.9vw, 26px); overflow-wrap: anywhere; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.stat-icon .i { width: 20px; height: 20px; }
.stat-icon.sm { width: 36px; height: 36px; border-radius: 10px; }
.stat-icon.sm .i { width: 17px; height: 17px; }
.tone-violet { background: var(--t-violet-bg); color: var(--t-violet); }
.tone-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.tone-teal { background: var(--t-teal-bg); color: var(--t-teal); }
.tone-orange { background: var(--t-orange-bg); color: var(--t-orange); }
.tone-green { background: var(--t-green-bg); color: var(--t-green); }
.tone-red { background: var(--t-red-bg); color: var(--t-red); }
.tone-gray { background: var(--t-gray-bg); color: var(--t-gray); }
.skeleton { height: 82px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Painel */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.dash-grid.single { grid-template-columns: minmax(0, 1fr); }
.timeline { list-style: none; margin: 0; padding: 0 8px 10px; }
.timeline li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; }
.timeline li:hover { background: var(--surface-2); }
.tl-time { width: 52px; flex: none; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tl-time b { font-size: 14px; }
.tl-time small { color: var(--muted); font-size: 12px; }
.tl-bar { width: 4px; align-self: stretch; border-radius: 99px; background: var(--aula); flex: none; }
.tl-reserva .tl-bar { background: var(--reserva); }
.tl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tl-main .muted { font-size: 12.5px; }
.fin-list { display: flex; flex-direction: column; padding: 0 8px 10px; }
.fin-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); }
.fin-row:hover { background: var(--surface-2); }
.fin-label { flex: 1; display: flex; flex-direction: column; font-weight: 600; font-size: 13px; color: var(--text-2); }
.fin-label small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.fin-row b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Agenda semanal ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 8px; min-height: 260px;
  display: flex; flex-direction: column; gap: 6px; }
.day.today { background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.day header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.day header b { font-size: 17px; color: var(--text); letter-spacing: -.02em; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; }
.day.today header b { background: var(--primary); color: #fff; }
.day-empty { color: var(--muted); text-align: center; margin: 14px 0; opacity: .6; }
.ev { position: relative; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 7px 9px 7px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 1px;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; overflow: hidden; }
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--aula); }
.ev-reserva::before { background: var(--reserva); }
.ev:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ev.st-realizada { opacity: .65; }
.ev.st-falta .ev-title { text-decoration: line-through; }
.ev-time { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-title { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 11, 18, .45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease-out; }
.modal { background: var(--canvas); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 500px;
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-wide { max-width: 740px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.modal-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.modal-body { padding: 14px 22px 20px; overflow-y: auto; }
.modal-body > p:first-child { margin-bottom: 14px; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 14px 22px;
  border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 36px); }
.toast { background: #15151f; color: #fff; padding: 12px 16px 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: pop .2s ease-out; transition: opacity .3s, transform .3s; max-width: 380px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; flex: none; }
.toast-error::before { background: #ff6b81; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .week { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; background: var(--bg); transform: translateX(-100%);
    transition: transform .22s ease, box-shadow .22s; }
  .menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(11,11,18,.45); z-index: 30; }
  .main { padding: 0; }
  .topbar { top: 0; border-radius: 0; border-width: 0 0 1px; padding: 8px 12px; }
  .content { border: 0; border-radius: 0; padding: 18px 16px 40px; }
  .today-chip { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .search { width: 100%; }
  h1, .hero-head h1 { font-size: 24px; }
  /* Tabela vira lista de cartões */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
  .table td.acoes { justify-content: flex-end; padding-top: 8px; }
  .table td.acoes::before, .table td.empty::before { content: none; }
  .table td.empty { display: block; text-align: center; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .col-2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { flex-direction: column; gap: 10px; padding: 14px; }
  .stat-value { font-size: 20px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .seg-label { min-width: 0; }
}

/* ---------- Perfis de acesso ---------- */
.field[hidden] { display: none; }
.legenda-niveis { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.legenda-niveis span { display: inline-flex; align-items: center; gap: 8px; }
.legenda-niveis .nivel { min-width: 0; }

.comp-card { overflow: hidden; }
.comp-wrap { overflow-x: auto; }
.comp { width: 100%; border-collapse: separate; border-spacing: 0; }
.comp th, .comp td { padding: 10px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.comp tbody tr:last-child th, .comp tbody tr:last-child td { border-bottom: 0; }
.comp tbody th { font-weight: 600; color: var(--text-2); position: sticky; left: 0; background: var(--surface); z-index: 1; }
.comp thead th { background: var(--surface-2); vertical-align: bottom; padding: 10px 10px; }
.comp thead th.comp-mod { padding-left: 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  font-weight: 700; position: sticky; left: 0; z-index: 2; }
.comp tbody tr:hover th, .comp tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.comp-perfil { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 1px;
  padding: 6px 8px; border-radius: 10px; min-width: 130px; }
.comp-perfil:hover { background: var(--canvas); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.comp-perfil:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.comp-nome { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.comp-nome .i { width: 14px; height: 14px; color: var(--muted); transition: transform .15s, color .15s; }
.comp-perfil:hover .comp-nome .i { color: var(--primary); transform: translateX(2px); }
.comp-meta { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.comp tbody .comp-escopo th, .comp tbody .comp-escopo td { border-bottom: 2px solid var(--border); }
.escopo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.escopo .i { width: 15px; height: 15px; }
.escopo-admin { color: var(--t-violet); }
.escopo-prof { color: var(--t-teal); }
.nivel { display: inline-block; font-style: normal; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; min-width: 64px; text-align: center; }
.nivel-total { background: var(--t-green-bg); color: var(--t-green); }
.nivel-parcial { background: var(--t-blue-bg); color: var(--t-blue); }
.nivel-leitura { background: var(--t-gray-bg); color: var(--t-gray); }
.nivel-nenhum { color: var(--muted); opacity: .6; }

.opcoes-perfil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.opcao { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; background: var(--surface-2); }
.opcao:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: var(--primary-soft); }
.opcao input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--primary); flex: none; }
.opcao b { display: block; font-size: 13.5px; }
.opcao small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }

.matriz-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: auto; transition: opacity .15s; }
.matriz-wrap.desativada { opacity: .4; pointer-events: none; }
.matriz { width: 100%; border-collapse: collapse; }
.matriz th, .matriz td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.matriz thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.matriz tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.matriz tr:last-child th, .matriz tr:last-child td { border-bottom: 0; }
.matriz tbody tr:hover { background: var(--surface-2); }
.toggle { position: relative; display: inline-block; width: 36px; height: 21px; cursor: pointer; vertical-align: middle; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + span { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + span::after { transform: translateX(15px); }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-ring); }
@media (max-width: 560px) { .opcoes-perfil { grid-template-columns: 1fr; } }

/* ---------- Login: ondas interativas e foto do estúdio ---------- */
/* Camada escura/violeta sobre o fundo para dar leitura ao texto.
   FOTO DO ESTÚDIO: salve em public/img/estudio.jpg e inclua a linha
     url("/img/estudio.jpg") center / cover no-repeat,
   entre o linear-gradient e o var(--grad) abaixo. */
.auth-v2 .auth-hero { justify-content: center; align-items: center; text-align: center; gap: 56px;
  background:
    linear-gradient(160deg, rgba(20, 12, 48, .86) 0%, rgba(58, 24, 120, .78) 55%, rgba(120, 30, 110, .72) 100%),
    var(--grad); }
.auth-v2 .auth-hero::after { background: radial-gradient(700px 420px at 50% 62%, rgba(140, 90, 255, .28), transparent 70%); }
.auth-v2 .hero-copy { max-width: 560px; }
.auth-v2 .hero-copy h1 { font-size: clamp(32px, 3.4vw, 44px); }
.ondas { all: unset; position: relative; z-index: 1; box-sizing: border-box; width: min(100%, 600px);
  display: flex; flex-direction: column; align-items: center; gap: 22px; cursor: pointer; border-radius: 24px; padding: 12px; }
.ondas:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.eq { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 170px;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.25)); }
.eq i { flex: none; width: 3px; height: 100%; border-radius: 99px; transform: scaleY(.1); transform-origin: center; will-change: transform;
  background: linear-gradient(180deg, rgba(255,255,255,.4), #fff 50%, rgba(255,255,255,.4));
  transition: transform 60ms linear; }
.ondas:hover .eq { filter: drop-shadow(0 0 14px rgba(255,255,255,.45)); }
.ondas.trocou .eq { animation: toque .35s ease-out; }
@keyframes toque { 30% { transform: scale(1.04); filter: brightness(1.25); } }
.ritmo-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; color: #fff; font-size: 13px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(8px); transition: background .15s; }
.ondas:hover .ritmo-chip { background: rgba(255,255,255,.26); }
.ritmo-chip b { font-weight: 800; }
.ritmo-chip [data-bpm] { opacity: .85; font-variant-numeric: tabular-nums; }
.ritmo-dica { opacity: .7; font-size: 12px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.35); }
.ritmo-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: batida .5s ease-out infinite; }
@keyframes batida { 0% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(.8); opacity: .5; } }

/* Logo acima do formulário */
.brand-painel { gap: 16px; margin-bottom: 32px; }
.brand-painel b { font-size: 20px; letter-spacing: -.03em; }
.brand-painel span { font-size: 13px; }
.brand-painel .logo-pulse, .brand-painel .logo-pulse .logo-mark { width: 48px; height: 48px; }
.brand-painel .logo-pulse .logo-mark { border-radius: 14px; padding: 5px; background: var(--grad); border: 0;
  box-shadow: 0 14px 30px -10px rgba(108, 71, 255, .65), inset 0 1px 0 rgba(255,255,255,.35); }
.brand-painel .logo-pulse i { border-color: color-mix(in srgb, var(--primary) 55%, transparent); border-radius: 16px; }

@media (prefers-reduced-motion: reduce) {
  .ritmo-dot, .ondas.trocou .eq { animation: none; }
  .eq i { transition: none; }
}

/* ---------- PWA ---------- */
/* Botão "Instalar app" na barra superior */
.instalar-app { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-soft); }
.instalar-app:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 14%); border-color: var(--primary); }
.instalar-app[hidden], .instalar-login[hidden] { display: none; }
@media (max-width: 560px) { .instalar-app span { display: none; } .instalar-app { width: 32px; padding: 0; } }
/* Link de instalação na tela de login */
.instalar-login { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 600; }
.instalar-login:hover { color: var(--primary); }
.instalar-login .i { width: 16px; height: 16px; }
.passos-ios { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: -5px; border-radius: 6px; background: var(--surface-3); }
.ios-share svg { width: 15px; height: 15px; fill: none; stroke: #0a84ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Aviso fixo de falta de conexão (a faixa de nova versão fica no fim do arquivo) */
.aviso-offline { position: fixed; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px;
  max-width: calc(100vw - 24px); animation: pop .2s ease-out; }
.aviso-offline { top: calc(12px + env(safe-area-inset-top) + var(--aviso-h, 0px)); background: var(--t-amber-bg); color: var(--t-amber);
  border: 1px solid color-mix(in srgb, var(--t-amber) 30%, transparent); padding-right: 14px; }
.aviso-offline .i { flex: none; }
@media (max-width: 560px) {
  .aviso-offline { left: 12px; right: 12px; transform: none; max-width: none; }
}

/* Áreas seguras (entalhe e barra inferior do iPhone, app instalado) */
.sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: calc(14px + env(safe-area-inset-left)); }
#toasts { bottom: calc(18px + env(safe-area-inset-bottom)); }
@media (max-width: 900px) {
  .topbar { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
  .content { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .auth-panel { padding-top: calc(32px + env(safe-area-inset-top)); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}
/* No app instalado o usuário não precisa ver o convite para instalar, e não há "puxar para recarregar" acidental */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  .instalar-app, .instalar-login { display: none !important; }
}

/* ---------- Menu lateral recolhível (computador) ---------- */
.sidebar { transition: width .22s ease, padding .22s ease; overflow-x: hidden; }
.sidebar nav a span, .sidebar .brand > div, .user-chip > span:last-child { white-space: nowrap; transition: opacity .15s; }
@media (min-width: 901px) {
  .menu-recolhido .sidebar { width: 76px; padding-left: 12px; padding-right: 12px; }
  .menu-recolhido .sidebar > .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .menu-recolhido .sidebar nav a { justify-content: center; padding: 10px 0; }
  .menu-recolhido .sidebar nav a .i { width: 20px; height: 20px; }
  /* nomes escondidos visualmente, mas ainda lidos por leitores de tela */
  .menu-recolhido .sidebar nav a span, .menu-recolhido .sidebar .brand > div, .menu-recolhido .user-chip > span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
  .menu-recolhido .nav-group { font-size: 0; padding: 12px 0 6px; }
  .menu-recolhido .nav-group::before { content: ""; display: block; height: 1px; margin: 0 10px; background: var(--border-strong); }
  .menu-recolhido .sidebar-foot { flex-direction: column; gap: 4px; padding: 6px; }
  .menu-recolhido .user-chip { flex: none; padding: 4px; }
}
.nav-dica { position: fixed; z-index: 80; pointer-events: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  background: #15151f; color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: fade .12s ease-out; }
.nav-dica[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.versao-app { margin-top: 18px; }

/* ---------- Faixa de nova versão (topo, empurra a página para baixo) ---------- */
:root { --aviso-h: 0px; }
body { padding-top: var(--aviso-h); }
.aviso-versao { position: fixed; top: 0; left: 0; right: 0; z-index: 75; display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(90deg, #4f2fe0, #7c3aed 55%, #b03aa8); color: #fff; font-size: 13.5px;
  box-shadow: 0 6px 20px -8px rgba(40, 10, 90, .55); animation: faixa .25s ease-out; }
@keyframes faixa { from { transform: translateY(-100%); } }
.aviso-icone { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.18); color: #fff; flex: none; }
.aviso-icone .i { width: 17px; height: 17px; }
.aviso-texto { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.3; }
.aviso-texto b { font-size: 14px; font-weight: 800; }
.aviso-texto small { font-size: 13px; color: rgba(255,255,255,.85); font-weight: 500; }
.aviso-acoes { display: flex; gap: 8px; }
.aviso-versao .btn-primary { background: #fff; color: #4f2fe0; border-color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.aviso-versao .btn-primary:hover { background: #f0ecff; border-color: #f0ecff; }
.aviso-versao .btn-primary.busy::after { border-color: rgba(79,47,224,.3); border-top-color: #4f2fe0; }
.btn-ghost-claro { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; box-shadow: none; }
.btn-ghost-claro:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); }
/* o menu lateral e a barra superior descem junto com a faixa */
.sidebar { top: var(--aviso-h); height: calc(100vh - var(--aviso-h)); }
.topbar { top: calc(10px + var(--aviso-h)); }
@media (max-width: 900px) {
  .sidebar { top: 0; height: 100vh; }
  .topbar { top: var(--aviso-h); }
}
@media (max-width: 560px) {
  .aviso-versao { justify-content: flex-start; gap: 10px 12px; }
  .aviso-texto { flex: 1 1 calc(100% - 50px); flex-direction: column; gap: 0; }
  .aviso-acoes { width: 100%; }
  .aviso-acoes .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .aviso-versao { animation: none; } }

/* Usuários: situação do acesso */
.acesso-sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.acesso-ok { display: inline-flex; flex-direction: column; font-size: 13px; color: var(--text-2); }
@media (max-width: 900px) { .acesso-sub { display: inline; margin-left: 6px; } .acesso-ok { flex-direction: row; align-items: baseline; } }

/* Entrada com código e diagnóstico de links */
.campo-codigo { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.link-sutil { color: var(--muted); font-weight: 600; font-size: 13px; margin-top: -8px; }
.diagnostico { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 8px 10px; word-break: break-word; }

/* Senha provisória */
.modo-acesso { border: 0; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modo-acesso legend { font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.modo-acesso .opcao input[type=radio] { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--primary); flex: none; }
[data-campo-senha] { margin-top: 14px; }
[data-campo-senha][hidden] { display: none; }
.campo-com-botao { display: flex; gap: 8px; }
.campo-com-botao input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .03em; }
.credenciais { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.credenciais dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.credenciais dd { margin: 0; font-weight: 600; word-break: break-all; }
.senha-destaque { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 17px; color: var(--primary); }
@media (max-width: 560px) { .modo-acesso { grid-template-columns: 1fr; } }

/* Janela de edição de usuário: ações de acesso dentro do corpo */
.secao-acesso { margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 10px; }
.secao-acesso b { display: block; font-size: 13.5px; }
.secao-acesso small { display: block; color: var(--muted); font-size: 12px; }
.secao-acesso-botoes { display: flex; flex-wrap: wrap; gap: 8px; }
/* Rodapés de janelas: quebram linha em vez de transbordar */
.modal-foot { flex-wrap: wrap; }

/* ---------- Menu lateral compacto, com grupos recolhíveis e sem barra de rolagem ---------- */
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar > .brand { padding-bottom: 16px; }
.sidebar nav { gap: 0; }
.nav-secao { display: flex; flex-direction: column; gap: 1px; }
.nav-itens { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a { padding: 7px 10px; font-size: 13.5px; }
.nav-group { padding: 14px 10px 4px; }
.nav-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  width: 100%; border-radius: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); opacity: .8; padding: 14px 10px 4px; }
.nav-toggle:hover { opacity: 1; color: var(--text-2); }
.nav-toggle:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.nav-toggle .i { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .18s; }
.nav-secao.fechada .nav-toggle .i { transform: none; }
.nav-secao.fechada .nav-itens { display: none; }
/* telas baixas: ainda mais compacto */
@media (min-width: 901px) and (max-height: 760px) {
  .sidebar { padding-top: 14px; }
  .sidebar > .brand { padding-bottom: 10px; }
  .sidebar nav a { padding: 6px 10px; }
  .nav-group, .nav-toggle { padding-top: 10px; }
}
/* menu recolhido (só ícones): mostra todos os itens e troca os títulos dos grupos por um divisor */
@media (min-width: 901px) {
  .menu-recolhido .nav-secao.fechada .nav-itens { display: flex; }
  .menu-recolhido .nav-toggle { font-size: 0; padding: 12px 0 6px; pointer-events: none; }
  .menu-recolhido .nav-toggle .i { display: none; }
  .menu-recolhido .nav-toggle::before { content: ""; display: block; width: 100%; height: 1px; margin: 0 10px; background: var(--border-strong); }
  .menu-recolhido .sidebar nav a { padding: 8px 0; }
}

/* Só a lista do menu rola (logo e usuário ficam fixos); esmaece o pé quando há mais itens abaixo */
@media (min-width: 901px) {
  .sidebar { overflow-y: hidden; }
  .sidebar nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav.tem-mais { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
  .menu-recolhido .sidebar nav a { padding: 7px 0; }
  .menu-recolhido .nav-group, .menu-recolhido .nav-toggle { padding: 6px 0 4px; }
  .menu-recolhido .sidebar > .brand { padding-bottom: 10px; }
}

/* ---------- Botão de recolher sobre a linha que divide o menu do conteúdo ---------- */
.shell { --menu-w: 252px; }
.shell.menu-recolhido { --menu-w: 76px; }
.sidebar-toggle { all: unset; box-sizing: border-box; position: fixed; z-index: 35; cursor: pointer;
  top: calc(var(--aviso-h, 0px) + 28px); left: calc(var(--menu-w) - 13px);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--canvas); color: var(--muted); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm);
  transition: left .22s ease, color .15s, border-color .15s, box-shadow .15s; }
.sidebar-toggle .i { width: 15px; height: 15px; stroke-width: 2.2; }
.sidebar-toggle:hover { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.sidebar-toggle:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.icon-btn.so-celular { display: none; }
@media (max-width: 900px) {
  .sidebar-toggle { display: none; }
  .icon-btn.so-celular { display: inline-grid; }
}
@media (prefers-reduced-motion: reduce) { .sidebar-toggle { transition: none; } }
