/* Login / password change overlay */

.auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-app);
}

.auth-layout {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  padding: 28px 24px 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-logo {
  display: block;
  flex-shrink: 0;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-heading {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.auth-hint {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.auth-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.auth-error {
  margin: 0;
  font-size: 13px;
  color: var(--danger, #dc2626);
}

.auth-submit {
  margin-top: 4px;
  width: 100%;
  padding: 10px 14px;
}

.auth-pw-rules {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-pw-rules li.is-ok {
  color: var(--accent);
  font-weight: 600;
}

.auth-splash {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 48px 16px;
}

/* Profile modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.profile-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 8px;
}

.modal-close:hover {
  background: var(--bg-app);
  color: var(--text);
}

.modal-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.profile-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 16px;
  font-weight: 700;
}

.profile-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 12px;
  font-size: 14px;
  margin: 0;
}

.profile-grid dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-grid dd {
  margin: 0;
}

/* Admin settings full page */
.view-admin-settings {
  max-width: none;
  padding: 0;
}

.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.settings-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.settings-layout {
  display: flex;
  min-height: calc(100vh - 120px);
  align-items: stretch;
}

.settings-lnb {
  width: 200px;
  flex-shrink: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-lnb-btn {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.settings-lnb-btn:hover {
  background: var(--bg-app);
  color: var(--text);
}

.settings-lnb-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-color: var(--accent-border-subtle);
}

.settings-panels {
  flex: 1;
  padding: 20px 24px 40px;
  min-width: 0;
}

.settings-panel {
  display: none;
}

.settings-panel.is-visible {
  display: block;
}

.settings-panel-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.settings-panel-hd h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.log-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.log-filter input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
}

.admin-add-form {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-app);
}

.admin-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.admin-add-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-add-grid input,
.admin-add-grid select {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-add-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: -2px;
}

.admin-add-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-add-actions {
  margin-top: 12px;
}

.btn-danger {
  color: var(--danger, #dc2626);
  border-color: var(--danger, #dc2626);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.temp-pw-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 24px;
}

.temp-pw-desc {
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.temp-pw-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.temp-pw-box code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  user-select: all;
  word-break: break-all;
}

.temp-pw-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-users-table,
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-users-table th,
.admin-users-table td,
.log-table th,
.log-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.admin-users-table th,
.log-table th {
  background: var(--bg-app);
  font-weight: 600;
}

.badge-active {
  color: var(--success, #16a34a);
  font-weight: 600;
}

.badge-locked {
  color: var(--danger, #dc2626);
  font-weight: 600;
}

.badge-inactive {
  color: var(--text-muted);
  font-weight: 600;
}

.badge-log-ok {
  color: var(--success, #16a34a);
  font-weight: 600;
}

.badge-log-fail {
  color: var(--danger, #dc2626);
  font-weight: 600;
}

.policy-card {
  padding: 16px;
}

.policy-rows {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px 16px;
  margin: 0;
  font-size: 14px;
}

.policy-rows dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.policy-rows dd {
  margin: 0;
}

#btn-profile,
#btn-settings,
#btn-logout {
  cursor: pointer;
}
