.collections-toolbar {
  align-items: end;
}

.collections-toolbar input {
  min-width: 260px;
  flex: 1;
}

.collections-toolbar select {
  width: auto;
  min-width: 170px;
}

.collections-toolbar #collectionsSyncInfo {
  margin-left: auto;
  color: var(--muted);
}

.collection-card textarea {
  min-height: 132px;
  resize: vertical;
  margin: 10px 0 8px;
}

.collection-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.collection-templates button {
  width: auto;
  padding: 8px 11px;
  border: 1px solid #cbd8ed;
  border-radius: 9px;
  background: #edf2fa;
  color: #08265e;
  font-size: 13px;
}

.collection-templates button:last-child {
  border-color: #e0a49d;
  background: #fff0ed;
  color: #8f231b;
}

.collection-templates button.selected-template {
  border-color: #174b9b;
  background: #174b9b;
  color: #fff;
}

.collection-card .lead-actions button,
.collection-card .lead-actions select {
  width: 100%;
}

.collection-card .lead-actions button[disabled] {
  background: #ffd9cc;
  color: #9b3518;
  cursor: not-allowed;
}

.campaign-results .status-counter {
  border: 0;
  border-radius: 10px;
}

.campaign-results .status-counter:focus-visible,
.collection-card button:focus-visible,
.collection-card select:focus-visible,
.collection-card textarea:focus-visible {
  outline: 3px solid #b7cdf4;
  outline-offset: 2px;
}

@media (max-width: 850px) {
  .collections-toolbar #collectionsSyncInfo {
    width: 100%;
    margin-left: 0;
  }
}

#collectionsSyncBtn{display:none!important}


.collection-ai-panel {
  margin-top: 10px;
  border: 1px solid #d7e1f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.collection-ai-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #08265e;
}

.collection-ai-history {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  margin: 10px 0;
}

.collection-ai-turn {
  border-left: 4px solid #174b9b;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.collection-ai-turn.client {
  border-left-color: #15803d;
}

.collection-ai-turn p {
  margin: 4px 0;
}

.collection-ai-turn small {
  color: var(--muted);
}

.collection-ai-controls {
  display: grid;
  gap: 8px;
}

.collection-ai-controls select,
.collection-ai-controls textarea,
.collection-ai-controls button {
  width: 100%;
}

