/*
 * app/assets/css/app.css
 * Camada de design moderno que substitui o Bootstrap CSS.
 * Reimplementa as classes usadas nas telas (btn, card, table, form-control,
 * modal, alert, badge, pagination, grid row/col, utilitários de espaçamento
 * etc.) com um visual mais moderno (cantos arredondados, sombras suaves,
 * paleta atualizada), SEM exigir alterar o HTML de cada módulo.
 * Utilitários do Tailwind (via CDN) continuam disponíveis para qualquer
 * markup novo.
 */

:root {
  --c-primary: #4f46e5;
  --c-primary-dark: #4338ca;
  --c-primary-light: #eef2ff;
  --c-secondary: #64748b;
  --c-success: #16a34a;
  --c-success-light: #dcfce7;
  --c-danger: #dc2626;
  --c-danger-light: #fee2e2;
  --c-warning: #d97706;
  --c-warning-light: #fef3c7;
  --c-info: #0891b2;
  --c-info-light: #cffafe;
  --c-dark: #111827;
  --c-light: #f8fafc;
  --c-border: #e2e8f0;
  --c-text: #1e293b;
  --c-text-muted: #64748b;
  --radius: 0.65rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 1px 3px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 4px 14px -2px rgb(15 23 42 / 0.08), 0 2px 6px -2px rgb(15 23 42 / 0.05);
  --shadow-lg: 0 12px 28px -6px rgb(15 23 42 / 0.16), 0 6px 12px -6px rgb(15 23 42 / 0.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

/* Estrutura moderna compartilhada por todos os módulos */
.app-topbar {
  min-height: 82px; padding: 1rem 2rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; background: rgb(255 255 255 / .88);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 1020;
}
.app-topbar h1 { margin: .15rem 0 0; font-size: 1.18rem; font-weight: 750; letter-spacing: -.02em; }
.app-eyebrow { color: var(--c-text-muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.app-topbar-actions { display: flex; align-items: center; gap: .75rem; }
.app-status { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .75rem; border: 1px solid #dcfce7; border-radius: 999px; background: #f0fdf4; color: #15803d; font-size: .76rem; font-weight: 700; }
.app-profile-link { width: 2.55rem; height: 2.55rem; display: grid; place-items: center; border-radius: 999px; color: white; text-decoration: none; font-weight: 800; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 8px 20px rgb(79 70 229 / .24); }
.app-content { max-width: 1680px; margin-inline: auto; }

/* Acabamento transversal das telas legadas */
.card { border: 1px solid rgb(226 232 240 / .85); border-radius: 1rem; box-shadow: 0 10px 30px -18px rgb(15 23 42 / .28); }
.card-header { background: linear-gradient(180deg, #fff, #fbfcff); }
.table-responsive { border-radius: .8rem; border: 1px solid var(--c-border); }
.table-responsive .table { margin-bottom: 0; }
.form-control, .form-select { min-height: 2.65rem; border-radius: .65rem; background-color: #fff; transition: border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgb(99 102 241 / .13); }
.btn { min-height: 2.45rem; border-radius: .65rem; }
.btn-primary { background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 8px 18px -10px rgb(79 70 229 / .8); }

@media (max-width: 767.98px) {
  .app-topbar { min-height: 68px; padding: .75rem 1rem .75rem 4rem; }
  .app-status, .app-eyebrow { display: none; }
  .app-topbar h1 { font-size: 1rem; }
  .app-content { padding-inline: .35rem; }
}

a { color: var(--c-primary); }

/* Links do menu lateral nunca recebem sublinhado, inclusive no hover/foco. */
#sidebar a,
#sidebar a:hover,
#sidebar a:focus,
#sidebar a:active,
#sidebar .nav-link,
#sidebar .nav-subitem {
  text-decoration: none !important;
}

h1, h2, h3, h4, h5, h6 { color: var(--c-dark); font-weight: 600; }

small, .small { font-size: .85rem; }

/* ---------- Layout / Grid (compatível com Bootstrap row/col) ---------- */
.container, .container-fluid {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}
.container { max-width: 1140px; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -0.5rem;
}
.row > * { padding-inline: 0.5rem; }

.row.g-1 { row-gap: .25rem; } .row.g-1 > * { padding-inline: .25rem; }
.row.g-2 { row-gap: .5rem; } .row.g-2 > * { padding-inline: .5rem; }
.row.g-3 { row-gap: 1rem; }
.row.g-4 { row-gap: 1.5rem; }

[class^="col"], [class*=" col"] { flex: 1 0 0%; width: 100%; max-width: 100%; }

/* No Bootstrap, colunas numeradas possuem largura fixa no grid de 12 colunas.
   Sem este reset o flex-grow fazia col-md-3, col-md-4 e col-md-6 ficarem iguais. */
[class^="col-"], [class*=" col-"] { flex: 0 0 auto; }

.col-auto { flex: 0 0 auto; width: auto; }
.col-12 { width: 100%; }
.col-11 { width: 91.6667%; }
.col-10 { width: 83.3333%; }
.col-9  { width: 75%; }
.col-8  { width: 66.6667%; }
.col-7  { width: 58.3333%; }
.col-6  { width: 50%; }
.col-5  { width: 41.6667%; }
.col-4  { width: 33.3333%; }
.col-3  { width: 25%; }
.col-2  { width: 16.6667%; }
.col-1  { width: 8.3333%; }

.row-cols-1 > * { flex: 0 0 auto; width: 100%; }
.row-cols-2 > * { flex: 0 0 auto; width: 50%; }
.row-cols-3 > * { flex: 0 0 auto; width: 33.3333%; }
.row-cols-4 > * { flex: 0 0 auto; width: 25%; }

@media (min-width: 576px) {
  .col-sm-auto { flex: 0 0 auto; width: auto; }
  .col-sm-11 { width: 91.6667%; } .col-sm-10 { width: 83.3333%; }
  .col-sm-12 { width: 100%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.6667%; }
  .col-sm-7 { width: 58.3333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.6667%; }
  .col-sm-4 { width: 33.3333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.6667%; } .col-sm-1 { width: 8.3333%; }
  .row-cols-sm-1 > * { flex: 0 0 auto; width: 100%; }
  .row-cols-sm-2 > * { flex: 0 0 auto; width: 50%; }
  .row-cols-sm-3 > * { flex: 0 0 auto; width: 33.3333%; }
  .row-cols-sm-4 > * { flex: 0 0 auto; width: 25%; }
}
@media (min-width: 768px) {
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-11 { width: 91.6667%; }
  .col-md-12 { width: 100%; } .col-md-10 { width: 83.3333%; } .col-md-9 { width: 75%; }
  .col-md-8 { width: 66.6667%; } .col-md-6 { width: 50%; } .col-md-4 { width: 33.3333%; }
  .col-md-3 { width: 25%; } .col-md-2 { width: 16.6667%; } .col-md-1 { width: 8.3333%; }
  .col-md-5 { width: 41.6667%; } .col-md-7 { width: 58.3333%; }
  .row-cols-md-1 > * { flex: 0 0 auto; width: 100%; }
  .row-cols-md-2 > * { flex: 0 0 auto; width: 50%; }
  .row-cols-md-3 > * { flex: 0 0 auto; width: 33.3333%; }
  .row-cols-md-4 > * { flex: 0 0 auto; width: 25%; }
}
@media (min-width: 992px) {
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.6667%; } .col-lg-10 { width: 83.3333%; }
  .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.6667%; } .col-lg-7 { width: 58.3333%; }
  .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.6667%; } .col-lg-4 { width: 33.3333%; }
  .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.6667%; } .col-lg-1 { width: 8.3333%; }
}
@media (min-width: 1200px) {
  .col-xl-auto { flex: 0 0 auto; width: auto; }
  .col-xl-12 { width: 100%; } .col-xl-11 { width: 91.6667%; } .col-xl-10 { width: 83.3333%; }
  .col-xl-9 { width: 75%; } .col-xl-8 { width: 66.6667%; } .col-xl-7 { width: 58.3333%; }
  .col-xl-6 { width: 50%; } .col-xl-5 { width: 41.6667%; } .col-xl-4 { width: 33.3333%; }
  .col-xl-3 { width: 25%; } .col-xl-2 { width: 16.6667%; } .col-xl-1 { width: 8.3333%; }
}

/* ---------- Display / Flex utilities ---------- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; gap: .5rem; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-fill { flex: 1 1 auto !important; }
.flex-grow-0 { flex-grow: 0 !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-shrink-1 { flex-shrink: 1 !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }
.align-self-center { align-self: center !important; }
.align-self-stretch { align-self: stretch !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-middle { vertical-align: middle !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

@media (min-width: 768px) {
  .d-md-flex { display: flex !important; }
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
}

/* ---------- Spacing utilities ---------- */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; } .mt-4 { margin-top: 1.5rem !important; } .mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; } .mb-5 { margin-bottom: 3rem !important; }
.ms-1 { margin-left: .25rem !important; } .ms-2 { margin-left: .5rem !important; } .ms-3 { margin-left: 1rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; } .me-2 { margin-right: .5rem !important; } .me-3 { margin-right: 1rem !important; }
.me-auto { margin-right: auto !important; }
.mx-auto { margin-inline: auto !important; }
.my-2 { margin-block: .5rem !important; } .my-3 { margin-block: 1rem !important; }

.p-0 { padding: 0 !important; } .p-1 { padding: .25rem !important; } .p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; } .p-4 { padding: 1.5rem !important; }
.pt-2 { padding-top: .5rem !important; } .pt-3 { padding-top: 1rem !important; }
.pb-2 { padding-bottom: .5rem !important; } .pb-3 { padding-bottom: 1rem !important; }
.py-1 { padding-block: .25rem !important; } .py-2 { padding-block: .5rem !important; } .py-3 { padding-block: 1rem !important; }
.px-2 { padding-inline: .5rem !important; } .px-3 { padding-inline: 1rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.img-fluid { max-width: 100%; height: auto; }
.img-thumbnail { max-width: 100%; height: auto; padding: .25rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.float-end { float: right !important; }
.float-start { float: left !important; }

/* ---------- Texto ---------- */
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-break { overflow-wrap: break-word !important; word-break: break-word !important; }
.text-decoration-none { text-decoration: none !important; }
.text-uppercase { text-transform: uppercase !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fst-italic { font-style: italic !important; }
.text-muted { color: var(--c-text-muted) !important; }
.text-white { color: #fff !important; }
.text-white-50 { color: rgb(255 255 255 / .6) !important; }
.text-dark { color: var(--c-dark) !important; }
.text-primary { color: var(--c-primary) !important; }
.text-success { color: var(--c-success) !important; }
.text-danger { color: var(--c-danger) !important; }
.text-warning { color: var(--c-warning) !important; }
.text-info { color: var(--c-info) !important; }
.link-bold { font-weight: 600; text-decoration: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.4;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  background: var(--c-light);
  color: var(--c-text);
}
.btn:hover { filter: brightness(0.97); text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; border-radius: .5rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }

.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgb(79 70 229 / .25); }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-secondary { background: var(--c-secondary); border-color: var(--c-secondary); color: #fff; }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-warning { background: var(--c-warning); border-color: var(--c-warning); color: #fff; }
.btn-info { background: var(--c-info); border-color: var(--c-info); color: #fff; }
.btn-dark { background: var(--c-dark); border-color: var(--c-dark); color: #fff; }
.btn-light { background: #fff; border-color: var(--c-border); color: var(--c-text); }

.btn-outline-primary { background: transparent; border-color: var(--c-primary); color: var(--c-primary); }
.btn-outline-primary:hover { background: var(--c-primary-light); }
.btn-outline-secondary { background: transparent; border-color: var(--c-border); color: var(--c-secondary); }
.btn-outline-secondary:hover { background: var(--c-light); }
.btn-outline-success { background: transparent; border-color: var(--c-success); color: var(--c-success); }
.btn-outline-success:hover { background: var(--c-success-light); }
.btn-outline-danger { background: transparent; border-color: var(--c-danger); color: var(--c-danger); }
.btn-outline-danger:hover { background: var(--c-danger-light); }
.btn-outline-warning { background: transparent; border-color: var(--c-warning); color: var(--c-warning); }
.btn-outline-info { background: transparent; border-color: var(--c-info); color: var(--c-info); }
.btn-outline-light { background: transparent; border-color: rgb(255 255 255 / .25); color: #fff; }
.btn-outline-light:hover { background: rgb(255 255 255 / .12); }
.btn-outline-dark { background: transparent; border-color: var(--c-dark); color: var(--c-dark); }
.btn-close {
  width: 1.4rem; height: 1.4rem; border: none; background: transparent; opacity: .6;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit;
}
.btn-close:hover { opacity: 1; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.btn-group > .btn:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; display: inline-block; color: var(--c-text); }
.form-text { font-size: .8rem; color: var(--c-text-muted); }
.form-control, .form-select {
  display: block;
  width: 100%;
  padding: .55rem .8rem;
  font-size: .9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgb(79 70 229 / .15);
}
.form-control[disabled], .form-control:disabled, .form-control-sm:disabled { background: var(--c-light); opacity: .75; }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; font-size: .82rem; border-radius: .5rem; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check-input { width: 1.05rem; height: 1.05rem; accent-color: var(--c-primary); }
.form-check-label { font-size: .88rem; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { border-radius: 0; flex: 1 1 auto; min-width: 0; }
.input-group > .form-control:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.input-group > .form-control:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.input-group-text {
  display: flex; align-items: center; padding: .5rem .8rem; background: var(--c-light);
  border: 1px solid var(--c-border); font-size: .85rem; color: var(--c-text-muted);
}
.input-group-text:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.input-group-text:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  position: relative;
}
.card-body { padding: 1.25rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--c-border); font-weight: 600; background: transparent; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--c-border); }
.card-title { font-weight: 700; margin-bottom: .5rem; }
dl.row { margin-top: 0; margin-bottom: 0; }
dl.row > dt, dl.row > dd { margin-bottom: .75rem; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.border { border: 1px solid var(--c-border) !important; }
.border-0 { border: none !important; }
.rounded { border-radius: var(--radius) !important; }
.rounded-circle { border-radius: 50% !important; }
.border-primary { border-color: var(--c-primary) !important; border-left-width: 4px !important; }
.border-success { border-color: var(--c-success) !important; border-left-width: 4px !important; }
.border-danger { border-color: var(--c-danger) !important; border-left-width: 4px !important; }
.border-warning { border-color: var(--c-warning) !important; border-left-width: 4px !important; }
.border-info { border-color: var(--c-info) !important; border-left-width: 4px !important; }
.border-secondary { border-color: var(--c-secondary) !important; border-left-width: 4px !important; }
.border-dark { border-color: var(--c-dark) !important; border-left-width: 4px !important; }

.stretched-link::after { position: absolute; inset: 0; z-index: 1; content: ""; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: .65rem .75rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table thead th { font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; border-bottom: 2px solid var(--c-border); }
.table-sm th, .table-sm td { padding: .4rem .6rem; }
.table-hover tbody tr:hover { background: var(--c-light); }
.table-striped tbody tr:nth-of-type(odd) { background: rgb(248 250 252 / .6); }
.table-bordered th, .table-bordered td { border: 1px solid var(--c-border); }
.table-light, thead.table-light th { background: var(--c-light); }
.table-danger { background: var(--c-danger-light) !important; }
.table-warning { background: var(--c-warning-light) !important; }
.table-success { background: var(--c-success-light) !important; }
.table-info { background: var(--c-info-light) !important; }

/* Destaque para o evento/aniversário do dia (fundo escuro, texto branco, bem visível) */
.table-today, .table-today > * { background: #b91c1c !important; color: #fff !important; font-weight: 600; }
.table-today:hover { background: #991b1b !important; }

/* ---------- Badges / Alerts ---------- */
.badge {
  display: inline-flex; align-items: center; padding: .3rem .55rem; border-radius: .4rem;
  font-size: .72rem; font-weight: 700; background: var(--c-secondary); color: #fff;
}
.badge.bg-primary { background: var(--c-primary) !important; }
.badge.bg-success { background: var(--c-success) !important; }
.badge.bg-danger { background: var(--c-danger) !important; }
.badge.bg-warning { background: var(--c-warning) !important; color: #1f2937 !important; }
.badge.bg-info { background: var(--c-info) !important; }
.badge.bg-secondary { background: var(--c-secondary) !important; }
.badge.bg-dark { background: var(--c-dark) !important; }
.badge.bg-light { background: var(--c-light) !important; color: var(--c-text) !important; }

.alert { padding: .85rem 1.1rem; border-radius: var(--radius); border: 1px solid transparent; margin-bottom: 1rem; font-size: .88rem; }
.alert-primary { background: var(--c-primary-light); color: var(--c-primary-dark); border-color: #c7d2fe; }
.alert-success { background: var(--c-success-light); color: #166534; border-color: #bbf7d0; }
.alert-danger { background: var(--c-danger-light); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--c-warning-light); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--c-info-light); color: #155e75; border-color: #a5f3fc; }

/* ---------- Bg utilities ---------- */
.bg-primary { background: var(--c-primary) !important; }
.bg-light { background: var(--c-light) !important; }
.bg-white { background: #fff !important; }
.bg-dark { background: var(--c-dark) !important; }

/* ---------- Nav / Tabs ---------- */
.nav { display: flex; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.nav-item { display: block; }
.nav-tabs { border-bottom: 1px solid var(--c-border); gap: .25rem; }
.nav-tabs .nav-link {
  border: 1px solid transparent; border-radius: var(--radius) var(--radius) 0 0; padding: .55rem 1rem;
  color: var(--c-text-muted); font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.nav-tabs .nav-link.active { color: var(--c-primary); border-color: var(--c-border); border-bottom-color: #fff; background: #fff; }
.tab-content > .tab-pane { display: none; }
.tab-content > .active { display: block; }

/* ---------- Breadcrumb / Pagination ---------- */
.breadcrumb { display: flex; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .85rem; gap: .35rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; margin-right: .35rem; color: var(--c-text-muted); }

.pagination { display: flex; list-style: none; padding: 0; margin: 0; gap: .25rem; flex-wrap: wrap; }
.page-item .page-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem;
  padding: 0 .5rem; border: 1px solid var(--c-border); border-radius: .5rem; color: var(--c-text);
  text-decoration: none; font-size: .85rem; font-weight: 600;
}
.page-item .page-link:hover { background: var(--c-light); }
.page-item.active .page-link { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.page-item.disabled .page-link { opacity: .45; pointer-events: none; }
.pagination-sm .page-link { min-width: 1.9rem; height: 1.9rem; font-size: .78rem; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 1055; display: none; overflow-y: auto;
  outline: 0;
}
.modal.show { display: block; }
.modal-dialog {
  margin: 2.5rem auto; max-width: 500px; width: calc(100% - 2rem);
  transform: translateY(-10px); opacity: 0; transition: all .15s ease;
}
.modal.show .modal-dialog { transform: translateY(0); opacity: 1; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 5rem); }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1100px; }
.modal-sm { max-width: 360px; }
.modal-content { background: #fff; border-radius: 1rem; box-shadow: var(--shadow-lg); border: none; overflow: hidden; width: 100%; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--c-border); }
.modal-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.modal-body { padding: 1.4rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.4rem; border-top: 1px solid var(--c-border); }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgb(15 23 42 / .55); }
body.modal-open { overflow: hidden; }

/* ---------- Collapse / Dropdown ---------- */
.collapse { display: none; }
.collapse.show { display: block; }
.collapsing { overflow: hidden; transition: height .2s ease; }

.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; z-index: 1060; min-width: 11rem; margin-top: .35rem;
  padding: .4rem; background: #fff; border: 1px solid var(--c-border); border-radius: .6rem; box-shadow: var(--shadow);
  list-style: none; left: 0;
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }

/* Na listagem de pessoas, o menu abre ao lado direito do botão de ações. */
.person-actions-menu {
  top: 0;
  left: calc(100% + .5rem);
  right: auto;
  margin-top: 0;
  min-width: 15rem;
}

/* Mesmo padrão para os menus de ações de todas as tabelas do sistema. */
.table-responsive .dropdown-menu,
.table .dropdown-menu {
  top: 0;
  left: calc(100% + .5rem);
  right: auto;
  margin-top: 0;
  min-width: 15rem;
}
.dropdown-item {
  display: block; width: 100%; padding: .5rem .7rem; border-radius: .4rem; font-size: .86rem;
  color: var(--c-text); text-decoration: none; border: none; background: none; text-align: left; cursor: pointer;
}
.dropdown-item:hover { background: var(--c-light); }
.dropdown-divider { height: 1px; background: var(--c-border); margin: .35rem 0; border: none; }

/* ---------- Tooltip ---------- */
.app-tooltip {
  position: absolute; z-index: 1080; padding: .35rem .6rem; font-size: .75rem; color: #fff;
  background: var(--c-dark); border-radius: .4rem; pointer-events: none; opacity: 0; transition: opacity .12s ease;
  max-width: 220px;
}
.app-tooltip.show { opacity: 1; }

/* ---------- Spinner ---------- */
.spinner-border {
  display: inline-block; width: 1.4rem; height: 1.4rem; border: .2em solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: app-spin .65s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .15em; }
@keyframes app-spin { to { transform: rotate(360deg); } }

/* ---------- Misc ---------- */
.list-group { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); }
.list-group-item { padding: .7rem 1rem; border-bottom: 1px solid var(--c-border); background: #fff; }
.list-group-item:last-child { border-bottom: none; }
.list-group-item.active { background: var(--c-primary); color: #fff; }
.list-group-item-action:hover { background: var(--c-light); cursor: pointer; }

hr { border: none; border-top: 1px solid var(--c-border); }

/* fade transition helper used alongside .show */
.fade { transition: opacity .15s linear; opacity: 0; }
.fade.show { opacity: 1; }
