/* ═══════════════════════════════════════════
   CRM Contatti – contatti.css
═══════════════════════════════════════════ */

/* ── DARK THEME (default) ── */
:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface2: #1e2436;
  --border: #2a3050;
  --accent: #4f8ef7;
  --accent2: #7c3aed;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e4e8f5;
  --muted: #6b7a9e;
  --tableplan: #4f8ef7;
  --epsoft: #a78bfa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #f5f7fc;
  --border: #dde2f0;
  --accent: #2b6ef5;
  --accent2: #6d28d9;
  --green: #059669;
  --red: #dc2626;
  --yellow: #d97706;
  --text: #1a2040;
  --muted: #7a84a8;
  --tableplan: #2b6ef5;
  --epsoft: #7c3aed;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* smooth theme transition */
body, .topbar, .filters-bar, .table-card, .modal-content,
.form-control, .form-select, .filter-select, .chiamata-item,
.allegato-card, .stat-chip, .drop-zone, .sub-content,
thead th, tbody td {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 3px;
}
.theme-toggle::before {
  content: '';
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 3px;
  transition: transform .3s cubic-bezier(.4,0,.2,1), background .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
[data-theme="light"] .theme-toggle::before { transform: translateX(20px); }

.theme-label {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.theme-icon { font-size: 14px; transition: color .2s; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.5; transform:scale(1.4); }
}
.topbar .ms-auto { display: flex; gap: 10px; align-items: center; }

/* ── TORNA A DAEPSIVO ── */
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79,142,247,.08);
}
.btn-back-label { /* shown on desktop, hidden on mobile */ }

/* ── FILTERS BAR ── */
.filters-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .2s;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box .bi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  min-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* ── MAIN TABLE ── */
.main-wrap { padding: 24px 28px; }

.stats-row {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.stat-chip .num { font-size: 22px; font-weight: 700; font-family: 'DM Mono', monospace; }

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── TABLE SCROLL WRAPPER ── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-wrap table {
  min-width: 900px;
}

table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text); }
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text); background: var(--bg); }
thead th .sort-icon { opacity: .3; margin-left: 4px; font-size: 10px; pointer-events: none; }
thead th.sorted { color: var(--accent); }
thead th.sorted .sort-icon { opacity: 1; color: var(--accent); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover > td { background: rgba(79,142,247,.05); }
tbody tr.expanded > td { background: rgba(79,142,247,.07); }

td { padding: 10px 14px; vertical-align: middle; }

/* ── BADGES ── */
.badge-tipo {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.badge-tableplan { background: rgba(79,142,247,.15); color: var(--tableplan); border: 1px solid rgba(79,142,247,.3); }
.badge-epsoft    { background: rgba(167,139,250,.15); color: var(--epsoft); border: 1px solid rgba(167,139,250,.3); }

.badge-tipologia {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
  background: rgba(107,122,158,.12);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── PHONE LINK ── */
.phone-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); text-decoration: none;
  font-family: 'DM Mono', monospace; font-size: 13px;
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid transparent;
  transition: all .15s;
}
.phone-link:hover { border-color: var(--green); background: rgba(16,185,129,.1); color: var(--green); }

.wa-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #25d366; text-decoration: none;
  font-size: 12px; padding: 2px 6px;
  border-radius: 5px; transition: background .15s;
}
.wa-link:hover { background: rgba(37,211,102,.1); }

/* ── ACTION BTNS ── */
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s;
  font-size: 14px;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: rgba(79,142,247,.1); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,.1); }
.btn-icon.success:hover { border-color: var(--green); color: var(--green); background: rgba(16,185,129,.1); }

.expand-btn {
  transition: transform .25s; display: inline-block;
}
.expanded .expand-btn { transform: rotate(90deg); }

/* ── COUNTER PILLS ── */
.counter-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 20px; font-size: 11px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); margin-right: 4px;
  cursor: pointer; transition: all .15s;
}
.counter-pill:hover { border-color: var(--accent); color: var(--accent); }
.counter-pill .count { font-weight: 700; font-family: 'DM Mono', monospace; }

