/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

:root {
  --primary: #861630;
  --primary-dark: #731127;
  --primary-soft: #9a1f3b;
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e4e7ec;
  --text: #1f2933;
  --muted: #6b7280;
  --icon-bg: #f7e8ed;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ================= UTIL ================= */

.hidden {
  display: none !important;
}

.page {
  display: none;
}

.active-page {
  display: block;
}

/* ================= LOGOS ================= */

.brand-images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  line-height: 0;
}

.brand-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.75);
  flex: 0 0 auto;
}

.card-divider {
  background: rgba(123, 15, 26, 0.25);
  height: 42px;
}

/* topo login */
.logo-cgb {
  width: 160px;
  height: auto;
  object-fit: contain;
  display: block;
}

.logo-agencia {
  width: 300px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* card login */
.logo-cgb-card {
  width: 120px;
  height: auto;
  object-fit: contain;
  display: block;
}

.logo-agencia-card {
  width: 210px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* topo sistema */
.logo-cgb-header {
  width: 96px;
  height: auto;
  object-fit: contain;
  display: block;
}

.logo-agencia-header {
  width: 190px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ================= LOGIN ================= */

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
}

.login-topbar {
  height: 140px;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.06), transparent 34%),
    linear-gradient(180deg, #861630 0%, #731127 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand-center {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-subtitle {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
}

.login-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
  position: relative;
}

.login-area::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 72px;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.06), transparent 35%),
    linear-gradient(180deg, #861630 0%, #731127 100%);
}
.login-card {
  width: 426px;
  min-height: 255px;
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px 24px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.9);
  text-align: center;
  position: relative;
  z-index: 2;
  transform: scale(0.92);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  line-height: 0;
}

.login-card h2 {
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 8px 0 12px;
}

.login-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.login-card form {
  text-align: left;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  height: 40px;
  border-radius: 7px;
  border: 1px solid #d8dde6;
  padding: 0 12px;
  font-size: 13px;
  color: #111827;
  outline: none;
  margin-bottom: 12px;
  background: #fff;
}

.login-card input:focus {
  border-color: rgba(123, 15, 26, 0.55);
  box-shadow: 0 0 0 3px rgba(123, 15, 26, 0.08);
}

.login-card button {
  width: 100%;
  height: 40px;
  background: linear-gradient(180deg, #9a1f3b 0%, #861630 100%);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.login-card button:hover {
  background: linear-gradient(180deg, #a92745 0%, #731127 100%);
}

.login-error {
  display: block;
  min-height: 18px;
  text-align: center;
  margin-top: 10px;
  color: #dc2626;
  font-size: 12px;
}

/* ================= APP ================= */

.app-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  height: 82px;
  flex: 0 0 82px;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.06), transparent 35%),
    linear-gradient(180deg, #861630 0%, #731127 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 34px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  font-weight: 700;
}

.user-button,
.logout-button {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ================= BODY / SIDEBAR ================= */

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 320px;
  flex: 0 0 320px;
  background: linear-gradient(180deg, #9a1f3b 0%, #861630 45%, #731127 100%);
  color: #fff;
  padding: 14px 16px 18px;
  overflow-y: auto;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  width: 100%;
  min-height: 40px;
  background: transparent;
  border: 0;
  color: #fff;
  border-radius: 7px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition: 0.18s ease;
}

.menu-item i {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.11);
}

.menu-item.active {
  background: rgba(84, 10, 30, 0.55);
}

/* ================= MAIN ================= */

.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 42px;
  overflow-y: auto;
  background: #f6f7f9;
}

.main-content h1 {
  color: var(--primary);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-subtitle {
  color: #687280;
  font-size: 14px;
  margin-bottom: 28px;
}

.section-title {
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 12px;
}

/* ================= CARDS ================= */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.home-card {
  min-height: 96px;
  background: #fff;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  transition: 0.2s ease;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.10);
}

.home-card strong {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
  margin-bottom: 8px;
}

.home-card span {
  display: block;
  color: #687280;
  font-size: 13px;
}

.card-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  background: var(--icon-bg);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 20px;
}

/* ================= INFO BOX ================= */

