:root {
  --color-navy: #0f1e2e;
  --color-navy-soft: #17283d;
  --color-blue-inst: #1a3a5c;
  --color-orange: #e07b2a;
  --color-gold: #c5a86a;
  --color-graphite: #1c1c1c;
  --color-white: #fff;
  --color-bg-clear: #f5f7fa;
  --color-surface-soft: #edf1f6;
  --color-border: #dce3eb;
  --color-border-hover: #b9c6d4;
  --color-text-muted: #64748b;
  --color-success: #14804a;
  --color-success-bg: #eaf9f0;
  --color-warning: #9a6700;
  --color-warning-bg: #fff8df;
  --color-danger: #b4233c;
  --color-danger-bg: #fff1f3;
  --color-info: #1a5fb4;
  --color-info-bg: #eaf2ff;

  --font-titles: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --font-brand: Montserrat, Sora, sans-serif;

  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;

  --space-xs: .25rem;
  --space-sm: .5rem;
  --space-md: .75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-xxl: 2rem;

  --shadow-sm: 0 1px 2px rgba(15, 30, 46, .05);
  --shadow-md: 0 4px 12px rgba(15, 30, 46, .08);
  --shadow-lg: 0 18px 42px rgba(15, 30, 46, .18);
  --transition-fast: 120ms ease;
  --transition-normal: 200ms ease;

  /* Backward-compatible aliases used by existing components. */
  --navy: var(--color-navy);
  --navy-2: var(--color-navy-soft);
  --gold: var(--color-gold);
  --orange: var(--color-orange);
  --paper: var(--color-bg-clear);
  --white: var(--color-white);
  --ink: var(--color-graphite);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --blue: var(--color-info);
  --green: var(--color-success);
  --red: var(--color-danger);
  --yellow: var(--color-warning);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--color-bg-clear); color-scheme: light; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-graphite);
  background: var(--color-bg-clear);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { letter-spacing: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(224, 123, 42, .24);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-xl);
  background: var(--color-navy);
}
.login-box {
  width: min(410px, 100%);
  padding: var(--space-xxl);
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid rgba(255, 255, 255, .2);
  border-top: 4px solid var(--color-orange);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in var(--transition-normal) both;
}
.login-box img { display: block; width: min(270px, 100%); margin: 0 auto var(--space-xl); }
.login-box h1 { margin: 0 0 var(--space-xs); color: var(--color-navy); text-align: center; font: 700 var(--fs-xl) var(--font-titles); }
.login-box p { margin: 0 0 var(--space-xl); color: var(--color-text-muted); text-align: center; }
.login-box label { margin-bottom: var(--space-lg); }
.login-box .btn { width: 100%; justify-content: center; margin-top: var(--space-sm); }
.turnstile-container { min-height: 65px; margin-bottom: var(--space-sm); }

label { display: grid; gap: 6px; color: var(--color-navy); font: 600 var(--fs-xs) var(--font-titles); }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--color-graphite);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--color-border-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--color-orange); box-shadow: 0 0 0 3px rgba(224, 123, 42, .12); }
input[type="checkbox"] { width: 20px; min-height: 20px; padding: 0; accent-color: var(--color-blue-inst); }
textarea { min-height: 92px; resize: vertical; }
.form-error { min-height: 20px; color: var(--color-danger); font-size: var(--fs-xs); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  color: var(--color-white);
  background: var(--color-navy);
  border-bottom: 3px solid var(--color-orange);
  box-shadow: var(--shadow-md);
}
.topbar-row {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  margin: auto;
  padding: var(--space-md) var(--space-xl) var(--space-sm);
}
.brand, .session { display: flex; min-width: 0; align-items: center; gap: var(--space-md); }
.brand img { width: 42px; height: 42px; padding: 3px; object-fit: contain; background: var(--color-white); border-radius: var(--radius-md); }
.brand strong { display: block; font: 700 var(--fs-md) var(--font-brand); }
.brand span, .session span { display: block; margin-top: 1px; color: #e5c98e; font-size: var(--fs-xs); }
.session { padding: 5px 6px 5px var(--space-md); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-md); }
.session > div { min-width: 0; }
.session strong { display: block; max-width: 260px; overflow: hidden; font-family: var(--font-titles); text-overflow: ellipsis; white-space: nowrap; }

