.cs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}.cs-role{display:flex;gap:6px;padding:4px;border:1px solid var(--line);border-radius:9px;background:var(--soft)}.cs-role button{min-height:34px;padding:0 12px;border:0;background:transparent}.cs-role .active{color:#fff;background:var(--navy)}.cs-types{display:flex;gap:8px;margin-bottom:9px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:auto}.cs-types button{flex:none;display:flex;align-items:center;gap:7px;min-height:38px;padding:0 12px;border-color:#c9d8e4;color:var(--navy);background:var(--soft)}.cs-types .active{color:#fff;border-color:var(--teal);background:var(--teal)}.cs-types small{display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#fff;color:var(--muted);font-size:10px}.cs-types .active small{color:var(--teal)}.cs-queues{display:flex;gap:8px;margin-bottom:15px;overflow:auto}.cs-queues button{flex:none;display:flex;align-items:center;gap:7px;min-height:40px;padding:0 13px}.cs-queues .active{color:#fff;border-color:var(--navy);background:var(--navy)}.cs-queues small{display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:var(--soft);color:var(--muted);font-size:10px}.cs-queues .active small{background:#fff;color:var(--navy)}.cs-workspace{display:grid;grid-template-columns:minmax(340px,.9fr) minmax(0,1.35fr);gap:18px;align-items:start}.cs-list{max-height:calc(100vh - 285px);overflow:auto}.cs-ticket-row{width:100%;display:grid;grid-template-columns:1fr auto;gap:8px;padding:14px 16px;border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left}.cs-ticket-row:hover,.cs-ticket-row.active{background:#f3fbfc;transform:none}.cs-ticket-row strong{color:var(--blue)}.cs-ticket-row span,.cs-ticket-row small{display:block;color:var(--muted);font-size:11px}.cs-ticket-row p{grid-column:1/-1;margin:0;color:var(--navy);font-weight:650}.cs-detail{min-height:520px}.cs-detail-body{padding:18px}.cs-empty{display:grid;place-items:center;min-height:360px;padding:32px;color:var(--muted);text-align:center}.cs-linked{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}.cs-linked p{display:grid;gap:3px;margin:0;padding:11px;border:1px solid var(--line);border-radius:8px;background:var(--soft)}.cs-linked span,.cs-meta span{color:var(--muted);font-size:11px}.cs-linked b{font-size:12px}.cs-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}.cs-meta p{display:grid;margin:0}.cs-actions{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;margin:16px 0;padding:14px;border-radius:9px;background:var(--soft)}.cs-actions label{display:grid;gap:6px;color:var(--muted);font-size:12px}.cs-actions button{align-self:end;min-height:46px}.cs-forms{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}.cs-forms form{display:grid;gap:9px;padding:14px;border:1px solid var(--line);border-radius:10px}.cs-forms h3{margin:0;font-size:14px}.cs-forms button{min-height:42px}.cs-forms textarea{min-height:92px}.cs-note-form{background:#fffaf2}.cs-timeline{display:grid;gap:10px;margin-top:16px}.cs-event{display:grid;grid-template-columns:12px 1fr;gap:10px}.cs-event i{width:9px;height:9px;margin-top:7px;border-radius:50%;background:var(--teal)}.cs-event.internal i{background:var(--orange)}.cs-event p{display:grid;gap:2px;margin:0;padding-bottom:11px;border-bottom:1px solid var(--line)}.cs-event small{color:var(--muted)}.cs-create-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.cs-create-grid .wide{grid-column:1/-1}.cs-error{margin:0 0 12px;color:var(--coral)}.cs-loading{padding:22px;color:var(--muted)}
@media(max-width:960px){.cs-workspace{grid-template-columns:1fr}.cs-list{max-height:none}.cs-linked,.cs-meta{grid-template-columns:1fr 1fr}.cs-actions,.cs-forms{grid-template-columns:1fr}.cs-actions button{width:100%}}
@media(max-width:760px){.cs-toolbar{align-items:stretch;flex-direction:column}.cs-role{width:100%;justify-content:space-between}.cs-role button{flex:1}.cs-linked,.cs-meta,.cs-create-grid{grid-template-columns:1fr}.cs-detail{min-height:0}}

.cs-role{
  display:grid;
  gap:3px;
  padding:10px 12px;
}
.cs-role small{
  color:var(--muted);
  font-size:11px;
}
.cs-toolbar [data-new-ticket]{
  min-height:52px;
  padding:0 22px;
  border-radius:12px;
  font-size:15px;
  font-weight:750;
  letter-spacing:.01em;
  box-shadow:0 10px 22px rgba(8,126,139,.22);
}
.cs-toolbar [data-new-ticket]:hover{
  box-shadow:0 14px 28px rgba(8,126,139,.28);
}
.cs-filter-panel{
  margin-bottom:14px;
}
.cs-filter-grid{
  display:grid;
  grid-template-columns:minmax(360px,2fr) repeat(3,minmax(170px,1fr)) max-content;
  align-items:end;
  gap:12px;
  padding:14px 16px;
}
.cs-filter-grid label{
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:12px;
}
.cs-filter-grid input,
.cs-filter-grid select{
  min-height:42px;
}
.cs-error-card{
  display:grid;
  gap:6px;
  margin:0 0 14px;
  padding:16px 18px;
  border:1px solid #f1b1aa;
  border-radius:10px;
  color:#8f2f28;
  background:#fff4f2;
}
.cs-error-card--action{
  border-color:#ead28d;
  color:#695112;
  background:#fff9e7;
}
.cs-error-card p,
.cs-error-card strong{
  margin:0;
}
.cs-ticket-row-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) max-content;
  grid-column:1/-1;
  align-items:center;
  gap:10px;
  width:100%;
}
.cs-ticket-row-top>strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cs-ticket-row-top .cs-status-badge{
  flex:none;
  max-width:none;
  white-space:nowrap;
}
.cs-archived-chip{
  justify-self:start;
  padding:4px 8px;
  border-radius:999px;
  color:#64748b;
  background:#f1f5f9;
  font-size:10px;
  font-style:normal;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.cs-detail-loading{
  min-height:0;
  padding:16px 18px 0;
}
.cs-detail-section{
  display:grid;
  gap:12px;
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.cs-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.cs-section-head h3,
.cs-section-head span{
  margin:0;
}
.cs-section-head span{
  color:var(--muted);
  font-size:11px;
}
.cs-message{
  display:grid;
  gap:8px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.cs-message.internal{
  background:#fffaf2;
}
.cs-message header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.cs-message header strong,
.cs-message header small,
.cs-message p{
  margin:0;
}
.cs-message header small{
  color:var(--muted);
  font-size:11px;
}
.cs-attachments{
  display:grid;
  gap:8px;
}
.cs-attachment{
  display:grid;
  gap:3px;
  padding:10px 12px;
  border-radius:10px;
  background:var(--soft);
}
.cs-attachment small,
.cs-attachment a{
  color:var(--muted);
  font-size:11px;
  word-break:break-word;
}
.cs-assignment-row{
  display:grid;
  gap:3px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.cs-assignment-row small,
.cs-assignment-row span{
  color:var(--muted);
  font-size:11px;
}
.cs-empty-note{
  padding:14px;
  border-radius:10px;
  color:var(--muted);
  background:var(--soft);
}
.cs-form-note{
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
.cs-staff-panel{
  margin-top:18px;
}
.cs-staff-card{
  display:grid;
  gap:12px;
  padding:16px;
  border-top:1px solid var(--line);
}
.cs-staff-card:first-of-type{
  border-top:0;
}
.cs-staff-head{
  display:grid;
  gap:2px;
}
.cs-staff-head small{
  color:var(--muted);
}
.cs-location-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.cs-location-check{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--navy);
}
.cs-location-check input{
  width:16px;
  min-height:16px;
}
.cs-staff-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.cs-staff-actions small{
  color:var(--muted);
}
.case-create-form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.case-create-form .wide{
  grid-column:1/-1;
}
.booking-link-field[hidden]{
  display:none;
}
.cs-booking-transfer-form,
.cs-booking-chat-form{
  display:grid;
  gap:10px;
}
.cs-booking-transfer-form .wide,
.cs-booking-chat-form .wide{
  grid-column:1/-1;
}
.cs-booking-chat-form input[type=file]{
  padding:10px 0;
  border:0;
  background:transparent;
}

@media(max-width:960px){
  .cs-filter-grid,
  .cs-location-grid{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:760px){
  .case-create-form,
  .cs-filter-grid,
  .cs-location-grid{
    grid-template-columns:1fr;
  }
  .cs-staff-actions,
  .cs-message header,
  .cs-section-head{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* Keep CS status pills compact; the generic row span rule must not stretch them. */
.cs-ticket-row .status{
  display:inline-flex!important;
  width:auto;
  margin:0;
  line-height:1.2;
  white-space:nowrap;
}
.cs-ticket-row .cs-ticket-row-type,
.cs-ticket-row .cs-ticket-row-meta,
.cs-ticket-row .cs-ticket-row-submeta{
  display:block;
  min-width:0;
  color:var(--muted);
  font-size:11px;
}
.cs-ticket-row .cs-ticket-row-meta,
.cs-ticket-row .cs-ticket-row-submeta{
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.cs-ticket-row .cs-ticket-row-meta span,
.cs-ticket-row .cs-ticket-row-submeta span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cs-action-controls{
  display:grid;
  grid-template-columns:minmax(150px,.7fr) minmax(260px,1.3fr);
  gap:10px;
}
.cs-handler-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.cs-action-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.cs-actions-hint{color:var(--muted);font-size:11px}
@media(max-width:960px){
  .cs-action-controls,.cs-handler-fields{grid-template-columns:1fr}
}

.cs-open-booking{
  width:100%;
  margin:0 0 14px;
  min-height:42px;
}

.cs-booking-tools{
  display:grid;
  grid-template-columns:1fr auto;
  align-items:end;
  gap:10px;
  margin-top:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
}
.cs-booking-tools h3{
  grid-column:1/-1;
  margin:0;
  font-size:14px;
}
.cs-booking-tools .wide{
  grid-column:1/-1;
}
.cs-booking-tools button{
  min-height:42px;
}
.cs-api-note{
  margin:10px 0 0;
  padding:10px 12px;
  border-radius:8px;
  color:var(--muted);
  background:var(--soft);
  font-size:12px;
  line-height:1.4;
}
.cs-booking-history{
  display:grid;
  gap:8px;
  margin-top:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.cs-booking-history h3{
  margin:0;
  font-size:14px;
}
.cs-booking-history p{
  display:grid;
  gap:2px;
  margin:0;
  padding-top:8px;
  border-top:1px solid var(--line);
}
.cs-booking-history span,
.cs-booking-history small{
  color:var(--muted);
}

.cs-sidebar-types{
  display:grid;
  gap:5px;
  margin:-5px 0 10px 0;
  padding-left:18px;
}
.cs-sidebar-types .cs-sidebar-type{
  width:100%;
  min-height:34px;
  padding:0 10px 0 38px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  text-align:left;
}
.cs-sidebar-types .cs-sidebar-type span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  line-height:1.2;
}
.cs-sidebar-types .cs-sidebar-type small{
  display:grid;
  place-items:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  color:inherit;
  background:rgba(255,255,255,.12);
  font-size:10px;
  line-height:1;
}
.cs-sidebar-types .cs-sidebar-type.active small{
  color:var(--navy);
  background:#fff;
}
@media(max-width:1100px){
  .cs-sidebar-types{display:none}
}

.cs-typebar{
  margin-bottom:12px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.cs-typebar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
}
.cs-typebar-head strong{
  color:var(--navy);
  font-weight:750;
  line-height:1.2;
}
.cs-typebar-head span{
  color:var(--muted);
  font-size:11px;
  line-height:1.2;
  white-space:nowrap;
}
.cs-typebar .cs-types{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  overflow:visible;
}
.cs-typebar .cs-types button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-width:0;
  min-height:42px;
  padding:0 12px;
  border-color:#c9d8e4;
  color:var(--navy);
  background:var(--soft);
  text-align:left;
  white-space:normal;
}
.cs-typebar .cs-types button span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.15;
}
.cs-typebar .cs-types button em{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  color:var(--muted);
  background:#fff;
  font-size:11px;
  font-style:normal;
  font-weight:750;
}
.cs-typebar .cs-types button.active{
  color:#fff;
  border-color:var(--teal);
  background:var(--teal);
}
.cs-typebar .cs-types button.active em{
  color:var(--teal);
  background:#fff;
}
@media(max-width:760px){
  .cs-typebar .cs-types{grid-template-columns:1fr 1fr}
  .cs-typebar-head{align-items:flex-start;flex-direction:column;gap:2px}
  .cs-typebar-head span{white-space:normal}
}

/* The base modal/form rules predate the CS workspace. Keep this dialog as one
   wide, scrollable surface instead of letting its action forms become dialogs. */
.modal > .cs-booking-modal{
  width:min(1380px,calc(100vw - 28px));
  max-height:min(90vh,940px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  border-radius:24px;
}
.modal > .cs-booking-modal>header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:16px;
  align-items:start;
  padding:22px 24px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#f8fcfd,#fff);
}
.cs-booking-modal>header h2,
.cs-booking-modal>header p,
.cs-booking-modal>header small{
  margin:0;
}
.cs-booking-modal>header p,
.cs-booking-modal>header small,
.cs-booking-head-status small{
  color:var(--muted);
}
.modal > .cs-booking-modal .cs-booking-scroll{
  min-height:0;
  overflow:auto;
  padding:22px 24px;
}
.modal > .cs-booking-modal .cs-booking-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 380px;
  gap:20px;
  align-items:start;
}
.modal > .cs-booking-modal .cs-booking-main{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.modal > .cs-booking-modal .cs-booking-side{
  display:grid;
  gap:16px;
  position:sticky;
  top:0;
}
.cs-booking-section:first-child,
.cs-booking-section:nth-child(2){
  grid-column:1/-1;
}
.modal > .cs-booking-modal .cs-booking-section,
.modal > .cs-booking-modal .cs-booking-panel{
  display:grid;
  gap:14px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  position:static;
  width:auto;
  min-width:0;
  max-width:none;
  margin:0;
  box-shadow:none;
  transform:none;
}
.modal > .cs-booking-modal .cs-booking-panel label{display:grid;gap:7px;min-width:0}
.modal > .cs-booking-modal .cs-booking-panel input,
.modal > .cs-booking-modal .cs-booking-panel textarea{width:100%;min-width:0;box-sizing:border-box}
.cs-booking-section h3,
.cs-booking-panel h3{
  margin:0;
  color:var(--navy);
  font-size:15px;
}
.cs-booking-card-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.cs-booking-card,
.cs-booking-row{
  display:grid;
  gap:4px;
  min-width:0;
}
.cs-booking-card{
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
}
.cs-booking-card span,
.cs-booking-row span,
.cs-booking-attachment span,
.cs-booking-history-item span{
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}
.cs-booking-card strong,
.cs-booking-row strong{
  min-width:0;
  color:var(--navy);
  font-size:13px;
  line-height:1.45;
  word-break:break-word;
}
.cs-booking-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 16px;
}
.cs-booking-row{
  padding-bottom:12px;
  border-bottom:1px solid var(--line);
}
.cs-booking-row:last-child{
  border-bottom:0;
  padding-bottom:0;
}
.cs-booking-inline-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.cs-booking-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.cs-booking-actions button{
  min-height:42px;
}
.cs-booking-json{
  border-top:1px solid var(--line);
  padding-top:14px;
}
.cs-booking-json summary{
  cursor:pointer;
  color:var(--teal);
  font-weight:700;
}
.cs-booking-json pre{
  max-height:240px;
  margin:12px 0 0;
  overflow:auto;
  padding:12px;
  border-radius:10px;
  color:#294358;
  background:#f5f8fb;
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
}
.cs-booking-history-list,
.cs-booking-attachments{
  display:grid;
  gap:10px;
}
.cs-booking-history-item,
.cs-booking-attachment{
  display:grid;
  gap:6px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
}
.cs-booking-history-item>div{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.cs-booking-history-item p{
  margin:0;
  color:var(--navy);
  line-height:1.5;
}
.cs-booking-history-item a,
.cs-booking-attachment a{
  color:var(--teal);
  word-break:break-all;
}
.cs-empty-note{
  padding:12px 14px;
  border-radius:10px;
  color:var(--muted);
  background:var(--soft);
}
@media(max-width:1100px){
  .cs-booking-layout{grid-template-columns:1fr}
  .cs-booking-main{grid-template-columns:1fr}
  .cs-booking-side{position:static}
  .cs-booking-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cs-booking-section:first-child,
  .cs-booking-section:nth-child(2){grid-column:auto}
}
@media(max-width:760px){
  .modal > .cs-booking-modal{
    width:min(100vw - 18px,100%);
    max-height:calc(100vh - 18px);
  }
  .modal > .cs-booking-modal>header,
  .modal > .cs-booking-modal .cs-booking-scroll{
    padding:18px 16px;
  }
  .modal > .cs-booking-modal>header{
    grid-template-columns:1fr auto;
  }
  .cs-booking-head-status{
    grid-column:1/-1;
  }
  .cs-booking-card-grid,
  .cs-booking-grid,
  .cs-booking-inline-fields,
  .cs-booking-actions{
    grid-template-columns:1fr;
  }
}

/* CS keeps the dense operational layout, but gives each layer a clear surface. */
.cs-toolbar{
  margin-bottom:16px;
  padding:18px 20px;
  border:1px solid rgba(177,201,215,.72);
  border-radius:16px;
  background:linear-gradient(120deg,#f7fcfd 0%,#fff 62%,#fff8ed 100%);
  box-shadow:0 12px 28px rgba(15,49,82,.07);
}
.cs-role{border:0;background:transparent;padding:0}
.cs-queues{
  gap:6px;
  margin-bottom:16px;
  padding:6px;
  border:1px solid rgba(177,201,215,.72);
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 20px rgba(15,49,82,.05);
}
.cs-queues button{border:0;border-radius:10px;transition:background .18s ease,color .18s ease,transform .18s ease}
.cs-queues button:not(.active):hover,.cs-queues button:not(.active):focus-visible{transform:translateY(-1px);background:#eef8f9}
.cs-queues button.active,.cs-queues button.active:hover,.cs-queues button.active:focus-visible{color:#fff;background:var(--navy);box-shadow:0 7px 14px rgba(7,31,73,.18)}
.cs-queues--staff{display:none}
.cs-workspace{gap:16px}
.cs-list,.cs-detail{
  border-color:rgba(177,201,215,.78);
  border-radius:16px;
  box-shadow:0 12px 28px rgba(15,49,82,.07);
}
.cs-list{background:#fff}
.cs-ticket-row{padding:15px 16px;transition:background .18s ease,box-shadow .18s ease}
.cs-ticket-row:hover{box-shadow:inset 3px 0 0 var(--teal)}
.cs-ticket-row.active{box-shadow:inset 3px 0 0 var(--teal),0 4px 12px rgba(8,126,139,.08)}
.cs-detail{overflow:hidden;background:#fff}
.cs-detail>header{padding:20px;border-bottom:1px solid var(--line);background:linear-gradient(120deg,#f7fcfd,#fff)}
.cs-detail>header h2{margin-bottom:5px;font-size:20px;letter-spacing:-.02em}
.cs-detail-body{padding:20px}
.cs-detail-section{margin-top:20px;padding:18px;border:1px solid var(--line);border-radius:13px;background:#fbfdfe}
.cs-detail-section:first-child{margin-top:0}
.cs-section-head h3{font-size:14px;letter-spacing:.01em}
.cs-message,.cs-assignment-row{box-shadow:0 3px 10px rgba(15,49,82,.04)}
.cs-loading,.cs-empty{min-height:260px}
@media(max-width:760px){
  .cs-toolbar{padding:15px}
  .cs-queues--staff{display:flex}
  .cs-detail>header,.cs-detail-body{padding:16px}
  .cs-detail-section{padding:14px}
}

.cs-status-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  min-height:30px;
  padding:6px 11px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  line-height:1.2;
  white-space:nowrap;
}
.cs-status-badge i{width:8px;height:8px;flex:none;border-radius:50%;background:currentColor}
.cs-status-badge.attention{color:#a76009;border-color:#f0d19b;background:#fff8e8}
.cs-status-badge.work{color:#087e8b;border-color:#a9d2d7;background:#edf8fa}
.cs-status-badge.neutral{color:#66758a;border-color:#dce5eb;background:#f6f9fb}
.cs-status-badge.success{color:#168052;border-color:#b9e1ce;background:#eefaf3}
.cs-detail-status{display:grid;justify-items:end;gap:6px;min-width:150px}
.cs-detail-status>small{color:var(--muted);font-size:11px;font-weight:650}
.cs-detail-status .cs-status-badge{min-height:36px;padding:8px 13px;font-size:13px}
.cs-ticket-row .cs-status-badge{justify-self:end;gap:5px;min-height:22px;padding:3px 7px;font-size:10px}
.cs-ticket-row .cs-status-badge i{width:6px;height:6px}
@media(max-width:760px){
  .cs-detail>header{align-items:flex-start;gap:12px}
  .cs-detail-status{justify-items:start;min-width:0}
}

.cs-status-action-group{display:grid;grid-column:1/-1;gap:8px}
.cs-status-action-group>span{color:var(--muted);font-size:12px;font-weight:700}
.cs-status-action-buttons{display:flex;flex-wrap:wrap;gap:8px}
.cs-status-action{min-height:40px;padding:0 14px;border-radius:999px;font-size:12px;font-weight:700}
.cs-status-action.attention{color:#8b5608;border-color:#efcf91;background:#fff8e8}
.cs-status-action.work{color:#087e8b;border-color:#9ed1d6;background:#edf8fa}
.cs-status-action.neutral{color:#66758a;border-color:#dce5eb;background:#f6f9fb}
.cs-status-action.success{color:#168052;border-color:#b9dfca;background:#eefaf3}
.cs-status-action:hover{transform:translateY(-1px);filter:brightness(.98)}
.cs-status-action:disabled{cursor:not-allowed;opacity:.5;transform:none}
@media(max-width:560px){.cs-status-action-buttons{display:grid;grid-template-columns:1fr 1fr}.cs-status-action{width:100%;padding:0 8px}}

/* Status transitions are deliberately a horizontal carousel in the ticket card. */
.cs-status-carousel{display:flex;grid-column:1/-1;gap:8px;min-width:0;overflow-x:auto;padding:2px 0 6px;scrollbar-width:thin}
.cs-status-carousel .cs-status-action{flex:none;width:auto;white-space:nowrap}
.cs-status-carousel .cs-status-action.active{box-shadow:inset 0 0 0 2px currentColor;opacity:1}
/* The carousel is the single status control for the CS ticket card. */
.cs-detail-status{display:none}

.cs-meta p{gap:5px;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:var(--soft)}
.cs-meta b{overflow-wrap:anywhere;line-height:1.35}
.cs-file-picker{display:grid;gap:6px;padding:10px 11px;border:1px dashed #a9c6d0;border-radius:9px;background:#f8fbfc;color:var(--navy);font-size:12px;cursor:pointer}
.cs-file-picker input{min-height:38px;padding:7px;background:#fff}
.cs-file-picker small{color:var(--muted);overflow-wrap:anywhere}
.cs-cancel-action{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.cs-cancel-action small{max-width:320px;color:var(--muted);font-size:11px;text-align:right}
.cs-message>p{white-space:pre-wrap}
@media(max-width:560px){.cs-cancel-action{align-items:stretch;flex-direction:column}.cs-cancel-action button{width:100%}.cs-cancel-action small{text-align:left}}

/* Keep ticket workflow controls readable without changing their behavior. */
.cs-actions{
  grid-template-columns:minmax(0,1.2fr) minmax(270px,.8fr);
  align-items:start;
  gap:18px;
  padding:18px;
}
.cs-action-controls{
  grid-template-columns:1fr;
  gap:16px;
  min-width:0;
}
.cs-action-section{
  display:grid;
  gap:8px;
  min-width:0;
}
.cs-action-caption{
  color:var(--muted);
  font-size:11px;
  font-weight:750;
  letter-spacing:.02em;
}
.cs-status-section{align-content:start}
.cs-status-carousel{
  flex-wrap:wrap;
  overflow:visible;
  padding:0;
}
.cs-current-handler{
  padding-top:14px;
  border-top:1px solid var(--line);
}
.cs-current-handler strong{
  color:var(--navy);
  font-size:14px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.cs-action-operations{
  padding-left:18px;
  border-left:1px solid var(--line);
}
.cs-action-buttons{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.cs-action-buttons button{
  width:100%;
  min-height:44px;
  padding:8px 12px;
}
.cs-actions>.cs-actions-hint{grid-column:1/-1}
@media(max-width:1100px){
  .cs-actions{grid-template-columns:1fr}
  .cs-action-operations{padding-left:0;padding-top:14px;border-top:1px solid var(--line);border-left:0}
}
@media(max-width:560px){
  .cs-actions{padding:14px}
  .cs-action-buttons{grid-template-columns:1fr}
}

/* Ticket rows keep readable semantic colors on hover and keyboard focus. */
.cs-ticket-row:hover,.cs-ticket-row:focus-visible{color:var(--navy)}
.cs-ticket-row:hover strong,.cs-ticket-row:focus-visible strong{color:var(--blue)}
.cs-ticket-row:hover p,.cs-ticket-row:focus-visible p{color:var(--navy)}
.cs-ticket-row:hover .cs-ticket-row-type,.cs-ticket-row:hover .cs-ticket-row-meta,.cs-ticket-row:hover .cs-ticket-row-submeta,.cs-ticket-row:focus-visible .cs-ticket-row-type,.cs-ticket-row:focus-visible .cs-ticket-row-meta,.cs-ticket-row:focus-visible .cs-ticket-row-submeta{color:var(--muted)}

/* Server-backed staff worklists; the sidebar is the single primary navigation. */
.cs-operation-tabs{
  display:flex;
  gap:8px;
  margin:0 0 12px;
  padding:6px;
  overflow:auto;
  border:1px solid rgba(177,201,215,.72);
  border-radius:14px;
  background:#f7fafc;
  scrollbar-width:thin;
}
.cs-operation-tabs button{
  flex:none;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:0 14px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  font-weight:700;
}
.cs-operation-tabs button:hover{border-color:#c8dde1;background:#fff}
.cs-operation-tabs button.active{color:#fff;border-color:var(--teal);background:var(--teal);box-shadow:0 7px 14px rgba(8,126,139,.18)}
.cs-operation-tabs small{display:grid;place-items:center;min-width:21px;height:21px;padding:0 6px;border-radius:999px;color:var(--muted);background:#fff;font-size:10px}
.cs-operation-tabs button.active small{color:var(--teal)}
.cs-filter-search{grid-column:auto}
.cs-filter-actions,.cs-booking-filter-actions{display:flex;align-items:end;justify-content:flex-end;gap:8px}
.cs-filter-actions{grid-column:-2/-1;align-self:end}
.cs-filter-actions button,.cs-booking-filter-actions button{min-height:42px;padding:0 14px}
.cs-pagination,.cs-pagination-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-top:1px solid var(--line);
  color:var(--muted);
  background:#fbfdfe;
  font-size:11px;
}
.cs-pagination>div{display:flex;align-items:center;gap:9px}
.cs-pagination button{min-height:34px;padding:0 10px;border-radius:8px;background:#fff}
.cs-pagination button:disabled{cursor:not-allowed;opacity:.45}
.cs-booking-filters{margin-bottom:14px;overflow:hidden;border-radius:15px}
.cs-booking-filters form{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  padding:16px;
}
.cs-booking-filters label{display:grid;align-content:end;gap:6px;color:var(--muted);font-size:11px;font-weight:650}
.cs-booking-filters label.wide{grid-column:span 2}
.cs-booking-filters input,.cs-booking-filters select{min-width:0;min-height:42px}
.cs-booking-unassigned{display:flex!important;align-items:center!important;align-self:end;grid-auto-flow:column;justify-content:start;min-height:42px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:#fff}
.cs-booking-unassigned input{width:18px;min-height:18px;margin:0;accent-color:var(--teal)}
.cs-booking-worklist{
  --cs-booking-worklist-columns:minmax(210px,1.3fr) minmax(170px,1fr) minmax(130px,.75fr) minmax(155px,.9fr) minmax(120px,.65fr);
  overflow:hidden;
  border-radius:15px;
}
.cs-booking-worklist .booking-row>span:first-child small:first-of-type{margin-top:3px;color:var(--navy);font-weight:650}
.cs-booking-table-head,.cs-booking-worklist .booking-row{
  display:grid!important;
  grid-template-columns:var(--cs-booking-worklist-columns)!important;
  align-items:center;
  gap:14px;
  padding-right:42px;
  padding-left:16px;
}
.cs-booking-table-head{
  min-height:44px;
  color:var(--muted);
  background:var(--soft);
  font-size:11px;
}
.cs-booking-table-head>span{display:block;min-width:0}
.cs-booking-worklist .booking-row{align-items:center}
.cs-booking-worklist .cs-loading{grid-column:1/-1}

@media(max-width:1180px){
  .cs-filter-grid{grid-template-columns:minmax(280px,2fr) repeat(3,minmax(0,1fr))}
  .cs-filter-actions{grid-column:1/-1}
  .cs-booking-filters form{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cs-booking-worklist{--cs-booking-worklist-columns:minmax(210px,1.2fr) minmax(170px,1fr) minmax(140px,.8fr) minmax(120px,.7fr)}
  .cs-booking-table-head>span:nth-child(3),.cs-booking-worklist .booking-row>span:nth-child(3){display:none}
}
@media(max-width:760px){
  .cs-operation-tabs{margin-right:-4px;margin-left:-4px}
  .cs-filter-search{grid-column:auto}
  .cs-filter-actions,.cs-booking-filter-actions{display:grid;grid-column:1/-1;grid-template-columns:1fr 1fr}
  .cs-booking-filters form{grid-template-columns:1fr}
  .cs-booking-filters label.wide{grid-column:auto}
  .cs-booking-table-head{display:none!important}
  .cs-booking-worklist .booking-row{grid-template-columns:1fr auto!important;padding-right:38px}
  .cs-booking-worklist .booking-row>span:nth-child(2){display:block;grid-column:1/-1}
  .cs-booking-worklist .booking-row>span:nth-child(3),.cs-booking-worklist .booking-row>span:nth-child(4){display:none}
  .cs-pagination{align-items:stretch;flex-direction:column}
  .cs-pagination>div{display:grid;grid-template-columns:1fr auto 1fr}
}
.cs-status-badge>span{color:inherit!important}
