:root {
  --navy: #111936;
  --navy-2: #1d2857;
  --teal: #169d94;
  --teal-2: #55c6bb;
  --bg: #f1f4f8;
  --card: #ffffff;
  --text: #18202d;
  --muted: #697386;
  --line: #e2e7ef;
  --danger: #d94f5c;
  --success: #16865d;
  --warning: #f5b942;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); min-width: 1180px; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; transition: transform .12s, filter .12s; }
button:hover { filter: brightness(.97); }
button:active { transform: translateY(1px); }
button:disabled {
  cursor: not-allowed;
  filter: grayscale(.35);
  opacity: .5;
  transform: none;
}
.hidden { display: none !important; }
.wide { width: 100%; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(470px, 42%) 1fr;
  background: linear-gradient(115deg, #1ba79d 0%, #111936 100%);
}
.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #050608;
  box-shadow: 22px 0 55px rgba(0, 0, 0, .26);
  z-index: 2;
}
.login-box { width: min(420px, 78%); color: #fff; }
.eyebrow { color: var(--teal-2); font-weight: 800; letter-spacing: .15em; font-size: 12px; }
.login-box h1 { margin: 12px 0 3px; font-size: 45px; letter-spacing: -.04em; }
.login-box > p { margin: 0 0 38px; color: #adb5c6; font-size: 16px; }
.login-box label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }
.login-box input {
  width: 100%;
  height: 54px;
  border-radius: 9px;
  border: 1px solid #2c3342;
  padding: 0 16px;
  background: #f4f6fa;
  color: var(--text);
  outline: none;
}
.login-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 157, 148, .24); }
.login-box .primary { margin-top: 28px; height: 54px; border-radius: 9px; text-transform: uppercase; letter-spacing: .05em; }
.form-error { min-height: 24px; margin-top: 12px; color: #ff7f8a; text-align: center; }
.brand-panel { position: relative; display: grid; place-items: center; overflow: hidden; padding: 70px; }
.brand-panel img { position: relative; width: min(790px, 90%); max-height: 60vh; object-fit: contain; filter: drop-shadow(0 22px 42px rgba(0, 0, 0, .26)); z-index: 1; }
.brand-glow { position: absolute; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), rgba(255,255,255,0) 66%); }
.brand-copy { position: absolute; bottom: 48px; color: #fff; display: flex; flex-direction: column; text-align: center; gap: 6px; }
.brand-copy strong { font-size: 19px; }
.brand-copy span { color: #d7def0; }

.dashboard { min-height: 100vh; }
.topbar {
  height: 76px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-shadow: 0 5px 18px rgba(17, 25, 54, .2);
}
.topbar-brand { display: flex; align-items: center; gap: 16px; }
.topbar-brand img { width: 96px; height: 58px; object-fit: contain; object-position: center; border-radius: 7px; background: #fff; }
.topbar-brand div { display: flex; flex-direction: column; gap: 3px; }
.topbar-brand strong { font-size: 20px; }
.topbar-brand span { color: #cbd4ea; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions .nav-active {
  background: #fff;
  color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--teal);
}
.mode-button {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.workspace {
  height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 264px minmax(520px, 1fr) 390px;
  gap: 14px;
  padding: 14px;
}
.encarte-workspace {
  height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 310px minmax(620px, 1fr) 360px;
  gap: 14px;
  padding: 14px;
}
.boletos-workspace {
  height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) minmax(360px, .85fr);
  gap: 14px;
  padding: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(28, 39, 66, .06);
}
.card-heading { display: flex; align-items: center; gap: 11px; padding: 17px 17px 11px; }
.card-heading h2 { margin: 0; font-size: 17px; }
.card-heading p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-heading.compact { padding-bottom: 10px; }
.step, .chat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.chat-icon { background: linear-gradient(135deg, var(--navy), #4b5ba1); }
.industry-card { overflow: hidden; }
.industry-list { padding: 2px 13px 6px; }
.industry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 9px;
  border-bottom: 1px solid #edf0f4;
}
.industry-item label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; min-width: 0; }
.industry-item input { accent-color: var(--teal); width: 16px; height: 16px; }
.industry-count { min-width: 26px; height: 22px; border-radius: 12px; display: grid; place-items: center; background: #e5f6f4; color: #087d76; font-size: 11px; font-weight: 800; }
.industry-item.empty { color: #929aaa; }
.industry-item.empty .industry-count { background: #f0f2f5; color: #929aaa; }
.notice { margin: 10px 14px 16px; padding: 11px; border-radius: 9px; background: #fff8e6; color: #795815; font-size: 11px; line-height: 1.4; }

.contacts-card { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.contacts-heading { flex: 0 0 auto; }
.contacts-heading .selection-pill { margin-left: auto; }
.selection-pill { padding: 8px 12px; border-radius: 18px; background: #e5f6f4; color: #087d76; font-size: 12px; font-weight: 800; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; padding: 0 17px; }
.filters label, .schedule-row label { display: flex; flex-direction: column; gap: 5px; }
.filters span, .schedule-row span { font-size: 11px; font-weight: 700; color: var(--muted); }
input, select, textarea {
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 157, 148, .12); }
.filters input, .filters select { height: 38px; padding: 0 10px; min-width: 0; }
.filter-actions { display: flex; gap: 8px; padding: 10px 17px; }
.filter-actions button, .topbar-actions button { padding: 9px 13px; border-radius: 8px; font-size: 12px; font-weight: 750; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { position: sticky; top: 0; z-index: 2; }
th { padding: 11px 9px; background: var(--navy); color: #fff; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
td { padding: 9px; border-bottom: 1px solid #edf0f4; }
tbody tr:hover { background: #f2fbfa; }
.check-col { width: 38px; text-align: center; }
td.invalid { color: var(--danger); }

.right-column { min-height: 0; }
.action-card { padding: 0 16px 15px; overflow: auto; }
.action-card .card-heading { padding-left: 0; padding-right: 0; }
.schedule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.schedule-row input { height: 40px; padding: 0 9px; }
.consent { display: flex; gap: 8px; margin: 12px 0; font-size: 12px; line-height: 1.35; }
.consent input { accent-color: var(--teal); width: 16px; height: 16px; flex: 0 0 auto; }
.action-card > button { min-height: 39px; border-radius: 8px; margin-top: 7px; font-size: 12px; font-weight: 800; }
.split-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 7px; }
.split-buttons button { min-height: 38px; border-radius: 8px; font-weight: 800; }
.job-status { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 11px; border-radius: 9px; background: #edf9f7; color: #0d625c; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); margin-top: 4px; box-shadow: 0 0 0 4px rgba(22,157,148,.12); }
.job-status div { display: flex; flex-direction: column; gap: 3px; }
.job-status strong { font-size: 12px; }
.job-status small { font-size: 10px; color: #537b78; }

.primary { background: var(--teal); color: #fff; }
.secondary { background: var(--navy-2); color: #fff; }
.navy { background: var(--navy); color: #fff; }
.ghost { background: #e9edf3; color: var(--text); }
.danger { background: var(--danger); color: #fff; }
.success { background: var(--success); color: #fff; }
.warning { background: var(--warning); color: #34270a; }
.warning-outline { background: #fff5d9; color: #6f5006; border: 1px solid #efc45a; }

.encarte-config-card,
.encarte-products-card,
.encarte-summary-card {
  min-height: 0;
  overflow: hidden;
}
.encarte-config-card,
.encarte-summary-card {
  overflow-y: auto;
}
.encarte-products-card {
  display: flex;
  flex-direction: column;
}
.encarte-form {
  display: grid;
  gap: 11px;
  padding: 0 17px 18px;
}
.encarte-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.encarte-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.encarte-form input,
.encarte-form select {
  min-height: 40px;
  padding: 0 10px;
  min-width: 0;
}
.encarte-form textarea {
  min-height: 80px;
  padding: 10px;
  resize: vertical;
}
.encarte-form .consent {
  flex-direction: row;
}
.encarte-standard-notice {
  padding: 13px;
  border-radius: 10px;
  background: #edf9f2;
  color: #0d6250;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}
.encarte-filter-heading {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.encarte-filter-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.encarte-filter-actions button,
.encarte-summary-actions button {
  min-height: 40px;
  min-width: 0;
  width: 100%;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.encarte-products-table td {
  vertical-align: middle;
}
.encarte-product-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 420px;
}
.encarte-product-name strong {
  color: var(--navy);
  font-size: 12px;
}
.encarte-product-name span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.encarte-summary-card {
  display: flex;
  flex-direction: column;
}
.encarte-selected-list {
  margin: 0 16px;
  min-height: 130px;
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.encarte-selected-item {
  padding: 8px 5px;
  border-bottom: 1px solid #edf0f4;
  color: var(--text);
}
.encarte-selected-item:last-child {
  border-bottom: 0;
}
.encarte-selected-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--green, #075b3b);
}
.encarte-summary-actions {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}
.encarte-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 16px 16px;
  padding: 12px;
  border-radius: 11px;
  background: #edf9f2;
  color: #0d6250;
  font-size: 12px;
}
.encarte-result img {
  width: 100%;
  max-height: 390px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d1e8dc;
}
.encarte-result a {
  color: var(--navy);
  font-weight: 800;
  text-align: center;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.boleto-card {
  min-height: 0;
  overflow: auto;
}
.boleto-form {
  display: grid;
  gap: 12px;
  padding: 0 17px 18px;
}
.boleto-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.boleto-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.boleto-form input,
.boleto-form textarea {
  width: 100%;
  padding: 10px;
}
.boleto-form textarea {
  min-height: 142px;
  resize: vertical;
}
.boleto-form .consent {
  flex-direction: row;
  margin: 0;
}
.boleto-form button {
  min-height: 42px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 850;
}
.boleto-status-card {
  display: flex;
  flex-direction: column;
}
.boleto-status {
  margin: 0 17px 12px;
  padding: 13px;
  border-radius: 11px;
  background: #edf9f7;
  color: #0d625c;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.boleto-status strong {
  font-size: 13px;
}
.boleto-status span {
  font-size: 12px;
  color: #537b78;
}
.boleto-log {
  margin: 0 17px 18px;
  flex: 1;
  min-height: 300px;
  overflow: auto;
  padding: 12px;
  border-radius: 11px;
  background: #091124;
  color: #d9f4ef;
  font: 11px/1.45 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(9, 14, 31, .58); z-index: 20; }
.modal-card { position: relative; width: min(620px, 92vw); max-height: 84vh; overflow: auto; background: #fff; border-radius: 15px; padding: 24px; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.modal-card h3 { margin: 0 35px 14px 0; font-size: 21px; }
.modal-close { position: absolute; top: 13px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: #edf0f4; font-size: 24px; color: var(--muted); }
#modal-content { white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: #3d4656; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.modal-actions button { min-width: 110px; padding: 10px 15px; border-radius: 8px; font-weight: 800; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 10px; box-shadow: 0 15px 35px rgba(0,0,0,.22); z-index: 30; font-size: 13px; }

@media (max-height: 780px) {
  .workspace { padding: 9px; gap: 9px; }
  .encarte-workspace { padding: 9px; gap: 9px; }
  .boletos-workspace { padding: 9px; gap: 9px; }
  .card-heading { padding-top: 12px; }
  .industry-item { padding-top: 7px; padding-bottom: 7px; }
  .notice { margin-top: 5px; }
}
