/* ========================================================== */
/* VARIÁVEIS E GERAL */
/* ========================================================== */
:host {
  --brand: #E33DCF; 
  --blue: #030FAA; 
  --text: #111214; 
  --muted: rgba(17, 18, 20, 0.65); 
  --surface-soft: rgba(255, 255, 255, 0.7);
  --surface-hover: rgba(255, 255, 255, 0.94);
  --focus-ring: 0 0 0 3px rgba(227, 61, 207, 0.16);
  
  --success-bg: rgba(25, 135, 84, 0.1);
  --success-text: #198754;
  --warn-bg: rgba(255, 193, 7, 0.15);
  --warn-text: #b58100;
  --danger-bg: rgba(220, 53, 69, 0.1);
  --danger-text: #dc3545;
  
  --radius-xl: 22px;
  --radius-lg: 16px;
  --shadow-card: 0 22px 46px rgba(17, 18, 20, 0.10);
  --glass-bg: rgba(255, 255, 255, 0.86);
  --glass-border: 1px solid rgba(227, 61, 207, 0.16);

  display: block;
  font-family: 'Inter', sans-serif;
  color: var(--text);
}

.vigencia-page {
  min-height: 100vh;
  padding: 0 12px;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-y: auto;
  
  /* Blobs de fundo (Estilo Mureg) */
  background: radial-gradient(900px 420px at 20% 10%, rgba(227, 61, 207, 0.14), transparent 60%),
              radial-gradient(820px 380px at 80% 30%, rgba(227, 61, 207, 0.08), transparent 60%),
              linear-gradient(180deg, #ffffff 0%, #f5f5f7 70%);

  .page-blob {
    position: fixed; pointer-events: none; border-radius: 999px; 
    filter: blur(34px); opacity: 0.55; z-index: 0;
    background: radial-gradient(circle at 30% 30%, rgba(227,61,207,0.55), rgba(227,61,207,0.06));
    animation: floaty 10s ease-in-out infinite;
  }
  .blob-1 { width: 420px; height: 420px; top: -140px; left: -140px; }
  .blob-2 { width: 520px; height: 520px; top: -220px; right: -240px; animation-duration: 12s; }
  .blob-3 { width: 360px; height: 360px; bottom: -180px; left: 25%; animation-duration: 14s; }
}

@keyframes floaty {
  0%    { transform: translate(0, 0) scale(1); }
  50%   { transform: translate(18px, 10px) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

.container-geral-responsive {
  width: 100%; max-width: 1280px; position: relative; z-index: 1; margin-top: 40px; margin-bottom: 100px;
}

.geral-card {
  border-radius: var(--radius-xl); overflow: hidden; background: var(--glass-bg);
  border: var(--glass-border); backdrop-filter: blur(12px); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; min-height: 80vh;
}

/* HEADER */
.geral-header {
  padding: 16px 24px; border-bottom: 1px solid rgba(17, 18, 20, 0.06);
  background: linear-gradient(180deg, rgba(227,61,207,0.06), rgba(255,255,255,0.2));
}

.header-row-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.title-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(227, 61, 207, 0.22); font-size: 13px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(17, 18, 20, 0.06);
  i { color: var(--brand); }
}

.header-title { text-align: center; }
.title { font-size: 1.5rem; font-weight: 950; margin: 0; letter-spacing: -0.5px; }
.subtitle { color: var(--muted); font-weight: 700; }
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
    min-height: 38px;
    border-width: 1px;
  }
}

/* KPIs */
.mureg-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(158px, 205px));
  justify-content: center;
  gap: 8px;
  .kpi {
    background: rgba(255,255,255,0.7); border: 1px solid rgba(17,18,20,0.08);
    border-radius: 14px;
    padding: 8px 10px;
    min-height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
    &:hover { transform: translateY(-2px); border-color: var(--brand); background: #fff; }
    .lbl { font-size: 0.64rem; font-weight: 900; text-transform: uppercase; color: var(--muted); }
    .val { font-size: 1.02rem; font-weight: 950; color: var(--text); }
    .text-brand { color: var(--brand) !important; }
  }
}

