:root {
  --bg: #06080c;
  --surface: rgba(16, 22, 31, 0.92);
  --surface-soft: rgba(21, 29, 40, 0.78);
  --surface-card: rgba(8, 12, 19, 0.72);
  --text: #f5f7fa;
  --text-muted: #aab5c3;
  --accent: #ef1a26;
  --accent-strong: #b6101c;
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(239, 26, 38, 0.22);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 26, 38, 0.82) rgba(13, 17, 23, 0.96);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(13, 17, 23, 0.96);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(239, 26, 38, 0.82);
  border-radius: 999px;
  border: 2px solid rgba(13, 17, 23, 0.96);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 26, 38, 0.96);
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-corner {
  background: rgba(13, 17, 23, 0.96);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 580px at -8% -12%, rgba(239, 26, 38, 0.22) 0%, transparent 65%),
    radial-gradient(860px 480px at 112% 14%, rgba(154, 18, 28, 0.22) 0%, transparent 62%),
    linear-gradient(180deg, #080b10 0%, #06080c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.88) 0%, rgba(6, 8, 12, 0.95) 100%),
    url("../assets/idv/IMG_8251.JPG.jpeg") center / cover no-repeat;
  opacity: 0.18;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.crm-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}

.crm-orb-one {
  width: 380px;
  height: 380px;
  top: 60px;
  left: -140px;
  background: radial-gradient(circle, rgba(239, 26, 38, 0.18) 0%, rgba(239, 26, 38, 0) 72%);
}

.crm-orb-two {
  width: 520px;
  height: 520px;
  right: -160px;
  bottom: 40px;
  background: radial-gradient(circle, rgba(122, 18, 28, 0.22) 0%, rgba(122, 18, 28, 0) 72%);
}

.crm-app {
  min-height: 100vh;
  padding: 1.5rem;
}

.eyebrow {
  margin: 0;
  color: #ff5761;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 3.9vw, 3.6rem);
}

