/* Sindicato Novo — layout claro, menu superior colorido (cor configurável em Aparência) */
:root {
  --nav: #2563eb; --nav-ink: #fff; --nav-hover: rgba(255,255,255,.14); --nav-line: rgba(255,255,255,.18);
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 30%, #fff);
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --line: #e6e8ee;
  --line-2: #d6d9e1;
  --ink: #1d1e2c;
  --ink-2: #4b5063;
  --ink-3: #7c8194;
  --pos: #059669;
  --neg: #e11d48;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 2px 10px rgba(20, 24, 40, .04);
  --font: "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1117; --surface: #171a23; --surface-2: #1d212c; --line: #262b38; --line-2: #333949;
  --ink: #eceef4; --ink-2: #b4b9c8; --ink-3: #8a90a3;
  --brand-soft: color-mix(in srgb, var(--brand) 18%, #171a23); --brand-line: color-mix(in srgb, var(--brand) 45%, #171a23);
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
button { font-family: inherit; }
.ic { flex: none; display: block; }
.muted { color: var(--ink-3); }
.neg { color: var(--neg); font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); font-variant-numeric: tabular-nums; }
.link { color: var(--brand); display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }
.grow { flex: 1; }
.inline { display: inline; margin: 0; }
.only-m { display: none !important; }

/* ---------------------------------------------------------------- menu superior */
.nav-top { position: sticky; top: 0; z-index: 50; background: var(--nav); color: var(--nav-ink); box-shadow: 0 2px 12px rgba(20,24,40,.08); }
.nav-in { max-width: 1440px; margin: 0 auto; height: 66px; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--nav-ink); }
.brand strong { font-size: 17px; font-weight: 700; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--brand); }
.menu { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; }
.menu-link { display: inline-flex; align-items: center; gap: 7px; height: 37px; padding: 0 13px; border-radius: 10px; color: var(--nav-ink); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; white-space: nowrap; user-select: none; }
.menu-link::-webkit-details-marker { display: none; }
.menu-link:hover { background: var(--nav-hover); }
.menu-link.active { background: #fff; color: var(--brand); }
:root[data-theme="dark"] .menu-link.active { background: var(--surface); }
.menu-link .ic:last-child:not(:first-child) { opacity: .7; }
.dd { position: relative; }
.dd[open] > summary .ic:last-child { transform: rotate(180deg); }
.dd-panel { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 40px rgba(20,24,40,.16); padding: 8px; z-index: 60; animation: ddin .14s ease-out; }
.dd-panel.right { left: auto; right: 0; }
@keyframes ddin { from { opacity: 0; transform: translateY(-4px); } }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); border: 0; background: none; cursor: pointer; text-align: left; }
.dd-item:hover { background: var(--surface-2); color: var(--ink); }
.dd-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.dd-item.danger { color: var(--neg); }
.dd-item .ic { color: var(--ink-3); }
.dd-item.on .ic { color: var(--brand); }
.dd-hdr { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; padding: 12px 12px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.dd-user { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.dd-user small { color: var(--ink-3); }
.user-dd { margin-left: auto; flex: none; }
.user-pill { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--nav-line); background: var(--nav-hover); color: var(--nav-ink); cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; }
.user-pill::-webkit-details-marker { display: none; }
.user-name { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand); font-weight: 700; flex: none; font-size: 14px; }
.avatar.xl { width: 76px; height: 76px; font-size: 30px; background: var(--brand-soft); }
.nav-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.nav-btn:hover { background: var(--nav-hover); }
.scrim { display: none; }

/* ---------------------------------------------------------------- página */
.content { max-width: 1440px; margin: 0 auto; padding: 28px 24px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 4px; }
.crumbs a:hover { color: var(--brand); }

