/* ── Settings page ── */

.settings-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.settings-page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
}

.settings-page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}

.settings-search {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.settings-search input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}

.settings-search input:focus { border-color: var(--primary); }
.settings-search input::placeholder { color: var(--text-4); }

.settings-search svg {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-3);
  pointer-events: none;
}

/* ── Role detail header ── */
.role-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.role-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.role-back-btn:hover { background: var(--bg); color: var(--text-1); }
.role-back-btn svg { width: 18px; height: 18px; }

.role-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-1);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  background: #f3f4f6;
  color: var(--text-3);
}

.role-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Permission / Member tabs ── */
.role-tabs {
  display: flex;
  gap: 28px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.role-tab {
  padding: 14px 2px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.role-tab:hover { color: var(--text-1); }
.role-tab.active { color: #0CAF60; border-bottom-color: #0CAF60; }

.role-tab-panel { padding: 20px 24px 24px; }

/* ── Access scope card ── */
.access-card {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.access-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 14px;
}

.access-select {
  min-width: 220px;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.access-select:focus { border-color: var(--primary); }

/* ── Language switcher: segmented pill toggle (see spec-language-switcher.md) ── */
.lang-switcher-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lang-switcher-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-muted, #f8fafc);
  border: 1px solid var(--border, #dbe2ef);
  border-radius: 999px;
}

.lang-switcher-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-switcher-btn:hover:not(.active) { color: var(--text-primary, #0f172a); }
.lang-switcher-btn.active {
  background: var(--primary, #083300);
  color: #fff;
}
.lang-switcher-btn:focus-visible { outline: 2px solid var(--primary, #083300); outline-offset: 2px; }

/* Sidebar footer: switcher sits above the Settings link, full width */
.sidebar-footer .lang-switcher-wrap {
  justify-content: stretch;
  margin-bottom: 10px;
  padding: 0 4px;
}
.sidebar-footer .lang-switcher-group { width: 100%; justify-content: center; }
.sidebar-footer .lang-switcher-btn { flex: 1; text-align: center; }

.access-lock-badge {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid #f5c518;
  color: var(--text-1);
}
.access-lock-badge svg { width: 17px; height: 17px; }

/* ── Permission table cell ── */
.perm-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.perm-select-wrap .perm-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex-shrink: 0;
}
.perm-select-wrap .perm-icon svg { width: 100%; height: 100%; }

.perm-select {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  appearance: none;
  padding: 4px 20px 4px 0;
  outline: none;
  text-align: right;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

/* ── Member tab ── */
.member-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.add-member-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px 6px 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: background .15s;
}
.add-member-btn:hover { background: var(--bg); }

.add-member-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  flex-shrink: 0;
}
.add-member-icon svg { width: 15px; height: 15px; }

.member-search {
  position: relative;
  width: 240px;
  max-width: 100%;
}
.member-search input {
  width: 100%;
  padding: 9px 38px 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.member-search input:focus { border-color: var(--primary); }
.member-search input::placeholder { color: var(--text-4); }
.member-search svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.member-empty { padding: 32px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* ── Password panel ── */
.password-panel-body {
  padding: 24px;
  max-width: 460px;
}

@media (max-width: 640px) {
  .password-panel-body { max-width: none; padding: 16px; }
}

.password-panel-body .dfield { margin-bottom: 18px; }
.password-panel-body .dfield label { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }

.password-input-wrap { position: relative; }
.password-input-wrap input {
  width: 100%;
  padding: 11px 44px 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.password-input-wrap input:focus { border-color: var(--primary); }

.pw-toggle-btn {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
}
.pw-toggle-btn svg { width: 18px; height: 18px; }
.pw-toggle-btn:hover { color: var(--text-1); }

.form-msg-error {
  display: block;
  font-size: 12px;
  color: var(--red);
  margin: -8px 0 16px;
}

.form-msg-success {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  font-size: 13px;
  color: var(--primary);
}

.btn-save-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 30px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-save-dark:hover { background: #0a4400; }

/* ── Notification panel ── */
.notif-panel-body { padding: 4px 24px 24px; }

.notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.notif-row:last-of-type { border-bottom: none; }

.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}
.notif-desc {
  font-size: 12px;
  color: var(--text-3);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .2s, background-image .2s;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
}
.switch input:checked + .switch-slider { background: var(--green); }
.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 13 9 17 19 7'/%3E%3C/svg%3E");
}

.notif-panel-footer { padding: 0 24px 24px; }
