/* ============================================================
   styles.css — Final Corners Admin Panel
   Dark industrial theme with amber accents
   ============================================================ */

/* ─── Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@400;600;700;800&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --bg-base:       #0a0a0b;
  --bg-surface:    #111114;
  --bg-elevated:   #18181d;
  --bg-hover:      #1e1e24;
  --border:        #2a2a32;
  --border-subtle: #1e1e24;

  --accent:        #f59e0b;
  --accent-dim:    rgba(245,158,11,0.15);
  --accent-hover:  #fbbf24;

  --text-primary:  #f4f4f5;
  --text-secondary:#9ca3af;
  --text-muted:    #52525b;

  --danger:        #ef4444;
  --danger-dim:    rgba(239,68,68,0.15);
  --success:       #22c55e;
  --success-dim:   rgba(34,197,94,0.15);
  --info:          #3b82f6;
  --info-dim:      rgba(59,130,246,0.15);
  --warning:       #f97316;
  --warning-dim:   rgba(249,115,22,0.15);

  --sidebar-w:     240px;
  --header-h:      60px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);

  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font-display);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.body--modal-open { overflow: hidden; }

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

img { max-width: 100%; display: block; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ─── Layout ─────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.2s ease;
}

.sidebar__brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.sidebar__logo span {
  color: var(--accent);
}

.sidebar__subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar__nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item--active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ─── Main content ───────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Content area ───────────────────────────────────────── */
.content {
  flex: 1;
  padding: 28px;
}

/* ─── Sections ───────────────────────────────────────────── */
.section { display: none; animation: fadeIn 0.2s ease; }
.section--active { display: block; }

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

/* ─── Section Header ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn--icon {
  padding: 7px;
  width: 32px;
  height: 32px;
  justify-content: center;
}

.btn--edit {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn--edit:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.btn--delete {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn--delete:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.btn--view {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn--view:hover {
  background: var(--info-dim);
  color: var(--info);
}

/* ─── Search Input ───────────────────────────────────────── */
.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text-primary);
  width: 240px;
  font-size: 0.85rem;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.data-table thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.td-primary {
  font-weight: 600;
  color: var(--text-primary);
}

.td-secondary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.td-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.td-cover { width: 56px; }

.table-thumbnail {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.table-thumbnail-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.table-loading,
.table-error,
.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
}

.table-error { color: var(--danger); }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── Dashboard Metrics ──────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.4;
}

.metric-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.metric-card__value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  transition: color 0.3s;
}

.metric-card__value.metric--loaded {
  color: var(--accent);
}

/* ─── Dashboard panels ───────────────────────────────────── */
.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dashboard-panels { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.panel__body {
  padding: 12px 0;
}

/* ─── Message items ──────────────────────────────────────── */
.message-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.message-item:last-child { border-bottom: none; }
.message-item:hover { background: var(--bg-hover); }

.message-item__header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.message-item__name {
  font-weight: 600;
  font-size: 0.88rem;
}

.message-item__time {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.message-item__subject {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.message-item__email {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Song items ─────────────────────────────────────────── */
.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.song-item:last-child { border-bottom: none; }
.song-item:hover { background: var(--bg-hover); }

.song-item__cover {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.song-item__cover img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.song-item__cover-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
}

.song-item__title {
  font-weight: 600;
  font-size: 0.88rem;
}

.song-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.badge--coming-soon {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(249,115,22,0.3);
}

.badge--released {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.3);
}

.badge--draft {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge--tag {
  background: var(--info-dim);
  color: var(--info);
  border: 1px solid rgba(59,130,246,0.3);
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--text-primary);
  font-size: 0.87rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.form-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
}

/* ─── Image preview ──────────────────────────────────────── */
.image-preview-wrap {
  margin-top: 8px;
}

.image-preview {
  max-width: 160px;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.image-preview.hidden { display: none; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal--active {
  display: flex;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal__panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: panelIn 0.2s ease;
}

.modal__panel--sm { max-width: 400px; }
.modal__panel--lg { max-width: 760px; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.15s;
}

.modal__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal__close svg { width: 18px; height: 18px; }

.modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Members grid ───────────────────────────────────────── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: default;
  position: relative;
}

.member-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.member-card--dragging {
  opacity: 0.5;
  border-style: dashed;
}

.member-card--dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.member-card__drag-handle {
  color: var(--text-muted);
  cursor: grab;
  padding: 2px;
  flex-shrink: 0;
}

.member-card__drag-handle:active { cursor: grabbing; }
.member-card__drag-handle svg { width: 14px; height: 14px; }

.member-card__photo {
  flex-shrink: 0;
}

.member-card__photo img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.member-card__photo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent);
}

.member-card__info { flex: 1; min-width: 0; }

.member-card__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.member-card__role {
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.member-card__bio {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-card__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ─── Gallery ────────────────────────────────────────────── */
.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

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

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s;
}

.gallery-item--selected {
  border-color: var(--accent);
}

.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item__checkbox-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.gallery-item__checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  gap: 6px;
}

.gallery-item:hover .gallery-item__overlay { opacity: 1; }

.gallery-item__caption {
  font-size: 0.78rem;
  color: #fff;
  line-height: 1.3;
}

.gallery-item__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
}

.gallery-upload-progress {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  padding: 4px 0;
}

.gallery-upload-progress.hidden { display: none; }

/* ─── Message view ───────────────────────────────────────── */
.message-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-view__meta {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.85rem;
}

.message-view__meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.message-view__meta-row:last-child { margin-bottom: 0; }

.message-view__meta-label {
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  min-width: 70px;
  padding-top: 1px;
}

.message-view__meta-value {
  color: var(--text-primary);
}

.message-view__body {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.87rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Settings ───────────────────────────────────────────── */
.settings-panel {
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.settings-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ─── Auth page ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  pointer-events: none;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.auth-card__brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card__logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.auth-card__logo span { color: var(--accent); }

.auth-card__subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.auth-error {
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--danger);
  margin-bottom: 16px;
}

.auth-error.hidden { display: none; }

/* ─── States ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.empty-state.error { color: var(--danger); }

.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
}

.hidden { display: none !important; }

/* ─── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow);
  pointer-events: all;
  position: relative;
  opacity: 0;
}

.toast--in {
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast--out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 80px; }
  to   { opacity: 0; transform: translateX(30px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
}

.toast__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.toast__icon svg { width: 18px; height: 18px; }

.toast--success { border-left: 3px solid var(--success); }
.toast--success .toast__icon { color: var(--success); }

.toast--error { border-left: 3px solid var(--danger); }
.toast--error .toast__icon { color: var(--danger); }

.toast--info { border-left: 3px solid var(--info); }
.toast--info .toast__icon { color: var(--info); }

.toast--warning { border-left: 3px solid var(--warning); }
.toast--warning .toast__icon { color: var(--warning); }

.toast__message {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toast__close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: flex;
  transition: color 0.15s;
}

.toast__close:hover { color: var(--text-primary); }
.toast__close svg { width: 14px; height: 14px; }

/* ─── Sidebar toggle (mobile) ────────────────────────────── */
#sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px;
  cursor: pointer;
  color: var(--text-primary);
}

#sidebar-toggle svg { width: 18px; height: 18px; display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .main {
    margin-left: 0;
  }

  #sidebar-toggle {
    display: flex;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .search-input {
    width: 180px;
  }
}

/* ─── Confirm dialog ─────────────────────────────────────── */
.confirm-dialog__message {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