.app-shell {
  display: grid;
  min-height: calc(100vh - 67px);
  grid-template-columns: 230px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 67px;
  height: calc(100vh - 67px);
  overflow-y: auto;
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  box-shadow: 3px 0 12px rgba(15, 30, 46, .04);
}
nav {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-lg) var(--space-md);
  scrollbar-width: thin;
}
nav button {
  display: inline-flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 10px 12px;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font: 600 var(--fs-sm) var(--font-titles);
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}
nav button:hover { color: var(--color-navy); background: var(--color-surface-soft); }
nav button.active { color: var(--color-navy); background: #edf3f8; border-left-color: var(--color-orange); }

.icon { width: 17px; height: 17px; flex: 0 0 auto; }
.icon-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }

main { width: 100%; min-width: 0; margin: 0; padding: 28px var(--space-xl) 60px; }
.panel { display: none; animation: panel-in var(--transition-normal) both; }
.panel.active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-xl); margin-bottom: 20px; }
.page-head h2 { margin: 0 0 var(--space-xs); color: var(--color-navy); font: 700 var(--fs-xl) var(--font-titles); }
.page-head p { margin: 0; color: var(--color-text-muted); }
.period-filter { display: flex; align-items: center; gap: var(--space-sm); }
.period-filter select { width: 155px; }
.period-filter input { width: 90px; font-family: var(--font-mono); }
.report-filter select:first-child { width: 190px; }

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--color-graphite);
  background: var(--color-white);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font: 600 var(--fs-sm) var(--font-titles);
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: var(--color-white); background: var(--color-blue-inst); }
.btn-primary:hover { background: var(--color-navy); }
.btn-secondary { color: var(--color-blue-inst); background: var(--color-white); border-color: var(--color-border); }
.btn-secondary:hover { color: var(--color-navy); border-color: var(--color-border-hover); background: #fafbfd; }
.btn-danger { color: var(--color-danger); background: var(--color-danger-bg); border-color: #fecdd3; }
.btn-success { color: var(--color-success); background: var(--color-success-bg); border-color: #bbf7d0; }
.btn-small { min-height: 30px; padding: 5px 9px; font-size: var(--fs-xs); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-lg); }
.kpi {
  position: relative;
  min-height: 116px;
  padding: var(--space-lg);
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-blue-inst);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi.completed { border-left-color: var(--color-success); }
.kpi.delayed { border-left-color: var(--color-danger); }
.kpi.financial { border-left-color: var(--color-gold); }
.kpi.commission { border-left-color: var(--color-orange); }
.kpi span { display: block; min-height: 34px; margin-bottom: var(--space-sm); color: var(--color-text-muted); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }
.kpi strong { display: block; color: var(--color-graphite); font: 600 1.55rem var(--font-mono); }

.table-card { width: 100%; margin-bottom: var(--space-xl); overflow: auto; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: var(--fs-sm); }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  color: var(--color-text-muted);
  background: #f8fafc;
  border-bottom: 2px solid var(--color-border);
  font: 600 var(--fs-xs) var(--font-titles);
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 10px 12px; color: var(--color-graphite); background: inherit; border-bottom: 1px solid var(--color-border); vertical-align: middle; white-space: nowrap; }
tbody tr { background: var(--color-white); transition: background-color var(--transition-fast); }
tbody tr:nth-child(even) { background: #fafbfd; }
tbody tr:hover { background: #f1f5f9; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-weight: 600; }
td:nth-child(n+4) { font-variant-numeric: tabular-nums; }
#clientsContent th:nth-child(2), #clientsContent td:nth-child(2) { min-width: 260px; white-space: normal; }
.actions-cell { display: flex; min-width: max-content; align-items: center; gap: 5px; }
.wrap-cell { min-width: 260px; white-space: normal; }

.empty { padding: 38px var(--space-lg); color: var(--color-text-muted); text-align: center; }
.task-column > .empty { padding: var(--space-xl) var(--space-sm); border: 1px dashed #cbd5e1; border-radius: var(--radius-md); background: rgba(255, 255, 255, .45); }
.badge { display: inline-flex; min-height: 22px; align-items: center; padding: 3px 8px; color: var(--color-info); background: var(--color-info-bg); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; }
.badge.green { color: var(--color-success); background: var(--color-success-bg); }
.badge.red { color: var(--color-danger); background: var(--color-danger-bg); }
.badge.gold { color: var(--color-warning); background: var(--color-warning-bg); }

.segmented { display: inline-flex; gap: 2px; margin-bottom: var(--space-lg); padding: 3px; background: #e9edf2; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.segmented button { min-height: 32px; padding: 6px 12px; color: var(--color-text-muted); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.segmented button:hover { color: var(--color-navy); }
.segmented button.active { color: var(--color-navy); background: var(--color-white); box-shadow: var(--shadow-sm); }

.task-board { display: flex; align-items: flex-start; gap: var(--space-md); padding: 2px 0 var(--space-lg); overflow-x: auto; scroll-behavior: smooth; scrollbar-color: #b8c3cf transparent; }
.task-column {
  flex: 0 0 286px;
  min-width: 286px;
  padding: var(--space-md);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.task-column h3 { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: var(--space-sm); margin: 0 2px var(--space-md); color: var(--color-navy); font: 600 var(--fs-sm) var(--font-titles); }
.task-column h3 .badge { min-width: 25px; justify-content: center; color: var(--color-text-muted); background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-mono); }
.task-card {
  position: relative;
  margin-bottom: var(--space-sm);
  padding: var(--space-md);
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.task-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: var(--color-gold); }
.task-card.priority-high::before { background: var(--color-danger); }
.task-card.priority-low::before { background: var(--color-success); }
.task-card:hover { border-color: var(--color-border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card strong { display: block; margin: 0 0 var(--space-sm); color: var(--color-graphite); font-size: var(--fs-sm); line-height: 1.4; white-space: normal; }
.task-card-client { margin-bottom: var(--space-sm); color: var(--color-blue-inst); font-size: var(--fs-xs); font-weight: 600; }
.task-card-onvio { margin: -2px 0 var(--space-sm); color: var(--color-orange); font: 600 var(--fs-xs) var(--font-mono); }
.task-card footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: var(--space-sm); color: var(--color-text-muted); border-top: 1px dashed var(--color-border); font-size: var(--fs-xs); }
.task-card footer span:not(.badge) { font-family: var(--font-mono); font-size: .7rem; }
.task-card .actions-cell { flex-wrap: wrap; margin-top: 9px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(15, 30, 46, .58); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(680px, 100%); max-height: 90vh; padding: 25px; overflow-y: auto; background: var(--color-white); border: 1px solid var(--color-border); border-top: 3px solid var(--color-orange); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: modal-in var(--transition-normal) both; }
.modal h2 { margin: 0 45px 20px 0; color: var(--color-navy); font: 700 var(--fs-xl) var(--font-titles); }
.modal p { color: var(--color-text-muted); }
.close-modal { position: absolute; top: 16px; right: 16px; color: var(--color-text-muted); background: var(--color-white); }
.close-modal:hover { color: var(--color-navy); background: #f1f5f9; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.form-grid .full { grid-column: 1 / -1; }
.cnpj-lookup { display: flex; gap: var(--space-sm); }
.cnpj-lookup input { min-width: 0; flex: 1; }
.cnpj-lookup .btn { flex: 0 0 auto; }
.lookup-status { display: block; min-height: 18px; margin-top: 5px; color: var(--color-text-muted); font-size: var(--fs-xs); }
.lookup-status.loading { color: var(--color-info); }
.lookup-status.success { color: var(--color-success); }
.lookup-status.error { color: var(--color-danger); }
.qsa-editor { padding: var(--space-lg); background: var(--color-surface-soft); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.qsa-editor-head, .partner-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.qsa-editor-head > div { display: grid; gap: 4px; }
.qsa-editor-head strong, .partner-row-head strong { color: var(--color-navy); font-family: var(--font-titles); }
.qsa-editor-head small { color: var(--color-text-muted); font-size: var(--fs-xs); }
.partner-rows { display: grid; gap: var(--space-md); margin-top: var(--space-md); }
.partner-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); padding: var(--space-md); background: var(--color-white); border: 1px solid var(--color-border); border-left: 3px solid var(--color-gold); border-radius: var(--radius-md); }
.partner-row-head, .partner-row .full { grid-column: 1 / -1; }
.qsa-empty { padding: var(--space-lg); color: var(--color-text-muted); text-align: center; border: 1px dashed var(--color-border-hover); border-radius: var(--radius-md); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-border); }

.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: var(--space-sm); }
.toast { max-width: 380px; padding: 12px 15px; color: var(--color-white); background: var(--color-navy); border-left: 4px solid var(--color-orange); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); animation: toast-in var(--transition-normal) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.temp-password { padding: 14px; color: var(--color-navy); background: var(--color-warning-bg); border: 1px solid #f3d58a; border-radius: var(--radius-md); font: 600 var(--fs-base) var(--font-mono); word-break: break-all; }
.report-section { margin-top: var(--space-xl); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: 10px; }
.section-head h3 { margin: 0; color: var(--color-navy); font: 600 var(--fs-md) var(--font-titles); }

.module-filter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.module-filter input { flex: 1 1 320px; }
.module-filter select { flex: 0 1 260px; }
.kpi-grid.compact { grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-bottom: var(--space-lg); }
.kpi-grid.compact .kpi { min-height: 92px; padding: var(--space-md); }
.kpi-grid.compact .kpi span { min-height: auto; }
.kpi-grid.compact .kpi strong { font-size: 1.35rem; }
.module-table { margin-top: 0; }

.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: var(--space-lg); }
.content-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: var(--space-xl);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.content-card.inactive { opacity: .65; }
.content-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.content-card h3, .meeting-card h3 { margin: 2px 0 var(--space-sm); color: var(--color-navy); font: 600 var(--fs-md) var(--font-titles); }
.content-card p { flex: 1; color: var(--color-text-muted); white-space: pre-line; }
.content-card footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding-top: var(--space-md); color: var(--color-text-muted); border-top: 1px solid var(--color-border); font-size: var(--fs-xs); }
.content-card footer a { color: var(--color-blue-inst); font-weight: 600; }
.eyebrow { color: var(--color-orange); font: 700 .68rem var(--font-titles); letter-spacing: .08em; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.content-empty { grid-column: 1 / -1; background: var(--color-white); border: 1px dashed var(--color-border-hover); border-radius: var(--radius-lg); }

.meeting-topics { display: flex; margin-bottom: var(--space-xl); }
.legal-modules { display: flex; width: 100%; flex-wrap: wrap; }
.legal-modules button { flex: 1 1 150px; }
.meeting-filters input, .meeting-filters select { flex: 1 1 150px; }
.meeting-list { display: grid; gap: var(--space-md); }
.meeting-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.meeting-date { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: var(--space-xl); color: var(--color-white); background: var(--color-navy); }
.meeting-date strong { font: 600 var(--fs-base) var(--font-mono); }
.meeting-date span { color: #e5c98e; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }
.meeting-body { min-width: 0; padding: var(--space-xl); }
.meeting-body p { margin: var(--space-sm) 0 var(--space-md); color: var(--color-graphite); }
.meeting-body small { color: var(--color-text-muted); }

@media (max-width: 900px) {
  .topbar-row, main { padding-inline: var(--space-lg); }
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .session strong { max-width: 180px; }
  .report-filter { align-items: stretch; flex-wrap: wrap; }
}
@media (max-width: 780px) {
  main { padding-top: var(--space-xl); }
  .page-head { align-items: stretch; flex-direction: column; gap: var(--space-md); }
  .page-head > .btn { align-self: flex-start; }
  .page-head > .actions-cell { align-self: flex-start; flex-wrap: wrap; }
  .period-filter { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .cnpj-lookup { align-items: stretch; flex-direction: column; }
  .qsa-editor-head { flex-direction: column; }
  .partner-row { grid-template-columns: 1fr; }
  .partner-row-head, .partner-row .full { grid-column: auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-column { flex-basis: 270px; min-width: 270px; }
  .module-filter { align-items: stretch; flex-wrap: wrap; }
  .module-filter > * { flex: 1 1 220px; }
  .kpi-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-card { grid-template-columns: 1fr; }
  .meeting-date { padding: var(--space-md) var(--space-xl); }
}
@media (max-width: 520px) {
  .login-gate { padding: var(--space-md); }
  .login-box { padding: var(--space-xl); }
  .topbar-row { gap: var(--space-md); }
  .brand strong { font-size: var(--fs-base); }
  .brand span, .session span { display: none; }
  .session { padding-left: 6px; }
  .session strong { max-width: 110px; font-size: var(--fs-xs); }
  .kpi-grid { grid-template-columns: 1fr; }
  .period-filter > * { flex: 1 1 120px; width: auto; }
  .report-filter select:first-child { width: auto; }
  .modal { padding: 20px; }
  .modal-actions { align-items: stretch; flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .toast-region { right: var(--space-md); bottom: var(--space-md); left: var(--space-md); }
  .toast { max-width: none; }
  .content-grid { grid-template-columns: 1fr; }
  .content-card footer { align-items: flex-start; flex-direction: column; }
  .kpi-grid.compact { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 70px minmax(0, 1fr); }
  .sidebar nav { padding: var(--space-sm); }
  .sidebar nav button { min-height: 46px; justify-content: center; padding: 10px; font-size: 0; }
  .sidebar nav button .icon { width: 20px; height: 20px; }
  main { padding-inline: var(--space-md); }
  .meeting-topics { display: grid; grid-template-columns: 1fr; width: 100%; }
  .legal-modules { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --transition-fast: 0s; --transition-normal: 0s; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
