/* TaxTech Academy — by Brickweb
   1. Tokens · 2. Base · 3. Estrutura · 4. Componentes · 5. Telas · 6. Responsivo */

/* ───────── 1. Tokens ───────── */
:root {
  color-scheme: dark;
  --bg: #0d0e11;
  --side: #101115;
  --surface: #141519;
  --surface-2: #1a1c21;
  --hover: #202228;
  --border: #23252c;
  --border-strong: #343741;
  --text: #e7e8eb;
  --muted: #9a9ea9;
  --faint: #7b808c;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-text: #b9a1fc;
  --accent-soft: rgba(139, 92, 246, .14);
  --accent-line: #8b5cf6;
  --ok: #4cc366;
  --ok-soft: rgba(63, 185, 80, .13);
  --warn: #dba63a;
  --warn-soft: rgba(210, 153, 34, .12);
  --danger: #fa6b62;
  --danger-soft: rgba(248, 81, 73, .12);
  --info: #6bb0ff;
  --info-soft: rgba(88, 166, 255, .12);
  --shadow: 0 16px 48px rgba(0, 0, 0, .5);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 236px;
  --font: "Inter var", Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfc;
  --side: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --hover: #ececf0;
  --border: #e4e4e9;
  --border-strong: #cdced6;
  --text: #17181d;
  --muted: #555a66;
  --faint: #6b707c;
  --accent-text: #6325cf;
  --accent-soft: rgba(124, 58, 237, .09);
  --accent-line: #7c3aed;
  --ok: #17753a;
  --ok-soft: rgba(26, 127, 55, .1);
  --warn: #8a5a00;
  --warn-soft: rgba(154, 103, 0, .1);
  --danger: #c42b22;
  --danger-soft: rgba(207, 34, 46, .08);
  --info: #0a5fc2;
  --info-soft: rgba(9, 105, 218, .09);
  --shadow: 0 16px 48px rgba(20, 20, 40, .16);
}

