/* ============================================================
   Variables & Reset
   ============================================================ */
:root {
  --bg: #323B44;
  --bg-card: #3b454f;
  --bg-elevated: #424d58;
  --bg-input: #3b454f;
  --accent: #a7434c;
  --accent-hover: #bf4f59;
  --text: #f0ebe3;
  --text-muted: #8896a4;
  --border: #4d5a66;
  --border-focus: #a7434c;
  --nav-height: 64px;
  --header-height: 80px;
  --radius: 8px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  line-height: 1.5;
}

/* ============================================================
   Header
   ============================================================ */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background:
    linear-gradient(rgba(30, 38, 44, 0.6), rgba(30, 38, 44, 0.6)),
    url('/Record.jpg') center 55% / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-logo {
  font-family: 'Monoton', cursive;
  font-size: 1.9rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  user-select: none;
  background: rgba(25, 32, 38, 0.45);
  padding: 5px 16px 5px 12px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.07);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 0;
  background: rgba(25, 32, 38, 0.45);
  padding: 5px 12px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.07);
}

#user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

#logout-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}
#logout-link:hover { text-decoration: underline; }

/* ============================================================
   Bottom Navigation
   ============================================================ */
#app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: #28333b;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  min-height: 44px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab:hover, .nav-tab.active { color: var(--accent); }

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-label { line-height: 1; }

.nav-tab-add .nav-add-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  line-height: 1;
  transition: background 0.15s;
}
.nav-tab-add:hover .nav-add-icon,
.nav-tab-add.active .nav-add-icon { background: var(--accent-hover); }
.nav-tab-add { color: var(--text-muted); }
.nav-tab-add:hover, .nav-tab-add.active { color: var(--text-muted); }

/* ============================================================
   Main / Sections
   ============================================================ */
#app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.app-section { display: none; }
.app-section.active { display: block; }
.hidden { display: none !important; }

/* ============================================================
   Loading State
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Records Grid & Cards
   ============================================================ */
.section-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

#search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  min-height: 44px;
}
#search-input:focus { border-color: var(--border-focus); }
#search-input::placeholder { color: var(--text-muted); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.btn-icon:hover { color: var(--text); border-color: #5c6b7a; }
.btn-icon.active { color: var(--accent); border-color: var(--accent); }