/* Controls */
.search-group {
  max-width: 270px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid rgba(17,18,20,0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

  &:focus-within {
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(227, 61, 207, 0.15);
    transform: translateY(-1px);
  }

  .input-group-text {
    background: transparent;
    border: none;
    color: var(--muted);
    padding-left: 14px;
    padding-right: 8px;
    display: flex;
    align-items: center;
  }

  .form-control {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text);
    box-shadow: none;

    &::placeholder { color: rgba(17, 18, 20, 0.4); font-weight: 500; }
    &:focus { outline: none; }
  }

  .btn-clear {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;

    &:hover { color: #dc3545; }
  }
}

.select-glass {
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(17, 18, 20, 0.15); border-radius: 12px;
  color: var(--blue); font-weight: 800;
}

.btn-brand,
.btn-glass,
.btn-primary,
.btn-danger {
  border-radius: 12px;
  font-weight: 900;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, filter 0.2s;

  &:hover {
    transform: translateY(-1px);
  }

  &:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  &:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
}

.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(227, 61, 207, 0.22);

  &:hover {
    box-shadow: 0 12px 24px rgba(227, 61, 207, 0.28);
    filter: brightness(1.05);
  }
}

.btn-glass {
  background: var(--surface-soft);
  border: 1px solid rgba(3, 15, 170, 0.24);
  color: var(--blue);
  box-shadow: 0 6px 16px rgba(3, 15, 170, 0.1);

  &:hover {
    background: var(--surface-hover);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 8px 18px rgba(227, 61, 207, 0.16);
  }
}

.btn-primary {
  background: linear-gradient(135deg, #1543ff, #030faa);
  border-color: #030faa;
  color: #fff;
  box-shadow: 0 10px 22px rgba(3, 15, 170, 0.28);

  &:hover {
    box-shadow: 0 12px 24px rgba(3, 15, 170, 0.3);
    filter: brightness(1.05);
  }
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #dc2626;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.26);
}

/* BODY E GRUPOS */
.geral-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.groups-container { padding: 16px; overflow-y: auto; height: 100%; }

.client-group-card {
  background: #fff; border-radius: 16px; border: 1px solid rgba(17,18,20,0.08); overflow: hidden; transition: all 0.3s ease;
  &:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(227,61,207,0.1); }
  &.expanded { border-color: var(--brand); box-shadow: 0 8px 24px rgba(227,61,207,0.12); }
}

