@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap');
:root{font-family:"DM Sans",system-ui,sans-serif;background:#f3f8fc;color:#102d48;color-scheme:light;--ink:#fff}
*{box-sizing:border-box}
body{margin:0;min-width:0}
button,input{font:inherit}
a{color:var(--accent);text-underline-offset:.2em}
button,summary{cursor:pointer}
:focus-visible{outline:2px solid var(--brand-focus,#cc6208);outline-offset:4px}
[hidden]{display:none!important}
svg{width:20px;height:20px;flex:none}
h1,h2,p{margin:0}
h1,h2,.brand{font-family:Manrope,system-ui,sans-serif}
.brand{display:flex;align-items:center;gap:12px;font-weight:800;font-size:1.125rem;white-space:nowrap}
.auth-icon,.page-icon{display:grid;place-items:center;border-radius:13px}

.auth-layout{min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.auth-aside{position:relative;isolation:isolate;min-height:100%;padding:clamp(32px,5vw,72px);display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;border-right:1px solid var(--line);background:linear-gradient(145deg,#0067a6,#00578f 60%,#073c65)}
.grid-art{position:absolute;inset:0;z-index:-1;background-image:linear-gradient(#79caff20 1px,transparent 1px),linear-gradient(90deg,#79caff20 1px,transparent 1px);background-size:46px 46px;mask-image:radial-gradient(ellipse at 78% 35%,#09213a,transparent 66%);pointer-events:none}
.aside-copy{padding:36px 0 0}
.aside-copy h2{font-size:clamp(3rem,6vw,6.25rem);line-height:.98;letter-spacing:-.085em;font-weight:800}
.aside-copy h2 span{color:#ff9b43}
.aside-copy p{margin-top:24px;color:var(--muted);font-size:1.1rem}
.auth-main{display:grid;place-items:center;padding:48px 28px}
.auth-content{width:min(100%,390px)}
.auth-icon,.page-icon{width:52px;height:52px;background:#183955;color:var(--accent);margin-bottom:22px;border:1px solid #345a77}
.auth-content h1,.page h1{font-weight:800;font-size:clamp(1.9rem,4vw,2.6rem);line-height:1.12;letter-spacing:-.045em}
.description,.switch,.page p{color:var(--muted);margin-top:12px;line-height:1.55}
.auth-content form{display:grid;gap:16px;margin-top:24px}
.auth-content label{display:grid;gap:8px;font-weight:600;font-size:.9rem}
input{min-width:0;border:1px solid #343b4d;background:#14283c;color:#f7f8fb;padding:12px 14px;border-radius:10px;min-height:48px}
input::placeholder{color:#9aa3b8}
.recover{font-size:.9rem;justify-self:end}
.primary{min-height:48px;border:0;border-radius:10px;background:#ff9326;color:#102d48;font-weight:800;padding:12px 16px}
.primary:hover{background:#ffac59}
.primary:disabled{opacity:.65;cursor:wait}
.switch{text-align:center;margin-top:24px;font-size:.94rem}
.notice,.feedback{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-top:16px;color:var(--muted);font-size:.9rem;line-height:1.5}
.feedback{margin-top:0;color:var(--accent)}
.mobile-brand,.mobile-trigger{display:none!important}
.shell{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:100dvh}
.sidebar{display:flex;flex-direction:column;gap:32px;padding:26px 18px;border-right:1px solid var(--line);background:var(--panel);position:sticky;top:0;align-self:start;height:100dvh;overflow:auto}

nav{display:grid;gap:5px}
nav a{display:flex;align-items:center;min-height:46px;gap:12px;padding:9px 12px;border-radius:9px;color:var(--muted);text-decoration:none;font-weight:600}
nav a:hover{background:#142b42;color:#fff}
nav a[aria-current=page]{background:#1a3b58;color:var(--accent);box-shadow:inset 3px 0 var(--accent)}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:76px;padding:10px clamp(18px,4vw,48px);border-bottom:1px solid var(--line);background:var(--panel)}
.topbar-title{display:flex;align-items:center;gap:12px;font-weight:700;min-width:0}
.account{position:relative;flex:none}
.account summary{display:flex;align-items:center;list-style:none;gap:9px;min-height:44px;padding:4px 6px;border-radius:8px}
.account summary::-webkit-details-marker{display:none}
.account summary>svg{width:15px}
.account-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.avatar{position:relative;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;overflow:hidden;background:#005d96;color:#fff;font-weight:800;font-size:.8rem}
.avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.account-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:195px;z-index:1;padding:6px;background:#142b42;border:1px solid var(--line);border-radius:10px;box-shadow:0 16px 40px #08284677}
.account-menu a,.account-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:0;background:transparent;color:inherit;text-decoration:none;padding:10px;border-radius:6px;white-space:nowrap}
.account-menu a:hover,.account-menu button:hover{background:#203b55}
.account-role{display:block;padding:7px 10px;color:var(--muted);font-size:.875rem}
.page{padding:clamp(24px,5vw,64px) clamp(18px,5vw,64px)}
.page>a{display:inline-block;margin-top:14px}
.profile{margin-top:30px;padding:22px 24px;border:1px solid var(--line);border-radius:14px;background:var(--panel);max-width:520px}
.profile h2{font-size:1.15rem}
.profile dl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:10px 22px;margin-bottom:0}
.profile dt{color:var(--muted)}
.profile dd{margin:0;overflow-wrap:anywhere}
.icon-button{display:grid;place-items:center;min-width:44px;min-height:44px;padding:6px;background:transparent;color:inherit;border:1px solid var(--line);border-radius:9px}
.drawer{position:fixed;inset:0 auto 0 0;margin:0;padding:20px 15px;max-height:none;height:100dvh;width:min(86vw,310px);max-width:none;background:var(--panel);color:inherit;border:0;border-right:1px solid var(--line);overflow:auto}
.drawer::backdrop{background:#071e35aa}
.drawer-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:24px}
.loader{display:grid;min-height:100dvh;place-content:center;justify-items:center;gap:14px;color:var(--muted)}
.loader span{width:36px;height:36px;border:3px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#toast{position:fixed;z-index:4;bottom:24px;right:24px;max-width:min(390px,calc(100vw - 48px));padding:13px 16px;background:var(--orange-surface);color:var(--orange-text);border:1px solid var(--orange-line);border-radius:10px;box-shadow:0 16px 40px #08284666}
@media(max-width:800px){
  .auth-layout,.shell{display:block}
  .auth-aside,.sidebar{display:none}
  .auth-main{min-height:100dvh;padding:28px 22px 42px}
  .mobile-brand{display:block!important;margin-bottom:34px}
  .mobile-trigger{display:grid!important}
  .topbar{min-height:66px}
}
@media(max-width:440px){.account-name{display:none}.profile{padding:16px}.profile dl{gap:10px 14px}}
@media(prefers-reduced-motion:reduce){.loader span{animation:none}}

/* DRE consolidado */
.workspace { min-width: 0; }
.dre-page { padding: clamp(20px, 3vw, 40px); }
.dre-heading { margin-bottom: 24px; }
.dre-heading p { margin-top: 6px; }
.dre-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
  gap: 15px 12px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.dre-filters label, .dre-edit-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: inherit;
  font-size: .875rem;
  font-weight: 600;
}
.dre-search { grid-column: 1 / -1; }
.dre-search > span { position: relative; }
.dre-search svg { position: absolute; top: 14px; left: 13px; color: var(--muted); pointer-events: none; }
.dre-search input { width: 100%; padding-left: 40px; }
.dre-filters select, .dre-edit-grid select, .dre-edit-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #343b4d;
  border-radius: 10px;
  background: #14283c;
  color: #f7f8fb;
  padding: 9px 12px;
  font: inherit;
}
.dre-edit-grid textarea { resize: vertical; }
.dre-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.dre-card-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
}
.dre-card-header h2 { font-size: 1.1rem; }
.dre-card-header span, .dre-pagination span { font-size: .875rem; color: var(--muted); }
.dre-table-wrap { overflow-x: auto; }
.dre-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.dre-table th {
  background: #142b42;
  color: #c6cdda;
  padding: 12px;
  border-block: 1px solid var(--line);
  white-space: nowrap;
}
.dre-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.dre-table th:first-child, .dre-table td:first-child { padding-left: 18px; }
.dre-table th:last-child, .dre-table td:last-child { padding-right: 18px; }
.dre-table tr[data-row] { cursor: pointer; }
.dre-table tr[data-row]:hover { background: #1b2330; }
.dre-date { white-space: nowrap; }
.dre-table small, .dre-muted, .dre-email { color: var(--muted); }
.dre-table small { display: block; margin-top: 3px; font-size: .82rem; }
.dre-row-link {
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #727d94;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.dre-row-link:hover { color: var(--accent); }
.dre-value {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dre-value.positive { color: var(--cfg-linked); background: var(--cfg-active); }
.dre-value.negative { color: var(--orange-text); background: var(--orange-surface); }
.dre-row-actions { display: flex; gap: 6px; }
.dre-row-actions .icon-button { min-width: 36px; min-height: 36px; }
.dre-row-actions svg { width: 16px; height: 16px; }
.dre-row-actions button:hover { background: #283243; }
.dre-delete { color: var(--orange-text); }
.dre-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.dre-pagination > div { display: flex; gap: 8px; }
.dre-secondary, .dre-danger {
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid #424a5f;
  background: #232a39;
  color: inherit;
  font-weight: 700;
  font-size: .875rem;
}
.dre-secondary:hover { background: #30394b; }
.dre-danger { background: var(--orange-button); border-color: var(--orange-line); color: #fff; }
.dre-danger:hover { background: var(--orange-hover); }
.dre-secondary:disabled, .dre-danger:disabled { opacity: .48; cursor: default; }
.dre-skeleton {
  display: block;
  width: min(100%, 88px);
  min-width: 35px;
  height: 15px;
  margin-block: 5px;
  border-radius: 5px;
  background: #32394a;
  animation: dre-pulse 1.25s ease-in-out infinite alternate;
}
@keyframes dre-pulse { to { opacity: .42; } }
.dre-empty { padding: 42px 18px; text-align: center; border-top: 1px solid var(--line); }
.dre-empty h3 { margin-bottom: 0; }
.dre-empty p { margin-top: 6px; }
.dre-empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #273448; color: #cfddf2; }
.dre-empty button { margin-top: 15px; }
.dre-dialog {
  width: min(550px, calc(100% - 24px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: #191f2c;
  border: 1px solid #394359;
  border-radius: 14px;
  color: inherit;
  padding: 20px;
}
.dre-dialog::backdrop { background: #071e35b5; }
.dre-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dre-dialog-header h2 { font-size: 1.25rem; }
.dre-dialog > p, .dre-dialog dd { overflow-wrap: anywhere; }
.dre-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.dre-sheet { inset: 0 0 0 auto; margin: 0; min-height: 100dvh; max-height: 100dvh; border-radius: 14px 0 0 14px; }
.dre-detail-grid, .dre-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dre-detail-grid dt { color: var(--muted); font-size: .875rem; }
.dre-detail-grid dd { margin: 3px 0 0; }
.dre-wide { grid-column: 1 / -1; }
.dre-edit-grid .dre-checkbox { display: flex; align-items: center; gap: 8px; }
.dre-checkbox input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.dre-dialog .dre-dialog-error { color: var(--orange-text); }
#toast[data-status="success"] { background: var(--cfg-active); border-color: var(--line); color: var(--cfg-linked); }
@media (max-width: 960px) {
  .dre-table th, .dre-table td { padding-inline: 9px; }
}
@media (max-width: 650px) {
  .dre-page { padding: 18px 12px; }
  .dre-filters { padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dre-filters select { padding-inline: 7px; }
  .dre-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .dre-table, .dre-table tbody, .dre-table tr { display: block; }
  .dre-table tr { border-top: 1px solid var(--line); padding: 8px 12px; }
  .dre-table td, .dre-table td:first-child, .dre-table td:last-child {
    display: grid;
    grid-template-columns: minmax(90px, 35%) minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 6px;
    border: 0;
    padding: 5px 0;
  }
  .dre-table td::before { content: attr(data-label); color: var(--muted); }
  .dre-row-actions .icon-button { min-width: 44px; min-height: 44px; }
  .dre-sheet { width: 100%; max-width: 100%; border-radius: 0; }
}
@media (max-width: 360px) { .dre-edit-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .dre-skeleton { animation: none; } }

.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.panel-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; margin-bottom: 20px; }
.panel-cards article { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.panel-cards h2 { color: var(--muted); font-size: .9rem; }
.panel-card-value { margin-top: 9px; font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel-cards p { margin-top: 8px; font-size: .88rem; }
.panel-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.panel-tag.good { color: var(--cfg-linked); background: var(--cfg-active); }
.panel-tag.bad { color: var(--orange-text); background: var(--orange-surface); }
.panel-tag.neutral { color: var(--cfg-linked); background: var(--cfg-surface); border: 1px solid var(--line); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-actions button { min-height: 36px; padding: 6px 9px; }
.panel-user { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 700; }
.panel-user .avatar { flex: 0 0 36px; }
.panel-skeleton, .panel-retry { padding: 12px 18px 20px; color: var(--muted); }
.panel-skeleton .dre-skeleton { width: 100%; max-width: 500px; margin-block: 12px; }
.panel-retry { text-align: center; }
.panel-extracted { display: grid; gap: 9px; margin-top: 14px; }
.panel-extracted article { padding: 12px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.panel-extracted article > div, .panel-extracted dt { color: var(--muted); font-size: .87rem; }
.panel-extracted dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; margin: 10px 0 0; }
.panel-extracted dd { margin: 2px 0 0; }

.cfg-session, .cfg-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.cfg-session { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.cfg-session .avatar { width: 54px; height: 54px; flex: 0 0 54px; }
.cfg-session > div:nth-child(2) { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.cfg-session > div:nth-child(2) span { color: var(--muted); }
.cfg-session-status { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 7px; }
.cfg-tabs { display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.cfg-tabs button { min-height: 44px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; padding: 6px 10px; }
.cfg-tabs button[aria-selected="true"] { color: inherit; border-bottom: 3px solid var(--accent); }
.cfg-body { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,310px),1fr)); align-items: start; gap: 12px; }
.cfg-card h2 { font-size: 1.13rem; }
.cfg-card .panel-actions, .cfg-card > button { margin-top: 14px; }
.cfg-form { display: grid; gap: 13px; margin-top: 13px; }
.cfg-form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; min-width: 0; }
.cfg-form input, .cfg-form select { width: 100%; min-width: 0; }
.cfg-form select { font: inherit; min-height: 44px; border-radius: 10px; background: var(--cfg-input, #14283c); color: inherit; border: 1px solid var(--line); padding: 8px 10px; }
.cfg-form fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0; display: grid; gap: 10px; }
.cfg-form .cfg-switch { display: flex; align-items: center; gap: 8px; }
.cfg-switch input { width: 23px; height: 21px; min-height: 0; accent-color: #005d96; }
.cfg-form .cfg-feedback { margin: 0; font-size: .9rem; }
.cfg-feedback[data-status="success"] { color: var(--cfg-linked); }
.cfg-feedback[data-status="error"] { color: var(--orange-text); }
:root {
  --muted: #35536e;
  --line: #c4d7e7;
  --panel: #fff;
  --accent: #005d96;
  --cfg-surface: #eaf3fa;
  --cfg-input: #fff;
  --cfg-hover: #e1eff9;
  --cfg-active: #dcecf8;
  --cfg-linked: #005d96;
  --cfg-table: #173956;
  --orange-surface: #fff0df;
  --orange-text: #883b08;
  --orange-line: #c76d28;
  --orange-button: #a64b0b;
  --orange-hover: #8a3806;
  --form-text: #102d48;
  --form-label: #173956;
  --form-border: #6b849c;
  --form-focus: #b75408;
  accent-color: #005d96;
}
:root a { color: var(--cfg-linked); }
:root nav a { color: var(--muted); }
:root nav a[aria-current="page"] { color: var(--cfg-linked); background: var(--cfg-active); }
:root nav a:hover, :root .account-menu a:hover,
:root .account-menu button:hover, :root .dre-table tr[data-row]:hover {
  color: inherit; background: var(--cfg-hover);
}
:root .account-menu, :root .dre-dialog, :root .dre-table th {
  background: var(--cfg-surface); border-color: var(--line);
}
:root .dre-table th { color: var(--cfg-table); }
:root input, :root .dre-filters select,
:root .dre-edit-grid select, :root .dre-edit-grid textarea {
  background: var(--cfg-input); color: inherit; border-color: var(--line);
}
:root input::placeholder { color: var(--muted); }
:root .dre-secondary { background: var(--cfg-surface); border-color: var(--line); }
:root .dre-secondary:hover { background: var(--cfg-hover); }
:root .dre-row-link:hover { color: var(--cfg-linked); }
:root .dre-dialog .dre-dialog-error { color: var(--orange-text); }
@media (max-width: 550px) { .cfg-session-status { margin-inline-start: 0; } }

:root { --dash-receita: #005d96; --dash-despesa: #bd5c08; --dash-meta: #005d96; --dash-realizado: #ba8d00; }
.dash-heading {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 25px;
}
.dash-heading h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.dash-heading p { margin-top: 5px; }
.dash-import { display: inline-flex; align-items: center; gap: 8px; }
.dash-import svg { width: 17px; }
.dash-filters {
  display: flex; flex-wrap: wrap; gap: 13px; align-items: center;
  min-width: 0; margin-bottom: 20px;
}
.dash-period {
  display: flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; gap: 2px; padding: 3px;
}
.dash-period button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 5px 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-weight: 700; font-size: .88rem;
}
.dash-period button[aria-pressed="true"] { color: var(--cfg-linked); background: var(--cfg-active); }
.dash-period button:hover:not([aria-pressed="true"]) { background: var(--cfg-hover); }
.dash-period svg { width: 16px; height: 16px; }
.dash-range, .dash-month { font-size: .875rem; color: var(--muted); }
.dash-month { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; font-weight: 600; }
.dash-month input { min-height: 42px; min-width: 9rem; padding: 7px 9px; }
.dash-card {
  min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.dash-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 15px; }
.dash-kpis:empty { display: none; }
.dash-kpi { display: flex; flex-direction: column; min-height: 156px; padding: 15px; }
.dash-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 10px; }
.dash-kpi h2 { color: var(--muted); font-size: .9rem; font-weight: 800; }
.dash-icon {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  color: var(--cfg-linked); background: var(--cfg-active); border: 1px solid var(--line);
}
.dash-icon svg { width: 17px; height: 17px; }
.dash-kpi strong {
  font-family: Manrope,system-ui,sans-serif; font-size: clamp(1.28rem,2.45vw,2rem);
  line-height: 1.15; letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.dash-kpi-context { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.dash-kpi-motion { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; padding-top: 12px; margin-top: auto; color: var(--muted); font-size: .81rem; }
.dash-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; }
.dash-trend svg { width: 15px; height: 15px; }
.dash-trend.positive { color: var(--cfg-linked); }
.dash-trend.negative { color: var(--orange-text); }
.dash-kpi .dre-skeleton:first-of-type { width: 70%; height: 25px; }
.dash-kpi > .dre-skeleton { width: 52%; }
.dash-notice {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  margin: 0 0 14px !important; font-size: .9rem;
}
.dash-notice svg { color: var(--cfg-linked); }
.dash-notice.error { color: var(--orange-text); }
.dash-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 15px; }
.dash-card > header, .dash-import-card { padding: 17px 17px 0; }
.dash-card h2 { font-size: 1.07rem; }
.dash-kpi h2 { font-size: .88rem; }
.dash-card header p, .dash-import-card p { margin-top: 4px; font-size: .9rem; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 9px 15px; padding: 13px 16px 3px; color: var(--muted); font-size: .82rem; }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i { display: inline-flex; width: 9px; height: 9px; border-radius: 3px; }
.dash-legend .receita { background: var(--dash-receita); }
.dash-legend .despesa { background: var(--dash-despesa); }
.dash-legend .meta { background: var(--dash-meta); }
.dash-chart { min-width: 0; height: clamp(215px, 24vw, 305px); padding: 2px 7px 10px; }
.dash-bars { overflow-x: auto; }
.dash-bars-canvas { height: 100%; width: 100%; }
.dash-chart .dre-empty { display: grid; place-content: center; height: 100%; border: 0; }
.dash-graph-skeleton {
  display: flex; align-items: end; justify-content: space-around; height: 80%;
  margin: 8px 16px 0; border-bottom: 1px solid var(--line);
}
.dash-graph-skeleton i {
  height: 40%; width: min(24px,7%); background: var(--cfg-hover); border-radius: 5px 5px 0 0;
  animation: dre-pulse 1.25s ease-in-out infinite alternate;
}
.dash-graph-skeleton i:nth-of-type(2n) { height: 72%; }
.dash-graph-skeleton i:nth-of-type(3n) { height: 28%; }
.dash-graph-skeleton i:nth-of-type(5n) { height: 90%; }
.dash-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dash-bottom { display: grid; grid-template-columns: minmax(0,2.6fr) minmax(215px,1fr); align-items: start; gap: 14px; }
.dash-activity > header { padding-bottom: 13px; }
.dash-activity .dre-table td a { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dash-activity .dre-table td a svg { width: 14px; height: 14px; }
.dash-event { display: flex; gap: 8px; align-items: center; }
.dash-event small { display: block; padding-top: 2px; overflow-wrap: anywhere; }
.dash-import-card { padding-bottom: 17px; }
.dash-import-card > .dash-icon { margin-bottom: 12px; width: 43px; height: 43px; }
.dash-import-card > button, .dash-import-card > a { margin-top: 12px; display: inline-flex; align-items: center; }
@media(max-width:1150px) { .dash-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:1000px) { .dash-charts, .dash-bottom { grid-template-columns: minmax(0,1fr); } }
@media(max-width:550px) {
  .dash-month { margin-inline-start: 0; }
  .dash-kpis { gap: 8px; }
  .dash-kpi { min-height: 145px; padding: 10px; }
  .dash-kpi-top .dash-icon { width: 27px; height: 27px; }
}
@media(prefers-reduced-motion:reduce) { .dash-graph-skeleton i { animation: none; } }

.button-loader {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  margin-inline-end: .38em;
  vertical-align: -.11em;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.button-loader:has(svg) { border: 0; }
.button-loader svg { width: 100%; height: 100%; }
button[aria-busy="true"] { cursor: progress; }

.empty-illustration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 94px;
  height: 69px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--cfg-active) 0 48%, transparent 72%);
}
.empty-illustration .empty-symbol {
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--cfg-linked);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--cfg-surface);
  transform: rotate(-7deg);
}
.empty-illustration .empty-symbol svg { width: 23px; height: 23px; }
.empty-illustration > i { width: 6px; height: 6px; border: 1px solid var(--cfg-linked); border-radius: 2px; transform: rotate(35deg); }
.empty-illustration > i:last-child { width: 4px; height: 4px; align-self: flex-start; margin-top: 12px; }

.mobile-row-toggle { display: none; }
@media (max-width: 650px) {
  .dash-kpis {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(185px, 71%);
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 3px 3px 10px;
    scrollbar-width: thin;
  }
  .dash-kpi { scroll-snap-align: start; }
  .dre-table tbody tr:has(.mobile-row-toggle) { position: relative; }
  .dre-table tbody tr:has(.mobile-row-toggle) > td:first-child { padding-right: 47px; }
  .dre-table tbody tr:has(.mobile-row-toggle):not(.mobile-expanded) > td:nth-child(n+3) { display: none; }
  .dre-table tbody tr:has(.mobile-row-toggle):not(.mobile-expanded) > td[data-label="Valor"],
  .dre-table tbody tr:has(.mobile-row-toggle):not(.mobile-expanded) > td[data-label="Status"],
  .dre-table tbody tr:has(.mobile-row-toggle):not(.mobile-expanded) > td[data-label="Ações"],
  .dre-table tbody tr:has(.mobile-row-toggle):not(.mobile-expanded) > td[data-label="Detalhes"] { display: grid; }
  .mobile-row-toggle {
    display: grid;
    position: absolute;
    top: 7px;
    right: 10px;
    min-width: 42px;
    min-height: 38px;
  }
  .mobile-row-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .button-loader { animation: none; } }

/* Identidade da Lotérica Sorte do Pará */
:root { --brand-focus: #cc6208; }
.brand { min-width: 0; white-space: normal; line-height: 1.15; }
.brand img, .login-logo img, .topbar-logo img { display: block; object-fit: contain; background: #fff; }
.brand img { width: 76px; height: 69px; border: 1px solid var(--line); border-radius: 11px; padding: 3px; flex: none; }
.brand span { color: inherit; }
.sidebar .brand { color: #005d96; margin-inline: 2px; padding: 0 6px 17px; border-bottom: 1px solid var(--line); }
.drawer-top .brand img { width: 65px; height: 60px; }
.login-logo img {
  width: clamp(170px, 23vw, 310px);
  height: auto;
  max-height: 45dvh;
  border-radius: 22px;
  padding: clamp(10px, 1.5vw, 20px);
  box-shadow: 0 16px 38px #020c1957;
}
.auth-aside { color: #f5f9fd; }
.aside-copy p { color: #fff; }
.auth-layout .auth-icon, .page-icon { color: var(--cfg-linked); background: var(--cfg-active); border-color: var(--line); }
.topbar-logo { display: none; }
nav a[aria-current=page] { box-shadow: inset 3px 0 #e98221; }
.cfg-tabs button[aria-selected="true"] { border-bottom-color: #e98221; }
@media (max-width: 800px) {
  .mobile-brand.login-logo { margin: 0 0 23px; }
  .mobile-brand.login-logo img { width: 153px; max-height: 150px; border-radius: 14px; padding: 7px; }
  .topbar-logo { display: block; flex: 0 0 43px; }
  .topbar-logo img { width: 43px; height: 43px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
  .topbar-title { gap: 8px; }
}

.dash-kpi .dash-comparison-range {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.dash-comparison {
  display: flex;
  justify-content: end;
  margin-top: 9px;
}
.dash-comparison select {
  width: 100%;
  max-width: 16.5rem;
  min-height: 40px;
  padding: 5px 8px;
  color: var(--cfg-linked);
  background: var(--cfg-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 700 .84rem/1.25 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
}

.dre-card-header:has(.dre-ledger-total) { flex-wrap: wrap; }
.dre-ledger-total {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-inline-start: auto;
  padding: 7px 12px;
  border: 1px solid var(--dash-despesa);
  border-radius: 9px;
  background: var(--cfg-surface);
}
.dre-ledger-total strong {
  color: var(--cfg-linked);
  font-family: Manrope, system-ui, sans-serif;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 550px) {
  .dre-ledger-total { order: 1; flex-basis: 100%; margin-inline-start: 0; }
}

/* Controles nativos e estados de seleção seguem a mesma identidade. */
::selection { color: #082846; background: #ffbe85; }
:root { scrollbar-color: var(--line) var(--panel); }
/* Use explicit foregrounds so a field never inherits a hint or label color. */
.auth-content label, .dre-filters label, .dre-edit-grid label, .cfg-form label {
  color: var(--form-label);
}
:root :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background-color: var(--cfg-input);
  color: var(--form-text);
  border-color: var(--form-border);
  caret-color: var(--form-focus);
}
:root :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
:root :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: var(--form-focus);
  outline: 2px solid var(--form-focus);
  outline-offset: 1px;
}
:root input:is(:autofill, :-webkit-autofill) {
  box-shadow: 0 0 0 1000px var(--cfg-input) inset;
  -webkit-text-fill-color: var(--form-text);
}

/* A entrada usa o azul da marca como painel e o branco como base do formulário. */
.auth-layout {
  --panel: #fff;
  --muted: #35536e;
  --line: #99b4ca;
  --cfg-input: #fff;
  --cfg-active: #e2eff9;
  --cfg-linked: #005d96;
  --form-text: #102d48;
  --form-label: #173956;
  --form-border: #6b849c;
  --form-focus: #b75408;
  --brand-focus: #b75408;
  --orange-text: #883b08;
  color-scheme: light;
  color: #102d48;
  background: #fff;
}
.auth-layout .auth-aside {
  border-right: 6px solid #ff9326;
}
.auth-layout .auth-main { background: #fff; }
.auth-layout .auth-icon {
  color: #092f50;
  background: #ff9326;
  border-color: #df7916;
}
:root .auth-layout a { color: #005d96; }
.auth-layout .primary { box-shadow: 0 3px 0 #b75408; }
.auth-layout .primary:active { box-shadow: none; }
.dash-period button[aria-pressed="true"] {
  box-shadow: inset 0 -2px #e98221;
}
@media (max-width: 800px) {
  .auth-layout { border-top: 6px solid #ff9326; }
  .auth-layout .login-logo img { border: 1px solid #99b4ca; box-shadow: none; }
}

.dash-team { margin-top: 16px; }
.dash-team-loading, .dash-team > div > header { padding: 16px; }
.dash-team:has(.dre-table) .dash-team-loading,
.dash-team:has(.dre-empty) .dash-team-loading { display: none; }

.dre-edit-grid input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 5px 7px;
}
.dre-edit-grid input[type="file"]::file-selector-button {
  margin-inline-end: 8px;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: #005d96;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.profile-photo-hint { color: var(--muted); font-size: .8rem; }

.staff-chart { margin-bottom: 18px; }
.staff-levels {
  display: grid;
  gap: 15px;
  list-style: none;
  max-width: 60rem;
  margin: 0 18px 18px;
  padding: 0;
}
.staff-levels > li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--dash-despesa);
  border-radius: 8px;
  background: var(--cfg-surface);
}
.staff-levels > li + li::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 12px;
  width: 2px;
  height: 15px;
  background: var(--dash-despesa);
}
.staff-levels ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.staff-levels ul li {
  max-width: 100%;
  padding: 4px 8px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.staff-levels small { color: var(--muted); }
@media (max-width: 550px) {
  .staff-levels > li { grid-template-columns: minmax(0, 1fr); }
}

.bolao-section { margin-bottom: 16px; }
.bolao-ranking {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0 16px 16px;
  list-style-position: inside;
}
.bolao-ranking li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--dash-despesa);
  border-radius: 9px;
  background: var(--cfg-surface);
  overflow-wrap: anywhere;
}
.bolao-ranking span { display: block; margin-top: 5px; color: var(--cfg-linked); font-weight: 800; }
.bolao-note { margin-bottom: 14px; }

.password-field {
  position: relative;
  display: block;
  min-width: 0;
}
.password-field input {
  width: 100%;
  padding-inline-end: 52px;
}
.password-toggle {
  position: absolute;
  inset-inline-end: 2px;
  inset-block-start: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
}
.password-toggle:focus-visible {
  outline: 2px solid #ff9326;
  outline-offset: -3px;
}
.password-toggle svg { width: 19px; height: 19px; }

.dash-legend .realizado { background: var(--dash-realizado); }
.goal-amount {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.goal-target {
  border-bottom: 3px solid #005d96;
  background: #e7f3fc;
  color: #000;
  font-weight: 800;
}
.goal-actual {
  border-bottom: 3px solid #d3a000;
  background: #fff5cc;
  color: #422e00;
  font-weight: 700;
}
.goal-remaining { color: #8d2020; font-weight: 700; }
.goal-progress { font-weight: 800; }
.goal-progress.low { color: #8d2020; background: #ffe3e0; }
.goal-progress.transition { color: #833700; background: #ffead9; }
.goal-progress.mid { color: #624600; background: #fff1b5; }
.goal-progress.near { color: #3b5011; background: linear-gradient(100deg, #f8f3bb, #e0f1c8); }
.goal-progress.met { color: #176036; background: #dcf4e4; }
.goal-progress.over { color: #005286; background: #dbedff; }
.dash-kpi > strong .goal-progress { font-size: inherit; }

.schedule-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body:has(> .schedule-print) > :not(.schedule-print) { display: none !important; }
  body:has(> .schedule-print) { background: #fff; }
  body > .schedule-print {
    display: block;
    break-inside: avoid;
    zoom: var(--schedule-print-zoom, 1);
    color: #102d48;
    font: 8.5pt/1.12 Arial, sans-serif;
  }
  .schedule-print h2 { margin: 0 0 2mm; font: 700 12pt/1.15 Arial, sans-serif; }
  .schedule-print table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .schedule-print tr { break-inside: avoid; }
  .schedule-print td, .schedule-print th {
    border: .2mm solid #466682;
    padding: .55mm 1.1mm;
    text-align: left;
    white-space: nowrap;
  }
  .schedule-print th { background: #eaf3fa; print-color-adjust: exact; }
  .schedule-print :is(td, th):first-child { width: 24mm; }
}

.schedule-positive { color: #176036; }

.schedule-calendar { margin-bottom: 16px; }
.schedule-calendar h2 { padding: 14px; text-transform: capitalize; }
.schedule-calendar table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.schedule-calendar th, .schedule-calendar td { border: 1px solid var(--line); padding: 8px; text-align: left; }
.schedule-calendar th { background: var(--cfg-surface); }
.schedule-calendar td { height: 74px; vertical-align: top; }
.schedule-calendar td:last-child { background: #f2f8fc; }
.schedule-calendar time { font-weight: 800; }
.schedule-calendar ul { list-style: none; padding: 0; margin: 6px 0 0; }
.schedule-calendar li { padding: 3px 5px; margin-bottom: 4px; border-radius: 5px; background: #e4f2fd; color: #17476e; font-size: .82rem; overflow-wrap: anywhere; }

.schedule-weekday-short { display: none; }
@media (max-width: 650px) {
  .schedule-calendar table { min-width: 0; }
  .schedule-calendar th, .schedule-calendar td { padding: 4px; }
  .schedule-calendar li { padding: 2px; font-size: .7rem; }
  .schedule-weekday-full { display: none; }
  .schedule-weekday-short { display: inline; text-decoration: none; }
}

.store-goal { margin-bottom: 16px; }
.store-goal-body { padding: 0 14px 14px; }
.store-goal-body .panel-cards { margin: 0; }
.store-goal-body .panel-card-value .goal-progress { font-size: inherit; }

.dash-ranking { margin-block: 16px; }
.dash-ranking-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dash-ranking-list li { display: grid; grid-template-columns: 2.1rem 2.5rem minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.dash-ranking-list .avatar { width: 2.5rem; height: 2.5rem; }
.dash-ranking-position { font-weight: 800; text-align: center; }
.dash-ranking-score > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.dash-ranking-score strong { overflow-wrap: anywhere; }
.dash-ranking-score span { white-space: nowrap; font-weight: 800; }
.dash-ranking-track { height: 7px; background: var(--cfg-surface); border-radius: 8px; overflow: hidden; }
.dash-ranking-track > div { height: 100%; background: var(--dash-meta); border-radius: inherit; }
.dash-ranking-lead .dash-ranking-track > div { background: var(--dash-despesa); }

.bolao-operator-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; padding: 16px; }
.bolao-operator-cards article { min-width: 0; padding: 14px; background: var(--cfg-surface); border: 1px solid var(--line); border-radius: 12px; }
.bolao-operator-cards h3 { font-size: 1rem; margin: 0 0 10px; overflow-wrap: anywhere; }
.bolao-operator-cards dl { display: grid; gap: 8px; margin: 0; }
.bolao-operator-cards dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bolao-operator-cards dt { font-size: .875rem; }
.bolao-operator-cards dd { margin: 0; font-weight: 700; }
.bolao-operator-total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }

.meta-proposal-table td { font-variant-numeric: tabular-nums; }
.meta-proposal-table .goal-amount { white-space: nowrap; }
.meta-proposal-actions, .meta-proposal-method { padding: 12px 16px; border-top: 1px solid var(--line); }
.meta-proposal-actions h3 { font-size: 1rem; margin: 0 0 6px; }
.meta-proposal-actions ul { list-style: none; margin: 0; padding: 0; }
.meta-proposal-actions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-block: 6px; }
.meta-proposal-actions li + li { border-top: 1px solid var(--line); }
.meta-proposal-actions small { display: block; color: var(--muted); }
.meta-proposal-actions button { flex-shrink: 0; }
.meta-proposal-method summary { font-weight: 700; cursor: pointer; }
.meta-proposal-method p { margin: 8px 0 0; }
@media (min-width: 701px) {
  .meta-proposal-table .dre-table { table-layout: auto; font-size: .8125rem; }
  .meta-proposal-table .dre-table th, .meta-proposal-table .dre-table td { padding: 8px; }
  .meta-proposal-table .dre-table th { white-space: normal; }
  .meta-proposal-table .dre-table td:not(:first-child) { white-space: nowrap; }
  .meta-proposal-table .dre-table :is(th, td):first-child { min-width: 128px; }
}

.cfg-accounts { grid-column: 1 / -1; min-width: 0; }