/* ───────── 2. Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.018em; line-height: 1.3; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -.006em; }
h3 { font-size: 14px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
p { max-width: 75ch; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { padding: 0; list-style: none; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
main:focus { outline: none; }
::selection { background: rgba(139, 92, 246, .35); }
[hidden] { display: none !important; }

.icon { width: 17px; height: 17px; flex: none; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.big { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.warn-text { color: var(--warn); }
.loading { padding: 48px; color: var(--muted); }

/* ───────── 3. Estrutura ───────── */
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; line-height: 1.25; }
.brand strong { display: block; font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.brand small { color: var(--faint); font-size: 11.5px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.search-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); }
.search-button kbd { margin-left: auto; }
.search-button:hover { border-color: var(--border-strong); color: var(--text); }
#nav { display: flex; flex-direction: column; gap: 1px; }
#nav a, .side-theme { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
#nav a:hover, .side-theme:hover { background: var(--hover); color: var(--text); }
#nav a.active { background: var(--accent-soft); color: var(--text); }
#nav a.active .icon { color: var(--accent-text); }
#nav .count { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-progress { display: flex; flex-direction: column; gap: 5px; padding: 0 9px; }
.side-timer { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 9px; display: flex; flex-direction: column; gap: 4px; }
.side-timer strong, .timer-clock { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.side-theme { background: none; border: 0; width: 100%; text-align: left; }
.topbar { display: none; }
.scrim { display: none; }
main { margin-left: var(--sidebar); padding: 28px clamp(16px, 3.2vw, 44px) 72px; max-width: calc(var(--sidebar) + 1240px); }
.page-head { margin-bottom: 20px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.subtitle { color: var(--muted); margin-top: 2px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lesson-columns { grid-template-columns: minmax(0, 1fr) 340px; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > * { margin: 0; }
.narrow { max-width: 820px; }
.section-title { margin: 28px 0 12px; font-size: 13px; color: var(--text); }
.section-title:first-child { margin-top: 0; }
.section-title span { font-weight: 400; margin-left: 6px; }
.grid-2, .grid-3 { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }

/* ───────── 4. Componentes ───────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.h-sm { font-size: 13px; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; min-height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 500; line-height: 1.3; max-width: 100%; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: #c9362d; border-color: #c9362d; color: #fff; }
.btn-danger:hover { background: #ae2c24; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 3px 9px; min-height: 28px; font-size: 12.5px; }
.btn-lg { padding: 9px 16px; min-height: 40px; align-self: flex-start; }
.btn-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--muted); }
.btn-icon:hover { background: var(--hover); color: var(--text); }
.btn-icon.on { color: var(--accent-text); }
.btn-icon.on svg { fill: currentColor; }
.link { color: var(--accent-text); }
.link:hover, a.ext:hover { text-decoration: underline; }
a.ext { color: var(--accent-text); overflow-wrap: anywhere; }
a.ext .icon { margin-left: 4px; opacity: .7; }
.file-button { cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--accent-line); outline-offset: 2px; }

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 34px; }
textarea { resize: vertical; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent-line); }
::placeholder { color: var(--faint); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field label, .field .label, legend { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.field small { color: var(--faint); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input:disabled { cursor: default; }
.checks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=number] { width: 100px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; }

.badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 550; line-height: 1.6; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--muted); }
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge-info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge-accent { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.badges, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.page-head .badges { margin-top: 8px; }
.chip { display: inline-block; padding: 2px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; text-align: center; line-height: 18px; }
.count.accent { background: var(--accent); color: #fff; }

.bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; width: 100%; }
:root[data-theme="light"] .bar { background: #e8e8ed; }
.bar span { display: block; height: 100%; background: var(--accent-line); border-radius: inherit; transition: width .25s ease; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent-line); }

.segmented { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { flex: 1; background: transparent; border: 0; padding: 6px 6px; font-size: 12.5px; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button:hover { background: var(--hover); color: var(--text); }
.segmented button.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.segmented button.active.done { background: var(--ok-soft); color: var(--ok); }
.segmented.compact { align-self: flex-start; }
.segmented.compact button { min-width: 38px; padding: 4px 10px; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; font-size: 13px; }
.notice > .icon { margin-top: 2px; color: var(--accent-text); }
.notice.warn { border-color: transparent; background: var(--warn-soft); }
.notice.warn > .icon { color: var(--warn); }
.notice > span, .notice > div { flex: 1; min-width: 0; }
.notice .row { flex-wrap: wrap; margin-top: 4px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-title { color: var(--text); font-weight: 600; }

.list { display: flex; flex-direction: column; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); min-width: 0; }
.list li:first-child { border-top: 0; }
.list a:hover { color: var(--accent-text); }
.list li > .row { flex: none; }
.list li > :first-child:not(.btn-icon) { min-width: 0; overflow-wrap: anywhere; }
.list.compact li { padding: 3px 0; }
.bullets { list-style: disc; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.bullets li::marker { color: var(--faint); }
.checklist { display: flex; flex-direction: column; gap: 9px; }
details > summary { cursor: pointer; }
details > summary:hover { color: var(--accent-text); }
.disclosure > summary { font-weight: 600; }
.disclosure[open] > summary { margin-bottom: 8px; }

.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }

.modal { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal-wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop, .palette::backdrop { background: rgba(0, 0, 0, .55); }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; flex: none; }
.modal-head { border-bottom: 1px solid var(--border); }
.modal-foot { border-top: 1px solid var(--border); justify-content: flex-end; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; }
.modal-body > .row { margin-bottom: 12px; flex-wrap: wrap; }
.modal-body > p { margin-bottom: 10px; }
.modal-body > .btn { align-self: flex-start; margin-bottom: 12px; }

.palette { width: min(600px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette .palette-input input { border: 0; background: transparent; outline: 0; color: var(--text); padding-left: 0; }
.palette ul { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.palette li[aria-selected="true"], .palette li[data-index]:hover { background: var(--accent-soft); }
.palette .kind { width: 62px; flex: none; font-size: 11.5px; color: var(--faint); }
.palette .none { color: var(--muted); cursor: default; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent-line); border-radius: var(--radius-sm); box-shadow: var(--shadow); animation: rise .18s ease; }
.toast-ok { border-left-color: var(--ok); }
.toast-danger { border-left-color: var(--danger); }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

.markdown { overflow-wrap: anywhere; }
.markdown > * + * { margin-top: 8px; }
.markdown ul { list-style: disc; padding-left: 20px; }
.markdown ol { list-style: decimal; padding-left: 20px; }
.markdown li.task { list-style: none; margin-left: -18px; }
.markdown h3 { font-size: 17px; margin-top: 14px; }
.markdown h4 { font-size: 15px; margin-top: 12px; }
.markdown h5, .markdown h6 { font-size: 13.5px; }
.markdown a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.markdown pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; }
.markdown pre code { background: none; border: 0; padding: 0; }
.markdown blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--muted); }
.markdown hr { border: 0; border-top: 1px solid var(--border); }

/* ───────── 5. Telas ───────── */
/* Dashboard */
.hero { flex-direction: row; flex-wrap: wrap; gap: 24px; padding: 20px 22px; border-color: var(--border-strong); }
.hero-main { flex: 1.4 1 320px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-main h2 { font-size: 19px; letter-spacing: -.015em; }
.hero-main .btn { margin-top: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.hero-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--border); padding-left: 24px; justify-content: center; min-width: 0; }
.hero-side dt { font-size: 12px; color: var(--faint); }
.hero-side dd { display: flex; flex-direction: column; }
.hero-side dd a:hover { color: var(--accent-text); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 21px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--faint); }
.stat .bar { margin-top: 6px; }
.disciplines li + li { border-top: 1px solid var(--border); }
.disciplines a { display: flex; gap: 12px; padding: 10px 6px; margin: 0 -6px; border-radius: var(--radius-sm); }
.disciplines a:hover { background: var(--hover); }
.disciplines .grow { display: flex; flex-direction: column; gap: 5px; }
.num { font-family: var(--mono); font-size: 12px; color: var(--faint); flex: none; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; color: var(--faint); }
.week li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-col { height: 44px; width: 100%; max-width: 26px; background: var(--surface-2); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.week-col span { width: 100%; background: var(--accent-line); }
.week li.today { color: var(--text); font-weight: 600; }
.week li.today .week-col { box-shadow: inset 0 0 0 1px var(--accent-line); }
.radar li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.radar li:first-child { border-top: 0; }
.radar li.past { opacity: .75; }
.radar-date { display: flex; flex-direction: column; font-size: 12.5px; }

.disclaimer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); max-width: 90ch; }
.disclaimer strong { display: block; color: var(--text); font-weight: 600; }

/* Módulos */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.module-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.module-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.module-card.highlight { border-color: var(--accent-line); }
.module-card h3 { letter-spacing: -.008em; }
.module-card > p { font-size: 13px; }
.module-foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.module-progress { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.lessons li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); }
.lessons li:first-child { border-top: 0; }
.lessons a { padding: 3px 0; }
.lessons a:hover { color: var(--accent-text); }
.lessons a .num { display: inline-block; width: 22px; }
.lessons li.done a { color: var(--muted); }
.lessons .meta { flex: none; }
.w-time { width: 56px; text-align: right; }
.status { display: inline-flex; color: var(--faint); }
.status-doing { color: var(--accent-text); }
.status-done { color: var(--ok); }
.exercise .question { font-size: 15px; font-weight: 500; }
.exercise select { width: auto; }
.flash-list { display: flex; flex-direction: column; }
.flash-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.flash-row:first-child { border-top: 0; }
.flash-row details { flex: 1; min-width: 0; }
.flash-row details p { margin-top: 6px; color: var(--muted); }

/* Materiais */
.materials { display: flex; flex-direction: column; }
.material { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.material:first-child { border-top: 0; padding-top: 2px; }
.material-icon { color: var(--faint); padding-top: 2px; }
.material-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.material-title { font-weight: 550; }
.material-title a.ext { color: var(--text); }
.material-title a.ext:hover { color: var(--accent-text); }
.material-note { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--border-strong); padding-left: 8px; overflow-wrap: anywhere; }
.material-actions { display: flex; align-items: flex-start; flex: none; }
.erp-question { display: flex; gap: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.erp-question > .icon { color: var(--accent-text); margin-top: 2px; }
.timer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timer-clock { font-size: 18px; margin-right: auto; }
.doubts { display: flex; flex-direction: column; }
.doubts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.doubts li:first-child { border-top: 0; }
.doubts li > textarea, .doubts li > .muted, .doubts li > .material-note { grid-column: 1 / -1; }
.doubts li.answered .check span { color: var(--muted); text-decoration: line-through; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.pager .btn { max-width: 48%; }

/* Caderno */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.split-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.filters .grid-2 { gap: 8px; }
.row-filters { flex-direction: row; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.row-filters input[type=search] { flex: 1 1 260px; width: auto !important; }
.row-filters select { width: auto !important; max-width: 100%; }
.note-list { max-height: calc(100dvh - 290px); min-height: 160px; overflow-y: auto; }
.note-list .group { font-size: 11.5px; color: var(--faint); padding: 10px 4px 4px; }
.note-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.note-item:hover { background: var(--hover); }
.note-item.active { background: var(--accent-soft); border-color: var(--accent-line); }
.title-input { font-size: 18px; font-weight: 600; }
.note-body { font-family: var(--mono); font-size: 13px; }
.note-preview { min-height: 340px; }

/* Diário */
.diary-field h3 { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.disclosure form { max-width: 820px; display: flex; flex-direction: column; }
.disclosure form > .btn { align-self: flex-start; margin-top: 10px; }

/* Revisão */
.review-card { padding: 24px; gap: 16px; }
.review-question { font-size: 18px; font-weight: 550; letter-spacing: -.01em; }
.review-answer { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grade { flex-direction: column; gap: 0; padding: 10px; }
.grade-forgot:hover { border-color: var(--danger); }
.grade-hard:hover { border-color: var(--warn); }
.grade-good:hover { border-color: var(--ok); }

/* Glossário */
.terms { display: flex; flex-direction: column; gap: 6px; max-width: 920px; }
.term { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.term summary { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; list-style: none; }
.term summary::-webkit-details-marker { display: none; }
.term[open] { border-color: var(--border-strong); }
.term dl { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.term dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.term > .row { padding: 0 14px 14px; }

/* Fontes */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.source { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.source a.ext { color: var(--text); }
.source a.ext:hover { color: var(--accent-text); }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* Meu ERP */
.area { gap: 0; }
.area .card-head { margin-bottom: 8px; }
.feature-head, .feature > summary { display: grid; grid-template-columns: minmax(0, 1fr) 156px 150px 112px; gap: 12px; align-items: center; }
.feature-head { font-size: 11.5px; color: var(--faint); padding: 4px 0; border-bottom: 1px solid var(--border); }
.feature { border-bottom: 1px solid var(--border); }
.feature:last-child { border-bottom: 0; }
.feature > summary { padding: 8px 0; list-style: none; }
.feature > summary::-webkit-details-marker { display: none; }
.feature > summary:hover { color: inherit; background: var(--hover); }
.feature-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.vendors { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.vendor { display: inline-flex; justify-content: center; align-items: center; min-width: 20px; }
.vendor.yes { color: var(--ok); }
.vendor.no { color: var(--danger); }
.vendor.unknown { color: var(--faint); }
.feature-ready { display: flex; align-items: center; gap: 8px; }
.feature-ready .muted { white-space: nowrap; min-width: 48px; text-align: right; }
.feature-body { padding: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.feature-body .field { margin: 0; width: 200px; }
.feature-body > .row { align-items: flex-end; }

/* Dados */
.danger-card { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ───────── 6. Responsivo ───────── */
@media (max-width: 1240px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .columns, .lesson-columns { grid-template-columns: minmax(0, 1fr); }
  .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--side); border-bottom: 1px solid var(--border); }
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; width: min(280px, 84vw); box-shadow: var(--shadow); }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  main { margin-left: 0; padding: 18px 14px 64px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .note-list { max-height: 260px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .feature-head { display: none; }
  .feature > summary { grid-template-columns: minmax(0, 1fr) 120px; row-gap: 6px; }
  .feature-ready { grid-column: 1; }
  .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 14px; }
}
@media (max-width: 560px) {
  .stats, .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid, .source-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grades { grid-template-columns: minmax(0, 1fr); }
  .term summary { grid-template-columns: minmax(0, 1fr) auto; }
  .term summary > .muted { display: none; }
  .lessons .meta .w-time { display: none; }
  .row-filters select { flex: 1 1 140px; }
  .inline-form { flex-wrap: wrap; }
  .danger-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .actions, .toasts { display: none !important; }
  main { margin: 0; }
}