h2 {
  font-size: clamp(1.45rem, 1.9vw, 2rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(182, 16, 28, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(182, 16, 28, 0.34);
  filter: brightness(1.04);
}

.btn-ghost {
  background: rgba(14, 19, 28, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.btn-block {
  width: 100%;
}

.panel {
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 0.44rem;
}

.field span {
  color: #e7edf6;
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  min-height: 48px;
  padding: 0.85rem 0.95rem;
  background: rgba(9, 13, 20, 0.82);
  color: #fff;
}

.field input[type="date"] {
  cursor: pointer;
  color-scheme: dark;
  padding-right: 2.5rem;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.95;
  filter: invert(29%) sepia(90%) saturate(2791%) hue-rotate(339deg) brightness(107%) contrast(93%);
}

.field input[type="date"]::-webkit-datetime-edit {
  color: #f5f7fa;
}

.field input[type="date"]:invalid::-webkit-datetime-edit {
  color: #8895a7;
}

.field textarea {
  min-height: 136px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8895a7;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(239, 26, 38, 0.74);
  box-shadow: 0 0 0 3px rgba(239, 26, 38, 0.12);
}

.field-full {
  grid-column: 1 / -1;
}

.role-pill,
.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.role-pill {
  border: 1px solid rgba(239, 26, 38, 0.22);
  background: rgba(239, 26, 38, 0.1);
  color: #ffd6d9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag {
  background: rgba(255, 255, 255, 0.06);
  color: #d9e2ed;
}

.tag-service-range {
  background: rgba(89, 167, 255, 0.12);
  color: #b7daff;
}

.tag-service-opala {
  background: rgba(241, 192, 77, 0.12);
  color: #ffe19a;
}

.tag-priority-high {
  background: rgba(239, 26, 38, 0.14);
  color: #ffc3c8;
}

.status-pill {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #eef2f7;
}

.status-pill-pre {
  border-color: rgba(223, 175, 62, 0.26);
  background: rgba(223, 175, 62, 0.12);
  color: #ffe4a6;
}

.status-pill-sinal,
.status-pill-confirmado {
  border-color: rgba(239, 26, 38, 0.3);
  background: rgba(239, 26, 38, 0.12);
  color: #ffd4d8;
}

.status-pill-bloqueio {
  border-color: rgba(125, 169, 255, 0.28);
  background: rgba(125, 169, 255, 0.12);
  color: #d3e5ff;
}

.auth-screen {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 3rem);
}

.auth-panel {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 1.2rem;
}

.auth-copy,
.auth-box {
  border: 1px solid var(--stroke-strong);
  border-radius: 30px;
  background: rgba(12, 17, 24, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-copy {
  padding: 2rem clamp(1.5rem, 3vw, 3rem);
  background:
    linear-gradient(180deg, rgba(12, 17, 24, 0.82) 0%, rgba(12, 17, 24, 0.92) 100%),
    url("../assets/idv/IMG_8245.JPG.jpeg") center / cover no-repeat;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  color: #c8d2df;
  font-size: 0.92rem;
}

.auth-logo {
  width: min(240px, 100%);
  margin-bottom: 1.2rem;
}

.auth-description {
  margin: 1rem 0 0;
  max-width: 44ch;
  color: #d4dde7;
}

.preview-points {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.9rem;
}

.preview-card {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(8, 12, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-card strong {
  display: block;
  font-size: 1rem;
}

.preview-card span {
  display: block;
  margin-top: 0.28rem;
  color: var(--text-muted);
}

.auth-box {
  padding: 2rem clamp(1.3rem, 3vw, 2.2rem);
}

.auth-box-head p:last-child {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
}

.auth-users {
  margin-top: 1.35rem;
  display: grid;
  gap: 0.8rem;
}

.auth-user,
.session-card,
.stat-card,
.kanban-column,
.detail-item,
.detail-note,
.lead-list-item,
.script-card,
.schedule-item,
.mini-list-item,
.pipeline-card,
.contacts-table tbody tr {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface-card);
}

.auth-user {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 18px;
}

.auth-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.auth-user strong {
  font-size: 1rem;
}

.auth-user small,
.auth-user span {
  color: var(--text-muted);
}

.auth-form {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.9rem;
}

.manual-login-form {
  display: grid;
  gap: 0.9rem;
}

.auth-divider {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0.2rem 0;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
  position: relative;
  padding: 0 0.8rem;
  background: rgba(12, 17, 24, 0.96);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-provider-card {
  margin-top: 1.25rem;
}

.auth-feedback {
  min-height: 1.2rem;
  margin: 0;
  color: #ff9ca4;
  font-size: 0.88rem;
}

.crm-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.crm-header {
  padding: 1.35rem;
}

.crm-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.crm-brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.crm-brand-lockup img {
  width: 126px;
}

.crm-header-copy {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  max-width: 42ch;
}

.crm-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.crm-tabbar {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.crm-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(7, 11, 17, 0.76);
  padding: 0.76rem 1rem;
  color: #d4dde7;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.crm-tab:hover {
  border-color: rgba(239, 26, 38, 0.28);
}

.crm-tab-active {
  border-color: rgba(239, 26, 38, 0.28);
  background: rgba(239, 26, 38, 0.12);
  color: #fff;
}

.crm-view {
  display: none;
}

.crm-view-active {
  display: grid;
  gap: 1rem;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.view-head p:last-child {
  margin: 0;
  max-width: 46ch;
  color: var(--text-muted);
}

.overview-grid,
.dashboard-grid,
.schedule-grid {
  display: grid;
  gap: 1rem;
}

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

.access-panel-grid,
.access-form {
  display: grid;
  gap: 0.9rem;
}

.access-panel-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.access-checkbox-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(9, 13, 20, 0.82);
}

.access-checkbox-row input {
  width: 18px;
  height: 18px;
}

.access-checkbox-row strong {
  font-size: 0.92rem;
}

.access-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.access-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mini-action {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: #edf2f8;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.schedule-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

.overview-panel,
.kanban-shell,
.contacts-panel,
.schedule-grid > .panel,
.dashboard-grid > .panel {
  padding: 1.25rem;
}

.session-card {
  padding: 1rem;
  border-radius: 18px;
}

.session-label,
.stat-label {
  color: #ff8e97;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-label {
  margin: 0 0 0.35rem;
}

.overview-session-card {
  margin-top: 0.2rem;
}

.overview-session-card strong {
  display: block;
  font-size: 1.18rem;
}

.overview-session-card span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.overview-chip-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.rule-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.8rem;
  color: #d6deea;
}

.rule-list li::marker {
  color: #ff6c75;
}

.script-list,
.schedule-list,
.manual-block-form,
.mini-list,
.pipeline-summary {
  display: grid;
  gap: 0.8rem;
}

.script-card,
.mini-list-item,
.pipeline-card {
  padding: 0.95rem;
  border-radius: var(--radius-sm);
}

.script-card p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  white-space: pre-line;
}

.copy-script {
  margin-top: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  background: rgba(239, 26, 38, 0.12);
  color: #ffd7da;
  font-weight: 800;
  cursor: pointer;
}

.mini-list-item strong,
.pipeline-card strong {
  display: block;
  font-size: 0.98rem;
}

.mini-list-item span,
.pipeline-card span {
  display: block;
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.mini-list-item-empty {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pipeline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pipeline-card-count {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat-card {
  padding: 1rem 1.05rem;
  border-radius: 20px;
}

.stat-value {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
}

.stat-meta,
.board-summary {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.filters-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) repeat(2, minmax(180px, 0.45fr)) auto;
  gap: 0.8rem;
  align-items: end;
}

.filters-toolbar-contacts {
  grid-template-columns: minmax(240px, 1.15fr) repeat(3, minmax(160px, 0.42fr)) auto;
  margin-bottom: 1rem;
}

.kanban-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.kanban-layout.has-drawer {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
}

.kanban-column {
  min-height: 540px;
  padding: 0.95rem;
  border-radius: 20px;
}

.kanban-column.drag-over {
  border-color: rgba(239, 26, 38, 0.5);
  background: rgba(31, 13, 17, 0.64);
}

.kanban-head,
.lead-card-top,
.lead-detail-header,
.schedule-item-head,
.schedule-item-body,
.schedule-item-actions,
.lead-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.kanban-head,
.lead-drawer-head {
  align-items: flex-start;
}

.kanban-head {
  margin-bottom: 0.85rem;
}

.kanban-head span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.kanban-count {
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.kanban-list,
.lead-detail {
  display: grid;
  gap: 0.8rem;
}

.lead-card {
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 19, 29, 0.86);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.lead-card:hover,
.lead-card-active,
.contacts-table tbody tr:hover {
  border-color: rgba(239, 26, 38, 0.4);
  background: rgba(31, 14, 18, 0.88);
}

.lead-card-title,
.lead-detail-name {
  display: block;
  font-weight: 800;
}

.lead-card-subtitle,
.lead-card-value,
.lead-detail-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.lead-card-route {
  margin: 0.75rem 0 0;
  color: #dde5ef;
  font-size: 0.9rem;
}

.lead-card-meta,
.lead-card-tags,
.lead-detail-actions,
.status-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.lead-drawer {
  display: none;
  align-content: start;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  background: rgba(12, 17, 24, 0.94);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 11rem);
  overflow-y: auto;
  position: sticky;
  top: 1rem;
}

.kanban-layout.has-drawer .lead-drawer {
  display: grid;
}

.lead-detail-role {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.detail-grid,
.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.detail-item,
.detail-note {
  padding: 0.9rem;
  border-radius: 14px;
}

.detail-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.contacts-table th {
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: bottom;
  padding-bottom: 0.4rem;
}

.contacts-sort-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font: inherit;
  cursor: pointer;
}

.contacts-sort-button:hover {
  color: #eef2f7;
}

.contacts-sort-button-active {
  color: #eef2f7;
}

.contacts-sort-indicator {
  min-width: 0.9rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.78rem;
  text-align: right;
}

.contacts-sort-button[data-direction="asc"] .contacts-sort-indicator::before {
  content: "↑";
}

.contacts-sort-button[data-direction="desc"] .contacts-sort-indicator::before {
  content: "↓";
}

.detail-item strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.96rem;
}

.detail-note p {
  margin: 0.3rem 0 0;
  color: #dbe3ed;
  white-space: pre-line;
}

.status-action-grid {
  margin-top: 1rem;
}

.status-action {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.58rem 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  color: #e9eef5;
  font-weight: 700;
  cursor: pointer;
}

.status-action-active {
  border-color: rgba(239, 26, 38, 0.32);
  background: rgba(239, 26, 38, 0.12);
}

.status-action-cancel {
  border-color: rgba(255, 255, 255, 0.18);
}

.schedule-list {
  max-height: 620px;
  overflow-y: auto;
}

.schedule-item {
  padding: 0.95rem;
  border-radius: 16px;
}

.schedule-item-body {
  margin-top: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-item-meta,
.schedule-item-note,
.schedule-item-empty {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.schedule-item-note {
  margin-top: 0.55rem;
}

.schedule-item-actions {
  margin-top: 0.8rem;
  justify-content: flex-start;
}

.contacts-table-wrap {
  overflow: auto;
}

.contacts-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 0.55rem;
}

.contacts-table th,
.contacts-table td {
  text-align: left;
  padding: 0 0.9rem;
}

.contacts-table tbody tr {
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.contacts-table tbody td {
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  color: #e6ecf3;
}

.contacts-table tbody tr td:first-child {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.contacts-table tbody tr td:last-child {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.contacts-cell-title {
  display: block;
  font-weight: 800;
}

.contacts-cell-subtitle {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.contacts-open-button {
  min-height: 40px;
  padding: 0.6rem 0.9rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(8px);
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lead-modal .panel {
  width: min(760px, 100%);
  padding: 1.2rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lead-form {
  display: grid;
  gap: 1rem;
}

.lead-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

@media (max-width: 1260px) {
  .overview-grid,
  .dashboard-grid,
  .schedule-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kanban-layout.has-drawer {
    grid-template-columns: 1fr;
  }

  .lead-drawer {
    max-height: none;
    position: static;
  }

  .access-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .auth-panel,
  .overview-grid,
  .dashboard-grid,
  .schedule-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .crm-header-row,
  .view-head {
    display: grid;
  }

  .crm-header-actions {
    justify-content: flex-start;
  }

  .filters-toolbar,
  .filters-toolbar-contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .crm-app {
    padding: 1rem;
  }

  .crm-header,
  .overview-panel,
  .kanban-shell,
  .contacts-panel,
  .schedule-grid > .panel,
  .dashboard-grid > .panel,
  .lead-modal .panel,
  .auth-copy,
  .auth-box {
    border-radius: 22px;
  }

  .crm-brand-lockup {
    display: grid;
  }

  .crm-brand-lockup img {
    width: 150px;
  }

  .filters-toolbar,
  .filters-toolbar-contacts,
  .detail-grid,
  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-auto-columns: minmax(260px, 84vw);
  }
}

@media (max-width: 560px) {
  .crm-tabbar,
  .crm-header-actions,
  .overview-chip-row,
  .lead-card-meta,
  .lead-card-tags,
  .status-action-grid {
    gap: 0.5rem;
  }

  .crm-tab,
  .btn,
  .contacts-open-button {
    width: 100%;
  }

  .crm-header-actions {
    display: grid;
  }
}
