﻿/* ══ TABLE ══════════════════════════════════════════════════ */
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh-xs);
}
table, .table {
  width: 100%;
  border-collapse: collapse;
}
.table th, table th {
  padding: 12px 16px;
  border-bottom: 2px solid var(--bg-3);
  text-align: right;
  vertical-align: middle;
  background: linear-gradient(180deg, var(--bg-2) 0%, #f0ede7 100%);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: .4px;
  white-space: nowrap;
  text-transform: uppercase;
}
.table th:first-child, table th:first-child { border-radius: 0 var(--r-sm) 0 0 }
.table th:last-child,  table th:last-child  { border-radius: var(--r-sm) 0 0 0 }
.table td, table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-2);
  text-align: right;
  vertical-align: middle;
  font-size: 14px;
  color: var(--text-2);
  transition: background var(--t-fast);
}
/* Zebra striping */
.table tbody tr:nth-child(even) td,
table tbody tr:nth-child(even) td {
  background: #fdfcf9;
}
.table tbody tr:hover td,
table tbody tr:hover td {
  background: #fffbf0;
}
.table tbody tr:last-child td,
table tbody tr:last-child td {
  border-bottom: none;
}

/* ══ BADGE ══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-light);
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning-text);
  white-space: nowrap;
  line-height: 1.4;
}
.badge-success {
  background: var(--success-bg);
  border-color: var(--success-bdr);
  color: var(--success-text);
}
.badge-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bdr);
  color: var(--danger-text);
}
.badge-info {
  background: var(--info-bg);
  border-color: var(--info-bdr);
  color: var(--info-text);
}
.badge-warning {
  background: var(--warning-bg);
  border-color: var(--warning-bdr);
  color: var(--warning-text);
}
.badge-neutral {
  background: var(--bg-2);
  border-color: var(--border-2);
  color: var(--text-3);
}
.badge-dark {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ══ ACTIONS ROW ════════════════════════════════════════════ */
.actions, .act-row, .row-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.actions .btn, .actions button, .actions a,
.act-row .btn, .act-row button, .act-row a {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══ UTILITIES ══════════════════════════════════════════════ */
.muted { color: var(--muted); font-size: 13px }
.text-sm { font-size: 13px }
.text-xs { font-size: 12px }
.text-muted { color: var(--muted) }
.text-danger { color: var(--danger) }
.text-success { color: var(--success) }
.text-brand { color: var(--brand-deep) }
.font-bold { font-weight: 700 }
.font-black { font-weight: 900 }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px }

.header-actions,
.smart-search,
.links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.header-actions { margin-bottom: 14px }
.smart-search input { min-width: 220px }
.search-hint { font-size: 12px; color: var(--muted); margin-top: 6px }

/* Pager */
.pager {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pager .btn {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
  border: none;
}

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px }

/* Summary strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

/* Progress */
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  min-width: 80px;
}
.progress > .bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-brand);
  transition: width .4s ease;
}

/* Info / member grids */
.inf-grid,
.type-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.inf-card, .ts-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.inf-card:hover, .ts-card:hover { box-shadow: var(--sh-sm); transform: translateY(-1px) }
.inf-card h4, .ts-card h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.inf-big, .ts-big {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
}
.inf-row, .ts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--bg-2);
}
.inf-row:last-child, .ts-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0 }
.inf-label, .ts-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
  color: var(--text-3);
  font-weight: 600;
}
.inf-val, .ts-val { font-weight: 800; color: var(--text); flex-shrink: 0 }

/* Member grid */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.member-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.member-card:hover { box-shadow: var(--sh-sm); transform: translateY(-2px) }

/* Avatar */
.av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  color: var(--brand-darker);
  flex-shrink: 0;
  border: 2px solid var(--brand-light);
}
.av img { width: 100%; height: 100%; object-fit: cover }
.av.lg { width: 56px; height: 56px; font-size: 20px }
.av.xl { width: 72px; height: 72px; font-size: 26px }

/* Name info (table cell) */
.name-info { display: flex; flex-direction: column; gap: 2px }
.name-info .nm { font-weight: 700; font-size: 14px; color: var(--text) }
.name-info .sub { font-size: 12px; color: var(--muted) }

/* Quick links */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px }
.ql-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--t-fast);
  cursor: pointer;
  font-family: inherit;
  height: 40px;
}
.ql-btn:hover {
  border-color: var(--brand-light);
  background: var(--brand-bg);
  color: var(--brand-darker);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}

/* mem-table */
.mem-table th,
.mem-table td { padding: 11px 14px }

/* Approval cards */
.approval-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--sh-xs);
}
.approval-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px }
.approval-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.approval-actions .notes-input { max-width: 320px; flex: 1 1 200px }

/* Profile / entity hero */
.profile-hero,
.entity-head,
.mv-hero,
.pp-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-badges,
.mv-actions { display: flex; gap: 8px; flex-wrap: wrap }

/* Specific grids used in app pages */
.mv-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.mv-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
}
.mv-card h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.pp-hero-meta { display: flex; gap: 8px; flex-wrap: wrap }
.pp-knesset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.pp-tables-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.pp-two-col     { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.pp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
.pp-table { min-width: 500px; border-collapse: collapse }

/* Stats table */
.stats-table { width: 100%; border-collapse: collapse }
.stats-table th, .stats-table td { padding: 10px 14px; text-align: right; vertical-align: middle }
.stats-table thead th {
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.stats-table tbody td { border-bottom: 1px solid var(--bg-2); font-size: 14px; color: var(--text-2) }
.stats-table tbody tr:hover td { background: #fffbf0 }
.stats-table tbody tr:last-child td { border-bottom: none }

/* ══ FOOTER ═════════════════════════════════════════════════ */
.footer {
  margin-top: 32px;
  padding: 20px 0 28px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ══ MODALS ═════════════════════════════════════════════════ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(41,37,36,.52);
  z-index: 460;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 470;
}
.modal .card {
  width: min(100%, 580px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: 0;
  box-shadow: var(--sh-xl);
  border-color: var(--border-2);
  animation: modal-in .2s var(--t-spring) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}
.modal.show,
.modal-backdrop.show { display: flex }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 900 }

/* ══ TYPE PAGE HEADER ═══════════════════════════════════════ */
.type-page-header,
.members-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
