/* ---------- אזור גלילה לטבלה (כותרת נשארת קבועה, גלילה תחומה לטבלה עצמה) ---------- */

.table-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.table-scroll-area table {
  margin-bottom: 0;
}

.clear-filters-btn.active-filter-btn {
  color: #1e3a8a;
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* ---------- sortable/filterable table (SortableTable component) ---------- */

.st-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.st-table th, .st-table td {
  white-space: nowrap;
}

.st-th {
  white-space: nowrap;
  user-select: none;
  position: relative;
  background: #eef2f7;
}

/* ה-flex חייב להיות כאן, לא על th.st-th עצמו - display:flex על th דורס את display:table-cell
   המובנה שלו והורס את פריסת הטבלה (עמודות נופלות זו מתחת לזו במקום לשבת זו לצד זו) */
.st-th-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* לחיצה על כותרת העמודה כולה פותחת מיון/סינון - במקום כפתור משפך ייעודי */
.st-th-clickable {
  cursor: pointer;
}

.st-th-clickable:hover {
  background: #e2e8f0;
}

/* חובה min-width:0 בתוך flex כדי ש-text-overflow:ellipsis יתפוס בכלל
   (בלעדיו הפריט לא מתכווץ מתחת לרוחב התוכן הטבעי שלו) */
.st-label {
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* אינדיקציה בלבד (לא לחיץ) - מוצג רק כשיש סינון פעיל בעמודה; הלחיצה למיון/סינון
   היא על כותרת העמודה כולה (.st-th-clickable) */
.st-filter-indicator {
  flex: 0 0 auto;
  color: #1e3a8a;
  font-size: .95rem;
}

.st-header-action {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #1565c0;
  margin-right: 4px;
  cursor: pointer;
  padding: 0 2px;
  font-size: 1rem;
}

.st-header-checkbox {
  flex: 0 0 auto;
  margin-left: 4px;
  vertical-align: middle;
}

.st-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  width: 6px;
  cursor: col-resize;
  z-index: 3;
}

.st-resize-handle:hover,
.st-resize-handle.st-resizing {
  background: rgba(108, 139, 199, .5);
}

.st-popover-columns {
  width: 300px;
}

.st-popover-item-label {
  flex: 1 1 auto;
}

.st-move-btns {
  display: flex;
  gap: 0;
  flex: 0 0 auto;
}

.st-move-btn {
  border: none;
  background: transparent;
  color: #6c8bc7;
  cursor: pointer;
  padding: 2px 4px;
  font-size: .85rem;
  line-height: 1;
}

.st-move-btn:disabled {
  color: #d7dee8;
  cursor: default;
}

.st-popover {
  position: absolute;
  z-index: 2000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  width: 240px;
  padding: 8px;
}

.st-popover-sort {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.st-popover-sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  text-align: right;
  padding: 5px 4px;
  border-radius: 4px;
  font-size: .85rem;
  cursor: pointer;
}

.st-popover-sort-btn:hover {
  background: #f0f4f8;
}

.st-popover-divider {
  margin: 6px 0;
  border: none;
  border-top: 1px solid #eee;
}

.st-popover-search {
  margin-bottom: 6px;
}

.st-popover-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.st-popover-actions button {
  border: none;
  background: transparent;
  color: #1565c0;
  font-size: .85rem;
  cursor: pointer;
}

.st-popover-list {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 4px 0;
}

.st-popover-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  font-size: .85rem;
  cursor: pointer;
}

.st-popover-footer {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ---------- date-tree filter (year/month/day, Excel-style) ---------- */

.st-popover-datetree {
  width: 260px;
}

.st-date-tree {
  max-height: 280px;
}

.st-date-node > label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.st-date-month {
  padding-right: 16px;
}

.st-date-day {
  padding-right: 32px;
}

.st-date-children {
  display: block;
}

.st-date-node.st-date-collapsed > .st-date-children {
  display: none;
}

.st-tree-toggle {
  border: none;
  background: transparent;
  color: #6c8bc7;
  cursor: pointer;
  padding: 0 2px;
  font-size: .7rem;
  line-height: 1;
  transition: transform .15s;
}

.st-date-node.st-date-collapsed > label .st-tree-toggle i {
  transform: rotate(-90deg);
  display: inline-block;
}
