/* ─── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #21262d;
  --surface3:    #2d333b;
  --border:      #30363d;
  --border2:     #3d444d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-subtle: #656d76;
  --accent:      #58a6ff;
  --accent-dim:  #1f4068;
  --success:     #3fb950;
  --success-dim: #0f3320;
  --danger:      #f85149;
  --danger-dim:  #3d1414;
  --warn:        #d29922;
  --sent-bg:     #1c3a5e;
  --sent-border: #2d5a8e;
  --recv-bg:     #21262d;
  --recv-border: #30363d;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:        'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Auth Pages ─────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #1a2332 0%, var(--bg) 60%);
  padding: 24px;
  overflow: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: fadeUp .3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  display: flex;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}
.form-group input::placeholder { color: var(--text-subtle); }

.field-hint { font-size: 11px; color: var(--text-subtle); }

/* Password strength */
.password-strength { margin-top: 4px; font-size: 12px; }
.password-strength span { color: var(--text-muted); }
.pw-bar { height: 4px; background: var(--surface3); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.pw-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; background: var(--danger); }
.pw-2 .pw-fill { background: var(--warn); }
.pw-3 .pw-fill { background: #e3b341; }
.pw-4 .pw-fill { background: var(--success); }
.pw-5 .pw-fill { background: var(--success); }

.error-banner {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  padding: 10px 14px;
  font-size: 13px;
}

.btn {
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  transition: opacity .15s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:not(:disabled):hover { background: #79b8ff; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

.auth-note {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-subtle);
}
.auth-note svg { flex-shrink: 0; }

/* ─── App Layout ─────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-brand svg { color: var(--accent); flex-shrink: 0; }

.sidebar-me {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-username {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.logout-btn:hover { color: var(--danger); background: var(--danger-dim); text-decoration: none; }

.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  transition: border-color .15s;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--text-subtle); }

.sidebar-section-label {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-subtle);
}

.user-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 4px 8px;
}
.user-list::-webkit-scrollbar { width: 4px; }
.user-list::-webkit-scrollbar-track { background: transparent; }
.user-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.user-list-empty {
  padding: 20px 16px;
  color: var(--text-subtle);
  font-size: 13px;
  text-align: center;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.user-item:hover { background: var(--surface2); }
.user-item.active { background: var(--accent-dim); }

.user-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item-nokeys {
  font-size: 11px;
  color: var(--warn);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }

/* ─── Key Status Bar ─────────────────────────────────────────────────────── */
.key-status {
  margin: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 11px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.key-status.ready { border-color: var(--success); color: var(--success); background: var(--success-dim); }
.key-status.error { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }

/* ─── Chat Area ──────────────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-subtle);
  text-align: center;
  padding: 40px;
}
.chat-empty svg { opacity: .25; }
.chat-empty h2 { font-size: 18px; font-weight: 600; color: var(--text-muted); }
.chat-empty p { font-size: 13px; }

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-header-left { display: flex; align-items: center; gap: 12px; }

.chat-peer-name { font-size: 15px; font-weight: 600; }

.chat-peer-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--success);
}

.chat-header-right { display: flex; gap: 6px; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface2); }

/* ─── Messages ───────────────────────────────────────────────────────────── */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}
.messages-container::-webkit-scrollbar { width: 5px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

#messages-list { display: flex; flex-direction: column; gap: 6px; }

.msg-group {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.msg-group.mine { align-self: flex-end; align-items: flex-end; }
.msg-group.theirs { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  max-width: 100%;
}
.mine .msg-bubble {
  background: var(--sent-bg);
  border: 1px solid var(--sent-border);
  border-bottom-right-radius: 4px;
  color: #cde1ff;
}
.theirs .msg-bubble {
  background: var(--recv-bg);
  border: 1px solid var(--recv-border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.msg-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: 10px;
  display: block;
  cursor: pointer;
  transition: opacity .15s;
}
.msg-image:hover { opacity: .9; }
.msg-image.loading { opacity: .4; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-subtle);
  padding: 2px 3px;
}
.mine .msg-meta { flex-direction: row-reverse; }

.verified-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--success);
}
.unverified-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--warn);
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
  color: var(--text-subtle);
  font-size: 11px;
}
.date-divider::before, .date-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.decrypting-placeholder {
  color: var(--text-subtle);
  font-style: italic;
  font-size: 12px;
}

