:root {
  --bg: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #122033;
  --muted: #64748b;
  --primary: #1558d6;
  --primary-2: #0f3f9e;
  --line: #dbe5f4;
  --ok: #14935b;
  --warn: #cc7a00;
  --danger: #c83232;
  --shadow: 0 18px 50px rgba(15, 23, 42, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  background: linear-gradient(135deg, #eaf1ff 0%, #f8fbff 45%, #e9f7f2 100%);
  color: var(--text);
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 290px;
  background: linear-gradient(180deg, #0e2f67 0%, #0b234b 100%);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 30px; }
.brand-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #68e1fd, #1558d6);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.brand h1 { margin: 0; font-size: 25px; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; color: #cbd5e1; font-size: 13px; }
nav { display: grid; gap: 10px; }
.nav-btn {
  border: 0; border-radius: 14px; padding: 13px 14px;
  color: #dbeafe; background: rgba(255,255,255,.08);
  text-align: left; font-weight: 700; cursor: pointer;
}
.nav-btn.active, .nav-btn:hover { background: #fff; color: #0e2f67; }
.status-card {
  margin-top: 28px; padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,.10); display: grid; gap: 6px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); display: inline-block; }
.dot.ok { background: var(--ok); }
.status-card small { color: #cbd5e1; }
.content { flex: 1; padding: 30px; max-width: 1500px; margin: 0 auto; }
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--primary); font-weight: 800; margin: 0 0 8px; font-size: 12px; }
h2 { margin: 0 0 8px; font-size: 30px; }
h3 { margin: 0; font-size: 22px; }
p { color: var(--muted); }
.hero p { margin: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tab { display: none; }
.tab.active { display: block; }
.panel, .result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.small-panel { max-width: 1050px; }
.panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 20px;
}
.panel-header p { margin: 6px 0 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #334155; font-weight: 700; font-size: 13px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border-radius: 12px;
  border: 1px solid #cbd5e1; background: #fff; color: var(--text);
  font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,88,214,.12); }
.checkline { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #334155; }
.checkline input { width: auto; }
.advanced { background: var(--surface-2); border: 1px dashed #cbd5e1; border-radius: 14px; padding: 13px; margin: 8px 0 18px; }
.advanced summary { cursor: pointer; font-weight: 800; color: var(--primary-2); }
.advanced .grid { margin-top: 14px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 13px; padding: 12px 18px;
  font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(15,23,42,.09);
}
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn.secondary { background: #e8eef8; color: #17335f; }
.btn.warn { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.hidden { display: none !important; }
.result h4 { margin: 0 0 12px; font-size: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.kpi { padding: 14px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); }
.kpi small { color: var(--muted); display: block; margin-bottom: 6px; }
.kpi strong { font-size: 18px; }
pre {
  background: #0b1220; color: #dbeafe; padding: 16px;
  border-radius: 14px; overflow: auto; max-height: 430px;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #f8fafc; color: #334155; }
a.download { color: var(--primary); font-weight: 800; text-decoration: none; }
.toast {
  position: fixed; right: 24px; bottom: 24px;
  background: #0f172a; color: #fff; padding: 14px 18px;
  border-radius: 14px; box-shadow: var(--shadow); max-width: 440px;
}
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e8eef8; color: #17335f; font-weight: 800; font-size: 12px; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
@media (max-width: 1100px) {
  .layout { display: block; }
  .sidebar { width: auto; height: auto; position: relative; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { display: block; }
  .hero-actions { justify-content: flex-start; margin-top: 16px; }
  .cols-2, .cols-3, .cols-4, .kpis { grid-template-columns: 1fr; }
}
.note { color: var(--muted); margin: 8px 0 14px; }
.left-actions { justify-content: flex-start; margin-bottom: 12px; }
.btn.mini { padding: 7px 10px; border-radius: 9px; font-size: 12px; box-shadow: none; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.multi-table input, .multi-table select { padding: 8px 9px; border-radius: 9px; min-width: 90px; }
.multi-table th, .multi-table td { padding: 8px 7px; vertical-align: middle; }
.multi-table td:nth-child(1) { width: 36px; font-weight: 800; color: var(--muted); }
.multi-table td:nth-child(11) { width: 90px; }
.inline-summary { display: flex; gap: 18px; justify-content: flex-end; margin-top: 12px; color: #334155; }
.inline-summary strong { color: var(--primary-2); }
.muted-cell { color: var(--muted); text-align: center; padding: 18px !important; }

.field-span-3 { grid-column: 1 / -1; }
.label-title { color: #334155; font-weight: 800; font-size: 13px; margin-bottom: 7px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 10px; }
.origem-box { background: #fff; border: 1px solid #dbe3ef; border-radius: 14px; padding: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.check-grid .checkline { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; }
@media (max-width: 1100px) { .check-grid { grid-template-columns: 1fr; } }

.csv-import-box {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
}
.csv-import-box .hint,
.csv-import-status { grid-column: 1 / -1; }
.csv-import-status { min-height: 22px; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.multi-table input[data-darf-key="identificacaoDarf"] { min-width: 280px; }
.multi-table input[data-darf-key="contribuinteNumero"] { min-width: 140px; }
.multi-table input[data-darf-key="numeroDarf"] { min-width: 70px; }
@media (max-width: 1100px) { .csv-import-box { grid-template-columns: 1fr; } }

.mode-status { margin: 10px 0 14px; }
.mode-status .badge { display: inline-block; }

.csv-dctfweb-box{
  margin-top:18px;
  padding:16px;
  border:1px solid #d9e2f2;
  border-radius:16px;
  background:#f8fbff;
}
.panel-subheader{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:12px;
}
.panel-subheader h4{
  margin:0 0 4px 0;
  font-size:16px;
  color:#0b2e63;
}
.panel-subheader p{
  margin:0;
  color:#475569;
  font-size:13px;
}
.compact-grid{
  margin-top:10px;
}
.compact-origem{
  padding:10px 12px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:#fff;
}
.compact-checks{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
}
.csv-dctfweb-groups input{
  min-width:150px;
}
.csv-dctfweb-groups table th,
.csv-dctfweb-groups table td{
  white-space:nowrap;
}
.field-span-2 { grid-column: span 2; }
.small-top { align-self: end; min-height: 42px; }
@media (max-width: 1100px) { .field-span-2 { grid-column: 1 / -1; } }

/* Aba Impostos */
.impostos-upload { margin-bottom: 18px; }
.impostos-actions-box { margin-top: 16px; padding: 16px; background: #f8fbff; border: 1px solid #dbe3ef; border-radius: 16px; }
.impostos-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.mini-card { background: #fff; border: 1px solid #dbe3ef; border-radius: 16px; padding: 14px; box-shadow: 0 10px 24px rgba(15, 23, 42, .05); }
.mini-card span { display: block; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.mini-card strong { display: block; color: #0f172a; font-size: 16px; line-height: 1.25; }
.mini-card small { display: block; color: #475569; margin-top: 5px; line-height: 1.35; }
.iss-card strong { color: #0369a1; }
.ir-card strong { color: #92400e; }
.inss-card strong { color: #166534; }
.impostos-desc { background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 12px 14px; color: #334155; line-height: 1.45; }
.label-inline-note { align-self: end; color: #475569; font-size: 13px; padding: 10px 0; }
.impostos-btns .mini-modern { box-shadow: 0 10px 24px rgba(30, 64, 175, .20); }
.link-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-link { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 12px; background: #e8f0ff; color: #1746a2; font-weight: 800; text-decoration: none; border: 1px solid #c7d8ff; }
@media (max-width: 1100px) { .impostos-summary-grid { grid-template-columns: 1fr; } }

.compact-header { align-items: center; gap: 16px; }
.impostos-editor-box { margin-top: 16px; padding: 16px; background: #f8fbff; border: 1px solid #dbe3ef; border-radius: 18px; }
.soft-details { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 10px 12px; background: #fff; margin: 12px 0; }
.soft-details summary { cursor: pointer; font-weight: 800; color: #153e75; }
.impostos-edit-grid { margin-top: 12px; }
.impostos-edit-grid input, .impostos-edit-grid textarea { background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; }
.impostos-edit-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.imposto-edit-card { background: #fff; border: 1px solid #dbe3ef; border-radius: 16px; padding: 14px; box-shadow: 0 10px 25px rgba(15, 23, 42, .05); }
.imposto-edit-card h4 { margin: 0 0 8px 0; color: #0f2f66; }
.imposto-edit-card.iss-card { border-left: 4px solid #0f766e; }
.imposto-edit-card.ir-card { border-left: 4px solid #7c3aed; }
.imposto-edit-card.inss-card { border-left: 4px solid #1d4ed8; }
.field-span-4 { grid-column: span 4; }
@media (max-width: 1200px) { .impostos-edit-cards { grid-template-columns: 1fr; } .field-span-4 { grid-column: span 1; } }

/* v1.1.0 - Acesso institucional e identidade visual violeta/ciano */
:root {
  --bg: #f2f1f8;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --text: #17152c;
  --muted: #6d6880;
  --primary: #6d3fd6;
  --primary-2: #3f247f;
  --accent: #16a6a1;
  --line: #e4e0ee;
  --ok: #118a65;
  --warn: #c77a12;
  --danger: #c73d55;
  --shadow: 0 20px 52px rgba(39, 25, 76, .11);
}
body { background: linear-gradient(135deg, #efedf7 0%, #fbfbfd 48%, #e9f7f5 100%); }
.sidebar { background: linear-gradient(180deg, #251747 0%, #17112e 100%); }
.brand-icon { background: linear-gradient(135deg, #37d2c4, #7c4be3); }
.nav-btn.active, .nav-btn:hover { color: #34205d; }
.hero { background: linear-gradient(135deg, #ffffff 0%, #f5f2fd 68%, #edfbf8 100%); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(109,63,214,.13); }
.current-context {
  margin: -10px 0 20px;
  padding: 13px 14px;
  border-radius: 15px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.09);
  display: grid;
  gap: 4px;
}
.current-context small { color: #bdb4d8; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; }
.current-context strong { color: #fff; line-height: 1.25; }
.current-context span { color: #6ee7da; font-size: 12px; }
.logout-btn {
  width: 100%; margin-top: 18px; padding: 11px 13px; border-radius: 13px;
  border: 1px solid rgba(255,255,255,.14); color: #ede9fe; background: rgba(255,255,255,.07);
  font-weight: 800; cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,.14); }

/* Tela inicial */
.login-screen {
  position: fixed; inset: 0; z-index: 1000; padding: 20px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 10% 10%, rgba(22,166,161,.16), transparent 32%),
              radial-gradient(circle at 90% 90%, rgba(109,63,214,.18), transparent 34%),
              #eeedf4;
  overflow: auto;
}
.login-shell {
  width: min(1320px, 100%); min-height: 700px;
  display: grid; grid-template-columns: 1.55fr .95fr;
  border-radius: 30px; overflow: hidden; background: #fff;
  border: 1px solid rgba(55,42,91,.12); box-shadow: 0 35px 90px rgba(34,22,65,.22);
}
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 54px 50px 36px;
  background:
    radial-gradient(circle at 74% 36%, rgba(124,75,227,.26), transparent 34%),
    radial-gradient(circle at 30% 90%, rgba(22,166,161,.22), transparent 34%),
    linear-gradient(145deg, #18102f 0%, #27174c 52%, #122d45 100%);
}
.login-visual::before {
  content: ''; position: absolute; inset: 0; opacity: .18;
  background-image: radial-gradient(circle, #71ddd1 1.2px, transparent 1.2px);
  background-size: 26px 26px;
}
.login-visual::after { content: ''; position: absolute; width: 440px; height: 440px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -160px; top: -180px; }
.login-brandline, .login-copy, .login-illustration, .login-version { position: relative; z-index: 1; }
.login-brandline { display: flex; align-items: center; gap: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 900; }
.login-brandline span { color: #42d6c9; font-size: 28px; }
.login-brandline i { width: 6px; height: 6px; border-radius: 50%; background: #f3b55b; }
.login-brandline strong { font-size: 17px; }
.login-copy { margin-top: 126px; max-width: 660px; }
.login-kicker { color: #90eee5; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 900; }
.login-copy h1 { font-size: clamp(42px, 5vw, 68px); line-height: 1.03; margin: 17px 0 22px; letter-spacing: -.04em; }
.login-copy h1 em { display: block; font-style: normal; color: #42d6c9; }
.login-copy p { color: #ded8ee; font-size: 18px; line-height: 1.55; max-width: 590px; }
.login-safe-badge { display: inline-flex; margin-top: 26px; padding: 10px 16px; border: 1px solid rgba(66,214,201,.34); border-radius: 999px; color: #a6fff6; background: rgba(22,166,161,.12); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 900; }
.login-illustration { position: absolute; right: 50px; bottom: 90px; width: 390px; height: 310px; opacity: .95; }
.chart-card { position: absolute; border: 1px solid rgba(255,255,255,.18); background: rgba(21,17,48,.70); box-shadow: 0 25px 50px rgba(0,0,0,.24); backdrop-filter: blur(12px); }
.chart-main { right: 0; top: 0; width: 300px; height: 208px; border-radius: 26px; padding: 22px; }
.chart-head { display: flex; gap: 7px; padding-bottom: 17px; border-bottom: 1px solid rgba(255,255,255,.12); }
.chart-head span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); }
.bars { height: 100px; display: flex; align-items: end; gap: 12px; padding: 18px 20px 0; }
.bars i { width: 23px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg,#64e8dd,#16a6a1); }
.bars i:nth-child(1){height:38%}.bars i:nth-child(2){height:63%}.bars i:nth-child(3){height:48%}.bars i:nth-child(4){height:86%}.bars i:nth-child(5){height:70%}
.chart-line { margin: 10px 18px; height: 7px; border-radius: 99px; background: linear-gradient(90deg,#7c4be3 62%,rgba(255,255,255,.12) 62%); }
.mini-doc { position: absolute; bottom: 0; width: 160px; height: 112px; border-radius: 18px; background: #f8f7fd; padding: 17px; box-shadow: 0 20px 35px rgba(0,0,0,.22); transform: rotate(-6deg); }
.mini-doc b { color: #16a6a1; font-size: 22px; }.mini-doc i { display: block; height: 8px; border-radius: 99px; background: #ddd8eb; margin-top: 9px; }.mini-doc i:last-child{width:70%;background:#92e9e1}
.doc-one { left: 20px; }.doc-two { right: 0; transform: rotate(7deg); }.doc-two b { color:#7c4be3; }
.shield-lock { position: absolute; left: 166px; bottom: 64px; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 19px; background: linear-gradient(135deg,#7c4be3,#16a6a1); border: 5px solid #20133f; font-size: 26px; box-shadow: 0 17px 32px rgba(0,0,0,.26); }
.login-version { position: absolute; left: 50px; right: 50px; bottom: 35px; display: flex; justify-content: space-between; color: #bdb4d8; font-size: 12px; }.login-version span:first-child { color: #72e7dc; }
.login-panel { padding: 62px 48px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg,#fff 45%,#f2fbfa 100%); }
.login-icon { width: 68px; height: 68px; border-radius: 21px; display: grid; place-items: center; color: #fff; font-size: 27px; background: linear-gradient(135deg,#7c4be3,#16a6a1); box-shadow: 0 15px 34px rgba(109,63,214,.25); }
.login-panel h2 { font-size: 38px; margin: 25px 0 7px; color: #1d1537; letter-spacing: -.03em; }
.login-panel > p { margin: 0 0 28px; }
.login-form { display: grid; gap: 18px; }
.login-form > label { text-transform: uppercase; letter-spacing: .10em; font-size: 11px; color: #33234f; }
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap > span { position: absolute; left: 17px; z-index: 1; color: #8b82a2; font-size: 19px; }
.login-input-wrap input, .login-input-wrap select { height: 60px; padding-left: 50px; border-radius: 17px; border-color: #d9d4e7; background: rgba(255,255,255,.92); font-size: 15px; }
.login-input-wrap select { appearance: auto; }
.password-eye { position: absolute; right: 12px; border: 0; background: transparent; color: #8b82a2; font-size: 17px; cursor: pointer; }
.login-submit { height: 60px; border: 0; border-radius: 17px; margin-top: 5px; color: #fff; font-weight: 900; font-size: 15px; cursor: pointer; background: linear-gradient(135deg,#6d3fd6,#16a6a1); box-shadow: 0 17px 35px rgba(83,55,167,.25); }
.login-submit:hover { transform: translateY(-1px); filter: brightness(1.02); }
.login-message { min-height: 21px; color: #b52e48; font-size: 13px; font-weight: 700; line-height: 1.4; }
.login-register-row { margin-top: 21px; padding-top: 18px; border-top: 1px solid #e7e3ef; display: flex; justify-content: space-between; gap: 14px; align-items: center; color: #777086; font-size: 13px; }
.link-button { border: 0; background: transparent; color: #5f35c1; font-weight: 900; cursor: pointer; padding: 6px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: rgba(20,13,38,.70); backdrop-filter: blur(8px); }
.modal-card { width: min(820px,100%); max-height: 94vh; overflow: auto; background: #fff; border-radius: 24px; padding: 25px; box-shadow: 0 32px 80px rgba(0,0,0,.32); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }.modal-header h3 { margin-top: 4px; }.modal-kicker { color:#6d3fd6;font-size:11px;text-transform:uppercase;letter-spacing:.13em;font-weight:900}.modal-close { width:40px;height:40px;border:0;border-radius:12px;background:#f0edf7;color:#4b376f;font-size:25px;cursor:pointer; }
body.login-active { overflow: hidden; }
body.login-active .layout { visibility: hidden; }

.inline-actions { justify-content: flex-end; }
.impostos-saved-box { margin-top: 18px; }
.table-actions { display: flex; gap: 7px; white-space: nowrap; }
.institution-users-list { margin-top: 20px; }

@media (max-width: 1050px) {
  .login-shell { grid-template-columns: 1fr; max-width: 700px; }
  .login-visual { min-height: 470px; padding: 36px; }
  .login-copy { margin-top: 70px; }
  .login-copy h1 { font-size: 45px; }
  .login-illustration { opacity: .48; right: 20px; bottom: 55px; transform: scale(.8); transform-origin: right bottom; }
  .login-panel { padding: 42px 34px; }
  .login-version { left:36px;right:36px; }
}
@media (max-width: 620px) {
  .login-screen { padding: 0; }
  .login-shell { min-height: 100vh; border-radius: 0; }
  .login-visual { min-height: 350px; padding: 28px 24px; }
  .login-copy { margin-top: 52px; }.login-copy h1{font-size:38px}.login-copy p{font-size:15px}
  .login-illustration { display:none; }.login-version{left:24px;right:24px;bottom:20px}
  .login-panel { padding: 34px 24px; }.login-panel h2{font-size:31px}
  .login-register-row { align-items:flex-start; flex-direction:column; }
}


/* Base visual da tela inicial compacta em azul-marinho e ciano */
:root {
  --login-navy-950: #001827;
  --login-navy-900: #00263f;
  --login-navy-800: #003d61;
  --login-cyan: #19d5cf;
  --login-cyan-2: #04b9b4;
  --login-gold: #e7b25b;
  --login-panel-text: #08253b;
}

body {
  background: linear-gradient(135deg, #e8eef2 0%, #f7fafb 52%, #e8f3f3 100%);
}

.login-screen {
  padding: 14px;
  background:
    radial-gradient(circle at 8% 8%, rgba(24, 182, 190, .10), transparent 30%),
    radial-gradient(circle at 92% 92%, rgba(0, 61, 97, .10), transparent 32%),
    linear-gradient(135deg, #e7edf1 0%, #f8fafb 48%, #e8f1f2 100%);
}

.login-shell {
  width: min(1160px, calc(100vw - 32px));
  min-height: 610px;
  max-height: calc(100vh - 28px);
  grid-template-columns: 1.48fr .92fr;
  border-radius: 24px;
  border: 1px solid rgba(0, 44, 70, .11);
  box-shadow: 0 26px 70px rgba(0, 30, 52, .18);
}

.login-visual {
  padding: 40px 42px 28px;
  background:
    radial-gradient(circle at 78% 34%, rgba(18, 126, 151, .18), transparent 34%),
    radial-gradient(circle at 28% 92%, rgba(25, 213, 207, .12), transparent 34%),
    linear-gradient(145deg, var(--login-navy-950) 0%, var(--login-navy-900) 55%, #00314d 100%);
}

.login-visual::before {
  opacity: .13;
  background-image: radial-gradient(circle, #1cc8c4 1.05px, transparent 1.05px);
  background-size: 24px 24px;
}

.login-visual::after {
  width: 390px;
  height: 390px;
  right: -140px;
  top: -165px;
  border-color: rgba(25, 213, 207, .12);
}

.login-brandline { gap: 10px; }
.login-brandline span { color: var(--login-cyan); font-size: 25px; }
.login-brandline i { width: 5px; height: 5px; background: var(--login-gold); }
.login-brandline strong { font-size: 15px; color: #fff; letter-spacing: .045em; }

.login-copy {
  margin-top: 92px;
  max-width: 570px;
}

.login-kicker {
  color: var(--login-cyan);
  letter-spacing: .15em;
  font-size: 10px;
}

.login-copy h1 {
  font-size: clamp(39px, 4.25vw, 58px);
  line-height: 1.02;
  margin: 14px 0 18px;
  color: #fff;
}

.login-copy h1 em { color: var(--login-cyan); }
.login-copy p {
  color: #cedce5;
  font-size: 15px;
  line-height: 1.55;
  max-width: 520px;
}

.login-safe-badge {
  margin-top: 20px;
  padding: 8px 14px;
  border-color: rgba(25, 213, 207, .28);
  color: #74f2ec;
  background: rgba(0, 100, 117, .18);
  font-size: 10px;
}

.login-illustration {
  right: 42px;
  bottom: 66px;
  width: 334px;
  height: 260px;
}

.chart-card {
  background: rgba(0, 31, 51, .72);
  border-color: rgba(42, 213, 209, .19);
  box-shadow: 0 18px 44px rgba(0, 12, 24, .26);
}

.chart-main {
  width: 260px;
  height: 174px;
  border-radius: 22px;
  padding: 18px;
}

.chart-head { padding-bottom: 13px; }
.bars { height: 82px; gap: 10px; padding: 14px 16px 0; }
.bars i { width: 20px; background: linear-gradient(180deg, #48eee6, #09aaa7); }
.chart-line { margin: 7px 14px; height: 6px; background: linear-gradient(90deg, #18d5cf 62%, rgba(255,255,255,.11) 62%); }

.mini-doc {
  background: #f8fbfc;
  border-color: rgba(0, 39, 65, .12);
  box-shadow: 0 18px 35px rgba(0, 20, 36, .22);
}
.mini-doc b { color: var(--login-cyan-2); }
.mini-doc i { background: #dce6eb; }
.mini-doc i:last-child { background: linear-gradient(90deg, var(--login-cyan) 65%, #dce6eb 65%); }
.shield-lock { background: linear-gradient(145deg, #006994, #10c8c2); box-shadow: 0 12px 30px rgba(0, 76, 102, .35); }

.login-version {
  left: 42px;
  right: 42px;
  bottom: 25px;
  color: #8eaab8;
  font-size: 11px;
}
.login-version span:first-child { color: var(--login-cyan); }

.login-panel {
  padding: 42px 42px;
  background: linear-gradient(160deg, #ffffff 48%, #f3fbfa 100%);
}

.login-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #035d8a, #08bcb6);
  box-shadow: 0 13px 30px rgba(0, 87, 122, .22);
}
.login-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

.login-panel h2 {
  font-size: 34px;
  margin: 20px 0 5px;
  color: var(--login-panel-text);
}
.login-panel > p { margin: 0 0 22px; color: #728392; font-size: 14px; }
.login-form { gap: 14px; }
.login-form > label { color: #0a4968; font-size: 10px; letter-spacing: .11em; }
.login-input-wrap > span { left: 16px; color: #8aa0b0; font-size: 18px; }
.login-input-wrap input,
.login-input-wrap select {
  height: 52px;
  padding-left: 46px;
  border-radius: 14px;
  border-color: #d5e0e7;
  color: #17394f;
  background: rgba(255,255,255,.96);
  font-size: 14px;
}
.login-input-wrap input:focus,
.login-input-wrap select:focus {
  border-color: #19b9b5;
  box-shadow: 0 0 0 3px rgba(25, 185, 181, .12);
}
.password-eye { color: #678295; }
.login-submit {
  height: 52px;
  border-radius: 14px;
  margin-top: 3px;
  background: linear-gradient(120deg, #005c8b 0%, #0089a0 52%, #08b9ad 100%);
  box-shadow: 0 14px 30px rgba(0, 93, 127, .22);
}
.login-register-row {
  margin-top: 15px;
  padding-top: 14px;
  border-top-color: #e3eaee;
  color: #728392;
  font-size: 12px;
}
.link-button { color: #006b8f; }

@media (max-width: 1180px) {
  .login-shell { width: min(1040px, calc(100vw - 24px)); min-height: 590px; }
  .login-visual { padding: 34px 34px 26px; }
  .login-copy { margin-top: 76px; }
  .login-illustration { right: 26px; transform: scale(.90); transform-origin: right bottom; }
  .login-panel { padding: 36px 34px; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; max-width: 680px; max-height: none; min-height: auto; }
  .login-visual { min-height: 360px; padding: 30px; }
  .login-copy { margin-top: 46px; max-width: 520px; }
  .login-copy h1 { font-size: 39px; }
  .login-copy p { font-size: 14px; }
  .login-illustration { opacity: .38; right: 10px; bottom: 36px; transform: scale(.70); }
  .login-version { left: 30px; right: 30px; }
  .login-panel { padding: 32px 30px; }
}

@media (max-height: 700px) and (min-width: 901px) {
  .login-shell { min-height: 560px; }
  .login-copy { margin-top: 64px; }
  .login-copy h1 { font-size: 45px; }
  .login-copy p { font-size: 14px; }
  .login-illustration { transform: scale(.82); transform-origin: right bottom; bottom: 48px; }
  .login-panel { padding-top: 30px; padding-bottom: 30px; }
}

/* v1.1.2 - Padronização visual completa baseada na tela inicial */
:root {
  --bg: #edf4f6;
  --surface: #ffffff;
  --surface-2: #f5fafb;
  --surface-3: #eaf4f5;
  --text: #08253b;
  --muted: #607887;
  --primary: #006b8f;
  --primary-2: #003d61;
  --primary-3: #00263f;
  --accent: #19d5cf;
  --accent-2: #04b9b4;
  --line: #d5e2e8;
  --line-strong: #bfd2db;
  --ok: #0b927b;
  --warn: #b97a16;
  --danger: #bb3a45;
  --shadow: 0 12px 34px rgba(0, 38, 63, .08);
  --shadow-soft: 0 6px 18px rgba(0, 38, 63, .055);
  --radius-panel: 16px;
  --radius-field: 10px;
  --radius-button: 10px;
}

body {
  background:
    radial-gradient(circle at 7% 4%, rgba(25, 213, 207, .07), transparent 26%),
    linear-gradient(135deg, #eaf1f4 0%, #f8fbfc 48%, #edf6f5 100%);
  color: var(--text);
}

/* Menu lateral */
.sidebar {
  width: 286px;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 82% 10%, rgba(25, 213, 207, .10), transparent 28%),
    linear-gradient(180deg, var(--login-navy-950) 0%, var(--login-navy-900) 56%, #002238 100%);
  border-right: 1px solid rgba(25, 213, 207, .16);
  box-shadow: 9px 0 28px rgba(0, 25, 42, .08);
}

.brand {
  gap: 12px;
  margin-bottom: 20px;
  padding: 3px 4px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(145deg, #035d8a, var(--accent-2));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(0, 13, 25, .25);
}
.brand h1 { font-size: 23px; color: #fff; }
.brand p { color: #9eb8c6; }

.current-context {
  margin: 0 0 16px;
  padding: 12px 13px;
  border: 1px solid rgba(25, 213, 207, .16);
  border-radius: 12px;
  background: rgba(0, 75, 98, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.current-context small { color: #8fb5c3; }
.current-context strong { color: #fff; }
.current-context span { color: #64e7df; }

nav { gap: 7px; }
.nav-btn {
  position: relative;
  min-height: 43px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #c9dce4;
  background: rgba(255,255,255,.045);
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.nav-btn:hover {
  color: #fff;
  background: rgba(25, 213, 207, .10);
  border-color: rgba(25, 213, 207, .24);
  transform: translateX(2px);
}
.nav-btn.active {
  color: #06283b;
  background: linear-gradient(90deg, #eafffd 0%, #f7ffff 100%);
  border-color: rgba(25, 213, 207, .52);
  box-shadow: 0 7px 20px rgba(0, 16, 29, .18);
}
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-2);
}

.logout-btn {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #cce0e8;
  background: rgba(255,255,255,.045);
}
.logout-btn:hover {
  color: #fff;
  border-color: rgba(25,213,207,.30);
  background: rgba(25,213,207,.10);
}
.status-card {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.status-card small { color: #8fa9b7; }

/* Conteúdo, abas e painéis */
.content {
  padding: 24px;
  max-width: 1560px;
}
.hero {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    radial-gradient(circle at 92% 12%, rgba(25,213,207,.10), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f2f9fa 100%);
  box-shadow: var(--shadow-soft);
}
.eyebrow { color: var(--primary); }
h2, h3, h4 { color: var(--text); }

.panel,
.result {
  padding: 21px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.panel-header {
  margin-bottom: 17px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e4edf1;
}
.panel-header h3 { color: var(--primary-3); }
.panel-header p { color: var(--muted); }

/* Campos */
label,
.label-title { color: #173f54; }
input,
select,
textarea {
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(0,38,63,.025);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover,
select:hover,
textarea:hover { border-color: #9ebbc8; }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(4,185,180,.11);
}
input:disabled,
select:disabled,
textarea:disabled {
  color: #8aa0ab;
  background: #f1f5f6;
  border-color: #dbe5e9;
}

/* Botões */
.btn {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  box-shadow: 0 5px 14px rgba(0,38,63,.08);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease, border-color .14s ease;
}
.btn.primary {
  color: #fff;
  border-color: #007d91;
  background: linear-gradient(120deg, #005c8b 0%, #00849b 52%, #08b9ad 100%);
  box-shadow: 0 8px 20px rgba(0, 99, 126, .18);
}
.btn.secondary {
  color: #0a4968;
  border-color: #cbdce3;
  background: linear-gradient(180deg, #f7fbfc 0%, #eaf3f5 100%);
  box-shadow: none;
}
.btn.secondary:hover { border-color: #9fc3ce; background: #f5ffff; }
.btn.warn {
  color: #fff;
  border-color: #a86b11;
  background: linear-gradient(135deg, #ca8a24, #a9680d);
}
.btn.danger {
  color: #a72835;
  border-color: #edc6ca;
  background: #fff4f5;
}
.btn.mini {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
}
.btn:hover {
  filter: brightness(1.015);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,38,63,.11);
}
.btn:active { transform: translateY(0); }

/* Caixas auxiliares e cards */
.advanced,
.csv-import-box,
.csv-dctfweb-box,
.impostos-actions-box,
.origem-box,
.compact-origem {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.advanced { border-style: solid; }
.advanced summary { color: var(--primary-2); }
.panel-subheader h4 { color: var(--primary-2); }
.check-grid .checkline,
.compact-checks .checkline {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.check-grid .checkline:hover,
.compact-checks .checkline:hover { border-color: #9fc8ce; background: #f8ffff; }

.kpi,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  box-shadow: 0 4px 13px rgba(0,38,63,.04);
}
.kpi strong,
.mini-card strong { color: var(--primary-3); }
.iss-card strong { color: #006d8b; }
.ir-card strong { color: #0b7180; }
.inss-card strong { color: #0b927b; }

/* Tabelas */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
table { background: #fff; }
th,
td { border-bottom: 1px solid #e3ecef; }
th {
  color: #164158;
  background: #edf6f7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .025em;
}
tbody tr:hover td { background: #f8fcfc; }
tbody tr:last-child td { border-bottom: 0; }
a.download { color: var(--primary); }

/* Badges, avisos e resultados */
.badge {
  border: 1px solid #c8dce3;
  background: #edf5f7;
  color: #17516b;
}
.badge.ok { border-color: #b8e0d6; background: #eaf8f4; color: #08725f; }
.badge.warn { border-color: #ead9b6; background: #fff9eb; color: #8a5b0e; }
.badge.danger { border-color: #ecc4c8; background: #fff2f3; color: #a42d39; }
pre {
  border: 1px solid #173b51;
  border-radius: 11px;
  background: #031c2d;
  color: #d8f5f2;
}
.toast {
  border: 1px solid rgba(25,213,207,.25);
  border-radius: 11px;
  background: #00263f;
}

/* Modais */
.modal-backdrop { background: rgba(0, 24, 39, .72); }
.modal-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 72px rgba(0,24,39,.28);
}
.modal-kicker { color: var(--primary); }
.modal-close {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #164158;
  background: #eef5f7;
}
.modal-close:hover { border-color: #a9c8d2; background: #e5f2f3; }

/* Formulários e listas específicas */
.impostos-upload,
.impostos-saved-box,
.institution-users-list { border-color: var(--line); }
.inline-summary { color: #36596a; }
.inline-summary strong { color: var(--primary); }
.mode-status .badge { box-shadow: none; }

/* Barra de rolagem discreta */
* { scrollbar-color: #9fc7ce #edf4f6; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #edf4f6; }
*::-webkit-scrollbar-thumb { background: #9fc7ce; border: 2px solid #edf4f6; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #72aeb9; }

@media (max-width: 1100px) {
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(25,213,207,.16); box-shadow: none; }
  .content { padding: 18px; }
  .panel, .result, .hero { border-radius: 14px; }
}


/* Certificado A1 - origem explícita */
.cert-source-box {
  margin: -2px 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbfc;
}
.cert-source-box .hint { margin: 7px 0 0; }
.cert-copy-option { color: #0b3450; }
.cert-copy-option input { accent-color: var(--primary); }
.local-direct-box {
  border-color: #9edfd9;
  background: #effcf9;
}
.local-direct-box > strong {
  display: block;
  color: #064f5d;
  font-size: 13px;
}
.local-direct-box > p {
  margin: 6px 0 0;
}
.local-core-online { color: #087a5f !important; font-weight: 700; }
.local-core-offline { color: #9a5d0c !important; font-weight: 700; }

.certificate-auth-card {
  width: min(720px, 100%);
}
.certificate-auth-intro {
  margin: -4px 0 16px;
  color: #496776;
  line-height: 1.55;
}
.certificate-auth-steps {
  display: grid;
  gap: 12px;
}
.certificate-auth-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid #c9dde3;
  border-radius: 10px;
  background: #f7fbfc;
}
.certificate-auth-step .step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #087f8c;
  color: #fff;
  font-weight: 800;
}
.certificate-auth-step .step-content {
  display: grid;
  gap: 7px;
}
.certificate-auth-step .step-content > strong {
  color: #0a344b;
}
.certificate-auth-step input {
  width: 100%;
}
.certificate-auth-step small {
  color: #607987;
}
.certificate-security-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #08a38f;
  border-radius: 7px;
  background: #edfbf7;
  color: #315f60;
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .certificate-auth-card .actions {
    display: grid;
  }
  .certificate-auth-card .actions .btn {
    width: 100%;
  }
}

/* =====================================================================
   v1.2.4 — interface compacta, nítida e padronizada
   ===================================================================== */
:root {
  --app-navy-950: #031b2c;
  --app-navy-900: #062b43;
  --app-navy-800: #084a68;
  --app-teal-600: #069c9a;
  --app-teal-500: #11b9b3;
  --app-teal-100: #ddf7f4;
  --app-canvas: #eef4f6;
  --app-surface: #ffffff;
  --app-surface-soft: #f7fafb;
  --app-border: #d6e2e7;
  --app-border-strong: #bdcfd7;
  --app-text: #09263a;
  --app-muted: #607683;
  --app-shadow: 0 6px 20px rgba(3, 27, 44, .055);
  --app-shadow-hover: 0 10px 26px rgba(3, 27, 44, .09);
  --app-radius: 11px;
  --app-radius-sm: 8px;
}

html { background: var(--app-canvas); }
body {
  min-width: 320px;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 92% 2%, rgba(17, 185, 179, .055), transparent 24%),
    linear-gradient(145deg, #edf3f5 0%, #f7fafb 52%, #edf6f5 100%);
  color: var(--app-text);
  font-size: 13px;
  letter-spacing: .002em;
}

.layout { min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  padding: 17px 13px 14px;
  background:
    radial-gradient(circle at 88% 3%, rgba(17, 185, 179, .13), transparent 25%),
    linear-gradient(180deg, var(--app-navy-950) 0%, #05253b 54%, #041e31 100%);
  border-right: 1px solid rgba(96, 225, 217, .16);
  box-shadow: 5px 0 22px rgba(2, 22, 36, .07);
  overflow-y: auto;
}
.brand {
  gap: 10px;
  margin: 0 2px 14px;
  padding: 2px 2px 13px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 14px;
  letter-spacing: .04em;
  background: linear-gradient(145deg, #075d81 0%, #0aa39f 100%);
  border: 1px solid rgba(255,255,255,.17);
  box-shadow: 0 7px 18px rgba(0, 11, 20, .23);
}
.brand h1 { font-size: 18px; line-height: 1.05; letter-spacing: .04em; }
.brand p { margin-top: 3px; font-size: 11.5px; }

.current-context {
  margin: 0 1px 13px;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid rgba(61, 210, 201, .16);
  background: rgba(2, 77, 99, .23);
  box-shadow: none;
}
.current-context small {
  display: block;
  margin-bottom: 4px;
  color: #8daab8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.current-context strong {
  display: block;
  color: #f6ffff;
  font-size: 12.5px;
  line-height: 1.35;
}
.current-context span {
  display: block;
  margin-top: 3px;
  color: #73ded8;
  font-size: 11px;
}

.sidebar nav { gap: 5px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 5px 9px 5px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.065);
  background: rgba(255,255,255,.032);
  color: #c8d8df;
  font-size: 12.7px;
  line-height: 1.2;
  font-weight: 650;
  box-shadow: none;
}
.nav-btn::before { display: none !important; }
.nav-btn .nav-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.045);
  color: #76d8d3;
  font-size: 15px;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-weight: 500;
}
.nav-btn:hover {
  transform: none;
  background: rgba(17, 185, 179, .085);
  border-color: rgba(81, 218, 210, .22);
  color: #ffffff;
}
.nav-btn.active {
  color: #083149;
  background: #f6ffff;
  border-color: rgba(70, 210, 202, .55);
  box-shadow: 0 5px 14px rgba(0, 12, 22, .16);
}
.nav-btn.active .nav-icon {
  color: #006b78;
  background: var(--app-teal-100);
  border-color: #b7e5e1;
}
.logout-btn {
  width: calc(100% - 2px);
  min-height: 36px;
  margin: 13px 1px 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  color: #c6d7df;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.logout-btn:hover {
  background: rgba(17, 185, 179, .08);
  border-color: rgba(81, 218, 210, .22);
}
.status-card {
  margin: 12px 1px 0;
  padding: 9px 10px;
  gap: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.028);
  box-shadow: none;
}
.status-card strong { font-size: 11.5px; font-weight: 650; }
.status-card small { color: #8da7b4; font-size: 10px; }
.status-card .runtime-note { color: #63cbc5; }
.dot { width: 7px; height: 7px; }

.content {
  width: calc(100% - 252px);
  max-width: none;
  padding: 17px 19px 22px;
  margin: 0;
}
.hero {
  min-height: 94px;
  margin-bottom: 14px;
  padding: 14px 16px;
  gap: 16px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background:
    radial-gradient(circle at 92% 7%, rgba(17, 185, 179, .095), transparent 25%),
    linear-gradient(135deg, #ffffff 0%, #f5fafb 100%);
  box-shadow: var(--app-shadow);
}
.hero-copy { min-width: 0; }
.hero-title-row { display: flex; align-items: center; gap: 11px; }
.hero-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-radius: 9px;
  border: 1px solid #b8dadd;
  background: linear-gradient(145deg, #075d81, #0aa39f);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  box-shadow: 0 5px 14px rgba(4, 76, 100, .15);
}
.hero .eyebrow {
  margin: 0 0 2px;
  color: #087e86;
  font-size: 9.5px;
  letter-spacing: .1em;
}
.hero h2 {
  margin: 0;
  color: #08283b;
  font-size: 20px;
  line-height: 1.17;
  font-weight: 750;
  letter-spacing: -.015em;
}
.hero-description {
  margin: 7px 0 0 50px !important;
  max-width: 780px;
  color: #5c7180;
  font-size: 12px;
  line-height: 1.4;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 7px 0 0 50px;
  color: #537582;
  font-size: 9.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.hero-meta span::first-letter { color: #0aa39f; }
.hero-actions { flex: 0 0 auto; gap: 7px; }

.tab { animation: tabFade .12s ease-out; }
@keyframes tabFade { from { opacity: .72; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.panel,
.result {
  margin-bottom: 14px;
  padding: 15px 16px;
  border-radius: 11px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}
.panel:hover { border-color: #ccdde3; }
.panel-header {
  gap: 13px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5edef;
}
.panel-header h3 { font-size: 17px; line-height: 1.25; letter-spacing: -.008em; }
.panel-header h4,
.panel-subheader h4 { font-size: 14px; }
.panel-header p,
.panel-subheader p { margin-top: 4px; font-size: 11.5px; line-height: 1.45; }
.compact-header { margin-bottom: 10px; padding-bottom: 8px; }

.grid { gap: 10px 12px; margin-bottom: 11px; }
label,
.label-title {
  gap: 5px;
  color: #173c50;
  font-size: 11.5px;
  font-weight: 650;
}
input,
select,
textarea {
  min-height: 37px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--app-border-strong);
  background: #fff;
  color: #0c2a3c;
  font-size: 12.5px;
  box-shadow: inset 0 1px 1px rgba(3, 27, 44, .015);
}
textarea { min-height: 68px; resize: vertical; }
input:hover,
select:hover,
textarea:hover { border-color: #9eb9c3; }
input:focus,
select:focus,
textarea:focus {
  border-color: #0ba29f;
  box-shadow: 0 0 0 2px rgba(11, 162, 159, .105);
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: #078e8c; }
input[type="file"] { padding: 6px 8px; }
input::file-selector-button {
  margin-right: 8px;
  padding: 5px 9px;
  border: 1px solid #c5d8df;
  border-radius: 6px;
  background: #edf5f6;
  color: #154c62;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.actions { gap: 7px; }
.btn {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 8px;
  border-width: 1px;
  font-size: 11.8px;
  font-weight: 700;
  letter-spacing: .005em;
  box-shadow: none;
}
.btn.primary {
  border-color: #057884;
  background: linear-gradient(120deg, #075d82 0%, #07828e 54%, #0aa39f 100%);
  box-shadow: 0 5px 14px rgba(4, 105, 123, .14);
}
.btn.secondary {
  border-color: #cbdce2;
  background: #f7fafb;
  color: #164a61;
}
.btn.warn {
  border-color: #a96f19;
  background: linear-gradient(135deg, #c78a2a, #a86b13);
}
.btn.danger { border-color: #e7c4c8; background: #fff7f7; }
.btn:hover { transform: none; box-shadow: 0 5px 14px rgba(3, 27, 44, .085); }
.btn:active { transform: translateY(1px); }
.btn.mini { min-height: 28px; padding: 5px 8px; border-radius: 6px; font-size: 10.5px; }

.advanced,
.csv-import-box,
.csv-dctfweb-box,
.impostos-actions-box,
.origem-box,
.compact-origem,
.cert-source-box {
  border-radius: 9px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-soft);
  box-shadow: none;
}
.advanced { margin: 6px 0 12px; padding: 10px 11px; }
.advanced summary { font-size: 12px; }
.advanced .grid { margin-top: 10px; }
.note,
.hint { color: var(--app-muted); font-size: 10.8px; line-height: 1.45; }
.csv-import-box { margin: 9px 0; padding: 10px; gap: 9px; }
.csv-dctfweb-box { margin-top: 12px; padding: 12px; }
.panel-subheader { margin-bottom: 9px; }
.impostos-actions-box { margin-top: 12px; padding: 12px; }
.cert-source-box { margin-bottom: 11px; padding: 9px 10px; }
.checkline { gap: 7px; font-size: 11.5px; }
.check-grid { gap: 7px; }
.check-grid .checkline,
.compact-checks .checkline { padding: 7px 8px; border-radius: 7px; }

.kpis,
.impostos-summary-grid { gap: 9px; margin: 10px 0; }
.kpi,
.mini-card,
.imposto-edit-card {
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid var(--app-border);
  box-shadow: none;
}
.kpi small,
.mini-card span { font-size: 9.5px; }
.kpi strong,
.mini-card strong { font-size: 14px; }
.imposto-edit-card h4 { margin: 0 0 9px; font-size: 13px; }

.table-wrap {
  border-radius: 8px;
  border: 1px solid var(--app-border);
  box-shadow: none;
}
table { font-size: 11.8px; }
th,
td { padding: 8px 8px; border-bottom: 1px solid #e5edef; }
th {
  background: #eef6f7;
  color: #19475a;
  font-size: 9.8px;
  letter-spacing: .025em;
  font-weight: 750;
}
tbody tr:hover td { background: #f8fcfc; }
.multi-table input,
.multi-table select { min-height: 32px; padding: 6px 7px; border-radius: 6px; font-size: 11.3px; }
.multi-table th,
.multi-table td { padding: 6px 6px; }
.inline-summary { margin-top: 8px; gap: 13px; font-size: 11px; }
a.download {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid #c8dde2;
  border-radius: 6px;
  background: #f4fafb;
  color: #086b7b;
  font-size: 10.8px;
  font-weight: 700;
  text-decoration: none;
}
a.download:hover { border-color: #8fc4c9; background: #effdfb; }

.badge { padding: 3px 7px; border-radius: 999px; font-size: 9.8px; }
pre { padding: 11px; border-radius: 8px; font-size: 11px; max-height: 360px; }
.toast {
  right: 17px;
  bottom: 17px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 11.5px;
  box-shadow: 0 10px 28px rgba(2, 23, 37, .2);
}
.modal-card { border-radius: 12px; }
.modal-close { border-radius: 7px; }

/* Login preserva a mesma identidade, porém com acabamento mais nítido */
.login-shell { border: 1px solid rgba(6, 58, 78, .12); box-shadow: 0 20px 60px rgba(3, 27, 44, .15); }
.login-panel input,
.login-panel select { min-height: 43px; border-radius: 9px; }
.login-submit { border-radius: 9px; }

@media (min-width: 901px) and (max-width: 1180px) {
  .sidebar { width: 226px; flex-basis: 226px; }
  .content { width: calc(100% - 226px); padding: 14px; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-description, .hero-meta { margin-left: 0 !important; }
}

@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(81, 218, 210, .18);
  }
  .brand { margin-bottom: 9px; padding-bottom: 9px; }
  .current-context { margin-bottom: 9px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logout-btn, .status-card { margin-top: 9px; }
  .content { width: 100%; padding: 12px; }
  .hero { display: block; }
  .hero-actions { margin-top: 11px; justify-content: flex-start; }
  .hero-description, .hero-meta { margin-left: 0 !important; }
  .cols-2, .cols-3, .cols-4, .kpis, .impostos-summary-grid { grid-template-columns: 1fr; }
  .panel, .result { padding: 13px; }
}

@media (max-width: 560px) {
  .sidebar nav { grid-template-columns: 1fr; }
  .hero-title-row { align-items: flex-start; }
  .hero h2 { font-size: 18px; }
  .actions, .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .actions .btn, .hero-actions .btn { width: 100%; }
  .panel-header { display: block; }
  .panel-header > .btn { margin-top: 9px; width: 100%; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .layout { display: flex; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 226px;
    height: 100vh;
    flex: 0 0 226px;
  }
  .sidebar nav { grid-template-columns: 1fr; }
  .content { width: calc(100% - 226px); }
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis, .impostos-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v1.2.3 — impostos por Data NFS, cálculos salvos e valores compactos */
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.impostos-values-grid { margin-top: 10px; }
.impostos-values-grid label { min-width: 0; }
.impostos-edit-card input[readonly],
#imp-competencia[readonly] {
  background: #f4f8fa;
  color: #0b3750;
  border-color: #c7d8e1;
  font-weight: 700;
  cursor: default;
}
.impostos-consulta-detalhe { margin-top: 14px; }
.saved-tax-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.saved-tax-detail-grid > div {
  min-height: 74px;
  padding: 12px 13px;
  border: 1px solid #d2e0e7;
  border-radius: 10px;
  background: #f8fbfc;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.saved-tax-detail-grid span {
  color: #537083;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.saved-tax-detail-grid strong { color: #082c45; font-size: .94rem; }
.saved-tax-detail-grid small { color: #6b7f8c; }
.saved-tax-search {
  margin: 4px 0 16px;
  padding: 16px;
  border: 1px solid #cbdde5;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbfc, #eef6f8);
  box-shadow: 0 7px 22px rgba(8, 44, 69, .06);
}
.saved-tax-search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.saved-tax-search-header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.saved-tax-search-header strong { color: #082c45; font-size: .98rem; }
.saved-tax-search-header small { color: #5d7381; font-size: .78rem; }
.saved-tax-search-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #b9d6cf;
  border-radius: 999px;
  background: #eaf6f1;
  color: #17634f;
  font-size: .74rem;
  font-weight: 800;
}
.saved-tax-search-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 13px;
  padding: 0;
  border: 0;
}
.saved-tax-search-types legend {
  width: 100%;
  margin-bottom: 6px;
  color: #426071;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.saved-tax-search-types label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
}
.saved-tax-search-types input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.saved-tax-search-types span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #bed0da;
  border-radius: 9px;
  background: #fff;
  color: #36566a;
  font-size: .8rem;
  font-weight: 750;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.saved-tax-search-types span::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid #87a3b2;
  border-radius: 50%;
  background: #fff;
}
.saved-tax-search-types input:checked + span {
  border-color: #178566;
  background: #e8f6f1;
  color: #0b634b;
  box-shadow: 0 0 0 2px rgba(23, 133, 102, .1);
}
.saved-tax-search-types input:checked + span::before {
  border-color: #178566;
  background: #178566;
  box-shadow: inset 0 0 0 2px #e8f6f1;
}
.saved-tax-search-types input:focus-visible + span {
  outline: 3px solid rgba(25, 124, 184, .2);
  outline-offset: 2px;
}
.saved-tax-search-row > label {
  display: block;
  margin-bottom: 6px;
  color: #426071;
  font-size: .76rem;
  font-weight: 800;
}
.saved-tax-search-input {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 9px;
  align-items: center;
}
.saved-tax-search-input input {
  width: 100%;
  height: 40px;
}
.saved-tax-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 32px 18px;
  border: 1px dashed #c5d8e1;
  border-radius: 12px;
  background: #f8fbfc;
  color: #607887;
  text-align: center;
}
.saved-tax-empty strong { color: #173f56; }
#tab-impostos-salvos .table-actions { flex-wrap: wrap; min-width: 270px; }
#tab-impostos-salvos table th,
#tab-impostos-salvos table td { white-space: nowrap; }
#tab-impostos-salvos table td:nth-child(2),
#tab-impostos-salvos table td:nth-child(3) { white-space: normal; min-width: 180px; }

@media (max-width: 1300px) {
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .cols-5, .saved-tax-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .cols-5, .saved-tax-detail-grid { grid-template-columns: 1fr; }
  .saved-tax-search-header { flex-direction: column; }
  .saved-tax-search-input { grid-template-columns: 1fr; }
  .saved-tax-search-input .btn { width: 100%; }
}


/* v1.2.3 — campos monetários compactos e valor líquido automático */
.impostos-values-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(126px, 158px));
  justify-content: start;
  align-items: end;
  gap: 8px 10px;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0 12px;
}
.impostos-values-grid label {
  width: 100%;
  min-width: 0;
  gap: 5px;
  font-size: 12px;
}
.impostos-values-grid input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#imp-valorLiquido[readonly] {
  background: #eef7f7;
  color: #063b4d;
  border-color: #a9ced0;
  font-weight: 800;
}
@media (max-width: 980px) {
  .impostos-values-grid {
    grid-template-columns: repeat(3, minmax(126px, 158px));
  }
}
@media (max-width: 620px) {
  .impostos-values-grid {
    grid-template-columns: repeat(2, minmax(126px, 1fr));
    width: 100%;
  }
}
@media (max-width: 420px) {
  .impostos-values-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.2.3 — organização profissional da tela de Impostos */
.tax-editor-modern {
  padding: 0;
  overflow: hidden;
  background: #f7fafb;
  border-color: #d7e3e8;
  box-shadow: 0 10px 28px rgba(12, 48, 66, .06);
}
.tax-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: #fff;
  border-bottom: 1px solid #dce7eb;
}
.tax-editor-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.tax-editor-title h3 {
  margin: 0;
  color: #0b3047;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.tax-editor-title p {
  margin: 5px 0 0;
  color: #5b7280;
  font-size: 12px;
  line-height: 1.4;
}
.tax-editor-main-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid #a9d6d6;
  border-radius: 11px;
  background: linear-gradient(145deg, #f4ffff, #e5f7f7);
  color: #078886;
}
.tax-editor-main-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tax-editor-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.tax-editor-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  white-space: nowrap;
}
.btn-symbol {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 15px;
  line-height: 1;
}
.tax-form-section {
  margin: 14px 18px 0;
  border: 1px solid #d8e4e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 13px rgba(13, 48, 66, .025);
  overflow: hidden;
}
.tax-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 9px 18px;
  border-bottom: 1px solid #e1eaed;
  background: linear-gradient(180deg, #fff, #fbfdfd);
}
.tax-section-heading h4 {
  margin: 0;
  color: #10425d;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.005em;
}
.tax-section-heading h4 strong { color: #0a7180; }
.tax-section-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  background: linear-gradient(145deg, #0b9d9a, #08757f);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(7, 116, 126, .16);
}
.tax-section-icon-money { font-size: 16px; }
.tax-section-icon-text { font-size: 18px; }
.tax-section-icon-guide { font-size: 16px; }
.tax-section-body { padding: 14px 18px 16px; }
.tax-general-grid {
  display: grid;
  grid-template-columns: 1.25fr .82fr 1.08fr .9fr;
  gap: 11px 16px;
  margin: 0;
}
.tax-general-grid label {
  min-width: 0;
  gap: 5px;
  color: #173d51;
  font-size: 11.5px;
  font-weight: 720;
}
.tax-general-grid input {
  min-height: 39px;
  border-radius: 7px;
  border-color: #c7d6dd;
  background: #fff;
  font-size: 12.5px;
}
.tax-general-grid input::placeholder { color: #94a3ad; }
.tax-values-section .tax-section-body { padding-top: 13px; }
.tax-values-equation.impostos-values-grid {
  display: grid;
  grid-template-columns:
    minmax(138px, 1fr) 20px
    minmax(138px, 1fr) 20px
    minmax(138px, 1fr) 20px
    minmax(138px, 1fr) 20px
    minmax(150px, 1.08fr);
  align-items: center;
  gap: 0 7px;
  width: 100%;
  max-width: none;
  margin: 0;
}
.tax-money-card {
  display: block;
  min-width: 0;
  border: 1px solid #d3e0e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.tax-money-title {
  display: block;
  min-height: 29px;
  padding: 6px 8px;
  border-bottom: 1px solid #dbe5e9;
  background: linear-gradient(180deg, #fbfdfd, #f4f8f9);
  color: #173c50;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
.tax-money-input {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 39px;
  align-items: stretch;
}
.tax-money-input > span {
  display: grid;
  place-items: center;
  border-right: 1px solid #dbe5e9;
  background: #f8fbfb;
  color: #31586a;
  font-size: 12px;
  font-weight: 700;
}
.tax-money-input input,
.impostos-values-grid .tax-money-input input {
  width: 100%;
  height: 39px;
  min-height: 39px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #102f41;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tax-money-input input:focus { box-shadow: inset 0 0 0 2px rgba(11, 162, 159, .12); }
.tax-operator {
  display: grid;
  place-items: center;
  color: #6f8490;
  font-size: 17px;
  font-weight: 700;
}
.tax-money-total {
  border-color: #b8dfcc;
  background: #f4fff8;
}
.tax-money-total .tax-money-title {
  border-bottom-color: #c9e9d8;
  background: linear-gradient(180deg, #f5fff8, #eaf9f0);
  color: #08705e;
}
.tax-money-total .tax-money-input > span {
  border-right-color: #c9e9d8;
  background: #effbf4;
  color: #08705e;
}
.tax-money-total #imp-valorLiquido[readonly] {
  background: transparent;
  border: 0;
  color: #073f37;
  font-weight: 850;
}
.tax-formula-note,
.tax-save-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #d7e7ee;
  background: #f3f9fc;
  color: #285d76;
  font-size: 11.5px;
}
.tax-formula-note > span,
.tax-save-note > span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid #5da8c1;
  border-radius: 50%;
  color: #287e9d;
  font-size: 10px;
  font-weight: 800;
}
.tax-description-field { display: block; }
.tax-textarea-wrap { position: relative; display: block; }
.tax-textarea-wrap textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px 24px;
  border-radius: 7px;
  border-color: #c7d6dd;
  font-size: 12.5px;
  line-height: 1.45;
  resize: vertical;
}
.tax-character-counter {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #6c8290;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tax-save-note {
  margin: 14px 18px 0;
  border-color: #cfe3ec;
  background: #eef8fc;
}
.tax-guides-heading {
  margin: 14px 18px 0;
  border: 1px solid #d8e4e8;
  border-radius: 10px 10px 0 0;
}
.tax-editor-modern .impostos-edit-cards {
  margin: 0 18px 18px;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e4e8;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff;
}
.tax-editor-modern .imposto-edit-card {
  border-radius: 8px;
  padding: 12px;
  border-color: #d7e3e8;
  background: #fcfefe;
}
.tax-editor-modern .imposto-edit-card h4 {
  padding-bottom: 8px;
  border-bottom: 1px solid #e3ebee;
  color: #103d56;
  font-size: 13px;
}
.tax-editor-modern .imposto-edit-card.iss-card,
.tax-editor-modern .imposto-edit-card.ir-card,
.tax-editor-modern .imposto-edit-card.inss-card { border-left-width: 3px; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 1320px) {
  .tax-editor-header { align-items: flex-start; }
  .tax-editor-actions { flex-wrap: wrap; justify-content: flex-end; }
  .tax-general-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tax-values-equation.impostos-values-grid {
    grid-template-columns: repeat(5, minmax(125px, 1fr));
    gap: 9px;
  }
  .tax-operator { display: none; }
}
@media (max-width: 900px) {
  .tax-editor-header { display: block; }
  .tax-editor-actions { margin-top: 13px; justify-content: flex-start; }
  .tax-form-section,
  .tax-save-note,
  .tax-guides-heading,
  .tax-editor-modern .impostos-edit-cards { margin-left: 12px; margin-right: 12px; }
  .tax-values-equation.impostos-values-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}
@media (max-width: 620px) {
  .tax-editor-header { padding: 15px; }
  .tax-editor-title h3 { font-size: 18px; }
  .tax-editor-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .tax-editor-actions .btn { width: 100%; }
  .tax-general-grid,
  .tax-values-equation.impostos-values-grid { grid-template-columns: 1fr; }
  .tax-section-body { padding: 12px; }
  .tax-section-heading { padding: 8px 12px; }
}

/* v1.2.4 — armazenamento institucional, backup e restauração */
.storage-panel {
  margin-top: 14px;
  border: 1px solid #d5e2e8;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}
.storage-header { align-items: center; }
.storage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #b9dce1;
  border-radius: 999px;
  background: #eefafb;
  color: #0a6f75;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.storage-path-card {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid #cddfe6;
  border-left: 3px solid #0b8990;
  border-radius: 8px;
  background: #f6fbfc;
}
.storage-path-card label { margin: 0; }
.storage-path-card input[readonly] {
  margin-top: 7px;
  background: #fff;
  color: #15374c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}
.storage-path-card small {
  display: block;
  margin-top: 7px;
  color: #607786;
  font-size: 10.5px;
  overflow-wrap: anywhere;
}
.storage-grid {
  display: grid;
  grid-template-columns: 1.25fr .85fr 1fr;
  gap: 12px;
}
.storage-box {
  min-width: 0;
  padding: 13px;
  border: 1px solid #d6e2e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(3, 34, 52, .045);
}
.storage-box-title {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid #e5ecef;
}
.storage-box-title > span {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  height: 29px;
  border: 1px solid #a9d7dc;
  border-radius: 7px;
  background: linear-gradient(145deg, #eefbfc, #e3f4f7);
  color: #087b82;
  font-size: 10px;
  font-weight: 900;
}
.storage-box-title strong {
  display: block;
  color: #10364d;
  font-size: 12.5px;
}
.storage-box-title small {
  display: block;
  margin-top: 3px;
  color: #6a7e8a;
  font-size: 10.5px;
  line-height: 1.35;
}
.storage-box label { margin-bottom: 10px; }
.storage-box .btn { width: 100%; min-height: 34px; }
.storage-note,
.storage-warning {
  margin: 9px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
}
.storage-note { color: #5f7885; }
.storage-warning { color: #825d24; }
.btn.danger-outline {
  border: 1px solid #d9aeb3;
  background: #fffafa;
  color: #9b2634;
  box-shadow: none;
}
.btn.danger-outline:hover {
  border-color: #c77e88;
  background: #fff4f5;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: .52;
  filter: grayscale(.15);
  transform: none !important;
}
.admin-auth-card { width: min(460px, calc(100vw - 28px)); }
.admin-auth-card > label { display: block; margin-top: 12px; }
.admin-auth-message {
  margin: 3px 0 12px;
  color: #5c7180;
  font-size: 12px;
  line-height: 1.55;
}
.admin-auth-card .actions { margin-top: 14px; }
#result-storage { margin-top: 12px; }
@media (max-width: 1180px) {
  .storage-grid { grid-template-columns: 1fr 1fr; }
  .storage-box:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .storage-grid { grid-template-columns: 1fr; }
  .storage-box:first-child { grid-column: auto; }
  .storage-header { align-items: flex-start; }
  .storage-badge { margin-top: 8px; }
}


/* v1.2.6 — PDFs individuais por clique, sem cache antigo da interface */
.saved-tax-cell {
  min-width: 112px;
  padding: 5px 7px !important;
  text-align: center;
}
.saved-tax-value {
  display: inline-flex;
  min-width: 96px;
  min-height: 38px;
  padding: 5px 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid #aad3d8;
  border-radius: 7px;
  background: linear-gradient(180deg, #fbffff, #edf8f9);
  color: #0b5360;
  font: inherit;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 65, 77, .06);
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.saved-tax-value span {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.saved-tax-value small {
  margin-top: 2px;
  color: #43818a;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.saved-tax-value:hover:not(:disabled):not(.disabled) {
  border-color: #1598a3;
  background: linear-gradient(180deg, #f3ffff, #ddf4f5);
  box-shadow: 0 4px 12px rgba(8, 110, 121, .11);
  transform: translateY(-1px);
}
.saved-tax-value:focus-visible {
  outline: 2px solid rgba(16, 153, 165, .23);
  outline-offset: 2px;
}
.saved-tax-value.disabled,
.saved-tax-value:disabled {
  border-color: #d9e2e6;
  background: #f6f8f9;
  color: #84949c;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.saved-tax-value.disabled small { display: none; }
.saved-tax-value.loading {
  border-color: #64bdc5;
  background: #e9f8f9;
}
.saved-tax-detail-card .saved-tax-value {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
}
.saved-tax-detail-card .saved-tax-value span { font-size: 14px; }
.saved-tax-detail-card .saved-tax-value small { font-size: 9px; }
@media (max-width: 980px) {
  .saved-tax-value { min-width: 88px; }
}


/* v1.2.6 — ação explícita nos valores salvos */
.saved-tax-value small::before {
  content: "↗ ";
  font-size: 9px;
}
.saved-tax-value:not(.disabled):not(:disabled) {
  position: relative;
  z-index: 1;
  appearance: none;
  -webkit-appearance: none;
}
.saved-tax-value:not(.disabled):not(:disabled):active {
  transform: translateY(0);
  background: #dff4f5;
}

/* Retorno visual das ações: processamento, conclusão e falha */
.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: min(390px, calc(100vw - 28px));
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: #082d43;
  color: #fff;
  box-shadow: 0 18px 48px rgba(2, 22, 34, .24);
  z-index: 9999;
  overflow: hidden;
}
.toast-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
}
.toast-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.toast-content strong {
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
}
.toast-content > span {
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  line-height: 1.4;
}
.toast-success {
  border-color: rgba(92, 222, 177, .35);
  background: #075b50;
}
.toast-error {
  border-color: rgba(255, 171, 178, .38);
  background: #842f3b;
}
.toast-loading {
  border-color: rgba(77, 223, 216, .32);
  background: #07384f;
}
.toast-spinner,
.btn-spinner {
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: lcp-spin .72s linear infinite;
}
.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #45dfd4, transparent);
  animation: lcp-progress 1.15s ease-in-out infinite;
}
.btn.is-busy {
  cursor: wait;
  opacity: .88;
}
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
}
.result-success-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.result-success-head h4 { margin: 0 0 3px; }
.result-success-head p {
  margin: 0;
  color: #5b7480;
  font-size: 11.5px;
}
.result-success-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #8bd4c5;
  border-radius: 50%;
  background: #e8faf5;
  color: #087b67;
  font-size: 16px;
  font-weight: 900;
}
.result-success-head + .link-row { margin-top: 12px; }
@keyframes lcp-spin {
  to { transform: rotate(360deg); }
}
@keyframes lcp-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .toast-spinner,
  .btn-spinner,
  .toast-progress { animation-duration: 1.8s; }
}

/* Gestão centralizada de instituições, usuários e vínculos — v2.0.2 */
.access-management-card {
  width: min(1420px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 20px;
  border: 1px solid #cbdde3;
  border-radius: 14px;
  background: #f7fafb;
  box-shadow: 0 26px 70px rgba(2, 34, 52, .28);
}
.access-management-header {
  margin: -20px -20px 18px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #d9e5e9;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f8 100%);
}
.access-management-header h3 { margin: 3px 0 4px; color: #082d41; font-size: 22px; }
.access-management-header p { margin: 0; color: #617887; font-size: 12px; }
.access-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.access-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid #d5e2e7;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(7, 55, 75, .055);
}
.access-links-card { grid-column: 1 / -1; }
.access-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid #e2ebee;
}
.access-card-title > span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #075d81, #0aa39f);
  font-size: 10px;
  font-weight: 800;
}
.access-card-title strong { display: block; color: #0a3448; font-size: 14px; }
.access-card-title small { display: block; margin-top: 2px; color: #718591; font-size: 10.5px; line-height: 1.35; }
.access-form { display: grid; gap: 9px; }
.access-form .actions { margin-top: 1px; }
.access-table {
  max-height: 235px;
  margin-top: 13px;
  border: 1px solid #e0e9ec;
  border-radius: 9px;
  overflow: auto;
}
.access-table table { margin: 0; }
.access-table th { position: sticky; top: 0; z-index: 1; background: #edf5f6; }
.access-table td strong { display: block; color: #12384a; }
.access-table td small { display: block; margin-top: 2px; color: #738894; font-size: 10px; }
.access-links-cell { max-width: 320px; white-space: normal; line-height: 1.35; }
.empty-access { margin: 0; padding: 14px; color: #758995; text-align: center; }
.institution-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 230px;
  margin-top: 9px;
  padding: 9px;
  overflow: auto;
  border: 1px solid #dce7ea;
  border-radius: 9px;
  background: #f8fbfc;
}
.institution-link-grid > p { grid-column: 1 / -1; margin: 8px; color: #718591; text-align: center; }
.institution-link-option {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid #d7e4e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.institution-link-option:hover { border-color: #7fbfc0; background: #f1fbfa; }
.institution-link-option input { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; accent-color: #078b8d; }
.institution-link-option span { min-width: 0; }
.institution-link-option strong { display: block; color: #12384a; font-size: 11.5px; line-height: 1.3; }
.institution-link-option small { display: block; margin-top: 3px; color: #758995; font-size: 9.5px; }
.admin-access-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.admin-access-panel h3 { margin: 0 0 4px; }
.admin-access-panel p { margin: 0; }
.admin-access-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #075d81, #0aa39f);
  font-size: 20px;
}
.text-danger { color: #b63046 !important; }
.btn.xs { min-height: 27px; padding: 5px 9px; font-size: 9.5px; }
.badge.info { color: #075d81; background: #e4f4f7; border-color: #bcdce3; }

@media (max-width: 1050px) {
  .access-management-layout { grid-template-columns: 1fr; }
  .access-links-card { grid-column: auto; }
  .institution-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .access-management-card { width: calc(100vw - 12px); max-height: calc(100vh - 12px); padding: 13px; }
  .access-management-header { margin: -13px -13px 13px; padding: 14px 13px; }
  .institution-link-grid { grid-template-columns: 1fr; }
  .admin-access-panel { grid-template-columns: auto 1fr; }
  .admin-access-panel .btn { grid-column: 1 / -1; }
}

/* v2.0.2 — edição/exclusão administrativa e pesquisa institucional */
.login-institution-field {
  position: relative;
}
.login-institution-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 90;
  max-height: 245px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #c9dce3;
  border-radius: 10px;
  background: rgba(255,255,255,.99);
  box-shadow: 0 16px 36px rgba(3, 42, 61, .16);
}
.login-institution-option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid #edf2f4;
  border-radius: 7px;
  background: transparent;
  color: #0a3348;
  text-align: left;
  cursor: pointer;
}
.login-institution-option:last-child { border-bottom: 0; }
.login-institution-option:hover,
.login-institution-option:focus {
  outline: none;
  background: #edf9f8;
}
.login-institution-option strong { font-size: 11.5px; line-height: 1.3; }
.login-institution-option small { color: #718692; font-size: 9.5px; }
.login-institution-empty {
  padding: 12px;
  color: #758995;
  font-size: 10.5px;
  text-align: center;
}
.access-action-cell { white-space: nowrap; }
.access-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.btn.danger-outline {
  border-color: #e6c2c8;
  background: #fffafa;
  color: #b12c40;
}
.btn.danger-outline:hover {
  border-color: #d89ba5;
  background: #fff0f2;
}
.access-form select {
  min-height: 38px;
  border: 1px solid #cbdde3;
  border-radius: 8px;
  background: #fff;
}
