/* Orbit Despesas: complementos ao design system Orbit (styles.css). */

.field textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; resize: vertical;
  border: 1px solid #d9e2f1; border-radius: var(--o-r-sm);
  background: #fff; color: var(--o-ink); outline: 0; font-family: inherit;
}
.field textarea:focus { border-color: var(--o-cyan); box-shadow: 0 0 0 4px rgba(6, 182, 212, .14); }
.field .hint { font-size: 12px; color: var(--o-muted); margin-top: 5px; }
.field.wide { grid-column: 1 / -1; }
.field.need input, .field.need textarea { border-color: var(--o-amber); }
body.dark .field textarea { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #e6ecfb; }

.modal.wide { width: min(920px, 96vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.x-btn { border: 0; background: transparent; font-size: 22px; color: var(--o-muted); width: 40px; height: 40px; border-radius: 10px; }
.x-btn:hover { background: #f1f5fb; }

/* Captura: formas de trazer o documento */
.capture { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.capture button, .capture label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: 12px; border-radius: 14px; cursor: pointer;
  border: 1px dashed #c7d4ea; background: #f6f9fe; color: var(--o-ink-2);
  font-weight: 700; font-size: 13px; text-align: center;
}
.capture button:hover, .capture label:hover { border-color: var(--o-cyan); background: #eef8fc; }
.capture .big { font-size: 22px; line-height: 1; }
.capture small { font-weight: 500; color: var(--o-muted); font-size: 11px; }
.capture input[type=file] { display: none; }
body.dark .capture button, body.dark .capture label { background: #131c3d; border-color: rgba(255, 255, 255, .16); color: #d6deef; }

.doc-chip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .3);
  color: #047857; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; font-weight: 600;
}
.doc-chip.warn { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .3); color: #b91c1c; }
.doc-chip .grow { flex: 1 1 auto; }
body.dark .doc-chip { color: #6ee7b7; }
body.dark .doc-chip.warn { color: #fca5a5; }

/* Painel de politica ao vivo */
.policy { border-radius: 14px; padding: 12px 14px; margin-top: 14px; font-size: 13px; }
.policy.ok { background: rgba(16, 185, 129, .08); color: #047857; border: 1px solid rgba(16, 185, 129, .25); }
.policy.bad { background: #fff8eb; border: 1px solid #f7d79b; color: #92400e; }
.policy ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.policy li { display: flex; gap: 8px; align-items: flex-start; }
body.dark .policy.bad { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
body.dark .policy.ok { color: #6ee7b7; }

.sev { flex: 0 0 auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; }
.sev.block { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.sev.justify { background: rgba(245, 158, 11, .18); color: #b45309; }
.sev.warning { background: rgba(37, 99, 235, .1); color: var(--o-blue-600); }

.flags { display: flex; gap: 4px; flex-wrap: wrap; }

/* Faixa de totais do relatorio */
.totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 4px 0 16px; }
.totals div { background: #f4f8fe; border: 1px solid var(--o-line); border-radius: 12px; padding: 10px 12px; }
.totals span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--o-muted); }
.totals b { display: block; font-size: 17px; color: var(--o-ink); margin-top: 4px; }
.totals .neg b { color: #b91c1c; }
body.dark .totals div { background: #131c3d; border-color: rgba(255, 255, 255, .08); }
body.dark .totals b { color: #f2f5ff; }

/* Linha do tempo da aprovacao */
.timeline { list-style: none; display: flex; flex-direction: column; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li:before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--o-line); }
.timeline li:last-child:before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.timeline .dot.approved { background: var(--o-green); box-shadow: 0 0 0 1px var(--o-green); }
.timeline .dot.pending { background: var(--o-amber); box-shadow: 0 0 0 1px var(--o-amber); }
.timeline .dot.rejected { background: var(--o-red); box-shadow: 0 0 0 1px var(--o-red); }
.timeline .t-title { font-weight: 700; color: var(--o-ink); }
.timeline .t-sub { font-size: 12px; color: var(--o-muted); margin-top: 2px; }
.timeline .t-comment { font-size: 13px; margin-top: 6px; padding: 8px 10px; background: #f4f8fe; border-radius: 10px; }
body.dark .timeline .t-title { color: #e9eefb; }
body.dark .timeline .dot { border-color: #101935; }
body.dark .timeline .t-comment { background: #131c3d; }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Graficos simples em CSS */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 8px; }
.bars .bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .fill { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: var(--o-grad); min-height: 3px; }
.bars .lbl { font-size: 11px; color: var(--o-muted); font-weight: 600; }
.bars .val { font-size: 11px; color: var(--o-ink-2); font-weight: 700; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbars .row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 110px; gap: 10px; align-items: center; font-size: 13px; }
.hbars .track { height: 10px; border-radius: 99px; background: #eef3fb; overflow: hidden; }
.hbars .track i { display: block; height: 100%; background: var(--o-grad); border-radius: 99px; }
.hbars .amt { text-align: right; font-weight: 700; color: var(--o-ink); }
body.dark .hbars .track { background: #182348; }
body.dark .hbars .amt, body.dark .bars .val { color: #e9eefb; }

.stat-box .sub { font-size: 12px; color: var(--o-muted); margin-top: 4px; }
.stat-box.click { cursor: pointer; }
.num.money { font-size: 24px !important; }

.check { width: 18px; height: 18px; accent-color: var(--o-blue); }
.actions-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.muted { color: var(--o-muted); font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.link { border: 0; background: none; color: var(--o-blue); font-weight: 700; cursor: pointer; padding: 0; font-size: inherit; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--o-line); background: #fff; color: var(--o-ink-2); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; min-height: 38px; }
.tabs button.active { background: var(--o-blue); border-color: var(--o-blue); color: #fff; }
body.dark .tabs button { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #cdd8f2; }
body.dark .tabs button.active { background: var(--o-blue); color: #fff; }

.scanner video { width: 100%; border-radius: 14px; background: #000; max-height: 60vh; }
.badge-count { margin-left: auto; background: var(--o-red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }

#topbar #quick-add { min-height: 40px; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture { grid-template-columns: 1fr 1fr 1fr; }
  .hbars .row { grid-template-columns: 100px minmax(0, 1fr) 90px; }
  .stats { grid-template-columns: 1fr 1fr; }
  #topbar { padding: 10px 16px; }
}
@media (max-width: 520px) {
  .capture { grid-template-columns: 1fr; }
  .capture button, .capture label { min-height: 56px; flex-direction: row; }
  .modal { padding: 18px 16px; border-radius: 16px; }
  table.responsive thead { display: none; }
  table.responsive tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--o-line); }
  table.responsive td { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border: 0; }
  table.responsive td:before { content: attr(data-l); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--o-muted); }
  table.responsive td.nolabel:before { content: none; }
}

/* Viagens */
.field label.inline { display: flex; align-items: center; justify-content: flex-start; gap: 10px; font-size: 14px; font-weight: 600;
  color: var(--o-ink); cursor: pointer; text-transform: none; letter-spacing: 0; margin: 4px 0 0; }
.field label.inline input.check { width: 18px; height: 18px; min-height: 0; flex: none; padding: 0; margin: 0; box-shadow: none; }
body.dark .field label.inline { color: #f2f5ff; }
.trip-total { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 700; color: var(--o-muted); }
.facts dd { margin: 0; }
tr.muted-row td { opacity: .55; }

/* Conta Orbit e ambiente de homologacao */
.login-hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: #64748b; }
#landing.theme-dark .login-hint { color: #94a3b8; }
.env-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #92400e;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.login-emblem .env-badge { font-size: 12px; margin-left: 6px; }
body.dark .env-badge, #landing.theme-dark .env-badge { background: rgba(245, 158, 11, .18); color: #fbbf24; }

/* Rateio, moeda e diaria no formulario da despesa */
.split-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--o-line); border-radius: 12px; }
#split-area { margin-top: 12px; display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 80px 100px 32px; gap: 8px; align-items: center; }
.split-row select, .split-row input { min-height: 38px; padding: 0 10px; border: 1px solid #d9e2f1; border-radius: 9px; background: #fff; color: var(--o-ink); min-width: 0; }
.split-row .sp-amt { font-size: 12px; text-align: right; white-space: nowrap; }
.split-row .x-btn { width: 32px; height: 32px; font-size: 18px; }
.split-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.neg-text { color: #b91c1c; }
body.dark .split-row select, body.dark .split-row input { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #e6ecfb; }
body.dark .split-box { border-color: rgba(255, 255, 255, .14); }
@media (max-width: 760px) { .split-row { grid-template-columns: 1fr 1fr; } .split-row .sp-amt { text-align: left; } }

/* Orcamentos */
.budget-input { width: 130px; min-height: 36px; padding: 0 10px; border: 1px solid #d9e2f1; border-radius: 9px; background: #fff; color: var(--o-ink); text-align: right; }
.budget-bar { position: relative; display: flex; width: 160px; height: 8px; border-radius: 99px; background: #eef2f8; overflow: hidden; }
.budget-bar i { display: block; height: 100%; }
.budget-bar .real { background: var(--o-blue); }
.budget-bar .comm { background: #93c5fd; }
.budget-bar.alert .real { background: var(--o-amber); }
.budget-bar.alert .comm { background: #fcd34d; }
.budget-bar.over .real, .budget-bar.over .comm { background: var(--o-red); }
body.dark .budget-input { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #e6ecfb; }
body.dark .budget-bar { background: rgba(255, 255, 255, .08); }
