/* =========================================================
   1) RESET E VARIÁVEIS
========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-1: #060817;
  --bg-2: #09122b;
  --bg-3: #0b1f3d;

  --card: rgba(9, 18, 43, 0.72);
  --card-border: rgba(255, 255, 255, 0.12);

  --text-light: #f8fafc;
  --muted-light: #cbd5e1;

  --text-dark: #1e293b;
  --muted-dark: #64748b;

  --input: rgba(255, 255, 255, 0.07);
  --accent: #1d4ed8;
  --accent-2: #38bdf8;

  --shadow: 0 25px 80px rgba(2, 6, 23, 0.55);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;

  --sidebar-bg: linear-gradient(180deg, #0b1830 0%, #10264a 45%, #143764 100%);
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-text: #eaf2ff;
  --sidebar-muted: #b7c9e8;
  --sidebar-hover: rgba(96,165,250,0.16);
  --sidebar-active: rgba(96,165,250,0.22);
  --sidebar-shadow: 0 20px 60px rgba(2, 8, 23, 0.28);
  --sidebar-radius: 22px;
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 88px;
  --brand-blue: #60a5fa;
  --brand-cyan: #38bdf8;
}

/* =========================================================
   2) BASE GLOBAL DO SISTEMA
========================================================= */
body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-dark);
  background:
    radial-gradient(circle at 15% 20%, rgba(29, 78, 216, 0.28), transparent 26%),
    radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.20), transparent 24%),
    radial-gradient(circle at 70% 85%, rgba(99, 102, 241, 0.20), transparent 25%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

.main-content {
  margin-left: calc(var(--sidebar-width) + 8px);
  padding: 12px 22px 12px;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
  margin-left: calc(var(--sidebar-width-collapsed) + 8px);
}

@media (max-width: 1100px) {
  .main-content,
  .sidebar.collapsed ~ .main-content {
    margin-left: 0;
    padding: 16px;
  }
}

/* =========================================================
   3) LOGIN
========================================================= */
.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  isolation: isolate;
}

.blur {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.65;
  z-index: -1;
}

.blur.one {
  width: 240px;
  height: 240px;
  left: 4%;
  top: 10%;
  background: rgba(37, 99, 235, 0.45);
  animation: floatOne 8s ease-in-out infinite;
}

.blur.two {
  width: 320px;
  height: 320px;
  right: 8%;
  top: 15%;
  background: rgba(56, 189, 248, 0.28);
  animation: floatTwo 10s ease-in-out infinite;
}

.blur.three {
  width: 260px;
  height: 260px;
  bottom: 6%;
  left: 42%;
  background: rgba(79, 70, 229, 0.22);
  animation: floatOne 11s ease-in-out infinite;
}

.shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: stretch;
}

.panel {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text-light);
}

.panel::before {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 62%);
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e2e8f0;
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), #60a5fa);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.9);
}

.panel h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 10ch;
  margin-bottom: 18px;
  color: var(--text-light);
}

.lead {
  max-width: 52ch;
  color: var(--muted-light);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 28px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.feature-grid-1 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.feature {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.feature strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 8px;
  color: var(--text-light);
}

.feature span {
  display: block;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.6;
}

.feature-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
}

.feature-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.login-card {
  position: relative;
  align-self: center;
  padding: 40px 36px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(13, 27, 62, 0.92), rgba(9, 18, 43, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(22px);
  box-shadow: 0 25px 80px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  color: var(--text-light);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.10), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(56,189,248,0.08), transparent 30%);
  pointer-events: none;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.logo-wrap img {
  width: min(250px, 78%);
  height: auto;
  opacity: 0.98;
  filter:
    brightness(0)
    invert(1)
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.18))
    drop-shadow(0 8px 26px rgba(0, 0, 0, 0.35));
}

.login-title {
  text-align: center;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  color: var(--text-light);
}

