/* Shared presentation layer for all admin business pages.  It deliberately
   leaves data and page behaviour in the existing page modules unchanged. */
:root {
  --biz-blue: #2f6bff;
  --biz-blue-strong: #1f56df;
  --biz-blue-soft: #edf3ff;
  --biz-ink: #182230;
  --biz-muted: #667085;
  --biz-line: #e5e9f0;
  --biz-canvas: #f4f6fa;
  --biz-success: #087f5b;
  --biz-warning: #b75b00;
  --biz-danger: #c7362f;
  --biz-radius: 16px;
  --biz-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 22px rgba(16, 24, 40, .045);
}

/* Page chrome: legacy views and the CRM P0 views share the same hierarchy. */
body:not(.login-mode) main#tenantsView,
body:not(.login-mode) main#studentsView,
body:not(.login-mode) main#banksView,
body:not(.login-mode) main#leadsView,
body:not(.login-mode) main#staffView,
body:not(.login-mode) main.crm-p0-page {
  color: var(--biz-ink) !important;
}

body:not(.login-mode) main.crm-p0-page {
  padding: 28px clamp(22px, 2.6vw, 42px) 64px !important;
  background: transparent !important;
}

body:not(.login-mode) main.crm-p0-page > header.crm-p0-header {
  position: relative;
  min-height: 112px;
  margin: 0 0 20px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid #e1e7f0;
  border-radius: 18px;
  background: radial-gradient(circle at 90% 30%, rgba(47, 107, 255, .12), transparent 18rem), linear-gradient(135deg, #fff, #f8faff);
  box-shadow: var(--biz-shadow);
}
body:not(.login-mode) main.crm-p0-page > header.crm-p0-header::after {
  position: absolute;
  top: -54px;
  right: 6%;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(47, 107, 255, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(47, 107, 255, .025), 0 0 0 68px rgba(47, 107, 255, .018);
  pointer-events: none;
  content: "";
}
.crm-p0-header > * { position: relative; z-index: 1; }
.crm-p0-header .page-eyebrow { color: var(--biz-blue) !important; }
.crm-p0-header h1 { color: var(--biz-ink) !important; font-weight: 850 !important; }
.crm-p0-header p { color: var(--biz-muted) !important; line-height: 1.65; }

/* Summary metrics across orders, students, legacy CRM and the content pages. */
body:not(.login-mode) .summary,
body:not(.login-mode) .crm-order-summary {
  gap: 12px !important;
  margin-bottom: 18px !important;
}
body:not(.login-mode) .summary > div,
body:not(.login-mode) .crm-order-summary > article {
  position: relative;
  overflow: hidden;
  min-height: 98px !important;
  border: 1px solid var(--biz-line) !important;
  border-radius: var(--biz-radius) !important;
  background: linear-gradient(145deg, #fff, #fbfcff) !important;
  box-shadow: var(--biz-shadow) !important;
}
body:not(.login-mode) .summary > div::before,
body:not(.login-mode) .crm-order-summary > article::before {
  position: absolute;
  top: 0;
  left: 18px;
  width: 34px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--biz-blue);
  content: "";
}
body:not(.login-mode) .summary > div::after { opacity: .9; }
body:not(.login-mode) .summary b,
body:not(.login-mode) .crm-order-summary strong { color: var(--biz-ink) !important; }
body:not(.login-mode) .summary span,
body:not(.login-mode) .crm-order-summary small { color: var(--biz-muted) !important; }

/* A consistent work surface for tables, lists, editors and import panels. */
body:not(.login-mode) .student-list-panel,
body:not(.login-mode) .student-editor,
body:not(.login-mode) .crm-list-panel,
body:not(.login-mode) .crm-editor,
body:not(.login-mode) .list-panel,
body:not(.login-mode) .editor,
body:not(.login-mode) .bank-upload-guide,
body:not(.login-mode) .bank-preview-card,
body:not(.login-mode) .crm-p0-card {
  border: 1px solid var(--biz-line) !important;
  border-radius: var(--biz-radius) !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: var(--biz-shadow) !important;
}
body:not(.login-mode) .student-toolbar,
body:not(.login-mode) .crm-filterbar,
body:not(.login-mode) .crm-advanced-filters {
  gap: 10px !important;
  padding: 15px 18px !important;
  border-color: var(--biz-line) !important;
  background: linear-gradient(180deg, #fff, #fafbfe) !important;
}
body:not(.login-mode) .crm-advanced-filters { background: #f8faff !important; }
body:not(.login-mode) .student-toolbar input,
body:not(.login-mode) .student-toolbar select,
body:not(.login-mode) .crm-filterbar input,
body:not(.login-mode) .crm-filterbar select,
body:not(.login-mode) .crm-advanced-filters input,
body:not(.login-mode) .crm-advanced-filters select {
  min-height: 40px;
  border-color: #d8dee8 !important;
  background: #fff !important;
}

/* Tab bars, tables and list rows retain their existing semantics but gain one rhythm. */
body:not(.login-mode) .crm-tabs {
  padding: 0 18px !important;
  border-color: var(--biz-line) !important;
  background: #fff;
}
body:not(.login-mode) .crm-tabs button { color: var(--biz-muted) !important; }
body:not(.login-mode) .crm-tabs button.active {
  color: var(--biz-blue) !important;
  border-bottom-color: var(--biz-blue) !important;
}
body:not(.login-mode) .crm-tabs b {
  background: var(--biz-blue-soft) !important;
  color: var(--biz-blue-strong) !important;
}
body:not(.login-mode) #crmMoreFilters[aria-expanded="true"] {
  border-color: #b9ccff !important;
  background: var(--biz-blue-soft) !important;
  color: var(--biz-blue-strong) !important;
}
body:not(.login-mode) .crm-table th,
body:not(.login-mode) .student-list-panel thead th {
  background: #f8faff !important;
  color: var(--biz-muted) !important;
  border-bottom-color: var(--biz-line) !important;
}
body:not(.login-mode) .crm-table td,
body:not(.login-mode) .student-list-panel tbody td { border-bottom-color: #edf0f4 !important; }
body:not(.login-mode) .crm-table tr:hover td,
body:not(.login-mode) .student-list-panel tbody tr:hover td { background: #f8faff !important; }
body:not(.login-mode) .crm-name-cell > span {
  border: 1px solid #dbe6ff !important;
  background: linear-gradient(145deg, #f3f7ff, #e5efff) !important;
  color: var(--biz-blue-strong) !important;
  box-shadow: none !important;
}
body:not(.login-mode) .crm-name-cell button { color: var(--biz-ink) !important; }
body:not(.login-mode) .crm-table-actions button,
body:not(.login-mode) .crm-task-actions > button:not(.primary) {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}
body:not(.login-mode) .crm-follow-state { gap: 5px; }
body:not(.login-mode) .lead-list { padding: 14px !important; background: #f8faff !important; }
body:not(.login-mode) .lead-card {
  border-color: var(--biz-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025) !important;
}
body:not(.login-mode) .lead-card:hover { border-color: #cfdcff !important; box-shadow: 0 8px 18px rgba(47, 107, 255, .07) !important; }

/* Preserve status meaning while removing the old green-first palette. */
body:not(.login-mode) .crm-badge.blue,
body:not(.login-mode) .lead-stage.converted { background: var(--biz-blue-soft) !important; color: var(--biz-blue-strong) !important; }
body:not(.login-mode) .crm-badge.green,
body:not(.login-mode) .bind-state { color: var(--biz-success) !important; }
body:not(.login-mode) .crm-badge.orange { background: #fff3e5 !important; color: var(--biz-warning) !important; }
body:not(.login-mode) .crm-badge.red,
body:not(.login-mode) .lead-stage.invalid { background: #fff0ef !important; color: var(--biz-danger) !important; }

/* Drawers and dialogs use the same white surface and action bar. */
body:not(.login-mode) .modal-panel,
body:not(.login-mode) .crm-detail-drawer,
body:not(.login-mode) .crm-followup-drawer,
body:not(.login-mode) .lead-detail-drawer {
  border-color: var(--biz-line) !important;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .22) !important;
}
body:not(.login-mode) .modal-header,
body:not(.login-mode) .panel-title,
body:not(.login-mode) .drawer-header,
body:not(.login-mode) .crm-drawer-head,
body:not(.login-mode) .crm-editor-header { border-bottom-color: var(--biz-line) !important; }
body:not(.login-mode) .crm-editor-footer,
body:not(.login-mode) .actions { border-color: var(--biz-line) !important; }

/* Primary action remains the only visually dominant control on every page. */
body:not(.login-mode) button.primary,
body:not(.login-mode) .primary {
  border-color: var(--biz-blue) !important;
  background: linear-gradient(135deg, #3978ff, var(--biz-blue)) !important;
  box-shadow: 0 7px 16px rgba(47, 107, 255, .18) !important;
}
body:not(.login-mode) button.primary:hover,
body:not(.login-mode) .primary:hover { background: var(--biz-blue-strong) !important; }
body:not(.login-mode) button:not(.primary):not(.danger):not(:disabled):hover { border-color: #b9ccff !important; color: var(--biz-blue-strong) !important; }

/* On a phone, a horizontal data grid becomes labelled business cards. */
@media (max-width: 620px) {
  body:not(.login-mode) .crm-table-wrap { overflow: visible !important; }
  body:not(.login-mode) .crm-table,
  body:not(.login-mode) .crm-table tbody,
  body:not(.login-mode) .crm-table tr,
  body:not(.login-mode) .crm-table td { display: block !important; width: 100% !important; min-width: 0 !important; }
  body:not(.login-mode) .crm-table thead { display: none !important; }
  body:not(.login-mode) .crm-table tbody { padding: 10px; background: #f8faff; }
  body:not(.login-mode) .crm-table tbody tr {
    overflow: hidden;
    margin: 0 0 10px;
    border: 1px solid var(--biz-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
  }
  body:not(.login-mode) .crm-table tbody tr:last-child { margin-bottom: 0; }
  body:not(.login-mode) .crm-table tbody td {
    display: grid !important;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 45px;
    padding: 10px 12px !important;
    border-bottom: 1px solid #edf0f4 !important;
    color: var(--biz-ink) !important;
  }
  body:not(.login-mode) .crm-table tbody td::before {
    color: var(--biz-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.8;
    content: attr(data-label);
  }
  body:not(.login-mode) .crm-table tbody td:last-child { border-bottom: 0 !important; }
  body:not(.login-mode) .crm-table tbody td[colspan] { display: block !important; }
  body:not(.login-mode) .crm-table tbody td[colspan]::before { display: none; }
  body:not(.login-mode) .crm-table .crm-name-cell,
  body:not(.login-mode) .crm-table .crm-table-actions,
  body:not(.login-mode) .crm-table .crm-task-actions { min-width: 0; }
  body:not(.login-mode) .crm-table .crm-table-actions { flex-wrap: wrap; }
  body:not(.login-mode) .crm-table .crm-task-actions { justify-content: flex-start; }
  body:not(.login-mode) .crm-table .crm-inline-phone { align-items: flex-start; }
}

/* Editorial parity pass ---------------------------------------------------
   The workbench is the visual source of truth for every business page. */
:root {
  --biz-brand-red: #e11919;
  --biz-brand-red-soft: #fff3f2;
  --biz-editorial-line: #e5e7eb;
  --biz-editorial-ink: #171a20;
  --biz-editorial-muted: #68707c;
}

body:not(.login-mode) main#tenantsView,
body:not(.login-mode) main#studentsView,
body:not(.login-mode) main#banksView,
body:not(.login-mode) main#leadsView,
body:not(.login-mode) main#staffView,
body:not(.login-mode) main.crm-p0-page {
  max-width: 1540px !important;
  padding: 20px clamp(18px, 2vw, 30px) 52px !important;
  background: transparent !important;
  color: var(--biz-editorial-ink) !important;
}

body:not(.login-mode) main#tenantsView > header,
body:not(.login-mode) main#studentsView > header,
body:not(.login-mode) main#banksView > header,
body:not(.login-mode) main#leadsView > header,
body:not(.login-mode) main#staffView > header,
body:not(.login-mode) main.crm-p0-page > header.crm-p0-header {
  min-height: 72px !important;
  margin: 0 0 14px !important;
  padding: 0 8px 14px !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid var(--biz-editorial-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body:not(.login-mode) main.crm-p0-page > header.crm-p0-header::after,
body:not(.login-mode) main#tenantsView > header::after,
body:not(.login-mode) main#studentsView > header::after,
body:not(.login-mode) main#banksView > header::after,
body:not(.login-mode) main#leadsView > header::after,
body:not(.login-mode) main#staffView > header::after { display: none !important; }

body:not(.login-mode) main:not(#dashboardView) > header h1,
body:not(.login-mode) .crm-p0-header h1 {
  margin: 0 !important;
  color: #111318 !important;
  font-size: 30px !important;
  font-weight: 750 !important;
  letter-spacing: -.02em !important;
}
body:not(.login-mode) main:not(#dashboardView) > header p,
body:not(.login-mode) .crm-p0-header p {
  margin-top: 5px !important;
  color: #59616c !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}
body:not(.login-mode) .page-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--biz-brand-red) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: .08em !important;
}

body:not(.login-mode) .summary,
body:not(.login-mode) .crm-order-summary {
  display: grid !important;
  gap: 0 !important;
  margin: 12px 0 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--biz-editorial-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
}
body:not(.login-mode) .summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
body:not(.login-mode) .crm-order-summary { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
body:not(.login-mode) .summary > div,
body:not(.login-mode) .crm-order-summary > article {
  min-width: 0 !important;
  min-height: 86px !important;
  padding: 14px 18px !important;
  border: 0 !important;
  border-right: 1px solid var(--biz-editorial-line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}
body:not(.login-mode) .summary > div:last-child,
body:not(.login-mode) .crm-order-summary > article:last-child { border-right: 0 !important; }
body:not(.login-mode) .summary > div::before,
body:not(.login-mode) .crm-order-summary > article::before {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: 2px;
  border-radius: 0;
  background: transparent;
}
body:not(.login-mode) .summary > div:hover::before,
body:not(.login-mode) .crm-order-summary > article:hover::before { background: var(--biz-blue); }
body:not(.login-mode) .crm-order-summary > article::after {
  background: var(--biz-blue) !important;
}
body:not(.login-mode) .summary b,
body:not(.login-mode) .crm-order-summary strong { font-size: 24px !important; letter-spacing: -.035em; }
body:not(.login-mode) .summary span,
body:not(.login-mode) .crm-order-summary small { font-size: 12px !important; font-weight: 700; }

body:not(.login-mode) .student-list-panel,
body:not(.login-mode) .student-editor,
body:not(.login-mode) .crm-list-panel,
body:not(.login-mode) .crm-editor,
body:not(.login-mode) .list-panel,
body:not(.login-mode) .editor,
body:not(.login-mode) .bank-upload-guide,
body:not(.login-mode) .bank-preview-card,
body:not(.login-mode) .crm-p0-card,
body:not(.login-mode) .lead-card {
  border-color: var(--biz-editorial-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
}

body:not(.login-mode) .panel-title,
body:not(.login-mode) .editor-title,
body:not(.login-mode) .crm-section-head {
  position: relative;
}
body:not(.login-mode) .panel-title > div > strong:first-child,
body:not(.login-mode) .editor-title > div > strong:first-child,
body:not(.login-mode) .crm-section-head h3 {
  color: var(--biz-editorial-ink) !important;
  font-size: 16px !important;
  font-weight: 850 !important;
}
body:not(.login-mode) .panel-title > div > strong:first-child::before,
body:not(.login-mode) .editor-title > div > strong:first-child::before,
body:not(.login-mode) .crm-section-head h3::before {
  display: inline-block;
  width: 3px;
  height: 16px;
  margin-right: 9px;
  background: var(--biz-brand-red);
  vertical-align: -2px;
  content: "";
}

body:not(.login-mode) .crm-tabs {
  gap: 22px !important;
  padding: 0 18px !important;
  border-bottom: 1px solid var(--biz-editorial-line) !important;
}
body:not(.login-mode) .crm-tabs button {
  padding: 15px 0 12px !important;
  color: #555d68 !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}
body:not(.login-mode) .crm-tabs button.active {
  color: var(--biz-blue-strong) !important;
  border-bottom-color: var(--biz-blue) !important;
}
body:not(.login-mode) .crm-tabs b {
  background: #f3f4f6 !important;
  color: #707782 !important;
}
body:not(.login-mode) .crm-tabs button.active b {
  background: var(--biz-blue-soft) !important;
  color: var(--biz-blue-strong) !important;
}

body:not(.login-mode) .student-toolbar,
body:not(.login-mode) .crm-filterbar,
body:not(.login-mode) .crm-advanced-filters {
  padding: 14px 18px !important;
  border-color: var(--biz-editorial-line) !important;
  background: #fafafa !important;
}
body:not(.login-mode) .crm-advanced-filters { background: #f6f7f8 !important; }
body:not(.login-mode) input,
body:not(.login-mode) select,
body:not(.login-mode) textarea {
  border-color: #d8dce2 !important;
  border-radius: 8px !important;
  color: #242932 !important;
}
body:not(.login-mode) input:focus,
body:not(.login-mode) select:focus,
body:not(.login-mode) textarea:focus {
  border-color: #7aa2f5 !important;
  box-shadow: 0 0 0 3px rgba(39, 101, 232, .12) !important;
}

body:not(.login-mode) .crm-table th,
body:not(.login-mode) .student-list-panel thead th {
  height: 44px;
  padding: 0 13px !important;
  background: #fafafa !important;
  color: #596273 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
body:not(.login-mode) .crm-table td,
body:not(.login-mode) .student-list-panel tbody td {
  min-height: 48px;
  padding: 12px 13px !important;
  color: #3f4650 !important;
  font-size: 13px !important;
}
body:not(.login-mode) .crm-table tr:hover td,
body:not(.login-mode) .student-list-panel tbody tr:hover td { background: #f4f7fd !important; }
body:not(.login-mode) .crm-badge { border-radius: 6px !important; }

/* Readability pass: keep status labels intact and let the table scroll inside
   its own wrapper instead of squeezing Chinese labels into vertical text. */
body:not(.login-mode) .crm-badge { white-space: nowrap; line-height: 1.5; }
body:not(.login-mode) .crm-table td { white-space: nowrap; line-height: 1.6; }
body:not(.login-mode) .crm-table td:first-child { min-width: 180px; white-space: normal; overflow-wrap: anywhere; }
body:not(.login-mode) .crm-table td:is([data-label="最近跟进"],[data-label="下次跟进"],[data-label="创建时间"]) {
  min-width: 96px;
  max-width: 112px;
  white-space: normal;
}
body:not(.login-mode) .crm-table-wrap { scrollbar-width: thin; scrollbar-color: #b9c4d3 #f4f6fa; }
body:not(.login-mode) .crm-table-actions button { min-height: 36px; font-size: 13px; font-weight: 500; }
body:not(.login-mode) .crm-table tr:focus-within td { background: #f4f7fd !important; }
body:not(.login-mode) .crm-form-grid label { gap: 8px; line-height: 1.5; color: #475467; }
body:not(.login-mode) .crm-form-grid input:not([type="checkbox"]):not([type="radio"]),
body:not(.login-mode) .crm-form-grid select { min-height: 42px; }
body:not(.login-mode) .crm-form-grid textarea { line-height: 1.6; }
/* The editor body already provides horizontal padding. */
body:not(.login-mode) .crm-editor-body .crm-form-grid.single { padding: 18px 0; }
body:not(.login-mode) :is(.crm-order-panel,.crm-qualification-panel) textarea {
  height: 112px;
  min-height: 96px;
  resize: vertical;
}
body:not(.login-mode) input::placeholder,
body:not(.login-mode) textarea::placeholder { color: #747e8d; font-weight: 400; }
body:not(.login-mode) :is(button,a,input,select,textarea):focus-visible {
  outline: 2px solid var(--biz-blue-strong);
  outline-offset: 3px;
}
body:not(.login-mode) button.danger:hover:not(:disabled) {
  color: var(--biz-danger) !important;
  border-color: #efb9b5 !important;
  background: #fff0ef !important;
}
body:not(.login-mode) button:disabled,
body:not(.login-mode) button:disabled:hover {
  color: #7b8491 !important;
  border-color: #e5e9f0 !important;
  background: #f2f4f7 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}
body:not(.login-mode) #crmOpportunityFunnelRows > article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}
body:not(.login-mode) #crmOpportunityFunnelRows > article > button {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f4f6fa;
  color: #475467;
  font-size: 13px;
  white-space: normal;
  text-align: left;
}
body:not(.login-mode) .crm-order-summary strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

@media (min-width: 621px) {
  /* Keep row actions reachable while wide tables scroll horizontally. */
  body:not(.login-mode) .crm-table th:last-child,
  body:not(.login-mode) .crm-table td:last-child:not([colspan]) {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -6px 0 12px -10px rgba(24,34,48,.3);
  }
  body:not(.login-mode) .crm-table th:last-child { z-index: 3; }
}

@media (max-width: 620px) {
  body:not(.login-mode) .crm-table td,
  body:not(.login-mode) .crm-table td:first-child { min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; }
  body:not(.login-mode) .crm-table td:is([data-label="最近跟进"],[data-label="下次跟进"],[data-label="创建时间"]) { min-width: 0; max-width: none; }
  body:not(.login-mode) .crm-table td > small { grid-column: 2; }
  body:not(.login-mode) .crm-table td > small > br:first-child { display: none; }
  body:not(.login-mode) .crm-table td > .crm-badge { justify-self: start; }
  body:not(.login-mode) .crm-table-actions button { min-height: 44px; }
}

body:not(.login-mode) button.primary,
body:not(.login-mode) .primary {
  border-color: #2765e8 !important;
  border-radius: 8px !important;
  background: #2765e8 !important;
  box-shadow: none !important;
}
body:not(.login-mode) button.primary:hover,
body:not(.login-mode) .primary:hover { background: #1d55ca !important; }

@media (max-width: 900px) {
  body:not(.login-mode) main#tenantsView,
  body:not(.login-mode) main#studentsView,
  body:not(.login-mode) main#banksView,
  body:not(.login-mode) main#leadsView,
  body:not(.login-mode) main#staffView,
  body:not(.login-mode) main.crm-p0-page { padding: 14px 12px 38px !important; }
  body:not(.login-mode) .summary > div,
  body:not(.login-mode) .crm-order-summary > article { border-bottom: 1px solid var(--biz-editorial-line) !important; }
}

@media (max-width: 620px) {
  body:not(.login-mode) main:not(#dashboardView) > header h1,
  body:not(.login-mode) .crm-p0-header h1 { font-size: 28px !important; }
  body:not(.login-mode) .summary,
  body:not(.login-mode) .crm-order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body:not(.login-mode) .summary > div:nth-child(2n),
  body:not(.login-mode) .crm-order-summary > article:nth-child(2n) { border-right: 0 !important; }
  body:not(.login-mode) .summary > div,
  body:not(.login-mode) .crm-order-summary > article { min-height: 82px !important; padding: 13px !important; }
  body:not(.login-mode) .crm-tabs { gap: 18px !important; overflow-x: auto !important; }
  body:not(.login-mode) .crm-table tbody { background: #f6f6f5 !important; }
  body:not(.login-mode) .crm-table tbody tr { border-radius: 10px; box-shadow: none; }
}

@media (max-width: 900px) {
  body:not(.login-mode) main.crm-p0-page { padding: 18px 14px 38px !important; }
  body:not(.login-mode) main.crm-p0-page > header.crm-p0-header { min-height: 0; padding: 18px !important; border-radius: 15px; }
  body:not(.login-mode) main.crm-p0-page > header.crm-p0-header::after { display: none; }
  body:not(.login-mode) .crm-order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 620px) {
  body:not(.login-mode) main.crm-p0-page { padding: 12px 10px 32px !important; }
  body:not(.login-mode) .crm-p0-header { align-items: stretch !important; flex-direction: column !important; gap: 14px !important; }
  body:not(.login-mode) .crm-p0-header-actions { width: 100%; }
  body:not(.login-mode) .crm-p0-header-actions > button,
  body:not(.login-mode) .crm-p0-header-actions .crm-create-menu { flex: 1 1 auto; }
  body:not(.login-mode) .crm-p0-header-actions .primary { width: 100%; }
  body:not(.login-mode) .summary > div,
  body:not(.login-mode) .crm-order-summary > article { min-height: 86px !important; border-radius: 14px !important; }
  body:not(.login-mode) .student-toolbar,
  body:not(.login-mode) .crm-filterbar,
  body:not(.login-mode) .crm-advanced-filters { padding: 12px !important; }
  body:not(.login-mode) .crm-tabs { padding: 0 10px !important; }
  body:not(.login-mode) .crm-advanced-filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end !important;
  }
  body:not(.login-mode) .crm-advanced-filters label {
    min-width: 0;
  }
  body:not(.login-mode) .crm-advanced-filters label:nth-of-type(7),
  body:not(.login-mode) .crm-advanced-filters label:nth-of-type(8),
  body:not(.login-mode) .crm-advanced-filters label:nth-of-type(9),
  body:not(.login-mode) .crm-advanced-filters button {
    grid-column: 1 / -1;
  }
  body:not(.login-mode) .crm-advanced-filters button {
    min-height: 38px;
    justify-self: start;
  }
  body:not(.login-mode) .crm-filterbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  body:not(.login-mode) .crm-filterbar > *,
  body:not(.login-mode) .crm-filterbar select,
  body:not(.login-mode) .crm-filterbar input { width: 100%; min-width: 0; }
  body:not(.login-mode) .crm-filterbar :is(button,input,select) { min-height: 44px; }
  body:not(.login-mode) :is(.crm-order-panel,.crm-qualification-panel) .crm-editor-header { padding: 18px; }
  body:not(.login-mode) :is(.crm-order-panel,.crm-qualification-panel) .crm-editor-body { padding: 0 18px 10px; }
  body:not(.login-mode) :is(.crm-order-panel,.crm-qualification-panel) .crm-editor-footer { padding: 12px 16px max(14px,env(safe-area-inset-bottom)); }
  body:not(.login-mode) :is(.crm-order-panel,.crm-qualification-panel) .crm-editor-footer button { flex: 1; min-width: 0; min-height: 44px; }
}
