.vfcrm-app {
  --vfcrm-bg: linear-gradient(180deg, #f5f8fb 0%, #eef4f9 100%);
  --vfcrm-surface: #ffffff;
  --vfcrm-border: #d7e0ea;
  --vfcrm-text: #0f2438;
  --vfcrm-muted: #587188;
  --vfcrm-accent: #0d6f61;
  --vfcrm-accent-soft: #d9f2ed;
  border: 1px solid var(--vfcrm-border);
  border-radius: 14px;
  background: var(--vfcrm-bg);
  color: var(--vfcrm-text);
  min-height: 620px;
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  overflow: hidden;
}

.vfcrm-nav {
  background: #0f2d46;
  color: #d9e8f6;
  padding: 16px;
  border-right: 1px solid #183d5d;
}

.vfcrm-nav h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.vfcrm-nav button {
  width: 100%;
  text-align: left;
  margin: 0 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 9px 10px;
  cursor: pointer;
}

.vfcrm-nav button.active {
  background: #1c4a70;
  border-color: #2d5c82;
  color: #fff;
}

.vfcrm-main {
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.vfcrm-toolbar {
  border: 1px solid var(--vfcrm-border);
  background: var(--vfcrm-surface);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vfcrm-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vfcrm-kpi {
  border: 1px solid var(--vfcrm-border);
  border-radius: 10px;
  background: var(--vfcrm-surface);
  padding: 10px 12px;
}

.vfcrm-kpi .k {
  font-size: 12px;
  color: var(--vfcrm-muted);
}

.vfcrm-muted {
  color: var(--vfcrm-muted);
}

.vfcrm-kpi .v {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
}

.vfcrm-list {
  border: 1px solid var(--vfcrm-border);
  border-radius: 10px;
  background: var(--vfcrm-surface);
  overflow: hidden;
}

.vfcrm-list .row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eef3f8;
  cursor: pointer;
}

.vfcrm-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.vfcrm-open-btn,
.vfcrm-btn,
.vfcrm-tab-btn {
  border: 1px solid #c7d4e0;
  background: #f8fbff;
  color: #18344e;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.vfcrm-btn-primary {
  background: #0d6f61;
  color: #fff;
  border-color: #0d6f61;
}

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

.vfcrm-card-block {
  border: 1px solid var(--vfcrm-border);
  border-radius: 10px;
  background: var(--vfcrm-surface);
  padding: 10px;
}

.vfcrm-card-block h4 {
  margin: 0 0 8px;
}

.vfcrm-lead-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.vfcrm-lead-filters {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 8px;
  margin-bottom: 10px;
}

.vfcrm-lead-filters input,
.vfcrm-lead-filters select {
  border: 1px solid #c8d7e6;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}

.vfcrm-kanban {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.vfcrm-kanban-col {
  border: 1px solid #d5e1ec;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px;
  min-height: 260px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.vfcrm-kanban-col h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: capitalize;
}

.vfcrm-kanban-card {
  border: 1px solid #d3dee9;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  margin-bottom: 8px;
  display: grid;
  gap: 6px;
  cursor: grab;
  text-align: left;
  width: 100%;
}

.vfcrm-selection-banner {
  margin-bottom: 10px;
  border: 1px solid #bad9d3;
  background: #ecfbf7;
  color: #1f5f4e;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.vfcrm-is-selected {
  border-color: #0d6f61;
  background: #ecfbf7;
  box-shadow: 0 0 0 2px rgba(13, 111, 97, 0.16);
}

.vfcrm-is-dragging {
  opacity: 0.72;
}

.vfcrm-drop-target-active {
  border-color: #0d6f61 !important;
  background: #e8f8f4 !important;
  box-shadow: inset 0 0 0 2px rgba(13, 111, 97, 0.28);
}

.vfcrm-agenda-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.vfcrm-agenda-unscheduled {
  border: 1px solid #d5e1ec;
  border-radius: 10px;
  background: #f9fcff;
  padding: 10px;
  margin-bottom: 12px;
}

.vfcrm-agenda-unscheduled-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vfcrm-agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.vfcrm-agenda-weekdays span {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5d748b;
  text-align: right;
  padding-right: 6px;
}

.vfcrm-agenda-grid {
  width: 100%;
  min-width: 0;
}

.vfcrm-agenda-grid.seven-col {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.vfcrm-agenda-grid.one-col {
  display: grid;
  grid-template-columns: 1fr;
}

.vfcrm-agenda-cell {
  border: 1px solid #d7e3ee;
  border-radius: 10px;
  background: #fff;
  min-height: 140px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.vfcrm-agenda-cell-head {
  border-bottom: 1px solid #edf3f9;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1c3e59;
  font-size: 12px;
}

.vfcrm-agenda-cell-head.is-muted {
  color: #8ca1b5;
}

.vfcrm-agenda-cell-body {
  padding: 6px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.vfcrm-agenda-pill {
  border: 1px solid #d0dbe7;
  border-radius: 8px;
  background: #ffffff;
  color: #16324a;
  padding: 4px 6px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: grab;
  width: 100%;
}

.vfcrm-agenda-pill-label,
.vfcrm-agenda-pill-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vfcrm-agenda-pill-label {
  font-size: 12px;
  font-weight: 600;
}

.vfcrm-agenda-pill-meta {
  font-size: 11px;
  color: #5b7288;
}

.vfcrm-agenda-more {
  border: 1px dashed #b8c8d8;
  background: #f4f9ff;
  color: #4c6680;
  border-radius: 8px;
  padding: 4px 6px;
  text-align: left;
  font-size: 12px;
}

.vfcrm-agenda-grid.is-time-grid {
  overflow-x: auto;
}

.vfcrm-agenda-day-col {
  border: 1px solid #d7e3ee;
  border-radius: 10px;
  background: #fff;
  min-width: 220px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.vfcrm-agenda-day-col-head {
  border-bottom: 1px solid #edf3f9;
  padding: 8px;
  font-weight: 600;
  color: #18344e;
  background: #f8fbff;
}

.vfcrm-agenda-day-slots {
  max-height: 560px;
  overflow: auto;
}

.vfcrm-agenda-slot {
  display: grid;
  grid-template-columns: 78px 1fr;
  border-top: 1px solid #edf3f9;
  min-height: 48px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.vfcrm-agenda-slot:first-child {
  border-top: 0;
}

.vfcrm-agenda-hour-label {
  padding: 8px;
  border-right: 1px solid #edf3f9;
  font-size: 11px;
  color: #5d748b;
  background: #f9fcff;
}

.vfcrm-agenda-slot-body {
  padding: 5px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.vfcrm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.vfcrm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 35, 0.55);
}

.vfcrm-modal-panel {
  position: relative;
  z-index: 1;
  margin: 32px auto;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  border-radius: 14px;
  border: 1px solid #c9d7e5;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.vfcrm-modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.vfcrm-modal-tabs {
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vfcrm-tab-btn.active {
  background: #0d6f61;
  color: #fff;
  border-color: #0d6f61;
}

.vfcrm-modal-body {
  padding: 14px;
  overflow: auto;
}

.vfcrm-modal-foot {
  padding: 10px 14px;
  border-top: 1px solid #e5edf5;
  background: #f6fbff;
  color: #275374;
}

.vfcrm-modal-foot.is-error {
  background: #fff5f3;
  color: #962d22;
}

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

.vfcrm-tab-grid label,
.vfcrm-preview-card label {
  display: grid;
  gap: 5px;
  color: #2c4963;
  font-size: 13px;
}

.vfcrm-tab-grid input,
.vfcrm-tab-grid textarea,
.vfcrm-tab-grid select,
.vfcrm-preview-card input,
.vfcrm-preview-card textarea,
.vfcrm-preview-card select {
  border: 1px solid #c8d7e6;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}

.vfcrm-tab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vfcrm-interactions-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.vfcrm-interactions-list {
  display: grid;
  gap: 8px;
}

.vfcrm-interaction-row {
  text-align: left;
  border: 1px solid #d2deea;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.vfcrm-interaction-row.selected {
  border-color: #0d6f61;
  background: #effaf7;
}

.vfcrm-interaction-row span,
.vfcrm-interaction-row small {
  color: #5a738b;
}

.vfcrm-preview-card {
  border: 1px solid #d4e0eb;
  border-radius: 10px;
  background: #f9fcff;
  padding: 10px;
}

.vfcrm-sublist {
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.vfcrm-subrow {
  border-top: 1px solid #eef3f8;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.vfcrm-subrow:first-child {
  border-top: 0;
}

.vfcrm-list .row:first-child {
  border-top: 0;
}

.vfcrm-list .row.selected {
  background: #f0f7ff;
}

.vfcrm-pill {
  border-radius: 999px;
  border: 1px solid #c7d4e0;
  background: #f4f8fc;
  padding: 3px 8px;
  font-size: 12px;
  color: #39526b;
}

.vfcrm-empty {
  border: 1px dashed #b7c8d9;
  border-radius: 10px;
  background: #f8fbff;
  color: #4f6780;
  padding: 18px;
}

.vfcrm-side {
  background: #f7fbff;
  border-left: 1px solid var(--vfcrm-border);
  padding: 16px;
}

.vfcrm-side .card {
  border: 1px solid var(--vfcrm-border);
  border-radius: 10px;
  background: var(--vfcrm-surface);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.vfcrm-status-ok {
  color: #1f5f4e;
  background: var(--vfcrm-accent-soft);
  border-color: #b8e0d8;
}

@media (max-width: 1160px) {
  .vfcrm-app {
    grid-template-columns: 180px 1fr;
  }

  .vfcrm-side {
    display: none;
  }

  .vfcrm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vfcrm-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .vfcrm-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vfcrm-agenda-grid.seven-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vfcrm-interactions-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .vfcrm-app {
    grid-template-columns: 1fr;
  }

  .vfcrm-nav {
    border-right: 0;
    border-bottom: 1px solid #183d5d;
  }

  .vfcrm-kpis {
    grid-template-columns: 1fr;
  }

  .vfcrm-lead-filters {
    grid-template-columns: 1fr;
  }

  .vfcrm-kanban,
  .vfcrm-agenda-grid.seven-col {
    grid-template-columns: 1fr;
  }

  .vfcrm-agenda-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .vfcrm-modal-panel {
    margin: 10px auto;
    width: calc(100vw - 10px);
    max-height: calc(100vh - 20px);
  }

  .vfcrm-tab-grid {
    grid-template-columns: 1fr;
  }
}
