/* ── Patient table, toolbar, panel, dropdown ─────────────── */

/* Toolbar */
.toolbar {
  background: rgba(69, 69, 69, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: var(--radius-lg);
}

.toolbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar__search {
  background: #171717;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  width: 341px;
}

.toolbar__search-input {
  background: transparent;
  flex: 1;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  border: none;
  outline: none;
}
.toolbar__search-input::placeholder { color: #818181; }

.toolbar__icon {
  width: 20px;
  height: 20px;
  color: #818181;
  flex-shrink: 0;
}

/* ── Legacy flex table (images index) ───────────────────── */
.table-header {
  background: rgba(69, 69, 69, 0.5);
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: var(--radius-md);
}

.table-header__cell {
  display: flex;
  flex: 1;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  font-weight: 500;
  font-size: 16px;
  color: #fff;
}

.table-row-wrap {
  display: flex;
  align-items: center;
  height: 50px;
  width: 100%;
}
.table-row-wrap:hover { background: rgba(255, 255, 255, 0.02); }

.table-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
}

.table-cell {
  display: flex;
  flex: 1;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  gap: 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 16px;
  font-weight: 300;
  color: #fff;
  white-space: nowrap;
}

.table-cell--actions {
  flex: none;
  width: 340px;
  justify-content: flex-end;
}

.table-cell--actions__left {
  flex: none;
  display: flex;
  align-items: center;
  width: 200px;
  justify-content: flex-start;
  height: 100%;
  padding: 0 10px;
  gap: 20px;
  border-bottom: 1px solid var(--color-border);
}

/* ── Data table ──────────────────────────────────────────── */
.dt {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dt thead tr:first-child th {
  background: rgba(69, 69, 69, 0.5);
  padding: 0 10px;
  height: 50px;
  font-weight: 500;
  font-size: 16px;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  position: relative;
}
.dt thead tr:first-child th:last-child { cursor: default; }

.dt thead tr:first-child th::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  opacity: 0.3;
  font-size: 12px;
}
.dt thead tr:first-child th[data-col]::after { content: "⇅"; }
.dt thead tr:first-child th.dt-sorted-asc::after  { content: "↑"; opacity: 1; }
.dt thead tr:first-child th.dt-sorted-desc::after { content: "↓"; opacity: 1; }

.dt thead tr:last-child th {
  padding: 4px 10px 6px;
  background: rgba(69, 69, 69, 0.25);
}

.dt-search {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 13px;
  padding: 4px 8px;
  outline: none;
}
.dt-search::placeholder { color: var(--color-muted-2); }
.dt-search:focus { border-color: var(--color-border-focus); }

.dt tbody tr { border-bottom: 1px solid var(--color-border); }
.dt tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.dt__row { cursor: pointer; }

.dt td {
  padding: 0 10px;
  height: 50px;
  font-size: 16px;
  font-weight: 300;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.dt__actions {
  text-align: right;
  overflow: visible;
  padding-right: 0;
}

/* Detail panel */
.panel {
  display: none;
  width: 400px;
  border-left: 1px solid var(--color-border);
  flex-direction: column;
  overflow-y: auto;
}
.panel--open { display: flex; }

.panel__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 89px 20px 32px;
  position: relative;
}

.panel__menu-btn-wrap {
  position: absolute;
  top: 43px;
  right: 20px;
}

.panel__avatar {
  background: var(--color-surface-2);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel__name {
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  color: var(--color-text);
  text-align: center;
  width: 100%;
  margin: 28px 0 0;
}

.panel__id {
  font-weight: 500;
  font-size: 18px;
  color: var(--color-subtle);
  margin: 4px 0 0;
}

.panel__info {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 54px;
  padding: 0 20px;
}

.panel__info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 16px;
}

.panel__info-label {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-subtle);
  white-space: nowrap;
}

.panel__info-value {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-text);
  text-align: right;
}

.panel__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
  margin-top: 32px;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown__toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-subtle);
  transition: color 0.15s;
}
.dropdown__toggle:hover { color: var(--color-text); }

.dropdown__menu {
  display: none;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px 0;
  z-index: 1000;
  min-width: 180px;
}
.dropdown__menu--open { display: block; }

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.15s;
}
.dropdown__item:hover { background: var(--color-hover); }

.dropdown__item--danger { color: #f87171; }
.dropdown__item--disabled { color: var(--color-subtle); cursor: not-allowed; pointer-events: none; }

.dropdown__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 4px 0;
}

/* Filter row */
.filter-row {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
}
.filter-row--open { display: flex; }

.filter-select {
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 500;
  padding: 0 16px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  outline: none;
  cursor: pointer;
  transition: background-color 0.15s;
}
.filter-select:hover { background: var(--color-hover); }
