@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-1: #f7f8fb;
  --bg-2: #eef2f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-2: #3b82f6;
  --border: #e6eaf2;
  --success: #15803d;
  --error: #b42318;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Manrope', 'IBM Plex Sans', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(59, 130, 246, 0.18), transparent 46%),
    radial-gradient(circle at 90% 18%, rgba(29, 78, 216, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.crm-page .page-shell {
  max-width: 1860px;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 44px 16px;
}

.card {
  background: var(--card);
  border: 1px solid #103889;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.centered {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
}

.auth-card {
  width: min(420px, 100%);
  align-self: center;
}

.auth-header {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo-img {
  height: 32px;
  width: auto;
}

.logo-img.large {
  height: 60px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1,
h2 {
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 48px);
  border-radius: 0;
  border-bottom: 1px solid #dbe3f5;
  background: linear-gradient(90deg, #e6efff 0%, #f7f9ff 55%, #eef2ff 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  animation: fadeUp 0.5s ease both;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 18px;
}

.topbar .logo-img {
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid #dfe6f5;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: #1f2a44;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid #dfe6f5;
  border-radius: 999px;
  background: #f6f8fd;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.24);
}

.btn.ghost {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.content {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  animation: fadeUp 0.55s ease both;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.crm-actions .action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.kpi-card {
  border: 1px solid #d9e2f3;
  border-radius: 14px;
  padding: 14px;
  background: #f7f9ff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card h3 {
  margin: 0;
  font-size: 22px;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.status-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.status-label strong {
  color: var(--text);
  font-size: 14px;
}

.status-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #eef2ff;
  overflow: hidden;
}

.status-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: inherit;
}

.filter-form {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.crm-actions .filter-form {
  margin-top: 0;
  align-self: flex-end;
}

.filter-form .field {
  margin: 0;
}

.filter-form .field span {
  margin-bottom: 4px;
}

.filter-form .btn {
  margin-bottom: 0;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7f9ff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.tab:hover,
.tab:focus {
  color: var(--text);
  border-color: rgba(29, 78, 216, 0.4);
  background: #eef2ff;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fafc;
  margin: 8px 0;
}

.flash.success {
  border-color: rgba(21, 128, 61, 0.3);
  color: var(--success);
}

.flash.error {
  border-color: rgba(180, 35, 24, 0.3);
  color: var(--error);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.form.inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  background: #f7f9ff;
  border: 1px solid #103889;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  outline: 1px solid rgba(29, 78, 216, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.field-inline-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field-inline-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.form-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--error);
}

.password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.muted a,
.link {
  color: var(--primary);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.assessor-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.assessor-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d9e2f3;
  background: #f9fbff;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.assessor-item:hover {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.assessor-item:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.assessor-tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.assessor-name {
  flex: 1;
}

.assessor-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assessor-tag.secondary {
  background: #ffe4e6;
  color: #9f1239;
}

.menu-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.menu-card {
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border-color: #d9e2f3;
}

.menu-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.menu-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-card .menu-title .muted.small {
  min-height: 44px;
}

.menu-icon {
  margin-top: 10px;
  border: 1px dashed #d7e0f2;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.06), rgba(59, 130, 246, 0.08));
  min-height: 160px;
}

.menu-icon svg {
  width: 46px;
  height: 46px;
}

.menu-icon span {
  font-weight: 600;
  color: var(--muted);
}

.report-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px;
  animation: fadeUp 0.55s ease both;
}

.report-card:nth-child(2) {
  animation-delay: 0.05s;
}

.report-card:nth-child(3) {
  animation-delay: 0.1s;
}

.report-card:nth-child(4) {
  animation-delay: 0.15s;
}

.report-card:nth-child(5) {
  animation-delay: 0.2s;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.iframe-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 56%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f2f5fb;
  flex: 1;
  min-height: 210px;
}

.iframe-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.table {
  display: grid;
  gap: 8px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 1fr 0.6fr;
  gap: 8px;
  align-items: center;
}

.table-head {
  color: var(--muted);
  font-size: 12px;
}

.table-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-row select {
  background: #f7f9ff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(320px, 1fr));
  gap: 20px;
  align-items: start;
}

.kanban-column {
  background: #f7f9ff;
  border: 1px solid #d9e2f3;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kanban-column.drag-over {
  border-color: rgba(29, 78, 216, 0.5);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.18);
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kanban-header h3 {
  font-size: 14px;
  margin: 0;
}

.kanban-counts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kanban-count {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.kanban-count-ia {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.kanban-list {
  display: grid;
  gap: 12px;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid #d9e2f3;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  min-height: 260px;
  align-items: stretch;
  text-align: left;
  width: 100%;
  cursor: grab;
  font: inherit;
  color: inherit;
  appearance: none;
}

.kanban-card.dragging {
  opacity: 0.6;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.45);
  outline-offset: 2px;
}

.kanban-card:hover {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

.kanban-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kanban-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kanban-info {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.kanban-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.kanban-info-row span {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: #64748b;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
}

.kanban-info-row strong {
  font-weight: 600;
  color: #0f172a;
  font-size: 12px;
  text-align: right;
}

.kanban-meta {
  display: grid;
  gap: 12px;
}

.kanban-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meeting-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.meeting-field .field {
  min-width: 0;
}

.meeting-field .field input {
  width: 100%;
}

.modal__content.lead-modal {
  width: min(720px, 100%);
  height: auto;
}

.lead-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.lead-modal-form .meeting-field {
  grid-column: span 2;
}

.lead-modal-form .field:last-of-type {
  grid-column: span 2;
}

.lead-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: span 2;
}

.kanban-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn.danger {
  background: #dc2626;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.2);
}

.btn.danger:hover {
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.24);
}

.kanban-card .field {
  width: 100%;
}

.kanban-card .btn.small {
  width: 100%;
  justify-content: center;
}

.kanban-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.kanban-empty.hidden {
  display: none;
}

.lead-input {
  width: 100%;
  background: #f7f9ff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.kanban-card .field input,
.kanban-card .field select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
}

.kanban-card .btn.small {
  padding: 10px 14px;
  font-size: 12px;
}

.reports-admin {
  display: grid;
  gap: 12px;
}

.report-config {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfcff;
}

.report-config__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.title-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.title-input:focus {
  outline: none;
  border-bottom: 1px solid var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.emoji {
  font-size: 46px;
  margin-bottom: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal__content {
  width: min(1200px, 100%);
  height: min(90vh, 900px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
}

.modal__content--small {
  width: min(420px, 100%);
  height: auto;
}

.modal__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-iframe {
  flex: 1;
  padding-top: 0;
  min-height: 0;
}

.modal-iframe iframe {
  height: 100%;
}

.modal-open {
  overflow: hidden;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: 20px 16px;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }

  .lead-modal-form {
    grid-template-columns: 1fr;
  }

  .lead-modal-form .meeting-field,
  .lead-modal-form .field:last-of-type,
  .lead-modal-actions {
    grid-column: span 1;
  }

}