.login-subtitle {
  text-align: center;
  color: var(--muted-light);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.login-card form {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.field {
  display: grid;
  gap: 8px;
}

.login-card label,
.panel label,
.page label {
  font-size: 0.93rem;
  color: #e2e8f0;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 0 16px;
  transition: 0.25s ease;
}

.input-wrap:focus-within {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.input-wrap .icon {
  color: #cfe5ff;
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  height: 54px;
  border: none;
  outline: none;
  background: transparent;
  color: white;
  font-size: 0.98rem;
}

.input-wrap input::placeholder {
  color: #94a3b8;
}

.toggle-password {
  border: none;
  background: transparent;
  color: #dbeafe;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: 0.2s ease;
  padding-left: 8px;
}

.toggle-password:hover {
  color: white;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #dbeafe;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
}

.link {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.link:hover {
  color: white;
}

.submit {
  margin-top: 8px;
  height: 56px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.38);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.45);
  filter: brightness(1.04);
}

.footer-note {
  text-align: center;
  margin-top: 18px;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.login-error {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  font-size: 0.95rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

@keyframes floatOne {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(14px, -18px, 0); }
}

@keyframes floatTwo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-16px, 14px, 0); }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 32px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 18px;
  }

  .panel,
  .login-card {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .row {
    align-items: flex-start;
  }
}

/* =========================================================
   4) SIDEBAR
========================================================= */
.sidebar {
  position: fixed;
  top: 14px;
  left: 14px;
  bottom: 14px;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--sidebar-radius);
  box-shadow: var(--sidebar-shadow);
  padding: 14px 12px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: width 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(14px);
}

.sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  max-width: 150px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.sidebar.collapsed .sidebar-logo {
  max-width: 44px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu .item {
  width: 100%;
}

.menu .item > a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.22s ease;
  position: relative;
}

.menu .item > a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(2px);
}

.menu .item > a i:first-child {
  width: 20px;
  min-width: 20px;
  text-align: center;
  color: #d7e8ff;
  font-size: 15px;
}

.menu .item > a span {
  flex: 1;
  white-space: nowrap;
}

.dropdown {
  transition: transform 0.25s ease;
  font-size: 13px;
  color: var(--sidebar-muted);
}

.item.active > .sub-btn {
  background: var(--sidebar-active);
}

.item.active > .sub-btn .dropdown {
  transform: rotate(90deg);
}

.user-card > a {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 60px;
}

.user-card-content {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex: 1;
}

.user-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.user-role {
  font-size: 12px;
  color: var(--sidebar-muted);
  margin-top: 4px;
}

.sub-menu {
  display: none;
  margin-top: 3px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.sub-menu a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  margin: 2px 0;
  border-radius: 12px;
  color: #cfe0fb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sub-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.sub-menu.show {
  display: block;
}

.menu .item a[target="_blank"] {
  color: #ffffff;
}

.menu .item a[href*="sair.php"] {
  color: #ffd2d2;
}

.menu .item a[href*="sair.php"]:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #ffffff;
}

.menu font {
  color: inherit !important;
}

.sidebar.collapsed .menu .item > a span,
.sidebar.collapsed .user-card-content,
.sidebar.collapsed .dropdown,
.sidebar.collapsed .sub-menu {
  display: none !important;
}

.sidebar.collapsed .menu .item > a {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .sidebar-header {
  min-height: 72px;
}

@media (max-width: 1100px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open-mobile {
    transform: translateX(0);
  }
}

/* =========================================================
   5) ESTRUTURA MODERNA DAS PÁGINAS INTERNAS
========================================================= */
.page-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: #FFFFFF;
  font-style: normal;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 8px 0 0;
  color: #FFFFFF;
  font-size: 0.98rem;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.content-card {
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(15,23,42,0.08);
  backdrop-filter: blur(10px);
  padding: 22px;
}

.content-card,
.content-card p,
.content-card span,
.content-card strong,
.content-card td,
.content-card th,
.content-card input,
.content-card select,
.content-card textarea,
.content-card button {
  color: #1e293b;
}

/* =========================================================
   6) BOTÕES
========================================================= */
.myButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 14px 30px rgba(37,99,235,0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.myButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37,99,235,0.3);
  text-decoration: none;
}

.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b84bd, #3e6fa7);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  box-shadow: 0 14px 30px rgba(37,99,235,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.modern-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37,99,235,0.24);
  opacity: 0.98;
}

.modern-btn-primary {
  min-width: 130px;
}

.modern-btn-secondary {
  background: rgba(255,255,255,0.9);
  color: #315f93 !important;
  border: 1px solid rgba(148,163,184,0.3);
  box-shadow: none;
  border-radius: 14px;
}