/* ─── Compose Area ───────────────────────────────────────────────────────── */
.compose-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.attach-btn {
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.attach-btn:hover { color: var(--accent); background: var(--accent-dim); }

.compose-input-wrap {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s;
  display: flex;
  flex-direction: column;
}
.compose-input-wrap:focus-within { border-color: var(--accent); }

#message-input {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  resize: none;
  outline: none;
  width: 100%;
  max-height: 120px;
  overflow-y: auto;
}
#message-input::placeholder { color: var(--text-subtle); }
#message-input::-webkit-scrollbar { width: 3px; }

.image-preview-wrap {
  position: relative;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
}
.image-preview-wrap img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 8px;
  display: block;
}
.remove-image-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--surface3);
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.remove-image-btn:hover { background: var(--danger); }

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.send-btn:hover { background: #79b8ff; }
.send-btn:active { transform: scale(.95); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 460px;
  box-shadow: var(--shadow);
  animation: fadeUp .2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.modal-desc { font-size: 13px; color: var(--text-muted); }

.fp-block { display: flex; flex-direction: column; gap: 6px; }
.fp-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.fp-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--success);
  background: var(--success-dim);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 10px 14px;
  word-break: break-all;
  letter-spacing: .5px;
  line-height: 1.8;
}

/* ─── Scrollbar global ───────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sidebar { width: 100%; position: absolute; z-index: 10; height: 100%; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .msg-group { max-width: 88%; }
}

/* ─── Admin link in chat sidebar ─────────────────────────────────────────── */
.sidebar-admin-link {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 8px 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--warn);
  border: 1px solid rgba(210,153,34,.3);
  background: rgba(210,153,34,.07);
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.sidebar-admin-link:hover {
  background: rgba(210,153,34,.15);
  border-color: var(--warn);
  text-decoration: none;
}
.sidebar-admin-link svg { flex-shrink: 0; }

/* ─── Admin layout ───────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  overflow: auto;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.admin-brand svg { color: var(--accent); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  text-decoration: none;
}
.admin-nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.admin-nav-item.active { background: var(--accent-dim); color: var(--accent); }

.admin-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ─── Admin main ─────────────────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1100px;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-page-title { font-size: 22px; font-weight: 700; }
.admin-page-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.admin-topbar-right { flex-shrink: 0; padding-top: 4px; }
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
  background: rgba(210,153,34,.1);
  border: 1px solid rgba(210,153,34,.3);
  border-radius: 20px;
  padding: 4px 12px;
}

/* ─── Stat cards ─────────────────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ─── Admin card / table ─────────────────────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}
.admin-search-wrap input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 12px;
  outline: none;
  width: 200px;
  transition: border-color .15s;
}
.admin-search-wrap input:focus { border-color: var(--accent); }
.admin-search-wrap input::placeholder { color: var(--text-subtle); }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface2); }
.admin-table tbody tr.row-self { background: rgba(88,166,255,.04); }

.table-loading { text-align: center; color: var(--text-muted); padding: 40px !important; }
.td-date { color: var(--text-muted); font-size: 13px; white-space: nowrap; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.table-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.user-cell-name { font-weight: 500; }
.user-cell-id { font-size: 11px; color: var(--text-subtle); }

/* ─── Tags ───────────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; border-radius: 20px;
  padding: 2px 8px; margin-right: 4px;
}
.tag-admin   { background: rgba(210,153,34,.15); color: var(--warn); border: 1px solid rgba(210,153,34,.3); }
.tag-user    { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.tag-you     { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(88,166,255,.3); }
.tag-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(63,185,80,.3); }
.tag-warn    { background: rgba(210,153,34,.1); color: var(--warn); border: 1px solid rgba(210,153,34,.2); }

/* ─── Buttons (extra variants) ───────────────────────────────────────────── */
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; white-space: nowrap; }
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:not(:disabled):hover { background: var(--surface3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:not(:disabled):hover { opacity: .85; }
.btn-warn { background: var(--warn); color: #000; }
.btn-warn:not(:disabled):hover { opacity: .85; }

/* ─── Edit modal extras ──────────────────────────────────────────────────── */
.modal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-section:last-child { border-bottom: none; padding-bottom: 0; }
.modal-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.modal-row { display: flex; gap: 8px; }
.modal-row input {
  flex: 1;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  padding: 7px 12px; outline: none; transition: border-color .15s;
}
.modal-row input:focus { border-color: var(--accent); }
.modal-row input::placeholder { color: var(--text-subtle); }
.modal-field-error { font-size: 12px; color: var(--danger); }
.modal-danger-zone { margin-top: 4px; }
.modal-danger-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-danger-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-danger-label { font-size: 13px; font-weight: 500; }
.modal-danger-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; max-width: 280px; }
