/* Plugi — tema visual (v2). Carrega depois de app.css: sobrescreve tokens e componentes.
   Estrutura e lógica não mudam; é só pele. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/inter-700.woff2") format("woff2"); }

:root {
  --color-primary: #0b4a8b;
  --color-primary-hover: #093c73;
  --color-primary-light: #eaf1f9;
  --color-accent: #f59e0b;
  --color-bg: #f7f8fa;
  --color-card-bg: #ffffff;
  --color-text: #0d1520;
  --color-text-muted: #68758b;
  --color-border: #e2e6ee;
  --color-border-light: #edf0f5;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(13, 21, 32, .05);
  --shadow-md: 0 4px 12px rgba(13, 21, 32, .07);
  --shadow-lg: 0 12px 32px rgba(13, 21, 32, .12);
  --side-bg: #0d1520;
  --side-line: #1c2635;
  --side-text: #c3cddc;
  --side-muted: #7f8fa6;
  --side-active: #16243a;
  --line: #e5e8ee;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04";
}

h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--color-text); }
.page-head h1, .container > h1 { color: var(--color-text); }
h2 { font-size: 15px; font-weight: 600; }
a { color: var(--color-primary); }

/* ---------------------------------------------------------------- ícones */
.ic, .icon, .ic-sm, .ic-xs, .ic-lg, .icon-sm, .icon-xs {
  stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto; vertical-align: -3px;
}
.ic, .icon { width: 18px; height: 18px; stroke-width: 1.75; }
.ic-sm, .icon-sm { width: 16px; height: 16px; stroke-width: 1.8; }
.ic-xs, .icon-xs { width: 14px; height: 14px; stroke-width: 1.9; }
.ic-lg { width: 26px; height: 26px; stroke-width: 1.6; }
.ic-24 { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- barra lateral */
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: var(--side-bg);
  border-right: 0;
  padding: 18px 12px 14px;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  overflow-y: auto; scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #22303f; border-radius: 3px; }

.sidebar .brand { padding: 4px 8px 16px; display: block; }
.sidebar .brand img { height: 26px; width: auto; display: block; }
.sidebar .brand span { color: #fff; font-weight: 700; letter-spacing: -.01em; }

.nav-sec {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: #566579; padding: 14px 10px 6px;
}

.sidebar .item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: 8px;
  color: var(--side-text); font-size: 13.5px; font-weight: 500;
  text-decoration: none; border: 0; background: none; width: 100%; text-align: left;
  transition: background .13s ease, color .13s ease;
}
.sidebar .item .ic { color: var(--side-muted); transition: color .13s ease; }
.sidebar .item:hover { background: #151f2e; color: #fff; }
.sidebar .item.on { background: var(--side-active); color: #fff; font-weight: 600; }
.sidebar .item.on .ic { color: var(--color-accent); }
.sidebar .sep { height: 1px; background: var(--side-line); margin: 10px 8px; }
.sidebar .salir { color: #93a1b5; }
.sidebar .salir:hover { background: #2a1620; color: #fca5a5; }

.side-plan { margin-top: auto; padding: 14px 6px 0; }
.side-plan .box { background: #111b28; border: 1px solid #1e2b3d; border-radius: 10px; padding: 10px 12px; }
.side-plan .t { font-size: 12.5px; font-weight: 600; color: #e6ecf5; }
.side-plan .s { font-size: 11.5px; color: var(--side-muted); margin-top: 1px; }

/* ---------------------------------------------------------------- conteúdo */
body:has(.sidebar) { padding-left: 236px; }
main.container {
  max-width: 1180px; margin: 0 auto; padding: 24px 28px 48px; width: 100%;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--color-text-muted); font-size: 13.5px; margin-top: 3px; }

/* navbar: só no celular */
.navbar {
  display: none;
  background: var(--side-bg); border-bottom: 0; height: 56px; padding: 0 14px;
  align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
}
.navbar-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.navbar-brand img.brand-logo { height: 24px; width: auto; max-width: 110px; }
.nav-toggle { color: #fff; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; }
.nav-links { display: none !important; }

/* ---------------------------------------------------------------- cartões */
.card {
  background: var(--color-card-bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 18px; margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 12px;
  color: var(--color-text); display: flex; align-items: center; gap: 8px; }
.card-title .ic, .card-title .ic-sm { color: #9aa5b8; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.metric-card {
  background: var(--color-card-bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.metric-label { font-size: 12.5px; color: var(--color-text-muted); font-weight: 500;
  text-transform: none; letter-spacing: 0;
  display: flex; align-items: center; gap: 7px; }
.metric-label .ic { width: 15px; height: 15px; color: #9aa5b8; }
.metric-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .13s ease, border-color .13s ease, box-shadow .13s ease;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 1px 2px rgba(11, 74, 139, .28); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: #fff; border-color: var(--line); color: #26313f; }
.btn-secondary:hover { background: #f7f9fc; border-color: #d7dce6; }
.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-soft { background: var(--color-primary-light); color: var(--color-primary); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-success { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.btn-success:hover { background: #d1fadf; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- formulários */
label, .form-label { font-size: 12.5px; font-weight: 500; color: #48566a; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="search"], input[type="url"],
select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--color-text);
  background: #fff; border: 1px solid #dfe4ec; border-radius: 9px;
  padding: 9px 11px; min-height: 38px; width: 100%;
  transition: border-color .13s ease, box-shadow .13s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 74, 139, .12);
}
input::placeholder, textarea::placeholder { color: #9aa5b6; }
.form-group { margin-bottom: 12px; }
.form-group > label { display: block; margin-bottom: 5px; }

/* ---------------------------------------------------------------- tabelas */
.table, table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: #8b96a8; text-align: left; padding: 10px 12px; background: #fbfcfe;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 12px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }
.table .num, .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- pílulas de estado */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #f2f4f7; color: #475467; border: 0; text-transform: capitalize;
}
.badge-borrador, .badge-enviado, .badge-pendiente { background: #eef2ff; color: #3538cd; }
.badge-aceptado, .badge-pagada, .badge-pagado, .badge-cobrada { background: #ecfdf3; color: #067647; }
.badge-rechazado, .badge-vencida, .badge-anulada { background: #fef3f2; color: #b42318; }
.badge-facturado, .badge-entregado { background: #eff8ff; color: #175cd3; }

/* ---------------------------------------------------------------- avisos */
.sync-bar { border: 0; background: transparent; padding: 0; margin: 0; }
.sync-bar .sync-status { display: none; }
#onb-banner { background: #fffbeb !important; border-bottom: 1px solid #fde68a !important;
  color: #92400e !important; font-size: 13px !important; padding: 10px 16px !important; }

.alert, .aviso {
  border-radius: 10px; padding: 11px 14px; font-size: 13px; border: 1px solid transparent;
}
.alert-info, .aviso-info { background: #eff8ff; border-color: #cfe4fb; color: #175cd3; }
.alert-warning, .aviso-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }

/* ---------------------------------------------------------------- vazios */
.empty { text-align: center; padding: 30px 18px; color: var(--color-text-muted); }
.empty .ic { width: 26px; height: 26px; color: #b6c0d0; margin-bottom: 8px; }
.empty p { font-size: 13px; margin-bottom: 10px; }

/* ---------------------------------------------------------------- modais */
.modal-content, .modal-box {
  border-radius: 14px; box-shadow: var(--shadow-lg); border: 0;
}
.modal-header, .modal-footer { border-color: var(--line); }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  body:has(.sidebar) { padding-left: 0; }
  .sidebar {
    transform: translateX(-100%); transition: transform .22s ease;
    width: 268px; flex-basis: 268px; box-shadow: 0 0 40px rgba(0, 0, 0, .4);
  }
  .sidebar.open, .sidebar.abierto, .sidebar.show { transform: none; }
  .navbar { display: flex; }
  main.container { padding: 16px 14px 40px; }
  h1 { font-size: 22px; }
  .page-head { align-items: stretch; }
  .metrics-grid { gap: 10px; }
  .metric-card { padding: 12px 13px; }
  .metric-value { font-size: 21px; }
  .metric-label { font-size: 11.5px; }
  .card { padding: 14px; border-radius: 12px; }
  .btn { height: 36px; }
}
@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .btn-group { gap: 6px; }
  .btn { font-size: 12.5px; padding: 0 11px; }
}

/* aviso de onboarding dentro da largura do conteúdo */
#onb-banner { max-width: 1180px; margin: 14px auto 0; border-radius: 10px !important;
  border: 1px solid #fde68a !important; }
@media (max-width: 1240px) { #onb-banner { margin: 12px 16px 0; } }
@media (max-width: 900px) { #onb-banner { margin: 10px 14px 0; } }

/* fundo do menu móvel */
.backdrop.show, .backdrop.active { background: rgba(9, 14, 22, .5); backdrop-filter: blur(1px); }

@media (max-width: 900px) {
  .metric-label { font-size: 11.5px; line-height: 1.3; }
  .metric-value { margin-top: 4px; }
  #onb-banner { position: relative; padding: 10px 36px 10px 12px !important; font-size: 12.5px !important;
    line-height: 1.45; }
  #onb-banner > button[onclick] { position: absolute; right: 8px; top: 6px; font-size: 1.15rem; }
  .card-title { font-size: 13.5px; }
}

/* tabelas: ações numa linha, número sem quebrar */
.table td:first-child, .table td:first-child a, .table td:first-child strong { white-space: nowrap; }
.table td .btn-group, .table td .btn-group { flex-wrap: nowrap; justify-content: flex-end; }
.table td .btn { margin: 0; }
.btn-sm { min-width: 0; }