.modern-btn-secondary:hover {
  background: #ffffff;
  color: #244c79 !important;
}

.delete-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff !important;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #c81e1e, #991b1b);
  color: #fff !important;
}

.icon-btn {
  min-width: 46px;
  width: 46px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  font-size: 16px;
}

.icon-btn i {
  pointer-events: none;
}

.bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.back-btn {
  gap: 10px;
}

.edit-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* =========================================================
   7) FILTROS E FORMULÁRIOS
========================================================= */
.filters-card {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(248,250,252,0.88));
  border: 1px solid rgba(148,163,184,0.16);
}

.filters-grid {
  display: grid;
  grid-template-columns: 2.3fr 1fr 1fr 1fr 1fr 0.8fr auto;
  gap: 14px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field label,
.modern-field label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #3b6ea5;
}

.filter-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-control,
.form-control-sm {
  border-radius: 12px !important;
  border: 1px solid rgba(148,163,184,0.35) !important;
  min-height: 40px;
  box-shadow: none !important;
}

.form-control:focus,
.form-control-sm:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15) !important;
}

.modern-input,
input.modern-input,
select.modern-input,
.filters-card select,
.filters-card .form-control {
  width: 100%;
  height: 46px;
  min-height: 46px;
  border-radius: 14px !important;
  border: 1px solid rgba(148,163,184,0.35) !important;
  background-color: rgba(255,255,255,0.92) !important;
  color: #1e293b !important;
  font-size: 0.95rem;
  padding: 10px 12px !important;
  box-shadow: none !important;
  line-height: 1.2;
}

.modern-field .form-control:not(textarea),
.modern-field select,
.modern-field input {
  height: 46px !important;
  min-height: 46px !important;
}

.modern-field select,
select.modern-input {
  height: 46px !important;
  min-height: 46px !important;
  padding-right: 40px !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #5f738d 50%),
    linear-gradient(135deg, #5f738d 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-color: rgba(255,255,255,0.92) !important;
}

.modern-input:focus,
.modern-field select:focus,
select.modern-input:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 4px rgba(96,165,250,0.15) !important;
  outline: none;
}

.modern-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.modern-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }

.modern-textarea {
  min-height: 260px !important;
  height: auto !important;
  padding: 12px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(148,163,184,0.35) !important;
  background: rgba(255,255,255,0.92) !important;
  color: #1e293b !important;
  line-height: 1.6;
  resize: vertical;
}

.modern-field textarea,
textarea.modern-textarea,
textarea.pessoal-textarea,
textarea.societario-textarea {
  height: auto !important;
  min-height: 260px !important;
  padding: 12px !important;
  line-height: 1.6;
  resize: vertical;
}

/* =========================================================
   8) TABELAS MODERNAS - BASE ÚNICA
========================================================= */

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
  color: #3b6ea5;
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
}

/* Container externo */
.modern-table-wrap {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.16);
  overflow: hidden;
  position: relative;
}

/* Container que rola */
.modern-table-responsive {
  width: 100%;
  max-height: calc(100vh - 330px);
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
}

/* Tabela base */
.modern-table {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: fixed;
  margin-bottom: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0;
}

/* Permite quebra de texto */
.modern-table th,
.modern-table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Cabeçalho fixo */
.modern-table thead th {
  position: sticky !important;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #4f87ba, #3f78ac) !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 12px !important;
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.18);
}

/* Remove sombra lateral do último cabeçalho */
.modern-table thead th:last-child {
  box-shadow: none;
}

/* Dados */
.modern-table tbody td {
  height: 48px;
  padding: 10px 12px !important;
  vertical-align: middle !important;
  border-color: rgba(148,163,184,0.16) !important;
  background: rgba(255,255,255,0.78);
  color: #334155 !important;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Linhas alternadas */
.modern-table tbody tr:nth-child(even) td {
  background: rgba(248,250,252,0.88);
}

/* Hover */
.modern-table tbody tr:hover td {
  background: rgba(96,165,250,0.10) !important;
}

/* Links dentro das tabelas */
.modern-table a,
.modern-table .table-text-link {
  color: #356fa8 !important;
  text-decoration: none !important;
  font-weight: 500;
}

.modern-table a:hover,
.modern-table .table-text-link:hover {
  color: #1f568d !important;
}

/* Bootstrap não deve quebrar o sticky */
.table-responsive table {
  overflow: visible !important;
  border-radius: 0;
}

/* Botões de ação dentro das tabelas */
.table-action-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.table-action-buttons .modern-btn.icon-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

/* Utilitários opcionais */
.table-center {
  text-align: center;
}

.table-uppercase tbody td {
  text-transform: uppercase;
}

.table-normal-case,
.table-normal-case td,
.table-normal-case a,
.text-normal-case {
  text-transform: none !important;
}

.table-link-cell {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* =========================================================
   9) MODAIS
========================================================= */
.modern-modal,
.modern-modal .modal-content {
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,0.18);
}

