/* Fix vista Clienti calendario */
.card .data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.data-table th {
  padding: 13px 16px;
  background: var(--blue-xpale);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--blue-xpale); }
.data-table th:nth-child(1), .data-table td:nth-child(1) { width: 30%; }
.data-table th:nth-child(2), .data-table td:nth-child(2) { width: 21%; }
.data-table th:nth-child(3), .data-table td:nth-child(3) { width: 17%; }
.data-table th:nth-child(4), .data-table td:nth-child(4) { width: 14%; }
.data-table th:nth-child(5), .data-table td:nth-child(5) { width: 10%; }
.data-table th:nth-child(6), .data-table td:nth-child(6) { width: 110px; }
.op-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.op-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 34px;
}
.sessions-cell { display: flex; align-items: center; gap: 10px; }
.sessions-count { min-width: 44px; font-weight: 800; color: var(--text); }
.sessions-count.sessions-low { color: var(--red); }
.sessions-bar-wrap {
  flex: 1;
  min-width: 54px;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.sessions-bar { height: 100%; border-radius: 999px; }
.action-btns { display: flex; align-items: center; gap: 7px; }
.btn-icon-sm {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-icon-sm:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-pale);
}
.row-inactive { opacity: .55; }

.client-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
}
.client-view-tab {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.client-view-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border);
  font-size: 10px;
}
.client-view-tab.active { background: var(--blue); color: #fff; }
.client-view-tab.active span { background: rgba(255,255,255,.2); }
.row-history { opacity: 1; background: #fbfcfd; }
.client-history-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.client-history-status strong { font-size: 12px; color: var(--text); }
.client-history-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}
.client-history-readonly { color: var(--text3); font-size: 11px; font-weight: 800; }
.client-history-notice { border-color: #cbd5e1; background: #f8fafc; }
.btn-icon-sm.archive { border-color: #d6b263; background: #fff8e8; color: #7b5917; }
.btn-icon-sm.archive:hover { border-color: #b88928; background: #fff1cc; color: #6b4b0d; }
.btn-archive { border-color: #d6b263; background: #fff8e8; color: #7b5917; }
.btn-archive:hover { border-color: #b88928; background: #fff1cc; color: #6b4b0d; }
.package-overview input:disabled,
.package-overview select:disabled { opacity: .72; cursor: not-allowed; background: #f8fafc; }

@media (max-width: 720px) {
  .client-view-tabs { width: 100%; }
  .client-view-tab { flex: 1; }
}

.modal-overlay.open,
.modal-overlay.active { display: flex; }
.modal-box {
  width: min(720px, 96vw);
  max-height: 92vh;
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
}
.modal-header,
.modal-footer {
  background: var(--bg2);
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.modal-header h3 { font-size: 18px; font-weight: 800; color: var(--text); }
.modal-subtitle { font-size: 12px; color: var(--text3); margin-top: 3px; font-weight: 700; }
.modal-body {
  padding: 22px;
  max-height: calc(92vh - 132px);
  overflow-y: auto;
}
.modal-footer { border-top: 1px solid var(--border); border-bottom: none; justify-content: flex-end; }
.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
}
.modal-close:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,49,68,.08); }
.checkbox-grid { display: grid; gap: 9px; margin-bottom: 14px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  font-weight: 800;
  cursor: pointer;
}
.form-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 18px 0 9px;
}
.form-hint { font-size: 11px; color: var(--text3); margin-top: 5px; font-weight: 700; }
.form-warning {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--gold-pale);
  color: #8a6210;
  font-size: 12px;
  font-weight: 800;
}
.compat-badge {
  margin-left: 6px;
  color: var(--green);
  background: var(--green-pale);
  border-radius: 999px;
  padding: 2px 7px;
}
.package-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--blue-xpale);
}
.package-info-label { font-size: 11px; font-weight: 800; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.val-ok,
.val-error {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}
.val-ok { background: var(--green-pale); color: var(--green); }
.val-error { background: var(--red-pale); color: var(--red); }

@media (max-width: 860px) {
  .card { overflow-x: auto; }
  .card .data-table { min-width: 760px; }
  .form-row { grid-template-columns: 1fr; }
}
