/* ═══════════════════════════════════════════════════════
   QRCode API — Vuexy / DrOnline Theme
   Bootstrap 5 + Montserrat + Feather Icons
   ═══════════════════════════════════════════════════════ */

:root {
  --primary: #6C5FEC;
  --primary-light: rgba(108, 95, 236, 0.12);
  --primary-dark: #5147B1;
  --success: #28C76F;
  --success-light: rgba(40, 199, 111, 0.12);
  --danger: #EA5455;
  --danger-light: rgba(234, 84, 85, 0.12);
  --warning: #FF9F43;
  --info: #00CFE8;
  --dark: #4B4B4B;
  --text-heading: #5E5873;
  --text-body: #6E6B7B;
  --text-muted: #B9B9C3;
  --border: #D8D6DE;
  --bg-light: #F8F8F8;
  --bg-card: #FFFFFF;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --radius: 0.428rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-body);
  background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}

.fw-normal  { font-weight: 400 !important; }
.fw-bold    { font-weight: 600 !important; }
.fw-bolder  { font-weight: 700 !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────── */
.app-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Navbar ─────────────────────────────────────────── */
.navbar-custom {
  background: var(--bg-card);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.navbar-brand img {
  width: 180px;
  height: auto;
}

.navbar-brand span {
  font-size: 1.286rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.01rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s ease;
}

.card-header {
  padding: 1.5rem 1.5rem 0;
  background: transparent;
  border-bottom: none;
}

.card-body { padding: 1.5rem; }

.card-title {
  font-size: 1.286rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 0.857rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.786rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(108, 95, 236, 0.4);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-flat-primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: transparent;
}

.btn-flat-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-flat-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: transparent;
}

.btn-flat-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-flat-success {
  background: var(--success-light);
  color: var(--success);
  border-color: transparent;
}

.btn-sm {
  padding: 0.486rem 1rem;
  font-size: 0.857rem;
}

.btn-block { width: 100%; }

/* ─── Forms ──────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.857rem;
  font-weight: 400;
  color: var(--text-heading);
  margin-bottom: 0.2857rem;
}

.form-control {
  display: block;
  width: 100%;
  height: 2.142rem;
  padding: 0.188rem 0.857rem;
  font-family: inherit;
  font-size: 0.857rem;
  font-weight: 400;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.45;
}

.form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 3px 10px rgba(108, 95, 236, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: auto;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.form-group { margin-bottom: 1rem; }

/* Validation states (onChange) */
.form-control.is-valid,
.custom-select.is-valid {
  border-color: var(--success);
}

.form-control.is-valid:focus {
  box-shadow: 0 3px 10px rgba(40, 199, 111, 0.1);
}

.form-control.is-invalid,
.custom-select.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 3px 10px rgba(234, 84, 85, 0.1);
}