.modern-modal .modal-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
  box-shadow: 0 24px 70px rgba(15,23,42,0.12);
}

.modern-modal .modal-header {
  border-bottom: 1px solid rgba(148,163,184,0.14);
}

.modern-modal .modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #315f93;
}

.modal-field-gap {
  margin-top: 14px;
}

.modal-confirm-text {
  margin: 0;
  color: #334155;
  font-size: 1rem;
}

.modal-dialog-custom {
  max-width: 1200px;
}

.table-action-buttons .icon-btn,
.bottom-actions .icon-btn,
.modal-footer .icon-btn {
  min-width: 46px;
  width: 46px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   10) CARDS DE CLIENTE / DETALHES
========================================================= */
.client-hero-card {
  padding: 28px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(248,250,252,0.92));
  border: 1px solid rgba(148,163,184,0.16);
  box-shadow: 0 20px 50px rgba(15,23,42,0.06);
  text-align: center;
  margin-bottom: 22px;
}

.client-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f87ba, #3f78ac);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 16px;
  box-shadow: 0 12px 25px rgba(63,120,172,0.22);
}

.client-main-title {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  font-weight: 800;
  color: #315f93;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1.1;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}

.client-subtitle {
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #475569;
}

.client-fantasy-name {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.client-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 8px;
  text-align: left;
}

.client-info-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148,163,184,0.14);
}

.client-info-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.client-info-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.section-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.section-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(148,163,184,0.18);
  color: #315f93;
  text-decoration: none !important;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(15,23,42,0.05);
  transition: all 0.2s ease;
}

.section-action-btn i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.section-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(96,165,250,0.10);
  color: #244c79;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 800;
  color: #2f4f78;
}

.detail-card-header i {
  color: #4f87ba;
}

.compact-hero {
  margin-bottom: 18px;
}

/* =========================================================
   11) PÁGINAS ESPECÍFICAS
========================================================= */

/* ------------------------------------------------------------ CLIENTES */
.clientes-table th:nth-child(1),
.clientes-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.clientes-table th:nth-child(2),
.clientes-table td:nth-child(2) {
  width: 110px;
  text-align: center;
}

.clientes-table th:nth-child(3),
.clientes-table td:nth-child(3) {
  width: 160px;
  text-align: center;
}

.clientes-table th:nth-child(4),
.clientes-table td:nth-child(4) {
  width: 30%;
}

.clientes-table th:nth-child(5),
.clientes-table td:nth-child(5) {
  width: 190px;
  text-align: center;
}

.clientes-table th:nth-child(6),
.clientes-table td:nth-child(6) {
  width: 190px;
}

.clientes-table th:nth-child(7),
.clientes-table td:nth-child(7) {
  width: 140px;
}


/* ------------------------------------------------------------ CONTATOS */
.contacts-table th:nth-child(1),
.contacts-table td:nth-child(1) {
  width: 22%;
}

.contacts-table th:nth-child(2),
.contacts-table td:nth-child(2) {
  width: 16%;
}

.contacts-table th:nth-child(3),
.contacts-table td:nth-child(3) {
  width: 30%;
}

.contacts-table th:nth-child(4),
.contacts-table td:nth-child(4) {
  width: 16%;
}

.contacts-table th:nth-child(5),
.contacts-table td:nth-child(5) {
  width: 16%;
  text-align: center;
}


/* ------------------------------------------------------------ SENHAS */
.senhas-table th:nth-child(1),
.senhas-table td:nth-child(1) {
  width: 10%;
}

.senhas-table th:nth-child(2),
.senhas-table td:nth-child(2) {
  width: 17%;
}

