/* tabela.fblog.com.br — CSS único, simples. Paleta da marca FBLog. */
:root {
  --teal: #6DA3AD;
  --teal-deep: #1A6875;
  --gray: #7C7D81;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --surface-3: #e3edef;
  --line: #d7dee0;
  --text: #1f2a2d;
  --text-soft: #5d6b6f;
  --ok: #1f7a4d; --ok-bg: #e3f4ea;
  --warn: #9a5a00; --warn-bg: #fbf0dd;
  --err: #a32020; --err-bg: #fbe6e6;
  --r: 8px; --r-lg: 12px;
  --shadow: 0 1px 3px rgba(20,40,45,.08), 0 1px 2px rgba(20,40,45,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 22px 0 8px; color: var(--teal-deep); }
p { margin: 6px 0; }
.muted { color: var(--text-soft); }
.small { font-size: 12.5px; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(95deg, var(--teal-deep), var(--teal));
  color: #fff; padding: 10px 20px; box-shadow: var(--shadow);
}
.brand { color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: baseline; gap: 2px; }
.brand:hover { text-decoration: none; }
.brand-fb { background: #fff; color: var(--teal-deep); padding: 0 5px; border-radius: 5px; }
.brand-rest { color: #eafafa; }
.brand-sub { font-size: 12px; font-weight: 500; opacity: .85; margin-left: 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: #eafafa; padding: 6px 11px; border-radius: var(--r); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.nav .nav-cta { background: rgba(255,255,255,.18); }
.user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.user-email { color: #eafafa; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .sair { color: #fff; opacity: .85; }

/* content */
.content { max-width: 1100px; margin: 22px auto; padding: 0 20px; }
.content.wide { max-width: 1400px; }
.content.narrow { max-width: 720px; }

/* flash */
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-erro { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--surface-3); color: var(--teal-deep); }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .3px; }
.badge-admin { background: #f3e1f7; color: #7a2891; }
.badge-editor { background: var(--ok-bg); color: var(--ok); }
.badge-visualizador { background: var(--surface-3); color: var(--teal-deep); }
.badge-sem_acesso, .badge-inativo { background: var(--surface-2); color: var(--gray); }
.badge-ativo { background: var(--ok-bg); color: var(--ok); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 4px; font-size: 14px; color: var(--text-soft); font-weight: 600; }
.card .big { font-size: 30px; font-weight: 700; color: var(--teal-deep); }
.card-actions { display: flex; flex-direction: column; gap: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 8px 14px; border-radius: var(--r); cursor: pointer; font-size: 14px; font-weight: 500; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-pri { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-pri:hover { background: #155663; color: #fff; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-danger { color: var(--err); border-color: #e7c4c4; background: #fff; }
.btn-danger:hover { background: var(--err-bg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* forms */
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.fld { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; background: #fff; }
.fld:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: var(--teal); }
.hint { display: block; color: var(--text-soft); font-size: 12px; margin-top: 3px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.inline-suf { position: relative; }
.inline-suf .suf { position: absolute; right: 10px; top: 9px; color: var(--text-soft); }

/* form-card */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }

/* wizard */
.wizard-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.wizard-steps .wstep { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 13px; padding: 4px 0; }
.wizard-steps .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-soft); display: grid; place-items: center; font-weight: 700; font-size: 12px; border: 1px solid var(--line); }
.wizard-steps .wstep.active { color: var(--teal-deep); font-weight: 600; }
.wizard-steps .wstep.active .dot { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.wizard-steps .wstep.done .dot { background: var(--ok); color: #fff; border-color: var(--ok); }
.wstep .sep { width: 18px; height: 2px; background: var(--line); }
.step { display: none; }
.step.active { display: block; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step h2 { margin-top: 0; }
.step-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; background: var(--surface-2); color: var(--text-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tbody tr:nth-child(even) { background: var(--surface-2); }
table.tbl tbody tr:hover { background: var(--surface-3); }
table.tbl tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 28px; color: var(--text-soft); }
.rowacts { display: flex; gap: 6px; }

/* toolbar / filters */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow); }
.toolbar .fld { width: auto; min-width: 150px; flex: 0 0 auto; }
.spacer { flex: 1; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }

/* preview fiscal */
.preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.preview h3 { margin: 0 0 10px; font-size: 14px; color: var(--teal-deep); }
.fiscal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fiscal-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.fiscal-item .lbl { font-size: 12px; color: var(--text-soft); display: flex; justify-content: space-between; align-items: center; }
.fiscal-item .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fiscal-item .val.neg { color: var(--err); }
.fiscal-item.result { background: var(--ok-bg); border-color: #bfe3cd; }
.fiscal-item.result .val { color: var(--ok); }
.fiscal-item .override { margin-top: 7px; display: none; }
.fiscal-item .override.show { display: block; }
.fiscal-item .override .fld { padding: 6px 8px; font-size: 13px; }
.chk { font-size: 11.5px; color: var(--teal-deep); cursor: pointer; user-select: none; display: inline-flex; gap: 4px; align-items: center; }
.piso { margin-top: 12px; padding: 10px 12px; background: #fff; border: 1px dashed var(--teal); border-radius: var(--r); font-size: 13px; }
.tag-indef { background: var(--warn-bg); color: var(--warn); font-size: 11px; padding: 1px 6px; border-radius: 8px; }

/* autocomplete */
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; display: none; }
.ac-list.show { display: block; }
.ac-item { padding: 8px 11px; cursor: pointer; }
.ac-item:hover, .ac-item.sel { background: var(--surface-3); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(120deg, var(--teal-deep), var(--teal)); }
.login-card { background: #fff; border-radius: var(--r-lg); padding: 36px 32px; box-shadow: 0 12px 40px rgba(0,0,0,.2); width: 360px; text-align: center; }
.login-card h1 { color: var(--teal-deep); }
.login-card .brand-fb { background: var(--teal-deep); color: #fff; padding: 0 6px; border-radius: 5px; }
.g-btn { margin-top: 20px; width: 100%; justify-content: center; }

/* status do negócio (vs piso ANTT + margem) */
.status-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); }
.status-badge { font-weight: 700; padding: 4px 12px; border-radius: 12px; font-size: 12.5px; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-alerta { background: var(--warn-bg); color: var(--warn); }
.status-ruim { background: var(--err-bg); color: var(--err); }
.status-muted { background: var(--surface-3); color: var(--text-soft); }
.status-metrics { color: var(--text-soft); font-size: 12.5px; }

/* extras (repeater) */
.extra-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 640px) { .extra-row { grid-template-columns: 1fr; } }

/* help */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.toc a { display: inline-block; margin-right: 14px; }
.help section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.help section h2 { margin-top: 0; }
.help dl dt { font-weight: 700; margin-top: 10px; }
.help dl dd { margin: 2px 0 0; color: var(--text-soft); }
details.faq { margin: 8px 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--teal-deep); }
