#btnRoomOwnerSettings {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
}

#btnRoomOwnerSettings:hover {
  background: var(--bg-light, #f5f7fa);
  color: var(--accent);
}

:root {
  --room-owner-overlay-bg: rgba(15, 23, 42, 0.55);
  --room-owner-vault-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.1));
  --room-owner-status-info-bg: #eff6ff;
  --room-owner-status-info-fg: #1d4ed8;
  --room-owner-status-error-bg: #fef2f2;
  --room-owner-status-error-fg: #b91c1c;
  --room-owner-status-ok-bg: #ecfdf5;
  --room-owner-status-ok-fg: #047857;
  --room-owner-warn-bg: #fffbeb;
  --room-owner-warn-fg: #b45309;
  --room-owner-amt-pos: #16a34a;
  --room-owner-amt-neg: #dc2626;
  --room-owner-clear-hover-bg: rgba(0, 0, 0, 0.06);
  --room-owner-confirm-layer-bg: rgba(15, 23, 42, 0.45);
  --room-owner-search-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --room-owner-panel-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  --room-owner-confirm-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

body.theme-dark {
  --room-owner-overlay-bg: rgba(0, 0, 0, 0.68);
  --room-owner-vault-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.16));
  --room-owner-status-info-bg: rgba(41, 121, 255, 0.16);
  --room-owner-status-info-fg: #90caf9;
  --room-owner-status-error-bg: rgba(229, 57, 53, 0.14);
  --room-owner-status-error-fg: #ef9a9a;
  --room-owner-status-ok-bg: rgba(67, 160, 71, 0.14);
  --room-owner-status-ok-fg: #a5d6a7;
  --room-owner-warn-bg: rgba(255, 183, 77, 0.14);
  --room-owner-warn-fg: #ffcc80;
  --room-owner-amt-pos: #81c784;
  --room-owner-amt-neg: #e57373;
  --room-owner-clear-hover-bg: rgba(255, 255, 255, 0.08);
  --room-owner-confirm-layer-bg: rgba(0, 0, 0, 0.62);
  --room-owner-search-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --room-owner-panel-shadow: 0 -8px 40px rgba(0, 0, 0, 0.55);
  --room-owner-confirm-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.room-owner-overlay {
  position: fixed;
  inset: 0;
  z-index: 26000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  background: var(--room-owner-overlay-bg);
  backdrop-filter: blur(4px);
  animation: chipFadeIn 0.2s ease;
}

@media (min-width: 640px) {
  .room-owner-overlay {
    padding: 16px;
  }
}

.room-owner-panel {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  height: min(85vh, 680px);
  min-height: min(85vh, 680px);
  max-height: min(85vh, 680px);
  display: flex;
  flex-direction: column;
  background: var(--bg-white, #fff);
  color: var(--text-dark);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: var(--room-owner-panel-shadow);
  overflow: hidden;
  animation: chipSlideUp 0.25s ease;
}

.room-owner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--bg-white, #fff);
}

.room-owner-header h3 {
  margin: 0;
  font-size: 17px;
}

.room-owner-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 50%;
  background: var(--bg-light, #f5f7fa);
  color: var(--text-dark, #1e293b);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.room-owner-close:hover {
  background: var(--bg-white, #fff);
  color: var(--accent);
  border-color: var(--accent, #6366f1);
}

.room-owner-close-x {
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
}

.room-owner-close .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.room-owner-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--bg-light, #f5f7fa);
}

.room-owner-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid, #64748b);
  cursor: pointer;
}

.room-owner-tab.active {
  background: var(--bg-white, #fff);
  color: var(--accent);
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.08));
}

.room-owner-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  background: var(--bg-white, #fff);
  -webkit-overflow-scrolling: touch;
}

.room-owner-vault-balance {
  text-align: center;
  padding: 16px 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--room-owner-vault-gradient);
  border: 1px solid var(--border, #e2e8f0);
}

.room-owner-vault-balance .label {
  font-size: 12px;
  color: var(--text-mid, #64748b);
  margin-bottom: 4px;
}

.room-owner-vault-balance .amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.room-owner-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid, #64748b);
  margin-bottom: 4px;
}

.room-owner-form input,
.room-owner-form select {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-white, #fff);
  color: var(--text-dark);
}

.room-owner-transfer-btn {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.room-owner-transfer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.room-owner-ledger {
  margin-top: 16px;
}

.room-owner-ledger h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-mid, #64748b);
}

.room-owner-ledger-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
}

.room-owner-ledger-item .amt-pos {
  color: var(--room-owner-amt-pos);
  font-weight: 600;
}

.room-owner-ledger-item .amt-neg {
  color: var(--room-owner-amt-neg);
  font-weight: 600;
}

.room-owner-hint {
  font-size: 12px;
  color: var(--text-mid, #64748b);
  margin-bottom: 12px;
  line-height: 1.4;
}

.room-owner-msg {
  font-size: 13px;
  margin-top: 8px;
}

.room-owner-msg.error {
  color: var(--room-owner-status-error-fg);
}

.room-owner-msg.ok {
  color: var(--room-owner-status-ok-fg);
}

.room-owner-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.room-owner-search-wrap input[type='search'] {
  width: 100%;
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 14px;
}

.room-owner-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: var(--room-owner-search-shadow);
}

