/* CRM Lead Management — compact layout (runtime + rebuild) */
.lm-crm {
  font-size: 0.8125rem;
}

.lm-crm .lm-page-head,
.panel-head-row.lm-page-head {
  margin-bottom: 6px !important;
  gap: 8px !important;
  align-items: center !important;
}

.lm-crm .lm-page-head h2,
.panel-head-row.lm-page-head h2 {
  font-size: 0.9375rem !important;
}

.lm-crm .lm-intro,
.lm-intro {
  display: none !important;
}

.lm-crm-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lm-crm-subhead .lm-tabs,
.lm-crm-subhead .adm-tabs.lm-tabs {
  flex: 1 1 auto;
  margin-bottom: 0 !important;
}

.lm-crm .admin-stats,
.admin-stats.lm-dash-stats,
.lm-stats-compact {
  gap: 6px !important;
  margin-bottom: 6px !important;
}

.lm-stats-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  grid-template-columns: unset !important;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.lm-stats-strip .stat-card,
.lm-crm .admin-stats .stat-card,
.admin-stats.lm-dash-stats .stat-card {
  flex: 0 0 auto;
  min-width: 72px;
  max-width: 96px;
  min-height: 0 !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(73, 33, 8, 0.05) !important;
}

.lm-stats-strip .stat-card:hover {
  transform: none !important;
}

.lm-stats-compact .stat-card h3,
.lm-crm .admin-stats .stat-card h3,
.admin-stats.lm-dash-stats .stat-card h3 {
  font-size: 0.8rem !important;
  line-height: 1.1 !important;
}

.lm-stats-compact .stat-card p,
.lm-crm .admin-stats .stat-card p,
.admin-stats.lm-dash-stats .stat-card p {
  margin-top: 1px !important;
  font-size: 11px !important;
}

.lm-stats-compact .lm-stat-hint,
.lm-crm .admin-stats .lm-stat-hint {
  display: none !important;
}

.lm-workload-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.9);
  border: 1px solid rgba(230, 184, 0, 0.2);
}

.lm-workload-strip--inline {
  flex: 1 1 280px;
  padding: 4px 8px;
}

.lm-workload-strip__label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #990000;
}

.lm-workload-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e8e0d8;
  font-size: 11px;
}

.lm-filters-bar,
.adm-toolbar.lm-filters-bar,
.lm-crm .adm-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  margin-bottom: 6px !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(230, 184, 0, 0.2) !important;
  background: rgba(255, 254, 249, 0.85) !important;
  grid-template-columns: unset !important;
}

.lm-filters-bar__main {
  display: flex;
  flex: 1 1 480px;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.lm-filters-bar__search {
  flex: 1 1 180px;
  min-width: 140px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e8e0d8;
  font-size: 12px;
}

.lm-filters-bar__selects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 2 1 360px;
}

.lm-filters-bar__selects select {
  flex: 1 1 108px;
  min-height: 28px;
  max-width: 140px;
  font-size: 11px;
}

.lm-filters-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}

.lm-filters-bar__primary {
  background: linear-gradient(135deg, #990000, #c41e1e) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.lm-crm .lm-tabs button,
.adm-tabs.lm-tabs button {
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.lm-layout {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
}

.lm-detail {
  width: 240px;
  min-width: 200px;
  max-width: 400px;
  max-height: calc(100vh - 72px);
  resize: horizontal;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  position: sticky;
  top: 8px;
  align-self: start;
}

.lm-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  scrollbar-width: thin;
}

.lm-fold {
  margin: 0 0 4px;
  border: 1px solid rgba(153, 0, 0, 0.1);
  border-radius: 6px;
  background: rgba(255, 254, 249, 0.65);
}

.lm-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #990000;
}

.lm-fold > summary::-webkit-details-marker {
  display: none;
}

.lm-fold > summary::before {
  content: '▸ ';
  display: inline-block;
}

.lm-fold[open] > summary::before {
  transform: rotate(90deg);
}

.lm-fold__body {
  padding: 0 8px 6px;
}

.lm-detail-actions {
  gap: 4px !important;
  margin: 4px 0 6px !important;
}

.lm-btn-sm {
  padding: 3px 7px !important;
  font-size: 11px !important;
  min-height: 0 !important;
  border-radius: 5px !important;
}

.lm-layout--empty {
  grid-template-columns: 1fr !important;
}

.lm-layout--empty .lm-detail {
  display: none !important;
}

.lm-list,
.lms-student-list.lm-list {
  gap: 6px !important;
}

.lm-crm .lm-lead-card,
.lms-student-card.lm-lead-card {
  padding: 8px 10px !important;
  border-radius: 8px !important;
}

.lm-lead-card .muted,
.lms-student-card.lm-lead-card .muted {
  margin: 2px 0 !important;
  font-size: 11px !important;
}

.lm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(153, 0, 0, 0.2);
  background: rgba(255, 254, 249, 0.6);
}

.lm-empty-state strong {
  font-size: 12px;
  color: #990000;
}

.lm-detail-empty {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(153, 0, 0, 0.18);
}

.lm-layout--no-selection {
  grid-template-columns: 1fr !important;
}

.lm-layout--no-selection .lm-detail {
  display: none !important;
}

.lm-more-menu:not([open]) .lm-more-menu__panel {
  display: none !important;
}

.lm-crm .admin-main-action {
  padding: 4px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(153, 0, 0, 0.12) !important;
}

.lm-crm .small-admin-btn,
.lm-crm .admin-tool-btn,
.lm-crm .lm-file-btn {
  padding: 4px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
}

.lm-crm h2,
.lm-crm .lm-page-head h2,
.panel-head-row.lm-page-head h2 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
}

.lm-crm .stat-card h3,
.lm-crm .admin-stats .stat-card h3,
.admin-stats.lm-dash-stats .stat-card h3,
.lm-stats-compact .stat-card h3 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
}

.lm-crm .stat-card p,
.lm-crm .admin-stats .stat-card p {
  font-size: 11px !important;
  font-weight: 600 !important;
}

.lm-crm .lm-lead-card h3,
.lm-crm .lms-student-card h3,
.lms-student-card.lm-lead-card h3 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.lm-crm .lm-detail .panel-head-row h3 {
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.lm-crm .lm-subhead,
.lm-crm h4.lm-subhead,
.lm-crm .lm-detail .lm-subhead {
  font-size: 11px !important;
  margin: 4px 0 3px !important;
}

.lm-crm .muted {
  font-size: 11px !important;
}

.lm-crm .lm-detail .muted {
  font-size: 11px !important;
}

@media (max-width: 900px) {
  .lm-filters-bar__main {
    flex-basis: 100%;
  }

  .lm-filters-bar__actions {
    width: 100%;
    margin-left: 0;
  }

  .lm-crm-subhead {
    flex-direction: column;
    align-items: stretch;
  }

  .lm-detail {
    resize: none;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    max-height: none;
    position: static;
  }
}