.group-header {
  padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  background: linear-gradient(180deg, #fff, #fdfdfd);
  &:hover .group-toggle-icon { color: var(--brand); }
}

.group-title { font-weight: 800; color: var(--text); }
.group-badges { display: flex; gap: 8px; }
.badge-pill {
  font-size: 0.7rem; padding: 4px 10px; border-radius: 999px; font-weight: 800; text-transform: uppercase;
  &.total { background: rgba(3,15,170,0.1); color: var(--blue); }
  &.danger { background: var(--danger-bg); color: var(--danger-text); }
  &.ok { background: var(--success-bg); color: var(--success-text); }
}

.group-body { border-top: 1px solid rgba(17,18,20,0.06); background: #fbfbfc; animation: slideDown 0.3s; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.chip-muted { font-size: 0.75rem; font-weight: 800; color: rgba(17,18,20,0.55); padding: 4px 10px; border-radius: 999px; background: rgba(17,18,20,0.04); }

/* TABELA MUREG STYLE */
.table-wrap { overflow: auto; }
.inner-table-wrap { max-height: 500px; overflow: auto; }
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  thead th {
    position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(227, 61, 207, 0.15); padding: 12px;
    color: rgba(17, 18, 20, 0.7); font-size: 0.8rem; font-weight: 950; letter-spacing: 0.05em; text-transform: uppercase;
  }
  tbody tr { transition: background 0.2s; &:hover { background-color: rgba(227, 61, 207, 0.05); } }
  td { padding: 12px; font-size: 0.875rem; border-bottom: 1px solid rgba(17,18,20,0.04); vertical-align: middle; }
}

.fw-black { font-weight: 950; }
.text-brand { color: var(--brand) !important; }
.text-blue { color: var(--blue) !important; }
.td-clip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.plano-col {
  max-width: 220px;
}

.actions-col {
  min-width: 280px;
  width: 280px;
  text-align: center;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.action-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
  margin: 0 auto;
}

.renew-chip {
  font-size: 0.66rem;
  font-weight: 900;
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 999px;
  padding: 4px 8px;
}

.btn-xs {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 0.66rem;
  font-weight: 800;
  border-radius: 8px;
  white-space: nowrap;
}

.btn-icon {
  width: 32px; height: 32px; border: none; background: rgba(17,18,20,0.04); border-radius: 8px; color: rgba(17,18,20,0.6);
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  &:hover { background: rgba(17,18,20,0.08); color: var(--text); transform: translateY(-1px); }
  &.primary:hover { background: rgba(3,15,170,0.1); color: var(--blue); }
  &.danger:hover { background: rgba(220, 53, 69, 0.12); color: #dc3545; }
}

/* FOOTER */
.geral-footer {
  padding: 14px 24px; border-top: 1px solid rgba(17, 18, 20, 0.06); display: flex; justify-content: space-between; align-items: center;
}
.pagination-modern .page-link { color: var(--blue); font-weight: 900; border-radius: 10px; border: 1px solid rgba(17,18,20,0.1); background: #fff; margin: 0 2px; }
.pagination-modern .page-link:hover { border-color: var(--brand); color: var(--brand); background: rgba(255, 255, 255, 0.98); }
.pagination-modern .page-item.active .page-link { background-color: var(--blue); border-color: var(--blue); color: #fff; }

/* MODAL */
.lg-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(227, 61, 207, 0.18), rgba(0, 0, 0, 0.55) 45%);
  z-index: 9990;
  backdrop-filter: blur(5px);
}
.lg-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9995; padding: 16px; }
.lg-modal-card {
  background: #ffffff;
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 20px;
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.4);
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: popUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lg-modal-card.modal-lg { width: min(760px, 94vw); }
.lg-modal-card.modal-xl { width: min(1040px, 95vw); max-height: 86vh; }

.lg-modal-card .modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(180deg, rgba(227, 61, 207, 0.09), rgba(255, 255, 255, 0.95) 70%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lg-modal-card .modal-title {
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.lg-modal-card .icon-bg {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(3, 15, 170, 0.1);
  color: var(--blue);
}

.lg-modal-card .icon-bg.primary-soft { background: rgba(3, 15, 170, 0.1); color: var(--blue); }
.lg-modal-card .icon-bg.danger-soft { background: rgba(220, 53, 69, 0.12); color: #dc3545; }

.lg-modal-card .modal-body { flex: 1; min-height: 0; overflow-y: auto; }
.lg-modal-card .modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff, rgba(248, 249, 251, 0.96));
}
.lg-modal-card.create-modal { width: min(1080px, 95vw); max-height: 86vh; }
.lg-modal-card.create-modal .modal-header { background: linear-gradient(180deg, rgba(227, 61, 207, 0.08), #ffffff 70%); }
.lg-modal-card.create-modal .modal-body { background: linear-gradient(180deg, rgba(248, 249, 250, 0.96), rgba(255, 255, 255, 0.98)); }
.lg-modal-card.create-modal .edit-sections { gap: 14px; }
.lg-modal-card.create-modal .detail-box { border: 1px solid rgba(227, 61, 207, 0.14); box-shadow: 0 10px 24px rgba(17, 18, 20, 0.06); }
.lg-modal-card.create-modal .box-header { color: var(--brand); background: linear-gradient(135deg, rgba(227, 61, 207, 0.1), rgba(3, 15, 170, 0.07)); }
.lg-modal-card.create-modal .box-body { background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 252, 0.96)); }
.lg-modal-card.create-modal .form-field label { color: rgba(17, 18, 20, 0.68); }
.lg-modal-card.create-modal .form-control,
.lg-modal-card.create-modal .form-select { min-height: 40px; }
.lg-modal-card.create-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px !important;
  background: linear-gradient(180deg, #ffffff, rgba(248, 249, 251, 0.95));
}
.lg-modal-card.create-modal .modal-footer .btn {
  border-radius: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}
.lg-modal-card.create-modal .modal-footer .btn.me-2 { margin-right: 0 !important; }
.bg-light-gray { background-color: #f8f9fa; }

.lg-modal-card .btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.04);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    background: rgba(17, 18, 20, 0.08);
    color: var(--brand);
    transform: translateY(-1px);
  }
}

