/* Błysk AutoSPA Manager v5.0 — CRM klienta */
.crm-nav-badge{
  display:inline-grid;
  place-items:center;
  min-width:19px;
  height:19px;
  margin-left:6px;
  padding:0 5px;
  border-radius:999px;
  background:var(--orange);
  color:#111;
  font-size:10px;
  font-weight:900;
  vertical-align:middle;
}

.crm-toolbar{
  flex-wrap:wrap;
}

.crm-toolbar input{
  flex:1 1 320px;
  max-width:none;
}

.crm-toolbar select{
  flex:0 1 230px;
}

.crm-stats{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.crm-layout{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(330px,.75fr);
  gap:18px;
  align-items:start;
}

.crm-panel{
  min-width:0;
}

.crm-panel-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

.crm-panel-heading h3{
  margin:0 0 4px;
}

.crm-panel-heading p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}

.crm-communications,
.crm-clients{
  display:grid;
  gap:10px;
  max-height:72vh;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:3px;
  overscroll-behavior:contain;
}

.crm-message,
.crm-client-card{
  min-width:0;
  border:1px solid var(--line);
  border-radius:15px;
  padding:14px;
  background:rgba(7,17,29,.6);
}

.crm-message{
  border-left:4px solid rgba(104,199,244,.6);
}

.crm-message.status-ready{
  border-left-color:var(--orange);
  background:linear-gradient(110deg,rgba(245,130,32,.10),rgba(7,17,29,.72));
}

.crm-message.status-planned{
  border-left-color:var(--blue);
}

.crm-message.status-sent,
.crm-message.status-opened{
  border-left-color:var(--green);
}

.crm-message.status-cancelled{
  opacity:.62;
}

.crm-message-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.crm-message-top h4,
.crm-client-card h4{
  margin:3px 0 4px;
  font-size:17px;
}

.crm-message-top p,
.crm-client-card p{
  margin:3px 0;
  color:var(--muted);
  font-size:12px;
}

.crm-type{
  color:var(--blue);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.crm-status{
  flex:0 0 auto;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(104,199,244,.12);
  color:var(--blue);
  font-size:11px;
  font-weight:800;
}

.crm-status-ready{
  background:rgba(245,130,32,.16);
  color:#ffb16e;
}

.crm-status-opened,
.crm-status-sent{
  background:rgba(54,211,153,.14);
  color:#70e6b9;
}

.crm-status-cancelled{
  background:rgba(251,113,133,.12);
  color:#ff91a3;
}

.crm-message-body{
  margin:12px 0;
  color:#e7f2fa;
  line-height:1.48;
  overflow-wrap:anywhere;
}

.crm-message-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:11px;
  color:var(--muted);
  font-size:11px;
}

.crm-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.crm-client-card{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

.crm-client-main{
  min-width:0;
}

.crm-client-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:8px 0;
}

.crm-next-care{
  color:#dff5ff!important;
}

.crm-dashboard-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
  padding:15px 17px;
  border:1px solid rgba(245,130,32,.48);
  border-radius:16px;
  background:linear-gradient(120deg,rgba(245,130,32,.18),rgba(104,199,244,.08));
}

.crm-dashboard-card>div{
  display:grid;
  gap:4px;
}

.crm-dashboard-card span{
  color:var(--muted);
  font-size:12px;
}

.crm-customer-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:14px 0;
}

.crm-customer-summary>div{
  min-width:0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:rgba(7,17,29,.52);
}

.crm-customer-summary span,
.crm-customer-summary strong{
  display:block;
  overflow-wrap:anywhere;
}

.crm-customer-summary span{
  color:var(--muted);
  font-size:11px;
  margin-bottom:4px;
}

.crm-consent-field{
  align-self:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  margin-top:18px;
}

.crm-vehicle-list,
.crm-history{
  display:grid;
  gap:8px;
}

.crm-vehicle,
.crm-history article{
  min-width:0;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(7,17,29,.52);
}

.crm-vehicle{
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.crm-vehicle span,
.crm-history span,
.crm-history p{
  color:var(--muted);
  font-size:12px;
}

.crm-history article{
  display:grid;
  grid-template-columns:minmax(150px,.5fr) minmax(110px,.35fr) minmax(0,1fr);
  gap:7px 12px;
}

.crm-history article p{
  grid-column:1/-1;
  margin:0;
  overflow-wrap:anywhere;
}

.crm-interval-list{
  display:grid;
  gap:8px;
  max-height:65vh;
  overflow-y:auto;
  overflow-x:hidden;
}

.crm-interval-list label{
  display:grid;
  grid-template-columns:minmax(0,1fr) 120px;
  align-items:center;
  gap:12px;
  margin:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(7,17,29,.52);
}

.crm-interval-list input{
  margin:0;
}

@media(max-width:1100px){
  .crm-layout{
    grid-template-columns:1fr;
  }

  .crm-communications,
  .crm-clients{
    max-height:none;
  }
}

@media(max-width:900px){
  .crm-toolbar>*{
    width:100%;
    flex-basis:100%;
  }

  .crm-dashboard-card{
    align-items:stretch;
    flex-direction:column;
  }

  .crm-dashboard-card .btn{
    width:100%;
  }

  .crm-client-card{
    flex-direction:column;
  }

  .crm-client-card>.btn{
    width:100%;
  }

  .crm-customer-summary{
    grid-template-columns:1fr 1fr;
  }

  .crm-history article{
    grid-template-columns:1fr;
  }

  .crm-history article p{
    grid-column:auto;
  }
}

@media(max-width:520px){
  .crm-stats{
    grid-template-columns:1fr 1fr;
  }

  .crm-message-top,
  .crm-message-meta,
  .crm-vehicle{
    flex-direction:column;
  }

  .crm-actions .btn{
    flex:1 1 45%;
  }

  .crm-customer-summary{
    grid-template-columns:1fr;
  }

  .crm-interval-list label{
    grid-template-columns:1fr;
  }
}