.invalid-feedback {
  display: none;
  font-size: 0.786rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

.is-invalid ~ .invalid-feedback {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.input-group {
  position: relative;
  display: flex;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Password toggle */
.input-password {
  position: relative;
}

.input-password .form-control {
  padding-right: 2.5rem;
}

.input-password .toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
}

.input-password .toggle-password:hover {
  color: var(--text-heading);
}

/* ─── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 0.72rem 1rem;
  font-size: 0.857rem;
  font-weight: 600;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #F3F2F7;
  border-top: 1px solid #EBE9F1;
  border-bottom: 1px solid #EBE9F1;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 0.72rem 1rem;
  font-size: 12px;
  color: var(--text-body);
  border-bottom: 1px solid #EBE9F1;
  vertical-align: middle;
}

td.td-ellipsis {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:hover td {
  background: rgba(108, 95, 236, 0.02);
}

/* ─── Badges / Pills ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  font-size: 0.786rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.badge-light-primary { background: var(--primary-light); color: var(--primary); }
.badge-light-success { background: var(--success-light); color: var(--success); }
.badge-light-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-light-warning { background: rgba(255, 159, 67, 0.12); color: var(--warning); }
.badge-light-info    { background: rgba(0, 207, 232, 0.12);  color: var(--info);    }
.badge-light-secondary { background: rgba(130, 134, 139, 0.12); color: #82868b; }

.badge-success { background: var(--success); color: #fff; }
.badge-danger  { background: var(--danger);  color: #fff; }
.badge-primary { background: var(--primary); color: #fff; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.786rem;
  font-weight: 600;
}

.status-pill.active   { background: var(--success); color: #fff; }
.status-pill.inactive { background: var(--danger-light);  color: var(--danger);  }
.status-pill.expired  { background: var(--danger-light);  color: var(--danger);  }

/* ─── Icon Buttons (Rounded Circle, Ripple) ──────────── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0.4rem;
  border: 1px solid transparent;
  border-radius: 50% !important;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  position: relative;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  line-height: 0.5;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  background-color: transparent;
  box-shadow: none;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
  flex-shrink: 0;
}

.btn-icon.btn-flat-dark {
  color: var(--dark);
}

.btn-icon.btn-flat-dark:hover {
  background: rgba(75, 75, 75, 0.12);
}

.btn-icon.btn-flat-danger {
  color: var(--danger);
}

.btn-icon.btn-flat-danger:hover {
  background: var(--danger-light);
}

.btn-icon.btn-flat-success {
  color: var(--success);
}

.btn-icon.btn-flat-success:hover {
  background: var(--success-light);
}

.btn-icon.btn-flat-primary {
  color: var(--primary);
}

.btn-icon.btn-flat-primary:hover {
  background: var(--primary-light);
}

.btn-icon.btn-flat-info {
  color: var(--info);
}

.btn-icon.btn-flat-info:hover {
  background: rgba(0, 207, 232, 0.12);
}

/* Ripple effect */
.btn-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.btn-icon:active::after {
  opacity: 0.15;
  transform: scale(2.5);
  transition: 0s;
}

/* Tooltip for icon buttons */
.btn-icon[title] {
  position: relative;
}

.btn-icon[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.btn-icon[data-tooltip]:hover::before {
  opacity: 1;
}

/* ─── Stats Cards ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.857rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ─── KPI row ────────────────────────────────────────── */
.kpi { font-size: 2rem; font-weight: 700; color: var(--primary); }

/* ─── Notices / Alerts ───────────────────────────────── */
.notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.857rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.notice.notice-success {
  background: var(--success-light);
  color: #1B7A43;
}

.notice.notice-danger {
  background: var(--danger-light);
  color: #A02E2F;
}

/* ─── Copy / Clipboard ──────────────────────────────── */
.copy-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  color: var(--text-heading);
  font: inherit;
  font-size: 0.857rem;
  cursor: pointer;
  text-align: left;
}

.copy-trigger:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.copy-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
  font-size: 0.786rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.copy-trigger:hover::after,
.copy-trigger.is-copied::after {
  opacity: 1;
}

.copy-trigger img {
  display: block;
  width: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.copy-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Secret Panel ───────────────────────────────────── */
.secret-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
}

/* ─── Code Block ─────────────────────────────────────── */
.code-block {
  background: #283046;
  color: #D0D2D6;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: 0.857rem;
}

code {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: 0.857rem;
  padding: 0.15rem 0.4rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 0.25rem;
}

/* ─── Preview QR ─────────────────────────────────────── */
.preview-qr {
  width: 400px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ─── Grid ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid .card { margin-bottom: 0; }
.grid { margin-bottom: 1.5rem; }

/* ─── Actions / Toolbar ──────────────────────────────── */
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Table Filters ──────────────────────────────────── */
.table-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ─── Telas de autenticação ──────────────────────────────
   Réplica do layout de login do painel.dronline (Vuexy
   auth-basic). As medidas estão em px porque a raiz do
   painel é 14px e a daqui é 16px — em rem os valores não
   bateriam. Todos foram lidos dos estilos computados da
   tela em execução, não estimados.
   ─────────────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 0 21px;
  overflow: hidden;
  /* sem background aqui: a forma decorativa de baixo usa z-index -1 e
     ficaria escondida atrás dele. O cinza vem do body. */
  font-family: 'Montserrat', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.14px;
  color: var(--text-body);
}

.auth-col {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 992px) {
  .auth-col { width: 50%; }
}

@media (min-width: 1200px) {
  .auth-col { width: 41.666667%; }
}

.auth-inner {
  position: relative;
  width: 100%;
  margin: 21px 0;
}

/* Formas decorativas atrás do card (as mesmas imagens do painel) */
.auth-inner::before,
.auth-inner::after {
  content: ' ';
  position: absolute;
  background-repeat: no-repeat;
}

.auth-inner::before {
  width: 244px;
  height: 243px;
  top: -54px;
  left: -46px;
  background-image: url('/assets/auth-shape-top.png');
}

.auth-inner::after {
  width: 272px;
  height: 272px;
  bottom: -55px;
  right: -75px;
  z-index: -1;
  background-image: url('/assets/auth-shape-bottom.png');
}

@media (max-width: 575.98px) {
  .auth-inner::before,
  .auth-inner::after { display: none; }
}

.auth-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 6px;
  box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
  padding: 56px 96px 72px;
}

/* ─── Logo ───────────────────────────────────────────── */
/* O viewBox do SVG é 375x375 e o desenho ocupa só
   298.07x101.51 a partir de (37.70, 138.14). O quadro abaixo
   recorta essa sobra para a logo sair com os mesmos 150px de
   largura que a do painel. */
.brand-logo {
  display: flex;
  justify-content: center;
  margin: 14px 0 28px;
}

.brand-logo-frame {
  position: relative;
  display: block;
  width: 150px;
  max-width: 100%;
  aspect-ratio: 298.0677 / 101.5078;
  overflow: hidden;
}

.brand-logo-frame img {
  position: absolute;
  top: -136.0916%;
  left: -12.6471%;
  width: 125.8107%;
  height: auto;
  max-width: none;
}

/* ─── Cabeçalho ──────────────────────────────────────── */
.auth-head { margin-bottom: 21px; }

.auth-title {
  margin: 0 0 7px;
  font-size: calc(18.55px + 0.9vw);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-heading);
  text-align: center;
}

@media (min-width: 1200px) {
  .auth-title { font-size: 28px; }
}