.senhas-table th:nth-child(3),
.senhas-table td:nth-child(3) {
  width: 12%;
}

.senhas-table th:nth-child(4),
.senhas-table td:nth-child(4) {
  width: 12%;
}

.senhas-table th:nth-child(5),
.senhas-table td:nth-child(5) {
  width: 12%;
}

.senhas-table th:nth-child(6),
.senhas-table td:nth-child(6) {
  width: 10%;
}

.senhas-table th:nth-child(7),
.senhas-table td:nth-child(7) {
  width: 19%;
}

.senhas-table th:nth-child(8),
.senhas-table td:nth-child(8) {
  width: 8%;
  text-align: center;
}

.senhas-table td:nth-child(4),
.senhas-table td:nth-child(5),
.senhas-table td:nth-child(6),
.senhas-table td:nth-child(7) {
  text-transform: none !important;
}

/* ------------------------------------------------------------ RELATÓRIO PARCELAMENTOS */
.rel-soc-table th:nth-child(1),
.rel-soc-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.rel-soc-table th:nth-child(2),
.rel-soc-table td:nth-child(2) {
  width: 190px;
  text-align: center;
}

.rel-soc-table th:nth-child(3),
.rel-soc-table td:nth-child(3) {
  width: 130px;
  text-align: center;
}

.rel-soc-table th:nth-child(4),
.rel-soc-table td:nth-child(4) {
  width: auto;
}

.rel-soc-table th:nth-child(5),
.rel-soc-table td:nth-child(5),
.rel-soc-table th:nth-child(6),
.rel-soc-table td:nth-child(6),
.rel-soc-table th:nth-child(7),
.rel-soc-table td:nth-child(7),
.rel-soc-table th:nth-child(8),
.rel-soc-table td:nth-child(8),
.rel-soc-table th:nth-child(9),
.rel-soc-table td:nth-child(9) {
  width: 120px;
  text-align: center;
}


/* ------------------------------------------------------------ RELATÓRIO FOLHA */
.rel-dp-table th:nth-child(1),
.rel-dp-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.rel-dp-table th:nth-child(2),
.rel-dp-table td:nth-child(2) {
  width: 170px;
  text-align: center;
}

.rel-dp-table th:nth-child(3),
.rel-dp-table td:nth-child(3) {
  width: auto;
}

.rel-dp-table th:nth-child(4),
.rel-dp-table td:nth-child(4) {
  width: 200px;
  text-align: center;
}

.rel-dp-table th:nth-child(5),
.rel-dp-table td:nth-child(5) {
  width: 210px;
  text-align: center;
}

.rel-dp-table th:nth-child(6),
.rel-dp-table td:nth-child(6) {
  width: 150px;
  text-align: center;
}

/* ------------------------------------------------------------ RELATÓRIO SENHAS DE ACESSO */

.rel-senhas-table th:nth-child(1),
.rel-senhas-table td:nth-child(1) {
  width: 60px;
  text-align: center;
}

.rel-senhas-table th:nth-child(2),
.rel-senhas-table td:nth-child(2) {
  width: 170px;
  text-align: center;
}

.rel-senhas-table th:nth-child(3),
.rel-senhas-table td:nth-child(3) {
  width: 20%;
}

.rel-senhas-table th:nth-child(4),
.rel-senhas-table td:nth-child(4) {
  width: 120px;
  text-align: center;
}

.rel-senhas-table th:nth-child(5),
.rel-senhas-table td:nth-child(5) {
  width: 180px;
  text-align: center;
}

.rel-senhas-table th:nth-child(6),
.rel-senhas-table td:nth-child(6) {
  width: 150px;
  text-align: center;
}

.rel-senhas-table th:nth-child(7),
.rel-senhas-table td:nth-child(7) {
  width: 150px;
  text-align: center;
}

.rel-senhas-table th:nth-child(8),
.rel-senhas-table td:nth-child(8) {
  width: 180px;
  text-align: center;
}

/* ------------------------------------------------------------ AUTOMAÇÕES */
.automacao-table th:nth-child(1),
.automacao-table td:nth-child(1) {
  width: 110px;
  text-align: center;
}

.automacao-table th:nth-child(2),
.automacao-table td:nth-child(2) {
  width: 90px;
  text-align: center;
}