@keyframes popUp { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.details-dashboard { display: grid; grid-template-columns: 1fr; gap: 16px; }
.detail-box { background: #fff; border-radius: 16px; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 10px rgba(0,0,0,0.03); overflow: hidden; }

.box-header {
  padding: 10px 16px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  background: #fdfdfd;
  display: flex;
  align-items: center;
}

.box-header.justify-content-center {
  justify-content: center;
  text-align: center;
  color: var(--brand);
  background: linear-gradient(135deg, rgba(227, 61, 207, 0.08), rgba(59, 130, 246, 0.08));
}

.box-body { padding: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px;
  background: rgba(245, 245, 247, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.04);

  &.span-2 { grid-column: span 2; }

  .lbl {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 2px;
  }

  .val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
    line-height: 1.25;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(25, 135, 84, 0.12);
  color: #157347;
  border: 1px solid rgba(25, 135, 84, 0.24);
}

.status-pill.is-danger {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
  border-color: rgba(220, 53, 69, 0.24);
}

.edit-sections { display: grid; gap: 12px; }
.edit-sections .detail-box { border: 1px solid rgba(17, 18, 20, 0.08); box-shadow: 0 8px 22px rgba(17, 18, 20, 0.06); }

summary.box-header {
  cursor: pointer;
  list-style: none;
  user-select: none;

  i:not(.transition-icon) { color: var(--brand); margin-right: 6px; }
  &::-webkit-details-marker { display: none; }
}

.transition-icon { color: var(--muted); transition: transform 0.25s ease, color 0.25s ease; }
details[open] .transition-icon { transform: rotate(180deg); color: var(--brand); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;

  &.span-2 { grid-column: span 2; }

  label {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(17, 18, 20, 0.64);
  }
}

.form-control,
.form-select {
  border-radius: 10px;
  border: 1px solid rgba(17,18,20,0.15);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;

  &:hover { border-color: rgba(17, 18, 20, 0.36); }
  &:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(227,61,207,0.15);
    outline: none;
    transform: translateY(-1px);
  }
}

.confirm-delete {
  border: 1px solid rgba(220, 53, 69, 0.16);
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;

  p { font-weight: 700; color: rgba(17, 18, 20, 0.85); }
}

.confirm-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .mureg-kpis {
    grid-template-columns: repeat(2, minmax(150px, 198px));
  }
}

