/* ==========================================================================
   TMS Maison — Tema (tokens de design + ajustes globais do Bootstrap 5)
   Altere as cores/tipografia AQUI para refletir em todo o protótipo.
   ========================================================================== */

:root {
  /* Marca */
  --tms-brand: #F71115;          /* vermelho Maison (header, alertas de marca) */
  --tms-brand-dark: #C90D10;
  --tms-brand-soft: #FDE8E8;

  /* Cor de ação (CTAs, item ativo, links) */
  --tms-primary: #1E3A6E;
  --tms-primary-hover: #162C54;
  --tms-primary-soft: #E8EEF8;

  /* Superfícies e texto */
  --tms-bg: #F4F5F7;
  --tms-surface: #FFFFFF;
  --tms-surface-muted: #EEF0F3;
  --tms-surface-hover: #FAFBFC;
  --tms-border: #E4E7EC;
  --tms-text: #1F2933;
  --tms-text-muted: #6B7280;
  --tms-text-subtle: #9AA1AC;

  /* Feedback */
  --tms-success: #1E7B3C;
  --tms-success-soft: #E7F6EC;
  --tms-warning: #9A5B00;
  --tms-warning-soft: #FFF4E0;
  --tms-danger: #B80B0E;
  --tms-danger-soft: #FDE8E8;

  /* Cores por status do item (fundo suave + texto) */
  --st-pendente-bg: #F1F2F4;     --st-pendente-fg: #4B5563;
  --st-recebido-bg: #E6F0FB;     --st-recebido-fg: #1D4E89;
  --st-proxima-bg: #ECEBFD;      --st-proxima-fg: #4338CA;
  --st-caminho-bg: #FFF4E0;      --st-caminho-fg: #9A5B00;
  --st-recolhimento-bg: #E3F5F3; --st-recolhimento-fg: #0F766E;
  --st-entregue-bg: #E7F6EC;     --st-entregue-fg: #1E7B3C;
  --st-compra-bg: #F5E9FB;       --st-compra-fg: #7E22CE;

  /* Forma e profundidade */
  --tms-radius: .5rem;
  --tms-radius-sm: .375rem;
  --tms-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --tms-shadow: 0 4px 12px rgba(16, 24, 40, .08);

  /* Layout */
  --tms-header-h: 64px;
  --tms-gutter: 1.25rem;

  /* Bootstrap: sobrescritas globais */
  --bs-body-font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-font-size: .9375rem;
  --bs-body-bg: var(--tms-bg);
  --bs-body-color: var(--tms-text);
  --bs-border-color: var(--tms-border);
  --bs-primary: var(--tms-primary);
  --bs-primary-rgb: 30, 58, 110;
  --bs-link-color: var(--tms-primary);
  --bs-link-color-rgb: 30, 58, 110;
  --bs-link-hover-color: var(--tms-primary-hover);
  --bs-secondary-color: var(--tms-text-muted);
}

/* ---------- Base ---------- */
html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--tms-bg);
  -webkit-font-smoothing: antialiased;
}

.fw-medium { font-weight: 500 !important; }
.text-subtle { color: var(--tms-text-subtle) !important; }

/* ---------- Botões ---------- */
.btn { font-weight: 500; font-size: .875rem; border-radius: var(--tms-radius-sm); }

.btn-primary {
  --bs-btn-bg: var(--tms-primary);
  --bs-btn-border-color: var(--tms-primary);
  --bs-btn-hover-bg: var(--tms-primary-hover);
  --bs-btn-hover-border-color: var(--tms-primary-hover);
  --bs-btn-active-bg: var(--tms-primary-hover);
  --bs-btn-active-border-color: var(--tms-primary-hover);
  --bs-btn-disabled-bg: var(--tms-primary);
  --bs-btn-disabled-border-color: var(--tms-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--tms-primary);
  --bs-btn-border-color: var(--tms-primary);
  --bs-btn-hover-bg: var(--tms-primary);
  --bs-btn-hover-border-color: var(--tms-primary);
  --bs-btn-active-bg: var(--tms-primary);
}

.btn-light {
  --bs-btn-bg: var(--tms-surface);
  --bs-btn-border-color: var(--tms-border);
  --bs-btn-hover-bg: var(--tms-surface-muted);
  --bs-btn-hover-border-color: var(--tms-border);
  --bs-btn-color: var(--tms-text);
}

/* ---------- Formulários ---------- */
.form-label { font-size: .8125rem; font-weight: 500; margin-bottom: .35rem; }

.form-control,
.form-select {
  font-size: .875rem;
  border-color: var(--tms-border);
  border-radius: var(--tms-radius-sm);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tms-primary);
  box-shadow: 0 0 0 .2rem rgba(30, 58, 110, .12);
}

/* ---------- Dropdown / Modal / Tooltip ---------- */
.dropdown-menu {
  --bs-dropdown-font-size: .875rem;
  --bs-dropdown-border-color: var(--tms-border);
  --bs-dropdown-link-active-bg: var(--tms-primary-soft);
  --bs-dropdown-link-active-color: var(--tms-primary);
  --bs-dropdown-item-padding-y: .5rem;
  border-radius: var(--tms-radius);
  box-shadow: var(--tms-shadow);
}

.dropdown-item { display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--tms-text-muted); }
.dropdown-item.active i, .dropdown-item:active i { color: inherit; }

.modal-content { border: 0; border-radius: .75rem; box-shadow: 0 20px 48px rgba(16, 24, 40, .18); }
.modal-header, .modal-footer { border-color: var(--tms-border); padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }

.tooltip { --bs-tooltip-font-size: .75rem; --bs-tooltip-bg: #111827; }