.automacao-table th:nth-child(3),
.automacao-table td:nth-child(3) {
  width: 120px;
  text-align: center;
}

.automacao-table th:nth-child(4),
.automacao-table td:nth-child(4) {
  width: 240px;
}

.automacao-table th:nth-child(5),
.automacao-table td:nth-child(5) {
  width: auto;
}

.automacao-table th:nth-child(6),
.automacao-table td:nth-child(6) {
  width: 140px;
  text-align: center;
}


/* ------------------------------------------------------------ POP */
.pop-table th:nth-child(1),
.pop-table td:nth-child(1) {
  width: 90px;
  text-align: center;
}

.pop-table th:nth-child(2),
.pop-table td:nth-child(2) {
  width: 220px;
  text-align: center;
}

.pop-table th:nth-child(3),
.pop-table td:nth-child(3) {
  width: auto;
  text-align: center;
}

.pop-table th:nth-child(4),
.pop-table td:nth-child(4) {
  width: 140px;
  text-align: center;
}

/* ------------------------------------------------------------ SCHIP */

.schip-table th:nth-child(2),
.schip-table td:nth-child(2) {
  width: 320px !important;
}


/* ------------------------------------------------------------ REINF */
.reinf-table th:nth-child(1),
.reinf-table td:nth-child(1) {
  width: 60px;
  text-align: center;
}

.reinf-table th:nth-child(2),
.reinf-table td:nth-child(2) {
  width: 170px;
  text-align: center;
}

.reinf-table th:nth-child(3),
.reinf-table td:nth-child(3) {
  width: auto;
}

.reinf-table th:nth-child(4),
.reinf-table td:nth-child(4) {
  width: 120px;
  text-align: center;
}

.reinf-table th:nth-child(5),
.reinf-table td:nth-child(5) {
  width: 120px;
  text-align: center;
}

.reinf-table th:nth-child(6),
.reinf-table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