.filter-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 500px) { .filter-panel { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .filter-panel { grid-template-columns: repeat(4, 1fr); } }

.records-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.record-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 60px;
}
.record-card:hover { border-color: #5c6b7a; background: var(--bg-elevated); }
.record-card:active { background: #424d58; }

.record-art {
  width: 60px;
  height: 60px;
  background: #2c353e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.record-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.record-art-placeholder {
  font-size: 1.4rem;
  color: #424d58;
  user-select: none;
}

.record-group-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  padding: 10px 4px 3px;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  margin-top: 2px;
}

.record-info {
  padding: 0 12px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.record-artist {
  font-weight: 600;
}
.record-sep {
  color: var(--border);
  margin: 0 2px;
}
.record-detail {
  color: var(--text-muted);
}

.record-chevron {
  color: var(--border);
  flex-shrink: 0;
  margin-right: 12px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary, .btn-secondary, .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 44px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #424d58; }

.btn-sm { padding: 7px 12px; font-size: 0.82rem; min-height: 36px; }

.btn-danger {
  background: #3d1e1e;
  color: #e08080;
  border: 1px solid #7a4a4a;
}
.btn-danger:hover { background: #5a2020; color: #f08080; }

/* ============================================================
   Selects (shared)
   ============================================================ */
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  min-height: 44px;
  cursor: pointer;
  appearance: auto;
}
select:focus { border-color: var(--border-focus); }

/* ============================================================
   Add / Edit Form
   ============================================================ */
.form-container {
  max-width: 560px;
  margin: 0 auto;
}
.form-container h2 {
  font-size: 1.3rem;
  margin-bottom: 18px;
}

.btn-scan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  min-height: 52px;
  transition: background 0.15s;
}
.btn-scan:hover { background: var(--accent-hover); }

.btn-lookup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  min-height: 44px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-lookup:hover { background: var(--border); color: var(--text); border-color: #5c6b7a; }
.btn-lookup:disabled { opacity: 0.5; cursor: default; }

#scanner-container {
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.scanner-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.scanner-btns {
  display: flex;
  gap: 8px;
  padding: 8px;
}
.scanner-btns .btn-primary { flex: 1; }
.scanner-btns .btn-secondary { flex: 1; }
#scanner-video {
  width: 100%;
  display: block;
  background: #000;
  max-height: 280px;
  object-fit: cover;
}
#scanner-cancel {
  width: 100%;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Release picker (multiple MusicBrainz results) */
.pick-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.release-pick-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.release-pick-btn:hover { border-color: var(--accent); background: #3b454f; }
.pick-artist { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.pick-album  { font-size: 0.82rem; color: var(--text-muted); }
.pick-meta   { font-size: 0.75rem; color: #665f58; }

.lookup-status {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  border-left: 3px solid var(--accent);
}

.form-group { margin-bottom: 14px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 400px) { .form-row { grid-template-columns: 1fr; } }

.form-group label:not(.toggle-label) {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.required { color: var(--accent); }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  min-height: 44px;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--border-focus); }
.form-group input::placeholder { color: var(--text-muted); opacity: 0.7; }

.form-group textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.art-preview { margin-top: 8px; }
#art-preview-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-track {
  width: 42px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-label input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-label input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); background: #fff; }
#owned-label-text { font-size: 0.9rem; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-bottom: 16px;
}
.form-actions .btn-primary { flex: 1; }

/* ============================================================
   Settings / Dimension Editor
   ============================================================ */
.settings-container { max-width: 600px; margin: 0 auto; }
.settings-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 20px; margin-top: 6px; }

.dim-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dim-tab {
  padding: 7px 15px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  min-height: 36px;
  transition: all 0.15s;
}
.dim-tab:hover { border-color: #5c6b7a; color: var(--text); }
.dim-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

#dim-editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dim-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.dim-item:last-child { border-bottom: none; }

.dim-item-name { flex: 1; font-size: 0.9rem; min-width: 0; }

.dim-item-edit { flex: 1; display: none; }
.dim-item-edit input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.dim-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  min-width: 30px;
  min-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.dim-btn:hover { color: var(--text); border-color: #5c6b7a; }
.dim-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.dim-btn.btn-delete:hover { color: #e74c3c; border-color: #e74c3c; }
.dim-btn.btn-rename { padding: 5px 9px; }
.dim-btn.btn-save { border-color: var(--accent); color: var(--accent); }
.dim-btn.btn-save:hover { background: var(--accent); color: #fff; }

.dim-add-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}
.dim-add-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  min-height: 40px;
}
.dim-add-form input:focus { border-color: var(--border-focus); }
.dim-add-form input::placeholder { color: var(--text-muted); opacity: 0.7; }
.dim-add-form button {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 40px;
  white-space: nowrap;
  transition: background 0.15s;
}
.dim-add-form button:hover { background: var(--accent-hover); }

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.4;
}
.empty-state p { font-size: 0.9rem; line-height: 1.7; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #424d58;
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  z-index: 300;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #1e3d1e; border: 1px solid #4a7a4a; }
.toast.error { background: #3d1e1e; border: 1px solid #7a4a4a; }

/* ============================================================
   Desktop sidebar layout (768px+)
   ============================================================ */
@media (min-width: 768px) {
  body {
    padding-left: 148px;
    padding-bottom: 0;
    padding-top: var(--header-height);
  }

  #app-nav {
    flex-direction: column;
    left: 0;
    right: auto;
    top: var(--header-height);
    bottom: 0;
    width: 148px;
    height: auto;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 12px 0;
    padding-bottom: 0;
  }

  .nav-tab {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px 24px;
    gap: 8px;
    font-size: 1.15rem;
    height: auto;
    border-radius: 0;
  }

  .nav-icon { width: 26px; height: 26px; }

  .nav-tab-add { flex-direction: column; }
  .nav-tab-add .nav-add-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    flex-shrink: 0;
  }

  .toast {
    bottom: 24px;
  }
}

/* ============================================================
   Login Screen
   ============================================================ */
#login-screen {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(18, 24, 28, 0.6), rgba(18, 24, 28, 0.6)),
    url('/Record.jpg') center 55% / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#login-screen.hidden { display: none; }

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 52px 44px;
  background: rgba(22, 28, 34, 0.88);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.login-logo {
  font-family: 'Monoton', cursive;
  font-size: 2.2rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: -16px 0 0;
}

.login-error {
  color: #e07878;
  font-size: 0.88rem;
  text-align: center;
  min-height: 1.2em;
}

/* ============================================================
   Header Avatar
   ============================================================ */
.user-avatar-wrap { position: relative; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
  transition: border-color 0.15s;
  display: block;
}
.user-avatar.hidden { display: none; }
.user-avatar:hover { border-color: var(--accent); }

.user-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
  transition: border-color 0.15s;
  user-select: none;
}
.user-avatar-fallback.hidden { display: none; }
.user-avatar-fallback:hover { border-color: rgba(255,255,255,0.5); }

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #28333b;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 160px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 500;
}
.avatar-dropdown.hidden { display: none; }
.avatar-dropdown button {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}
.avatar-dropdown button:hover { background: rgba(255,255,255,0.07); }
.avatar-dropdown-divider { height: 1px; background: var(--border); }

/* ============================================================
   Manage Users Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: #1e262c;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(480px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1rem; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invite-form {
  display: flex;
  gap: 8px;
}
.invite-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
.invite-input:focus { outline: none; border-color: var(--border-focus); }

.invite-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.users-list { display: flex; flex-direction: column; gap: 6px; }

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.user-row-email { color: var(--text); word-break: break-all; }
.user-row-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  flex-shrink: 0;
}
.user-row-remove:hover { color: #e07878; }