.auth-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-body);
  text-align: center;
}

/* ─── Formulário ─────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.auth-field { margin-bottom: 14px; }
.auth-field.auth-field-end { margin-bottom: 21px; }

.auth-wrapper .form-label {
  display: inline-block;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-heading);
}

.auth-wrapper .input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.auth-wrapper .input-group-text {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-body);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.auth-wrapper .input-group .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  height: auto;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-body);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.auth-wrapper .input-group .form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
  z-index: 2;
}

.auth-wrapper .form-control::placeholder { color: var(--text-muted); }

.auth-wrapper .input-group > :not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.auth-wrapper .input-group > :not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.auth-wrapper button.input-group-text {
  cursor: pointer;
  font-family: inherit;
}

.auth-wrapper button.input-group-text:hover { color: var(--text-heading); }

/* ─── Lembrar / Esqueceu a senha ─────────────────────── */
.auth-options {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 21px;
}

.auth-options p { margin: 0 0 14px; }

.auth-options .link {
  display: flex;
  width: fit-content;
  color: var(--primary);
  text-decoration: none;
}

.auth-options .link:hover { text-decoration: underline; }

.auth-options small {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.75;
}

/* ─── Botão ──────────────────────────────────────────── */
.auth-wrapper .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 20px;
  padding: 11px 21px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-wrapper .btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 8px 25px -8px var(--primary);
}

/* ─── Rodapé e avisos ────────────────────────────────── */
.auth-footnote {
  margin: 21px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  text-align: center;
}

.auth-back {
  margin: 21px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.75;
  text-align: center;
}

.auth-back a { color: var(--primary); text-decoration: none; }
.auth-back a:hover { text-decoration: underline; }

.auth-card .notice {
  margin-bottom: 0;
  font-size: 12px;
}

/* ─── Inline Options ─────────────────────────────────── */
.inline-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.857rem;
  font-weight: 500;
}

.inline-option input { width: auto; margin: 0; }

/* ─── Divider ────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 0.857rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 41, 47, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #EBE9F1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
}

/* ─── Tags ───────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.786rem;
  font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 720px) {
  .navbar-custom { flex-wrap: wrap; gap: 0.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Utilities ──────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-body    { color: var(--text-body) !important; }
.text-center  { text-align: center; }
.text-small   { font-size: 0.857rem; }
.fw-bold      { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.small  { font-size: 0.857rem; }

/* ─── DataTable Overrides ────────────────────────────── */
.datatable-wrapper .datatable-top,
.datatable-wrapper .datatable-bottom {
  font-family: 'Montserrat', Helvetica, Arial, sans-serif;
  font-size: 0.857rem;
  color: var(--text-body);
}

.datatable-wrapper .datatable-input {
  padding: 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.857rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-body);
}

.datatable-wrapper .datatable-input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 3px 10px rgba(108, 95, 236, 0.1);
}

.datatable-wrapper .datatable-selector {
  font-family: inherit;
  font-size: 0.857rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
}

.datatable-wrapper .datatable-pagination .datatable-active a,
.datatable-wrapper .datatable-pagination .datatable-active button {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.datatable-wrapper .datatable-sorter::before {
  border-bottom-color: var(--text-muted) !important;
}

.datatable-wrapper .datatable-sorter::after {
  border-top-color: var(--text-muted) !important;
}

.datatable-wrapper table thead th {
  background-color: #F3F2F7 !important;
  border-top: 1px solid #EBE9F1 !important;
  border-bottom: 1px solid #EBE9F1 !important;
}

/* ─── Custom Select (React Select style) ────────────── */
.custom-select-wrapper {
  position: relative;
}

.custom-select {
  display: flex;
  align-items: center;
  width: 100%;
  height: 2.142rem;
  padding: 0.188rem 2rem 0.188rem 0.857rem;
  font-family: inherit;
  font-size: 0.857rem;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E6B7B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.custom-select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 3px 10px rgba(108, 95, 236, 0.1);
}

.custom-select:hover {
  border-color: #B9B9C3;
}

/* ─── Flatpickr Inline Style ─────────────────────────── */
.flatpickr-wrapper {
  position: relative;
  width: 100%;
}

.flatpickr-input {
  display: block;
  width: 100%;
  height: 2.142rem;
  padding: 0.188rem 0.857rem;
  font-family: inherit;
  font-size: 0.857rem;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.flatpickr-input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 3px 10px rgba(108, 95, 236, 0.1);
}

/* Flatpickr calendar overrides */
.flatpickr-calendar {
  font-family: 'Montserrat', Helvetica, Arial, sans-serif !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border) !important;
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.flatpickr-calendar .flatpickr-day:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary-light) !important;
}

.flatpickr-calendar .flatpickr-months .flatpickr-month {
  color: var(--text-heading) !important;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
  font-weight: 600 !important;
}

.flatpickr-calendar .flatpickr-weekday {
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  font-size: 0.786rem !important;
}

.flatpickr-calendar .flatpickr-day.today:not(.selected) {
  border-color: var(--primary) !important;
}

.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
  color: var(--text-heading) !important;
  fill: var(--text-heading) !important;
}