/* ── SUBTABLE ROW ── */
.sub-row td { padding: 0; background: transparent; }
.sub-content {
  display: none;
  padding: 16px 20px 20px 48px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.sub-content.show { display: block; }
.sub-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.sub-tab {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.sub-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

/* ── CHIAMATE LIST ── */
.chiamata-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: 14px;
}
.chiamata-date {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--muted); white-space: nowrap;
  min-width: 110px;
}
.chiamata-body { flex: 1; }
.chiamata-feedback { font-size: 13px; color: var(--text); margin-top: 4px; }

.esito-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.esito-risposto   { background: rgba(16,185,129,.15); color: #10b981; }
.esito-non-risposto { background: rgba(239,68,68,.15); color: #ef4444; }
.esito-richiamare { background: rgba(245,158,11,.15); color: #f59e0b; }
.esito-positivo   { background: rgba(16,185,129,.2); color: #10b981; }
.esito-negativo   { background: rgba(239,68,68,.2); color: #ef4444; }
.esito-neutro     { background: rgba(107,122,158,.15); color: var(--muted); }

/* ── ALLEGATI ── */
.allegati-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.allegato-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  min-width: 200px; max-width: 280px;
  transition: border-color .15s;
}
.allegato-card:hover { border-color: var(--accent); }
.allegato-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.allegato-icon.pdf    { background: rgba(239,68,68,.15); color: #ef4444; }
.allegato-icon.img    { background: rgba(16,185,129,.15); color: #10b981; }
.allegato-icon.doc    { background: rgba(79,142,247,.15); color: var(--accent); }
.allegato-icon.other  { background: rgba(107,122,158,.15); color: var(--muted); }
.allegato-name { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.3; word-break: break-word; }
.allegato-size { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ── DROP ZONE ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
  margin-top: 12px;
  font-size: 13px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(79,142,247,.05);
  color: var(--accent);
}
.drop-zone input { display: none; }

/* ── MODALS ── */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }
.modal-title { font-weight: 700; font-size: 16px; }
.btn-close { filter: invert(1) opacity(.5); }
[data-theme="light"] .btn-close { filter: none; opacity: .6; }

.form-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 5px; }
.form-control, .form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}
.form-select option { background: var(--surface2); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── BUTTONS ── */
.btn-primary-custom {
  background: var(--accent); border: none;
  color: #fff; font-family: inherit; font-weight: 600;
  padding: 8px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: opacity .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-custom:hover { opacity: .85; }

.btn-outline-custom {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-weight: 500;
  padding: 8px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.btn-outline-custom:hover { border-color: var(--muted); }

.btn-danger-custom {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--red); font-family: inherit; font-weight: 600;
  padding: 8px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger-custom:hover { background: rgba(239,68,68,.25); }

/* ── COLUMN TOGGLE PANEL ── */
.col-toggle-wrap {
  position: relative;
}
.col-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1050;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 200px;
  max-height: 480px;
  overflow: hidden;
  flex-direction: column;
}
.col-panel.open { display: flex; }
.col-panel-header {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.col-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.col-panel-body label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
}
.col-panel-body label:hover { background: var(--surface2); }
.col-panel-body label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
  flex-shrink: 0;
}
.col-panel-footer {
  border-top: 1px solid var(--border);
  padding: 8px 14px;
  flex-shrink: 0;
}
.col-panel-footer button {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color .15s;
}
.col-panel-footer button:hover { color: var(--accent); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--muted);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; display: block; opacity: .3; }

/* ── TOAST ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  animation: slideIn .2s ease;
  min-width: 250px;
  color: var(--text);
  box-shadow: var(--shadow);
}
@keyframes slideIn { from { transform: translateX(40px); opacity:0; } to { transform:none; opacity:1; } }
.toast-item.success { border-left: 3px solid var(--green); }
.toast-item.error   { border-left: 3px solid var(--red); }

/* ── LOADING ── */
.loading-row td { text-align: center; padding: 40px; color: var(--muted); }
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* light theme overrides */
[data-theme="light"] .modal-backdrop { opacity: .3; }

.text-accent { color: var(--accent); }
.text-muted-custom { color: var(--muted); font-size: 12px; }
.separator { color: var(--border); margin: 0 4px; }

/* Confirm modal */
#confirmModal .modal-body { font-size: 14px; padding: 22px; }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-brand { font-size: 15px; }
  .btn-label { display: none; }
  .btn-back-label { display: none; }
  .btn-back { padding: 7px 10px; }
  .btn-primary-custom { padding: 8px 12px; border-radius: 50%; width: 36px; height: 36px; justify-content: center; }
  .filters-bar { padding: 10px 14px; gap: 8px; }
  .search-box { min-width: 0; }
  .filter-select { min-width: 0; flex: 1; font-size: 12px; }
  .main-wrap { padding: 14px; }
  .stats-row { gap: 8px; }
  .stat-chip { padding: 8px 12px; font-size: 12px; }
  .stat-chip .num { font-size: 18px; }
  .last-update-text { display: none; }
  .sub-content { padding: 12px 12px 16px 12px; }
}

/* ═══════════════════════════════════════════
   APPUNTAMENTI
═══════════════════════════════════════════ */

/* ── MINI CALENDAR ── */
.calendar-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 700; font-size: 14px;
}
.cal-nav {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; font-size: 12px;
}
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day-hdr {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  padding: 3px 0; letter-spacing: .5px;
}
.cal-cell {
  text-align: center; padding: 6px 2px;
  font-size: 12px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
  color: var(--text);
}
.cal-cell.empty { cursor: default; }
.cal-cell:not(.empty):hover { background: rgba(79,142,247,.15); color: var(--accent); }
.cal-cell.today { font-weight: 700; color: var(--accent); }
.cal-cell.selected {
  background: var(--accent); color: #fff !important;
  font-weight: 700;
}

/* ── APPUNTAMENTO ITEM ── */
.appuntamento-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color .15s;
}
.appuntamento-item:hover { border-color: var(--accent); }
.appuntamento-item.past { opacity: .55; }

