/* JISOO CRM 1.4 mobile layout recovery and refinements */
.customer-row.customer-thumbnail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
}
.customer-thumbnail .customer-name { min-width: 0; }
.customer-thumbnail-condition {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0 !important;
}
.customer-thumbnail-phone {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0 !important;
  color: #43534d !important;
  white-space: nowrap;
}
.mobile-customer-back { display: none; }

@media (max-width: 850px) {
  body { overflow-x: hidden; }
  .sidebar { width: 70px; padding: 25px 9px; }
  .brand { padding: 0 10px 35px; }
  .brand > span:last-child,
  .workspace-label,
  .nav-item:not(.active)::after,
  .nav-item { font-size: 0; }
  .nav-item { padding: 13px; justify-content: center; }
  .sidebar-bottom > div:not(.agent-avatar),
  .dots { display: none; }
  .main-content { margin-left: 70px; width: calc(100% - 70px); }
  .topbar,
  .view { padding-left: 25px; padding-right: 25px; }
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  html,
  body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .main-content { margin: 0 !important; width: 100% !important; padding-bottom: 72px; }
  .topbar { height: 64px; padding: 0 12px; gap: 7px; }
  .search-wrap { min-width: 0; flex: 1; }
  .global-search { width: 100%; min-width: 0; }
  .global-search input { min-width: 0; text-overflow: ellipsis; }
  .global-search kbd,
  .notification { display: none; }
  .view { width: 100%; max-width: 100%; padding: 25px 15px 86px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .page-heading > div:first-child { min-width: 0; }
  .page-heading h1 { font-size: 23px; }
  .page-heading p:not(.eyebrow) { display: none; }
  .page-heading > .primary-btn { flex: 0 0 auto; }
  .property-page-actions { width: auto !important; min-width: 0; flex: 0 1 auto; justify-content: flex-end !important; }
  .primary-btn { padding: 10px 12px; white-space: nowrap; }
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 9px; }
  .summary-row article { min-width: 0; padding: 13px; }
  .summary-row article small { display: none; }
  .summary-row strong { font-size: 21px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .filters label,
  .filters select { min-width: 0; }
  .filter-panel { padding: 13px; }
  .quick-filters { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .chip { white-space: nowrap; }
  .section-toolbar { flex-wrap: wrap; gap: 8px; margin: 20px 0 10px; }
  .property-view-switch { margin-left: auto; }
  .customer-layout { display: block; }
  .customer-list { border-right: 0; border-bottom: 1px solid var(--line); }
  #customers:not(.mobile-customer-detail-open) .customer-detail { display: none; }
  #customers.mobile-customer-detail-open .customer-list { display: none; }
  #customers.mobile-customer-detail-open .customer-detail {
    display: block;
    min-height: calc(100vh - 175px);
    padding-top: 14px;
  }
  .customer-row.customer-thumbnail { padding: 14px 18px; }
  .mobile-customer-back {
    display: inline-flex;
    align-items: center;
    margin: 0 0 18px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
  }
  .form-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
  .form-grid .full,
  .property-form-grid label.full { grid-column: auto; }
  dialog { max-width: calc(100vw - 18px); }
  dialog form { padding: 24px; }
  .modal-actions { position: sticky; bottom: 0; z-index: 2; background: #fff; padding-bottom: 0; }
  #schedule .calendar-card { max-width: 100%; overflow: hidden; }
  #schedule .weekdays,
  #schedule .calendar-grid { width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  #schedule .calendar-grid > *,
  #schedule .day { min-width: 0; overflow: hidden; }
  #schedule .event,
  #schedule .calendar-holiday { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #schedule .calendar-head { flex-wrap: wrap; }
  #schedule .calendar-head .today { margin-left: auto; }
  .sidebar .nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sidebar .nav-item { min-width: 0; font-size: 10px !important; line-height: 1.15; }
  .sidebar .nav-item .nav-icon { width: 18px !important; height: 18px; flex-basis: 18px; }
}

@media (max-width: 370px) {
  .topbar { padding-left: 9px; padding-right: 9px; }
  .data-tools #cloudAuthButton { max-width: 94px; overflow: hidden; text-overflow: ellipsis; }
  .view { padding-left: 12px; padding-right: 12px; }
  .property-page-actions { gap: 5px; }
  .property-page-actions button { padding-left: 8px; padding-right: 8px; font-size: 12px; }
  .sidebar .nav-item { font-size: 9px !important; }
}