@media (max-width: 700px) {
  .mureg-kpis {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }
  .lg-modal-card { border-radius: 16px; }
  .lg-modal-card .modal-header { padding: 12px 16px; }
  .lg-modal-card .modal-body { padding: 16px !important; }
  .lg-modal-card.modal-xl .modal-footer {
    flex-direction: column-reverse;
  }
  .lg-modal-card.modal-xl .modal-footer .btn {
    width: 100%;
    min-width: 0;
  }
  .lg-modal-card.modal-xl .modal-footer .btn.btn-sm {
    min-height: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1.15;
    border-radius: 10px;
  }
  .lg-modal-card.create-modal.modal-xl .modal-footer .btn.btn-sm {
    min-height: 0 !important;
    height: auto !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
  }
  .lg-modal-card.create-modal.modal-xl .modal-footer .btn {
    // Reset global mobile flex-basis (180px) so stacked buttons don't grow vertically.
    flex: 0 0 auto !important;
  }
  .form-grid,
  .info-grid { grid-template-columns: 1fr; }
  .info-item.span-2,
  .form-field.span-2 { grid-column: span 1; }

  .form-field.field-line {
    order: -1;
  }

  .form-field.field-line .form-control {
    min-height: 42px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
  }

  .form-field.field-item {
    align-items: flex-start;
  }

  .form-field.field-item .form-control {
    max-width: 152px;
    min-height: 38px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .form-field.field-item .field-hint {
    max-width: 220px;
  }
}

@media (max-width: 768px) {
  .vigencia-page {
    padding: 0 8px;
  }

  .vigencia-page .page-blob {
    opacity: 0.28;
    filter: blur(40px);
  }

  .vigencia-page .blob-1,
  .vigencia-page .blob-2,
  .vigencia-page .blob-3 {
    width: 240px;
    height: 240px;
  }

  .container-geral-responsive {
    width: calc(100vw - 16px);
    margin-top: 18px;
    margin-bottom: 28px;
  }

  .geral-card {
    min-height: auto;
    border-radius: 16px;
  }

  .geral-header {
    padding: 12px;
  }

  .header-row-top {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .title-badge {
    justify-self: center;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    gap: 8px;
    padding: 6px 10px;
  }

  .header-title {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 4px;
  }

  .title {
    font-size: 1.22rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .subtitle {
    display: block;
    font-size: 0.76rem;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
    max-width: 32ch;
    margin: 0 auto;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .mureg-kpis {
    margin-top: 12px !important;
    gap: 8px;
  }

  .mureg-kpis .kpi {
    min-height: 52px;
    padding: 8px 10px;
    gap: 8px;
  }

  .mureg-kpis .kpi .lbl {
    font-size: 0.62rem;
    line-height: 1.15;
    white-space: normal;
  }

  .mureg-kpis .kpi .val {
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .controls {
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 10px !important;
  }

  .controls > * {
    width: 100%;
    min-width: 0;
  }

  .search-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    border-radius: 14px;
  }

  .search-group .input-group-text,
  .search-group .btn-clear {
    height: 42px;
    min-height: 42px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
  }

  .search-group .input-group-text {
    padding-left: 10px;
    padding-right: 6px;
  }

  .search-group .form-control {
    min-width: 0;
    height: 42px;
    padding: 0;
    font-size: 16px;
    line-height: 1.2;
  }

  .search-group .btn-clear {
    padding-left: 8px;
    padding-right: 10px;
  }

  .page-size {
    width: 100%;
    justify-content: space-between;
    gap: 8px !important;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 18, 20, 0.08);
  }

  .page-size > span {
    min-width: 0;
    line-height: 1.15;
    white-space: normal;
  }

  .page-size app-select {
    flex-shrink: 0;
  }

  .geral-body {
    min-width: 0;
  }

  .groups-container {
    padding: 12px;
    min-width: 0;
  }

  .client-group-card {
    border-radius: 14px;
  }

  .group-header {
    padding: 12px 14px;
    gap: 10px;
    align-items: flex-start;
  }

  .group-info {
    min-width: 0;
    flex: 1 1 auto;
  }

  .group-title {
    font-size: 0.95rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  .group-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px !important;
  }

  .badge-pill {
    font-size: 0.62rem;
    line-height: 1.1;
    padding: 4px 8px;
    letter-spacing: 0.03em;
    white-space: normal;
  }

  .group-toggle-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 15, 170, 0.06);
    color: var(--blue);
    flex-shrink: 0;
    margin-top: 2px;
  }

  .group-body-top {
    padding: 10px 12px !important;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  .group-body-top small,
  .group-body-top .chip-muted {
    white-space: normal;
    line-height: 1.2;
  }

  .chip-muted {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .inner-table-wrap {
    max-height: 420px;
    -webkit-overflow-scrolling: touch;
  }

  .table-modern {
    min-width: 860px;
  }

  .table-modern thead th {
    padding: 10px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .table-modern td {
    padding: 9px 8px;
    font-size: 0.78rem;
  }

  .table-modern td.small {
    font-size: 0.74rem !important;
    line-height: 1.2;
  }

  .td-clip {
    max-width: 160px;
  }

  .actions-col {
    min-width: 210px;
    width: 210px;
  }

  .action-group {
    gap: 4px;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .geral-footer {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .geral-footer > .small {
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .geral-footer nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-modern {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    justify-content: center;
  }

  .pagination-modern .page-link {
    white-space: nowrap;
    font-size: 12px;
    padding: 0.35rem 0.6rem;
  }

}

@media (max-width: 480px) {
  .title-badge {
    font-size: 12px;
    padding: 6px 9px;
  }

  .title {
    font-size: 1.08rem;
    line-height: 1.12;
  }

  .subtitle {
    font-size: 0.72rem;
    max-width: 28ch;
  }

  .mureg-kpis .kpi {
    padding: 8px 9px;
    min-height: 50px;
  }

  .controls {
    gap: 8px !important;
  }

  .page-size {
    padding: 8px;
  }

  .groups-container {
    padding: 10px;
  }

  .group-header {
    padding: 11px 12px;
    gap: 8px;
  }

  .group-title {
    font-size: 0.88rem;
  }

  .badge-pill {
    font-size: 0.58rem;
    padding: 4px 7px;
  }

  .group-body-top {
    padding: 8px 10px !important;
  }

  .chip-muted {
    font-size: 0.67rem;
  }

  .inner-table-wrap {
    max-height: 380px;
  }

  .table-modern {
    min-width: 760px;
  }

  .table-modern thead th {
    padding: 9px 7px;
    font-size: 0.68rem;
  }

  .table-modern td {
    padding: 8px 7px;
    font-size: 0.74rem;
  }

  .table-modern td.small {
    font-size: 0.7rem !important;
  }

  .td-clip {
    max-width: 120px;
  }

  .actions-col {
    min-width: 190px;
    width: 190px;
  }

  .action-group {
    gap: 3px;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .geral-footer {
    padding: 10px;
    gap: 8px;
  }

}

.field-hint {
  display: block;
  font-size: 0.66rem;
  line-height: 1.2;
  color: rgba(17, 18, 20, 0.52);
  font-weight: 700;
}

.form-field.field-auto .form-control {
  background: rgba(245, 245, 247, 0.9);
  border-color: rgba(17, 18, 20, 0.1);
  color: rgba(17, 18, 20, 0.72);
}

.form-field.field-auto .form-control[readonly] {
  cursor: default;
}