.room-owner-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: transparent;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-dark);
}

.room-owner-search-item:last-child {
  border-bottom: none;
}

.room-owner-search-item:hover {
  background: var(--bg-light, #f5f7fa);
}

.room-owner-search-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.room-owner-search-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--text-mid, #64748b);
  text-align: center;
}

.room-owner-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--bg-light, #f5f7fa);
  border: 1px solid var(--border, #e2e8f0);
}

.room-owner-selected.empty {
  color: var(--text-mid, #64748b);
  font-size: 13px;
  justify-content: center;
}

.room-owner-selected-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.room-owner-selected-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.room-owner-selected-clear {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-mid, #64748b);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.room-owner-selected-clear:hover {
  background: var(--room-owner-clear-hover-bg);
  color: var(--room-owner-amt-neg);
}

.room-owner-confirm-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--room-owner-confirm-layer-bg);
  border-radius: inherit;
  pointer-events: auto;
}

/* Onay katmanı panel overflow / tıklama sorunlarını önlemek için body'de */
.room-owner-confirm-layer--portal {
  position: fixed;
  inset: 0;
  z-index: 27001;
  border-radius: 0;
}

.room-owner-confirm-status {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.room-owner-confirm-status.info {
  background: var(--room-owner-status-info-bg);
  color: var(--room-owner-status-info-fg);
}

.room-owner-confirm-status.error {
  background: var(--room-owner-status-error-bg);
  color: var(--room-owner-status-error-fg);
}

.room-owner-confirm-status.ok {
  background: var(--room-owner-status-ok-bg);
  color: var(--room-owner-status-ok-fg);
}

.room-owner-confirm {
  width: min(100%, 360px);
  padding: 18px 16px;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: var(--room-owner-confirm-shadow);
}

.room-owner-confirm h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.room-owner-confirm-main {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
}

.room-owner-confirm-meta {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-mid, #64748b);
  line-height: 1.4;
}

.room-owner-confirm-warn {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--room-owner-warn-fg);
  background: var(--room-owner-warn-bg);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
}

.room-owner-confirm-actions {
  display: flex;
  gap: 8px;
}

.room-owner-confirm-cancel,
.room-owner-confirm-ok {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
}

.room-owner-confirm-cancel {
  background: var(--bg-white, #fff);
  color: var(--text-dark);
}

.room-owner-confirm-ok {
  background: var(--accent);
  border-color: var(--accent, #6366f1);
  color: #fff;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.room-owner-confirm-ok:hover {
  filter: brightness(1.05);
}

body.theme-dark .room-owner-form input,
body.theme-dark .room-owner-form select,
body.theme-dark .room-owner-search-wrap input[type='search'] {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-dark);
}

body.theme-dark .room-owner-tab.active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

body.theme-dark .room-owner-close {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-dark);
}

body.theme-dark .room-owner-close:hover {
  background: var(--bg-white);
  color: var(--accent);
  border-color: var(--accent);
}

body.theme-dark #btnRoomOwnerSettings:hover {
  background: var(--bg-light);
}

.room-owner-activity-toolbar {
  margin: 10px 0;
}

.room-owner-activity-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 14px;
}

.room-owner-activity-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.room-owner-activity-page {
  font-size: 13px;
  color: var(--text-mid, #64748b);
}

/* Yetkili başvuruları + oda yetkilileri */
.alan-rov-staff {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.alan-rov-staff-block {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-light, #f8fafc);
}

.alan-rov-staff-block-apps,
.alan-rov-staff-block-add {
  background: var(--bg-white, #fff);
}

.alan-rov-staff-add-picker {
  position: relative;
  margin-top: 8px;
}

.alan-rov-staff-add-msg {
  margin-top: 8px;
}

.alan-rov-staff-add-picker .room-invite-search-wrap {
  position: relative;
}

.alan-rov-staff-add-picker .room-invite-search-results {
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--room-owner-search-shadow);
}

.alan-rov-staff-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
}

.alan-rov-staff-team-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alan-rov-staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e2e8f0);
}

.alan-rov-staff-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.alan-rov-staff-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alan-rov-staff-meta strong {
  font-size: 14px;
}

.alan-rov-staff-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alan-rov-staff-app-card {
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-white, #fff);
}

.alan-rov-staff-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.alan-rov-staff-app-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--room-owner-status-info-bg, #eff6ff);
  color: var(--room-owner-status-info-fg, #1d4ed8);
}

.alan-rov-staff-app-status--approved {
  background: var(--room-owner-status-ok-bg, #ecfdf5);
  color: var(--room-owner-status-ok-fg, #047857);
}

.alan-rov-staff-app-status--rejected {
  background: var(--room-owner-status-error-bg, #fef2f2);
  color: var(--room-owner-status-error-fg, #b91c1c);
}

.alan-rov-staff-app-msg {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mid, #64748b);
  line-height: 1.45;
}

body.theme-dark .alan-rov-staff-block {
  background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .alan-rov-staff-block-apps,
body.theme-dark .alan-rov-staff-row,
body.theme-dark .alan-rov-staff-app-card {
  background: var(--bg-white, #1e293b);
}

@media (max-width: 480px) {
  .alan-rov-staff-row {
    flex-wrap: wrap;
  }

  .alan-rov-staff-remove {
    width: 100%;
    margin-top: 4px;
  }
}