.app-date-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(79,142,247,.12);
  border: 1px solid rgba(79,142,247,.25);
  border-radius: var(--radius-sm);
  min-width: 44px; padding: 6px 4px;
  flex-shrink: 0;
}
.app-day { font-size: 20px; font-weight: 800; font-family: 'DM Mono', monospace; color: var(--accent); line-height: 1; }
.app-mon { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.app-body { flex: 1; min-width: 0; }
.app-titolo { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.app-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.app-note { font-size: 12px; color: var(--muted); margin-top: 5px; font-style: italic; }

/* ── GOOGLE CALENDAR SECTION ── */
.gcal-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.gcal-row {
  display: flex; align-items: center; gap: 10px;
}
.gcal-toggle-wrap {
  position: relative; display: inline-block;
  width: 40px; height: 22px; cursor: pointer;
}
.gcal-toggle-wrap input { display: none; }
.gcal-toggle {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 11px;
  transition: background .25s;
}
.gcal-toggle::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.gcal-toggle-wrap input:checked + .gcal-toggle { background: var(--green); }
.gcal-toggle-wrap input:checked + .gcal-toggle::before { transform: translateX(18px); }
.gcal-status {
  margin-top: 8px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}

/* ── DRAGGABLE COLUMNS ── */
thead th[draggable="true"] { cursor: grab; }
thead th[draggable="true"]:active { cursor: grabbing; }
thead th.col-dragging { opacity: .45; }
thead th.col-drag-over-left  { box-shadow: inset 3px 0 0 var(--accent); }
thead th.col-drag-over-right { box-shadow: inset -3px 0 0 var(--accent); }

/* ── RESIZABLE COLUMNS ── */
.col-resize-handle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 10;
  user-select: none;
}
.col-resize-handle:hover,
.col-resizing .col-resize-handle {
  background: var(--accent);
  opacity: .5;
}
body.col-resizing { cursor: col-resize !important; user-select: none; }
body.col-resizing * { user-select: none; }

thead th { overflow: hidden; }