.schedule-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}.schedule-stack{display:grid;gap:8px}.schedule-table{width:100%;border-collapse:collapse}.schedule-table th,.schedule-table td{border-bottom:1px solid var(--line);padding:10px;text-align:left}.schedule-table th{color:var(--navy);background:#f4f7fb}.schedule-events{display:grid;grid-template-columns:1fr 1fr;gap:18px}@media(max-width:850px){.schedule-grid,.schedule-events{grid-template-columns:1fr}}
.user-card{border:1px solid var(--line);border-radius:14px;padding:16px;margin:14px 0;background:#fff}
.user-card h4{margin:12px 0 8px;color:var(--navy)}
.access-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:8px;margin-bottom:12px}
.access-check{background:#f4f7fb;border:1px solid #d8e2f0;border-radius:10px;padding:8px 10px;margin:0}
@media(max-width:900px){.access-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.access-grid{grid-template-columns:1fr}}
.users-layout{display:grid;grid-template-columns:360px 1fr;gap:18px;align-items:start}
.users-actions{display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.user-row{width:100%;display:grid;gap:4px;text-align:left;background:#f4f7fb;color:var(--navy);border:1px solid #d8e2f0;border-radius:12px;padding:12px 14px;margin-bottom:10px}
.user-row.active{background:var(--navy);color:#fff;border-color:var(--navy)}
.user-row span,.user-row small{font-size:13px;color:inherit;opacity:.82}
.user-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.user-editor-head h3{margin:0;color:var(--navy)}
.user-editor-head p{margin:3px 0 0;color:var(--muted)}
.profile-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.advanced-access{margin-top:8px;border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff}
.advanced-access summary{cursor:pointer;font-weight:800;color:var(--navy)}
.empty.compact{padding:24px;text-align:center;color:var(--muted);border:1px dashed #b9c7da;border-radius:14px}
@media(max-width:950px){.users-layout{grid-template-columns:1fr}}
.editor-actions{display:flex;gap:8px;align-items:center}
.public-cards{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.public-cards div{border:1px solid #cfe0f5;background:#f7fbff;border-radius:14px;padding:14px;display:grid;gap:5px}
.public-cards b{color:var(--muted)}.public-cards strong{font-size:22px;color:var(--navy)}.public-cards small{color:var(--muted)}
.calendar-legend{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}.calendar-legend span{border-radius:999px;padding:6px 10px;font-weight:800;font-size:13px}.legend-work{background:#d8f5e3;color:#08703b}.legend-off{background:#ffe1e1;color:#9d2d24}.legend-holiday{background:#fff0c2;color:#8a5b00}
.calendar-weekdays,.schedule-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}.calendar-weekdays b{text-align:center;color:var(--muted);padding:6px}.calendar-cell{min-height:156px;border:1px solid #d8e2f0;border-radius:14px;background:#fff;padding:10px;display:flex;flex-direction:column;gap:7px}.calendar-cell.today{box-shadow:0 0 0 2px var(--orange) inset}.calendar-cell.holiday{background:#fffaf0}.calendar-cell.selected-work{background:#e9fbef;border-color:#28a458}.calendar-cell.selected-off{background:#fff1f1;border-color:#e16d6d}.calendar-cell.empty-cell{background:transparent;border:0}.calendar-day{display:flex;justify-content:space-between;align-items:center;color:var(--navy)}.calendar-day b{font-size:22px}.calendar-day span{font-size:12px;color:var(--muted);text-transform:capitalize}.tag{border-radius:9px;padding:6px 8px;font-size:12px;font-weight:800;line-height:1.25}.work-tag{background:#d8f5e3;color:#08703b}.off-tag{background:#ffe1e1;color:#9d2d24}.holiday-tag{background:#fff0c2;color:#8a5b00}.swap-tech{margin-top:auto;font-size:12px;font-weight:800;color:var(--navy)}.swap-tech select{margin-top:3px;padding:7px;font-size:13px}
@media(max-width:1000px){.calendar-weekdays,.schedule-calendar{grid-template-columns:repeat(2,1fr)}.calendar-weekdays{display:none}.public-cards{grid-template-columns:1fr}}
@media(max-width:560px){.schedule-calendar{grid-template-columns:1fr}}
.tech-color-dot{display:inline-block;width:13px;height:13px;border-radius:999px;margin-right:7px;vertical-align:middle;box-shadow:0 0 0 2px #fff,0 0 0 3px #d8e2f0}
.availability-split{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;overflow:hidden;border-radius:12px;min-height:42px;border:1px solid rgba(0,0,0,.08)}
.availability-split span{display:flex;align-items:center;justify-content:center;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.35);font-size:11px;padding:4px;min-width:0}
.availability-split span b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.availability-split.unavailable{display:block;background:#f3f4f6;color:#6b7280;text-align:center;padding:10px;font-weight:800}
.calendar-cell.selected-available{box-shadow:0 0 0 2px #38bdf8 inset}
.header-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.header-actions .ghost{background:#e8eef8;color:var(--navy)}
#accessPreviewBar{position:sticky;top:0;z-index:50;background:#10213f;color:#fff;padding:10px 18px;text-align:center;box-shadow:0 2px 10px rgba(0,0,0,.18)}
#accessPreviewBar button{margin-left:12px;background:#ff4b1f;color:#fff;border:0;border-radius:9px;padding:7px 10px;font-weight:800}
.preview-users{display:grid;gap:10px;margin:16px 0}.preview-user{display:grid;gap:4px;text-align:left;background:#f4f7fb;color:var(--navy);border:1px solid #d8e2f0;border-radius:12px;padding:12px}.preview-user span{color:var(--muted);font-size:13px}
.collection-ai-field {
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.collection-ai-field span {
  color: #001b55;
}
.collection-ai-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.collection-ai-tools button {
  width: auto;
  min-width: 180px;
}
.collection-paste-hint {
  display: block;
  line-height: 1.35;
}
.collection-draft-ready {
  margin: 10px 0 6px;
  border: 1px solid #b7ebc6;
  border-radius: 10px;
  background: #e9fbef;
  color: #08703b;
  padding: 9px 11px;
  font-weight: 800;
}
.collection-message.message-ready {
  box-shadow: 0 0 0 3px #22c55e;
  border-color: #22c55e;
}
.collection-card.has-ai-draft .collection-wa {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
}

.collection-timeline {
  margin: 10px 0;
  border: 1px solid #d7e1f0;
  border-radius: 10px;
  background: #fff;
  padding: 9px 11px;
}
.collection-timeline summary {
  cursor: pointer;
  font-weight: 800;
  color: #08265e;
}
.collection-timeline ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.collection-timeline li {
  border-left: 4px solid #174b9b;
  padding-left: 9px;
}
.collection-timeline li span {
  color: var(--muted);
  font-size: 12px;
}
.collection-timeline li p {
  margin: 4px 0 0;
  color: #304260;
  font-size: 13px;
}

.metric-filter {
  text-align: left;
  cursor: pointer;
  border: 1px solid #d8e2f0;
}
.metric-filter:hover,
.metric-filter:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(8, 38, 94, .10);
}
.unified-timeline .timeline-source {
  display: inline-block;
  margin: 0 0 4px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf2fa;
  color: #08265e;
  font-weight: 800;
  font-size: 11px;
}
.unified-timeline li.source-campaign { border-left-color: #15803d; }
.unified-timeline li.source-schedule { border-left-color: #f97316; }
.unified-timeline li.source-collections { border-left-color: #174b9b; }

.contact-search-panel {
  margin: 10px 0;
  border: 1px solid #d7e1f0;
  border-radius: 10px;
  background: #fffdf7;
  padding: 10px 12px;
}
.contact-search-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #08265e;
}
.contact-search-panel ul,
.contact-search-panel ol {
  margin: 8px 0 10px 18px;
  padding: 0;
}
.contact-search-panel li { margin: 6px 0; }
.contact-search-panel .ghost,
.contact-search-actions .ghost {
  width: auto;
  min-width: 130px;
  padding: 7px 10px;
  margin: 3px 4px 3px 0;
}
.contact-search-actions { display:flex; flex-wrap:wrap; gap:6px; }

.collection-action-state {
  display: grid;
  gap: 3px;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border-left: 4px solid #72829b;
  background: #f4f7fb;
  color: #10213f;
  line-height: 1.4;
}
.collection-action-state b { font-size: 15px; }
.collection-action-state span { font-size: 13px; }
.collection-action-state.is-prepared { border-left-color: #b36b00; background: #fff7e8; }
.collection-action-state.is-confirmed { border-left-color: #168047; background: #eef9f1; }
.collection-action-state.needs-review { border-left-color: #a33128; background: #fff1ef; }
.collection-card .confirm-collection-sent:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 620px) {
  .collection-card .lead-actions { display: grid; grid-template-columns: 1fr; }
  .collection-action-state { margin-top: 10px; }
}