/* ---------------------------------------------------------------- botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.outline { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn.outline:hover { background: var(--brand-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--neg); }
.btn.danger:hover { background: color-mix(in srgb, var(--neg) 8%, transparent); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.lg { height: 50px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--brand-line); font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); white-space: nowrap; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--neg); color: #fff; font-size: 12.5px; font-weight: 700; }

/* ---------------------------------------------------------------- cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-h h2 .ic, .card-title .ic { color: var(--brand); }
.card-title { margin-bottom: 18px; }
.card-sub { color: var(--ink-3); font-size: 14px; margin: -12px 0 16px; }
.pill-info { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 600; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.cols-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.cols-2 > .card, .cols-3 > .card, .cols-3 > .kpi { margin-bottom: 0; }
.stack { margin-bottom: 22px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; margin: 6px 0 14px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.b-green { background: #dcfce7; color: #047857; }
.b-red { background: #ffe4e9; color: #be123c; }
.b-amber { background: #fef3c7; color: #b45309; }
.b-blue { background: #dbeafe; color: #1d4ed8; }
.b-violet { background: #ede9fe; color: #6d28d9; }
.b-gray { background: #eef0f4; color: #4b5063; }
.b-dark { background: #1f2937; color: #fff; }
:root[data-theme="dark"] .b-green { background: #0d3324; color: #6ee7b7; }
:root[data-theme="dark"] .b-red { background: #3d1220; color: #fda4af; }
:root[data-theme="dark"] .b-amber { background: #3a2a0c; color: #fcd34d; }
:root[data-theme="dark"] .b-blue { background: #132a4d; color: #93c5fd; }
:root[data-theme="dark"] .b-gray { background: #262b38; color: #b4b9c8; }
:root[data-theme="dark"] .b-dark { background: #eceef4; color: #0f1117; }

/* ---------------------------------------------------------------- barra de filtros */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); min-width: 300px; color: var(--ink-3); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search input { border: 0; outline: 0; box-shadow: none !important; padding: 0; background: transparent; flex: 1; height: 100%; font: inherit; color: var(--ink); min-width: 0; }
.toolbar select, .toolbar input[type=month] { width: auto; max-width: 100%; height: 44px; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.period input[type=month] { width: 175px; }

/* ---------------------------------------------------------------- tabela */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 13px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th a { display: inline-flex; align-items: center; gap: 4px; }
.tbl th a:hover { color: var(--brand); }
.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.late td.primary { box-shadow: inset 3px 0 0 var(--neg); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.primary { font-weight: 600; }
.tbl .row-link:hover { color: var(--brand); }
.tbl .act { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions .btn span { display: none; }
.tbl tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.tot { display: flex; flex-wrap: wrap; gap: 26px; justify-content: flex-end; font-size: 14px; color: var(--ink-2); }
.tot b { margin-left: 6px; font-size: 16px; }
.thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; margin: 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.pager > div { display: flex; align-items: center; gap: 6px; }
.pg { color: var(--ink-2); font-weight: 600; }

/* ---------------------------------------------------------------- formulários */
.form .grid, .grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.sec { font-size: 18px; font-weight: 700; color: var(--ink); margin: 26px -24px 18px; padding: 22px 24px 0; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.c1 { grid-column: span 1; } .c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c10 { grid-column: span 10; } .c11 { grid-column: span 11; } .c12 { grid-column: span 12; }
.fld > label { font-size: 14px; font-weight: 600; color: var(--ink); }
.req { color: var(--neg); font-style: normal; }
input:where(:not([type=checkbox]):not([type=file]):not([type=radio]):not([type=color])), select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input[readonly], select:disabled { background: var(--surface-2); color: var(--ink-2); }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--neg); }
small.err { color: var(--neg); font-size: 13px; }
small.help { color: var(--ink-3); font-size: 13px; }
.static { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sel-row { display: flex; gap: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 24px -24px -24px; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.danger-zone { display: flex; justify-content: flex-end; }
/* segmentado Não/Sim */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); width: max-content; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 18px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg input:checked + label { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(20,24,40,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); }
/* upload */
.upl { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.upl input[type=file] { font: inherit; font-size: 14px; color: var(--ink-3); max-width: 100%; }
.upl input[type=file]::file-selector-button { font: 600 14px var(--font); height: 40px; padding: 0 16px; margin-right: 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--brand); background: var(--surface); color: var(--brand); cursor: pointer; }
.upl input[type=file]::file-selector-button:hover { background: var(--brand-soft); }
.upl-side { display: flex; flex-direction: column; gap: 8px; }
.preview { width: 92px; height: 92px; object-fit: contain; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 4px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(20px); }
.rte { border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.rte-bar button { min-width: 34px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font-size: 14px; }
.rte-bar button:hover { background: var(--line); }
.rte-area { min-height: 220px; max-height: 520px; overflow: auto; padding: 14px 16px; outline: 0; background: var(--surface); }
/* olho de mostrar senha dentro do campo */
.pw { position: relative; }
.pw input { width: 100%; padding-right: 46px; }
.pw .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
/* paleta de cores */
.palette { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.swatch-big { width: 52px; height: 52px; border-radius: 12px; border: 1.5px solid var(--line); box-shadow: inset 0 0 0 4px var(--surface); }
.hex { font: 600 13px ui-monospace, Consolas, monospace; padding: 4px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.1); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.sw-custom { width: 32px; height: 32px; border-radius: 50%; border: 1.5px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-3); background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444); }
.sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- alertas, toasts, modal */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 18px; font-size: 14.5px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert.err { background: #fff1f3; color: #be123c; border: 1px solid #fecdd6; }
.alert.info { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
:root[data-theme="dark"] .alert.err { background: #3d1220; border-color: #5c1a2e; color: #fda4af; }
.busy { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(15,23,42,.45); animation: fin .2s; }
.busy > div { display: grid; justify-items: center; gap: 8px; padding: 26px 30px; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; max-width: calc(100vw - 32px); }
.busy small { color: #6b7280; }
.busy .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #e5e7eb; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-radius: 14px; background: #1d1e2c; color: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.2); font-size: 14.5px; animation: tin .25s ease-out; }
.toast.t-ok .ic { color: #34d399; }
.toast.t-err { background: #be123c; }
.toast.t-warn .ic { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(20, 22, 35, .45); display: grid; place-items: center; padding: 20px; animation: fin .15s; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 22px; padding: 28px 24px 24px; width: min(440px, 100%); text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); animation: pop .18s ease-out; }
.modal-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); }
.modal-box h3 { font-size: 19px; margin-bottom: 6px; }
.modal-box p { color: var(--ink-3); margin: 0 0 22px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@keyframes fin { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.empty { text-align: center; padding: 52px 20px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { color: var(--brand-line); }
.empty.sm { padding: 30px 16px; }
.empty h2 { color: var(--ink); }
.empty p { margin: 0; }

/* ---------------------------------------------------------------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--ink); font-size: 15px; font-weight: 600; }
.kpi-top .ic { color: var(--c, var(--brand)); }
.kpi-val { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--c, var(--brand)); line-height: 1.25; margin-top: 8px; }
.kpi-val.sm { font-size: 26px; }
.kpi-sub { font-size: 13.5px; color: var(--ink-3); }
.prog { height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--brand)) 14%, var(--surface)); overflow: hidden; margin: 16px 0 10px; }
.prog > i { display: block; height: 100%; border-radius: 99px; background-color: var(--c, var(--brand)); background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 6px, transparent 6px 12px); }
.kpi-links { display: flex; flex-direction: column; margin-top: 4px; }
.kpi-links a { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.kpi-links a .ic:first-child { color: var(--ink-3); }
.kpi-links a .ic:last-child { margin-left: auto; color: var(--ink-3); }
.kpi-links a:hover { color: var(--brand); }
.c-blue { --c: #2563eb; } .c-green { --c: #059669; } .c-amber { --c: #d97706; } .c-red { --c: #e11d48; } .c-violet { --c: #7c3aed; } .c-sky { --c: #0284c7; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .bar-r { fill: var(--brand); }
.chart .bar-d { fill: #f59e0b; }
.chart .bar:hover { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mini-list { list-style: none; margin: 0; padding: 8px; }
.mini-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; }
.mini-list li:hover { background: var(--surface-2); }
.mini-list .grow { min-width: 0; }
.mini-list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mini-list .s { font-size: 13px; color: var(--ink-3); }
.date-pill { flex: none; width: 50px; text-align: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); padding: 5px 0; line-height: 1.1; }
.date-pill b { display: block; font-size: 18px; }
.date-pill small { font-size: 10.5px; text-transform: uppercase; font-weight: 700; }
.bar-h { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-h > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.task { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--surface-2); margin-bottom: 10px; }
.task:last-child { margin-bottom: 0; }
.task-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--brand); flex: none; box-shadow: var(--shadow); }
.task-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.task h4 { margin: 0; font-size: 15.5px; }
.task p { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.task .grow { min-width: 0; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 18px 24px 24px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; }
.quick a .ic { color: var(--brand); }
.quick a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------------------------------------------------------------- perfil / afiliado */
.profile { display: flex; gap: 18px; align-items: center; }
.profile h2 { font-size: 22px; }
.profile p { margin: 2px 0; }
.hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hero-photo { width: 108px; height: 108px; border-radius: 20px; object-fit: cover; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); font-size: 42px; font-weight: 700; flex: none; }
.hero h2 { font-size: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: max-content; max-width: 100%; }
.tabs button { border: 0; background: transparent; padding: 9px 16px; font: 600 14.5px var(--font); color: var(--ink-2); cursor: pointer; border-radius: 10px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { background: var(--surface-2); }
.tabs button.on { background: var(--brand); color: var(--brand-ink); }
.tabs .count { background: rgba(127,127,127,.18); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.tab-panel[hidden] { display: none; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 26px; margin: 0; }
.dl dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dl dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- calendário */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h { padding: 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 116px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--surface-2); color: var(--ink-3); }
.cal-d.today .cal-n { background: var(--brand); color: var(--brand-ink); }
.cal-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; }
.ev { display: block; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev:hover { background: var(--brand); color: var(--brand-ink); }

/* ---------------------------------------------------------------- login */
.bare { min-height: 100vh; }
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
/* degradê na cor do menu (Aparência): mais claro no topo, mais escuro embaixo */
.login-art { background: linear-gradient(160deg, color-mix(in srgb, var(--nav) 78%, #fff) 0%, var(--nav) 50%, color-mix(in srgb, var(--nav) 70%, #000) 100%), var(--nav); color: var(--nav-ink); display: flex; align-items: flex-end; padding: 56px; }
.login-art { position: relative; overflow: hidden; }
/* círculos translúcidos nos cantos */
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none; }
.login-art::before { width: 420px; height: 420px; top: -160px; right: -170px; }
.login-art::after { width: 320px; height: 320px; bottom: -140px; left: -150px; background: rgba(255,255,255,.08); }
.login-art-inner { position: relative; z-index: 1; max-width: 460px; }
.login-art .brand-mark.lg { width: 60px; height: 60px; border-radius: 16px; }
.login-art h2 { font-size: 36px; margin: 22px 0 10px; }
.login-art p { opacity: .85; font-size: 17px; margin: 0; }
.login-box { display: grid; place-items: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 400px; display: grid; gap: 16px; background: var(--surface); padding: 32px; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-form h1 { font-size: 26px; }
.login-form .muted { margin: -10px 0 4px; }
.login-logo { max-height: 64px; max-width: 200px; object-fit: contain; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1400px) {
  .menu-link { padding: 0 9px; font-size: 13.5px; }
}
@media (max-width: 1150px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: 1fr; }
}
/* menu vira gaveta abaixo de 1280px: com o nome completo do usuário, os 6 grupos não cabem */
@media (max-width: 1279px) {
  .only-m { display: inline-grid !important; }
  .menu-head.only-m { display: flex !important; }
  .nav-in { gap: 10px; padding: 0 14px; }
  .menu { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); background: var(--surface); color: var(--ink); flex-direction: column; align-items: stretch; gap: 2px; padding: 12px; overflow-y: auto; transform: translateX(-102%); transition: transform .22s ease; z-index: 70; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.side-open .menu { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20,22,35,.45); z-index: 65; }
  .menu-head { justify-content: space-between; align-items: center; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .menu .menu-link { color: var(--ink); width: 100%; height: 44px; }
  .menu .menu-link:hover { background: var(--surface-2); }
  .menu .menu-link.active { background: var(--brand-soft); color: var(--brand); }
  .menu .menu-link .ic:last-child:not(:first-child) { margin-left: auto; }
  .menu .dd-panel { position: static; box-shadow: none; border: 0; padding: 0 0 6px 14px; min-width: 0; animation: none; }
  .menu .dd-hdr { border-top: 0; margin-top: 0; }
  .brand strong { max-width: 46vw; }
}
@media (max-width: 900px) {
  .content { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 23px; }
  .cols-2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .form .grid, .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .c1, .c2 { grid-column: span 2; } .c3, .c4, .c5 { grid-column: span 3; } .c6, .c7, .c8, .c9, .c10, .c11, .c12 { grid-column: span 6; }
  .page-actions .btn span { display: none; }
  .page-actions .btn { padding: 0 13px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 18px; border-radius: 16px; }
  .sec { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .form-actions { margin: 20px -18px -18px; padding: 14px 18px; }
  .search { min-width: 0; flex: 1 1 100%; }
  .toolbar select { flex: 1 1 140px; }
  .c3, .c4, .c5 { grid-column: span 6; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .tbl td { border: 0; padding: 0; font-size: 14px; }
  .tbl td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
  .tbl td.primary { grid-column: 1 / -1; font-size: 16px; }
  .tbl td.primary::before { display: none; }
  .tbl td.num { text-align: left; }
  .tbl td.act { grid-column: 1 / -1; width: auto; }
  .tbl td.act::before { display: none; }
  .row-actions { justify-content: flex-start; margin-top: 4px; }
  .tbl tfoot tr { display: block; }
  .tot { justify-content: flex-start; gap: 12px; }
  .cal-d { min-height: 64px; padding: 3px; }
  .ev { font-size: 0; height: 6px; padding: 0; background: var(--brand); }
  .cal-h { font-size: 10px; padding: 6px 2px; }
  .hero-photo { width: 78px; height: 78px; font-size: 30px; }
  .quick { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .user-pill { padding: 0 6px 0 4px; }
}

/* ---------------------------------------------------------------- impressão */
@media print {
  .nav-top, .toolbar, .row-actions, .form-actions, .toasts, .no-print, .page-actions { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.page-actions .dd-panel { top: calc(100% + 6px); }
.public .brand strong { max-width: none; white-space: normal; }
.help-btn { margin-left: auto; flex: none; border: 1px solid var(--nav-line); border-radius: 999px; background: var(--nav-hover); color: var(--nav-ink); }
.help-btn + .user-dd { margin-left: 8px; }

/* referência de variáveis dos modelos de documento */
.tags-ref { margin-top: 10px; border: 1.5px dashed var(--brand-line); border-radius: var(--radius-sm); background: var(--brand-soft); padding: 12px 14px; }
.tags-ref-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--brand); font-size: 14px; margin-bottom: 8px; }
.tags-ref-h span { color: var(--ink-3); font-size: 12.5px; }
.tags-grp { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--brand-line); }
.tags-grp small { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding-top: 6px; }
.tags-grp > div { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); }
.tag-chip code { font: 600 12.5px ui-monospace, Consolas, monospace; color: var(--brand); }
.tag-chip:hover { border-color: var(--brand); background: var(--surface); color: var(--ink); }
.tag-chip.ok { border-color: var(--pos); }
@media (max-width: 640px) { .tags-grp { grid-template-columns: 1fr; } .tag-chip span { display: none; } }

/* foto do usuário */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; background: var(--brand-soft); vertical-align: middle; margin-right: 6px; display: inline-grid; }
