:root{
  --c-bg:#F3F5F7; --c-card:#FFFFFF; --c-accent:#E63912;
  --c-text:#252C37; --c-text2:#494C51; --c-muted:#6F767F; --c-light:#818993;
  --c-line:#E9ECF1; --c-border:#E7E9ED; --c-icon:#ADB2BB; --c-soft:#E7E9ED;
  --radius:14px;
  font-family:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}


.history{
  display:flex; flex-direction:column;
  flex:1 1 auto; min-width:0;
  padding:8px 0px 28px; gap:20px;
}
.history .history-title{ margin:0; font-size:24px; font-weight:800; }

/* --- Фильтры --- */
.history .history-filters{ display:flex; align-items:center; flex-wrap:wrap; gap:12px 20px; }
.history .history-period{ display:inline-flex; align-items:center; gap:8px; color:var(--c-text2); font-size:14px; font-weight:600; }
.history .history-period b{ font-weight:700; }
.history .history-period svg{ color:var(--c-light); }
.history .history-search{
  flex:1 1 240px; min-width:180px;
  display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 14px;
  background:var(--c-soft); border-radius:20px; color:var(--c-muted);
}
.history .history-search svg{ color:var(--c-icon); flex:0 0 auto; }
.history .history-search input{ border:none; background:none; outline:none; width:100%; font-family:inherit; font-size:14px; color:var(--c-text); }
.history .history-search input::placeholder{ color:var(--c-muted); }
.history .history-selects{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.history .history-select{ display:inline-flex; align-items:center; gap:8px; color:var(--c-text2); font-size:14px; font-weight:600; white-space:nowrap; }
.history .history-select svg{ color:var(--c-icon); }

/* --- Две панели --- */
.history .history-body{ display:flex; gap:28px; align-items:flex-start; }

/* ===== Левая панель: список броней ===== */
.history .booking-list{
  height:100%; overflow-y:auto; padding-left:22px;   /* место под полосу слева */
  display:flex; flex-direction:column; gap:10px;
  scrollbar-width:none;                              /* прячем нативную */
}
.history .booking-list::-webkit-scrollbar{ display:none; }
.history .booking-item{
  position:relative; display:flex; gap:12px;
  padding:16px; border-radius:12px;
  background:#E9ECF1;                              /* невыбранные — серые */
}
.history .booking-item-selected{
  background:var(--c-card);                        /* выбранная — белая */
  box-shadow:0 1px 3px rgba(37,44,55,.08);
}
.history .booking-check{
  flex:0 0 auto; width:22px; height:22px; margin-top:2px; border-radius:6px;
  border:1.5px solid var(--c-text);
  display:flex; align-items:center; justify-content:center; color:var(--c-text); background:var(--c-card);
}
.history .booking-check-on{ border-color:var(--c-text); background:var(--c-card); color:var(--c-text); }
.history .booking-main{ min-width:0; flex:1 1 auto; display:flex; flex-direction:column; gap:8px; }
.history .booking-title{
  font-size:14px; font-weight:700; color:var(--c-text); text-decoration:underline; text-underline-offset:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.history .booking-addr{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--c-muted); }
.history .booking-addr > span:first-child{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history .booking-tag{
  flex:0 0 auto; display:inline-flex; align-items:center; height:24px; padding:0 12px;
  border-radius:12px; background:var(--c-card); border:1px solid var(--c-border);
  font-size:11px; font-weight:700; color:var(--c-text2); letter-spacing:.3px;
}
.history .booking-foot{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:2px; }
.history .booking-id{ font-size:13px; font-weight:600; color:var(--c-text2); white-space:nowrap; }
.history .booking-id .dot{ color:var(--c-icon); margin:0 2px; }
.history .booking-date{ text-decoration:underline; text-underline-offset:2px; color:var(--c-muted); }
.history .manager-chip{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; max-width:120px;
  height:34px; padding:0 12px 0 5px; border-radius:17px; background:var(--c-soft);
  font-size:13px; font-weight:600; color:var(--c-text2);
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.history .manager-avatar{ flex:0 0 auto; width:26px; height:26px; border-radius:50%; background:#d9dde3; border:1.5px solid var(--c-accent); }

/* ===== Правая панель: детально ===== */
.history .history-detail{
  height:100%; overflow-y:auto; padding-left:24px;   /* место под полосу слева */
  display:flex; flex-direction:column; gap:16px;
  scrollbar-width:none;
}
.history .history-detail::-webkit-scrollbar{ display:none; }

/* ===== Кастомная полоса прокрутки (всегда видна, слева) ===== */
.history .scroll-host{ position:relative; height:760px; }
.history .scroll-host-list{ flex:0 0 420px; max-width:420px; }
.history .scroll-host-detail{ flex:1 1 auto; min-width:0; }
.history .scroll-bar{
  position:absolute; left:2px; top:6px; bottom:6px; width:8px;
  background:#E9ECEF; border-radius:7px; z-index:2;
}
.history .scroll-thumb{
  position:absolute; left:0; top:0; width:8px; min-height:32px;
  background:#D0D3D7; border-radius:7px; cursor:pointer;
  transition:background .15s;
}
.history .scroll-thumb:hover,.scroll-thumb.is-drag{ background:#B4B9C2; }
.history .detail-company{ margin:0; font-size:20px; font-weight:800; }
.history .change-card{
  display:flex; flex-direction:column; gap:10px;
  padding:20px 24px; background:var(--c-card);
  border:1px solid var(--c-line); border-radius:12px;
  box-shadow:0 1px 2px rgba(37,44,55,.04);
}
.history .change-top{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px 16px; }
.history .change-status{ display:flex; align-items:center; flex-wrap:nowrap; white-space:nowrap; gap:8px; font-size:14px; }
.history .change-label{ font-weight:700; color:var(--c-text); }
.history .change-from{ color:var(--c-muted); }
.history .change-arrow{ display:inline-flex; color:var(--c-accent); }
.history .change-to{ color:var(--c-text); font-weight:600; }
.history .change-side{ flex:0 0 auto; display:flex; align-items:center; gap:12px; white-space:nowrap; }
.history .change-date{ font-size:14px; font-weight:600; color:var(--c-muted); white-space:nowrap; }
.history .change-time{
  display:inline-flex; align-items:center; height:29px; padding:0 14px; border-radius:15px;
  border:1px solid var(--c-icon); font-size:13px; font-weight:600; color:var(--c-muted);
}
.history .change-current{
  display:inline-flex; align-items:center; height:29px; padding:0 14px; border-radius:15px;
  border:1px solid var(--c-accent); font-size:13px; font-weight:600; color:var(--c-accent);
}
.history .change-comment{ margin:0; font-size:14px; line-height:1.5; color:var(--c-muted); max-width:820px; }

@media (max-width:900px){
  .history .history-body{ flex-direction:column; }
  .history .booking-list{ flex-basis:auto; max-width:none; width:100%; max-height:340px; }
  .history .history-detail{ width:100%; max-height:none; }
}