.reinf-month-text {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.reinf-results-area {
  height: calc(100vh - 360px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reinf-results-area .modern-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.reinf-table-responsive {
  height: 100%;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.reinf-totais-footer {
  flex: 0 0 auto;
  margin-top: 0 !important;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 -10px 32px rgba(15,23,42,0.08);
  z-index: 20;
}

.reinf-totais-footer .detail-card-header {
  margin-bottom: 10px;
}

.reinf-totais-footer .totais-input-grid {
  grid-template-columns: repeat(9, minmax(110px, 1fr));
  gap: 10px;
}

.reinf-totais-footer .modern-field {
  gap: 5px;
}

.reinf-totais-footer .modern-field label {
  font-size: 0.78rem;
}

.reinf-totais-footer .modern-input,
.reinf-totais-footer .total-readonly {
  height: 38px !important;
  min-height: 38px !important;
  font-size: 0.86rem;
  padding: 8px 10px !important;
}

@media (max-width: 1600px) {
  .reinf-totais-footer .totais-input-grid {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
  }
}

@media (max-width: 1100px) {
  .reinf-results-area {
    height: auto;
    min-height: 0;
  }

  .reinf-table-responsive {
    max-height: 60vh !important;
  }

  .reinf-totais-footer .totais-input-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 768px) {
  .reinf-totais-footer .totais-input-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------ TIPO DE ENVIO */
.envio-table th:nth-child(1),
.envio-table td:nth-child(1) { width: 80px; }

.envio-table th:nth-child(2),
.envio-table td:nth-child(2) { width: 110px; }

.envio-table th:nth-child(3),
.envio-table td:nth-child(3) { width: 170px; }

.envio-table th:nth-child(4),
.envio-table td:nth-child(4) { width: 38%; }

.envio-table th:nth-child(5),
.envio-table td:nth-child(5) { width: 220px; }

.envio-table td:nth-child(3),
.envio-table td:nth-child(5) {
  text-transform: none !important;
}

/* ------------------------------------------------------------ SINDICATOS - CLIENTES */
.sindicatos-clientes-table th:nth-child(1),
.sindicatos-clientes-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.sindicatos-clientes-table th:nth-child(2),
.sindicatos-clientes-table td:nth-child(2) {
  width: 160px;
  text-align: center;
}

.sindicatos-clientes-table th:nth-child(3),
.sindicatos-clientes-table td:nth-child(3) {
  width: 32%;
}

.sindicatos-clientes-table th:nth-child(4),
.sindicatos-clientes-table td:nth-child(4) {
  width: 22%;
  text-align: center;
}

.sindicatos-clientes-table th:nth-child(5),
.sindicatos-clientes-table td:nth-child(5) {
  width: 110px;
  text-align: center;
}

.sindicatos-clientes-table th:nth-child(6),
.sindicatos-clientes-table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

/* ------------------------------------------------------------ SINDICATOS - LISTA */
.sindicatos-table th:nth-child(1),
.sindicatos-table td:nth-child(1) {
  width: 160px;
  text-align: center;
}

.sindicatos-table th:nth-child(2),
.sindicatos-table td:nth-child(2) {
  width: 140px;
}

.sindicatos-table th:nth-child(3),
.sindicatos-table td:nth-child(3) {
  width: 40%;
}

.sindicatos-table th:nth-child(4),
.sindicatos-table td:nth-child(4) {
  width: 110px;
  text-align: center;
}

.sindicatos-table th:nth-child(5),
.sindicatos-table td:nth-child(5) {
  width: 180px;
}

.sindicatos-table th:nth-child(6),
.sindicatos-table td:nth-child(6) {
  width: 8%;
  text-align: center;
}


/* ------------------------------------------------------------ DIVERSOS - EMAIL */

.email-table th:nth-child(1),
.email-table td:nth-child(1) {
  width: 22%;
}

.email-table th:nth-child(2),
.email-table td:nth-child(2) {
  width: 34%;
}

.email-table th:nth-child(3),
.email-table td:nth-child(3) {
  width: 24%;
}

.email-table th:nth-child(4),
.email-table td:nth-child(4) {
  width: 20%;
  text-align: center;
}

.text-normal-case {
  text-transform: none !important;
}

.email-filtros {
  grid-template-columns: 2fr auto;
}

.level-filtros {
  grid-template-columns: 2fr auto;
}

/* ------------------------------------------------------------ DIVERSOS - PORTA */
.porta-filtros {
  grid-template-columns: 2fr auto;
}

.porta-table th:nth-child(1),
.porta-table td:nth-child(1) {
  width: 28%;
  text-align: center;
}

.porta-table th:nth-child(2),
.porta-table td:nth-child(2) {
  width: 52%;
}

.porta-table th:nth-child(3),
.porta-table td:nth-child(3) {
  width: 20%;
  text-align: center;
}

/* ------------------------------------------------------------ DIVERSOS - COMPUTADORES */
.office-filtros {
  grid-template-columns: 2fr 1fr auto;
}

.office-table th:nth-child(1),
.office-table td:nth-child(1) {
  width: 28%;
}

.office-table th:nth-child(2),
.office-table td:nth-child(2) {
  width: 28%;
}

.office-table th:nth-child(3),
.office-table td:nth-child(3) {
  width: 20%;
  text-align: center;
}

.office-table th:nth-child(4),
.office-table td:nth-child(4) {
  width: 14%;
  text-align: center;
}

.office-table th:nth-child(5),
.office-table td:nth-child(5) {
  width: 10%;
  text-align: center;
}

/* ------------------------------------------------------------ DIVERSOS - DIVERSOS */
.top-actions {
  margin-top: 0;
  margin-bottom: 0;
  justify-content: flex-end;
}

.diversos-textarea {
  min-height: 400px !important;
  color: #315f93 !important;
}


/* TEXTAREAS ESPECÍFICAS */
.pessoal-textarea,
.societario-textarea,
.fiscal-textarea,
.onboarding-textarea {
  min-height: 260px !important;
  height: auto !important;
  padding: 12px !important;
  color: #315f93 !important;
  line-height: 1.6;
  resize: vertical;
}






/* MULTI SELECT DE DIAS */
.multi-select-dia {
  position: relative;
}

.multi-select-input {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.92);
  cursor: pointer;
  color: #1e293b;
}

.multi-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.14);
}

.multi-select-dropdown.show {
  display: block;
}

.dias-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.dia-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.92rem;
  color: #1e293b !important;
}

/* =========================================================
   12) RESPONSIVO
========================================================= */
@media (max-width: 1400px) {
  .filters-grid {
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr 0.8fr auto;
  }
}

@media (max-width: 1100px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-search,
  .filter-action {
    grid-column: 1 / -1;
  }

  .modern-btn-primary {
    width: 100%;
  }

  .filter-actions-row {
    flex-direction: column;
    width: 100%;
  }

  .filter-actions-row .modern-btn {
    width: 100%;
  }

  .modern-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .span-12 { grid-column: span 6; }
  .span-6 { grid-column: span 6; }
  .span-5 { grid-column: span 6; }
  .span-4 { grid-column: span 3; }
  .span-3 { grid-column: span 3; }
  .span-2 { grid-column: span 2; }
  .span-1 { grid-column: span 2; }

  .envio-grid {
    grid-template-columns: 1fr;
  }

  .automacao-grid {
    grid-template-columns: 1fr;
  }

  .dias-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  .content-card {
    padding: 16px;
    border-radius: 18px;
  }

  .filters-card {
    padding: 14px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .modern-btn {
    flex: 1;
  }

  .client-hero-card {
    padding: 20px 16px;
  }

  .section-actions-grid {
    grid-template-columns: 1fr;
  }

  .bottom-actions {
    justify-content: stretch;
  }

  .bottom-actions .modern-btn {
    width: 100%;
    justify-content: center;
  }

  .modern-form-grid {
    grid-template-columns: 1fr;
  }

  .span-12,
  .span-6,
  .span-5,
  .span-4,
  .span-3,
  .span-2,
  .span-1 {
    grid-column: span 1;
  }

  .edit-actions {
    flex-direction: column;
  }

  .edit-actions .modern-btn,
  .edit-actions .delete-btn {
    width: 100%;
    justify-content: center;
  }

  .pessoal-textarea,
  .societario-textarea,
  .fiscal-textarea,
  .onboarding-textarea {
    min-height: 220px !important;
  }

  .dias-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}



.table-text-link {
  color: #356fa8 !important;
  text-decoration: none !important;
  font-weight: 500;
}

.totais-input-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
  align-items: end;
}

.total-readonly {
  font-weight: 700 !important;
  color: #1e293b !important;
  background: rgba(255,255,255,0.92) !important;
}

.total-readonly-highlight {
  background: rgba(96,165,250,0.10) !important;
  border-color: rgba(96,165,250,0.22) !important;
  color: #244c79 !important;
}

.checkbox-modern {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.92);
}