.info-box {
  min-height: 96px;
  margin-top: 8px;
  background: linear-gradient(90deg, #fff4f5 0%, #fff8f9 100%);
  border: 1px solid #efc9cf;
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.info-box > i {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(123, 15, 26, 0.78);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.info-box strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
  display: block;
  margin-bottom: 6px;
}

.info-box p {
  color: #27313f;
  font-size: 13px;
  line-height: 1.45;
}

/* ================= PROFILE ================= */

.profile-card {
  background: #fff;
  border-radius: 10px;
  padding: 34px 34px 34px 30px;
  display: flex;
  gap: 42px;
  border: 1px solid #e1e5eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.profile-avatar {
  width: 172px;
  height: 172px;
  flex: 0 0 172px;
  background: #f4e7ea;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 84px;
}

.profile-content {
  flex: 1;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.profile-title-icon,
.profile-row > i {
  width: 46px;
  height: 46px;
  background: #f4e7ea;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.profile-title h2 {
  color: #111827;
  font-size: 20px;
  font-weight: 800;
}

.profile-title p {
  color: #6b7280;
  font-size: 14px;
}

.profile-row {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.profile-row span {
  display: block;
  color: #8a93a3;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.profile-row strong {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

/* ================= IFRAME ================= */

.iframe-box {
  margin-top: 15px;
  height: calc(100vh - 190px);
  min-height: 520px;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ================= COMING ================= */

.coming-box {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  padding: 28px;
  text-align: center;
  color: #6b7280;
}

/* ================= FOOTER PERFIL ================= */

.profile-footer {
  height: 96px;
  flex: 0 0 96px;
  display: flex;
  background: linear-gradient(180deg, #861630 0%, #731127 100%);
  color: #fff;
}

.footer-item {
  flex: 1;
  padding: 18px 32px;
  display: flex;
  gap: 18px;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.28);
}

.footer-item:last-child {
  border-right: 0;
}

.footer-item i {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex: 0 0 56px;
}

.footer-item strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 4px;
}

.footer-item span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

/* ================= RESPONSIVO ================= */

@media (max-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .sidebar {
    width: 290px;
    flex-basis: 290px;
  }
}

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .app-header {
    padding: 0 20px;
  }

  .logo-cgb-header {
    width: 82px;
  }

  .logo-agencia-header {
    width: 150px;
  }

  .header-title {
    display: none;
  }
}

/* ================= SCRIPTS / BUSCA MODERNA ================= */

.scripts-layout {
  display: flex;
  gap: 22px;
  height: calc(100vh - 160px); /* controla altura total */
}

.scripts-panel {
  width: 32%;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4e7ec;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.scripts-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(134, 22, 48, 0.28);
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.scripts-search:hover {
  border-color: rgba(134, 22, 48, 0.35);
  background: #ffffff;
}

.scripts-search i {
  color: var(--primary);
  font-size: 15px;
}

.scripts-search:focus-within {
  border-color: rgba(134, 22, 48, 0.45);
  box-shadow: 0 0 0 3px rgba(134, 22, 48, 0.08);
  transform: translateY(-1px);
}

.scripts-search input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 14px;
  color: #111827;
}

.scripts-search input::placeholder {
  color: #9ca3af;
}

.scripts-list {
  margin-top: 16px;
  max-height: 470px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.scripts-list::-webkit-scrollbar {
  width: 6px;
}

.scripts-list::-webkit-scrollbar-thumb {
  background: rgba(134, 22, 48, 0.35);
  border-radius: 20px;
}

.scripts-list::-webkit-scrollbar-track {
  background: transparent;
}

.script-item {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 14px 15px;
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.22s ease;
  font-size: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.script-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 8px 8px 0;
  background: transparent;
  transition: 0.22s ease;
}

.script-item strong {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.script-item span {
  color: #6b7280;
  font-size: 12px;
}

.script-item:hover {
  border-color: rgba(134, 22, 48, 0.35);
  background: #fffafb;
  transform: translateX(3px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
}

.script-item:hover::before {
  background: var(--primary);
}

.script-item.selected {
  border-color: rgba(134, 22, 48, 0.55);
  background: #fff5f7;
  box-shadow: 0 8px 18px rgba(134, 22, 48, 0.12);
}

.script-item.selected::before {
  background: var(--primary);
}

.script-viewer {
  flex: 1;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4e7ec;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.script-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
}

.viewer-label {
  font-size: 11px;
  color: #8a93a3;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.script-viewer h2 {
  margin-top: 4px;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
}

.script-text {
  white-space: pre-wrap;
  background: #f9fafb;
  padding: 18px;
  border-radius: 13px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  line-height: 1.6;
  color: #1f2933;
  min-height: 360px;
}

.copy-script-button {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--primary) 100%);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s ease;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(134, 22, 48, 0.22);
}

.copy-script-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #a92745 0%, var(--primary-dark) 100%);
}

.copy-script-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.copy-feedback {
  font-size: 12px;
  color: #16a34a;
  font-weight: 700;
}

.copy-script-button.copied {
  background: #22c55e;
  color: #fff;
}

.copy-script-button.copied:hover {
  background: #16a34a;
}

.script-empty {
  min-height: 150px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f9fafb;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 20px;
}

.script-empty i {
  font-size: 28px;
  color: var(--primary);
}

.script-empty strong {
  color: #374151;
  font-size: 14px;
}

.script-empty span {
  font-size: 12px;
}

.email-types-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  max-height: 520px;
}

@media (max-width: 1200px) {
  .email-types-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 800px) {
  .email-types-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= REGISTROS DE RECLAMAÇÃO ================= */

.complaint-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.complaint-form-card,
.complaint-result-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4e7ec;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.complaint-form-card {
  width: 42%;
  padding: 22px;
}

.complaint-result-card {
  flex: 1;
  padding: 22px;
}

.complaint-section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eef0f3;
}

.complaint-title-icon {
  width: 48px;
  height: 48px;
  background: var(--icon-bg);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(134, 22, 48, 0.12);
}

.complaint-section-title h2,
.complaint-result-header h2 {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.complaint-section-title span {
  color: #6b7280;
  font-size: 13px;
}

.complaint-field {
  margin-bottom: 14px;
}

.complaint-field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.complaint-field input,
.complaint-field select,
.complaint-field textarea {
  width: 100%;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
  color: #111827;
  background: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.complaint-field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.1 1.02l-4.24 4.5a.75.75 0 01-1.1 0l-4.24-4.5a.75.75 0 01.02-1.06z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}

.complaint-field textarea {
  resize: vertical;
  min-height: 78px;
}

.complaint-field input:focus,
.complaint-field select:focus,
.complaint-field textarea:focus {
  border-color: rgba(134, 22, 48, 0.55);
  box-shadow: 0 0 0 3px rgba(134, 22, 48, 0.08);
}

.complaint-radio-group {
  display: flex;
  gap: 18px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.complaint-radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: #374151;
}

.complaint-dynamic-fields {
  margin-top: 10px;
}

.complaint-empty-state {
  min-height: 200px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f9fafb;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
}

.complaint-empty-state i {
  font-size: 30px;
  color: var(--primary);
}

.complaint-empty-state strong {
  color: #374151;
  font-size: 14px;
}

.complaint-empty-state span {
  font-size: 12px;
}

.complaint-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
}

.complaint-result-text {
  width: 100%;
  min-height: 600px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2933;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  white-space: pre-wrap;
}

.complaint-result-text:focus {
  border-color: rgba(134, 22, 48, 0.45);
  box-shadow: 0 0 0 3px rgba(134, 22, 48, 0.08);
}

@media (max-width: 1200px) {
  .complaint-layout {
    flex-direction: column;
  }

  .complaint-form-card,
  .complaint-result-card {
    width: 100%;
  }

  .complaint-result-text {
    min-height: 420px;
  }
}

/* ================= AJUSTE CORPORATIVO SEM EMBAÇAR ================= */

@media (min-width: 1200px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .app-header {
    height: 66px;
    flex: 0 0 66px;
    padding: 0 24px;
  }

  .logo-cgb-header {
    width: 78px;
  }

  .logo-agencia-header {
    width: 150px;
  }

  .sidebar {
    width: 258px;
    flex: 0 0 258px;
    padding: 10px 12px 14px;
  }

  .menu-item {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 7px;
    gap: 10px;
  }

  .menu-item i {
    font-size: 14px;
  }

  .main-content {
    padding: 20px 28px;
  }

  .main-content h1 {
    font-size: 21px;
  }

  .page-subtitle {
    font-size: 12px;
    margin-bottom: 18px;
  }

  .section-title {
    font-size: 15px;
  }

  .cards-grid {
    gap: 10px;
  }

  .home-card {
    min-height: 76px;
    padding: 10px 12px;
    border-radius: 9px;
    gap: 12px;
  }

  .home-card strong {
    font-size: 12px;
  }

  .home-card span {
    font-size: 11px;
  }

  .card-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 16px;
  }

  .iframe-box {
    height: calc(100vh - 145px);
    min-height: 460px;
  }

/* ===== AJUSTE PERFIL ===== */

  .profile-card {
    padding: 24px 28px;
    gap: 28px;
  }

  .profile-avatar {
    width: 126px;
    height: 126px;
    flex: 0 0 126px;
    font-size: 62px;
  }

  .profile-title {
    padding-bottom: 16px;
    gap: 12px;
  }

  .profile-title-icon,
  .profile-row > i {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .profile-title h2 {
    font-size: 18px;
  }

  .profile-row {
    min-height: 58px;
    padding: 10px 0;
  }

  .profile-row span {
    font-size: 11px;
  }

  .profile-row strong {
    font-size: 13px;
  }

  .profile-footer {
    height: 78px;
  }

/* ================= REFINO CORPORATIVO FNQ / ISO ================= */

/* Suavidade geral */
button,
.home-card,
.menu-item,
.script-item,
.copy-script-button,
.logout-button,
.user-button {
  transition: all 0.2s ease;
}

/* Header mais premium */
.app-header,
.login-topbar {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

/* Menu lateral mais sofisticado */
.menu-item:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateX(3px);
}

.menu-item.active {
  background: rgba(84, 10, 30, 0.68);
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.9);
}

/* Cards com padrão corporativo */
.home-card {
  border: 1px solid #e4e7ec;
}

.home-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.11);
}

/* Ícones mais elegantes */
.card-icon,
.profile-title-icon,
.profile-row > i,
.complaint-title-icon {
  box-shadow: inset 0 0 0 1px rgba(134, 22, 48, 0.12);
}

.home-card:hover .card-icon {
  transform: scale(1.06);
}

/* Botão de login mais forte */
.login-card button,
.copy-script-button {
  box-shadow: 0 5px 14px rgba(134, 22, 48, 0.22);
}

.login-card button:hover,
.copy-script-button:hover {
  transform: translateY(-1px);
}

/* Caixas principais mais limpas */
.login-card,
.profile-card,
.scripts-panel,
.script-viewer,
.complaint-form-card,
.complaint-result-card,
.iframe-box {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

/* Títulos com presença corporativa */
.main-content h1 {
  letter-spacing: -0.3px;
}

/* Campo de busca mais refinado */
.scripts-search {
  border: 1px solid transparent;
}

.scripts-search:focus-within {
  border-color: rgba(134, 22, 48, 0.45);
  box-shadow: 0 0 0 3px rgba(134, 22, 48, 0.08);
}

/* Melhor sensação nos formulários */
.complaint-field input:focus,
.complaint-field select:focus,
.complaint-field textarea:focus,
.login-card input:focus {
  border-color: rgba(134, 22, 48, 0.55);
  box-shadow: 0 0 0 3px rgba(134, 22, 48, 0.08);
}

/* ================= BUSCA REGISTRO DE RECLAMAÇÃO ================= */

.complaint-search-box {
  margin: 14px 0 18px;
}

/* melhora encaixe visual */
.complaint-form-card .scripts-search {
  width: 100%;
}

/* leve refinamento para não ficar “colado” */
.complaint-form-card {
  gap: 10px;
  display: flex;
  flex-direction: column;
}
.complaint-types-list {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}

/* ================= GERADOR DE EMAIL - RESULTADO ================= */

.email-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 10px;
}

.email-block {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.email-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.email-block-header strong {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.email-block textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  font-size: 13px;
  color: #111827;
  background: #f9fafb;
  line-height: 1.5;
}

#emailBody {
  min-height: 180px;
}

.email-block .copy-script-button {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 8px;
}

/* ================= SCROLL INDEPENDENTE ================= */

.scripts-layout {
  display: flex;
  gap: 22px;
  height: calc(100vh - 160px);
}

.scripts-panel {
  width: 32%;
  overflow-y: auto;
}

.script-viewer {
  flex: 1;
  overflow-y: auto;
}

/* ================= AJUSTE ALTURA EMAIL ================= */

.scripts-layout {
  align-items: stretch; /* 👈 força os dois lados a ficarem iguais */
}

.scripts-panel {
  display: flex;
  flex-direction: column;
}

.scripts-list {
  flex: 1; /* 👈 faz a lista crescer até o final */
  max-height: none; /* remove limite travado */
}

/* ================= AVISOS - CARTA DE ANUÊNCIA ================= */

.aviso-carta {
  background: #fff8f8;
  border: 1px solid #efc9cf;
  padding: 18px 20px;
  border-radius: 12px;
  align-items: flex-start;
  text-align: left;
}

.aviso-carta strong {
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 8px;
}

.aviso-carta span {
  font-size: 15px;
  line-height: 1.75;
  color: #1f2933;
  white-space: pre-line;
}

/* BOTÃO ADICIONAR CAMPO - PADRÃO SISTEMA */
.add-field-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px dashed rgba(134, 22, 48, 0.45);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.add-field-btn i {
  font-size: 12px;
}

.add-field-btn:hover {
  background: rgba(134, 22, 48, 0.06);
  border-color: var(--primary);
}

/* ================= SCRIPT DINÂMICO - DESLOCAMENTO DE RAMAL ================= */

.dynamic-script-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dynamic-script-alert {
  background: #fff8f8;
  border: 1px solid #efc9cf;
  border-radius: 12px;
  padding: 16px 18px;
  color: #1f2933;
  line-height: 1.6;
}

.dynamic-script-alert strong {
  display: block;
  color: var(--primary);
  font-size: 15px;
  margin-bottom: 6px;
}

.dynamic-script-alert p {
  font-size: 14px;
}

.dynamic-script-result-title {
  margin-top: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.dynamic-script-result {
  width: 100%;
  min-height: 220px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  resize: vertical;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
  color: #111827;
  background: #f9fafb;
}

/* ================= NOVO LAYOUT - SCRIPTS / MENSAGENS PADRÃO ================= */

.scripts-new-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.scripts-top-search-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.scripts-main-search {
  width: 100%;
}

.script-search-clear {
  background: transparent;
  border: 0;
  border-left: 1px solid #e5e7eb;
  color: var(--primary);
  padding-left: 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.script-search-clear:hover {
  color: var(--primary-dark);
}

.scripts-list-hidden {
  display: none;
}

.scripts-top-search-card .scripts-list {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
}

.scripts-initial-message {
  margin-top: 18px;
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
}

.scripts-initial-message i {
  font-size: 18px;
}

.scripts-work-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.scripts-work-area.simple-mode {
  grid-template-columns: minmax(360px, 760px);
  justify-content: center;
}

.script-dynamic-form-card,
.script-result-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.script-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.script-card-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.script-card-header strong {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.script-step-number {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}

.script-step-number.green {
  background: #22c55e;
}

.script-dynamic-badge {
  background: #f7e8ed;
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

#scriptDynamicFields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

#scriptDynamicFields .complaint-field.full {
  grid-column: 1 / -1;
}

.script-clean-button {
  margin-top: 18px;
  min-height: 42px;
  background: #ffffff;
  border: 1px solid #d8dde6;
  color: #1f2933;
  border-radius: 9px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.script-clean-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.script-result-card .script-text {
  min-height: 240px;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .scripts-work-area {
    grid-template-columns: 1fr;
  }

  .scripts-work-area.simple-mode {
    grid-template-columns: 1fr;
  }

  #scriptDynamicFields {
    grid-template-columns: 1fr;
  }
}

/* ================= NOVO LAYOUT - GERADOR DE EMAIL ================= */

.email-work-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.email-form-card,
.email-result-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.email-form-card #emailDynamicFields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.email-form-card #emailDynamicFields .complaint-field {
  margin-bottom: 0;
}

.email-result-card .email-result-grid {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .email-work-area {
    grid-template-columns: 1fr;
  }

  .email-form-card #emailDynamicFields {
    grid-template-columns: 1fr;
  }
}

/* ================= CAMPOS OBRIGATÓRIOS - SCRIPTS DINÂMICOS ================= */

.campo-obrigatorio-erro {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}

.script-required-message {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 800;
}

/* ================= RESULTADO RECLAMAÇÃO - TAMANHO PROFISSIONAL ================= */

#complaintWorkArea {
  align-items: stretch;
}

#complaintWorkArea .email-result-card {
  height: 100%;
  min-height: 650px;
  display: flex;
  flex-direction: column;
}

#complaintWorkArea .email-block {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#complaintResultText {
  flex: 1;
  width: 100%;
  min-height: 550px;
  resize: vertical;

  font-size: 14px;
  line-height: 1.6;
  padding: 12px;
}

/* ================= FOTO PERFIL ================= */

.profile-avatar {
  width: 172px !important;
  height: 172px !important;
  flex: 0 0 172px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  background: #f4e7ea;
}

.profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 50% !important;
  font-size: 0 !important;
  color: transparent !important;
}