.checkbox-modern label {
  margin: 0;
  color: #1e293b !important;
  font-weight: 600;
}

.modal-dialog-custom {
  max-width: 1100px;
}

@media (max-width: 1100px) {
  .reinf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1600px) {
  .totais-input-grid {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
  }
}

@media (max-width: 1100px) {
  .totais-input-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .totais-input-grid {
    grid-template-columns: 1fr;
  }
}










/* =========================================================
   MANUAL DO PARCELAMENTO
========================================================= */
.manual-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.manual-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(248,250,252,0.94));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.06);
  padding: 18px;
}

.manual-card .detail-card-header {
  margin-bottom: 12px;
}

.manual-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-card-body p {
  margin: 0;
  padding-left: 16px;
  position: relative;
  color: #334155;
  line-height: 1.55;
  font-size: 0.95rem;
}

.manual-card-body p::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #4f87ba;
  font-weight: 900;
}

@media (max-width: 992px) {
  .manual-cards-grid {
    grid-template-columns: 1fr;
  }
}



/* =========================================================
   FILTROS ATIVOS
========================================================= */

.active-filters-card {
  margin: -4px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79,135,186,0.12), rgba(56,189,248,0.08));
  border: 1px solid rgba(79,135,186,0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.active-filters-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-filters-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #315f93;
  font-size: 0.95rem;
  font-weight: 800;
}

.active-filters-title i {
  color: #3f78ac;
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(79,135,186,0.20);
  color: #315f93 !important;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15,23,42,0.04);
}

.active-filter-chip strong {
  color: #1f568d !important;
}

.active-filters-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.3);
  background: #ffffff;
  color: #315f93;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.active-filters-clear:hover {
  background: #315f93;
  color: #ffffff;
  transform: translateY(-1px);
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.active-filter-chip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.active-filter-remove {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(49, 95, 147, 0.12);
  color: #315f93;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.2s ease;
}

.active-filter-remove:hover {
  background: #315f93;
  color: #ffffff;
}

