:root {
  --bg: #090806;
  --bg-soft: #100e0b;
  --panel: #17140f;
  --panel-2: #201b13;
  --paper: #f7f1e8;
  --muted: #b8ad9e;
  --faint: #766d60;
  --accent: #d9ad55;
  --accent-bright: #f1ce7e;
  --accent-deep: #8b6116;
  --danger: #e36f62;
  --success: #6bc39a;
  --info: #74a9df;
  --line: rgba(255,255,255,.1);
  --gold-line: rgba(217,173,85,.27);
  --shadow: 0 24px 70px rgba(0,0,0,.38);
  --radius: 20px;
  --sidebar: 260px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(217,173,85,.09), transparent 30rem),
    linear-gradient(180deg, #090806, #0d0b08 42%, #080705);
  color: var(--paper);
  font: 15px/1.55 "Segoe UI", Inter, Arial, sans-serif;
}
body.dialog-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.04); color: var(--accent-bright); }
::selection { background: var(--accent); color: #171006; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 9999; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; border-radius: 10px; background: #fff; color: #000; }
.skip-link:focus { transform: none; }

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.84), rgba(0,0,0,.38)),
    url("/assets/images/david-maxx-hero.webp") center/cover fixed;
}
.auth-card {
  width: min(100%, 520px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: rgba(10,9,7,.92);
  backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
.auth-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.auth-brand img { width: 84px; height: 84px; border: 1px solid var(--gold-line); border-radius: 20px; }
.auth-brand span { display: grid; line-height: 1.15; }
.auth-brand strong { font-size: 1.18rem; }
.auth-brand small { margin-top: 6px; color: var(--muted); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.auth-copy { margin: 38px 0 28px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-bright); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.auth-copy h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 8vw, 4.2rem); font-weight: 500; line-height: 1; letter-spacing: -.04em; }
.auth-copy p:last-child { margin: 18px 0 0; color: var(--muted); }
.stack-form, .form-grid { display: grid; gap: 16px; }
.stack-form label, .editor-form label, .dialog-form label { display: grid; gap: 7px; }
.stack-form label > span, .editor-form label > span, .dialog-form label > span { color: #d6cbbb; font-size: .76rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
label small { color: var(--faint); font-size: .76rem; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  outline: none;
  background: rgba(0,0,0,.26);
  color: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input, select { min-height: 46px; padding: 0 13px; }
textarea { min-height: 98px; padding: 12px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: rgba(0,0,0,.36); box-shadow: 0 0 0 3px rgba(217,173,85,.12); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: auto; accent-color: var(--accent); }
input[type="color"] { width: 52px; min-width: 52px; height: 46px; padding: 4px; cursor: pointer; }
.primary-button, .secondary-button, .danger-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 760;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.primary-button { background: linear-gradient(135deg, var(--accent-bright), var(--accent)); color: #171006; box-shadow: 0 10px 28px rgba(217,173,85,.14); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-1px); }
.secondary-button { border-color: var(--line); background: rgba(255,255,255,.035); color: var(--paper); }
.secondary-button:hover { border-color: var(--gold-line); background: rgba(217,173,85,.06); }
.danger-button { background: var(--danger); color: #1b0806; }
.text-button { min-height: auto; padding: 5px; background: transparent; color: var(--accent-bright); }
button:disabled { opacity: .55; cursor: wait; transform: none !important; }
.form-message { min-height: 22px; margin: 0; color: var(--accent-bright); font-size: .84rem; }
.form-message.error { color: #ff968b; }
.form-message.success { color: var(--success); }
.back-link { display: inline-block; margin-top: 26px; color: var(--muted); font-size: .82rem; text-decoration: none; }
.back-link:hover { color: var(--accent-bright); }

/* Shell */
.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 70;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(9,8,6,.94);
  backdrop-filter: blur(20px);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; text-decoration: none; }
.sidebar-brand img { width: 54px; height: 54px; border: 1px solid var(--gold-line); border-radius: 15px; }
.sidebar-brand span { display: grid; line-height: 1.1; }
.sidebar-brand strong { font-size: 1.02rem; }
.sidebar-brand small { margin-top: 5px; color: var(--faint); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav button {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.admin-nav button > span { color: var(--faint); font-size: 1.08rem; text-align: center; }
.admin-nav button:hover { color: #fff; background: rgba(255,255,255,.04); }
.admin-nav button.active { border-color: rgba(217,173,85,.16); background: linear-gradient(90deg, rgba(217,173,85,.14), rgba(217,173,85,.03)); color: #fff; }
.admin-nav button.active > span { color: var(--accent-bright); }
.admin-nav b { min-width: 23px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #171006; font-size: .67rem; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.sidebar-footer a, .sidebar-footer button { padding: 7px 0; border: 0; background: none; color: var(--faint); font-size: .78rem; text-align: left; text-decoration: none; cursor: pointer; }
.sidebar-footer a:hover, .sidebar-footer button:hover { color: var(--accent-bright); }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 82px;
  padding: 0 clamp(22px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(9,8,6,.82);
  backdrop-filter: blur(20px);
}
.topbar > div:first-of-type { min-width: 0; }
.topbar p { margin: 0; color: var(--faint); font-size: .67rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar h1 { overflow: hidden; margin: 1px 0 0; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--gold-line); border-radius: 50%; background: rgba(217,173,85,.1); color: var(--accent-bright); font-weight: 800; }
.topbar-user div { display: grid; line-height: 1.2; }
.topbar-user strong { font-size: .82rem; }
.topbar-user small { max-width: 190px; overflow: hidden; color: var(--faint); font-size: .7rem; text-overflow: ellipsis; }
.mobile-menu { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.mobile-menu span { display: block; height: 2px; margin: 4px 0; background: currentColor; }
.admin-main { padding: clamp(24px, 4vw, 50px); }
.admin-view { display: none; }
.admin-view.active { display: block; animation: viewIn .22s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* Dashboard and panels */
.welcome-panel {
  min-height: 220px;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(8,7,5,.94) 0%, rgba(8,7,5,.64) 58%, rgba(8,7,5,.2)),
    url("/assets/images/david-maxx-hero.webp") 72% 48%/cover;
  box-shadow: var(--shadow);
}
.welcome-panel > div { max-width: 690px; }
.welcome-panel h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.15rem, 4vw, 4.2rem); font-weight: 500; line-height: 1.02; letter-spacing: -.035em; }
.welcome-panel p:last-child { max-width: 640px; margin: 18px 0 0; color: #c8bdae; }
.metric-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.metric-grid article { min-height: 144px; padding: 22px; display: grid; align-content: space-between; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.metric-grid span { color: var(--muted); font-size: .78rem; }
.metric-grid strong { margin: 8px 0; color: var(--accent-bright); font: 500 clamp(2.2rem, 4vw, 3.4rem)/1 Georgia, serif; }
.metric-grid small { color: var(--faint); font-size: .7rem; }
.dashboard-grid { margin-top: 22px; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(320px,.7fr); gap: 22px; }
.panel-card { padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.025); }
.panel-heading { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.compact-list { display: grid; }
.compact-item { padding: 15px 0; display: grid; grid-template-columns: 1fr auto; gap: 16px; border-top: 1px solid var(--line); cursor: pointer; }
.compact-item:first-child { border-top: 0; }
.compact-item strong { display: block; margin-bottom: 3px; }
.compact-item p { margin: 0; color: var(--muted); font-size: .82rem; }
.compact-item time { color: var(--faint); font-size: .72rem; }
.empty-row { padding: 28px 0; color: var(--faint); text-align: center; }
.quick-actions { display: grid; align-content: start; }
.quick-actions > button { width: 100%; padding: 15px 0; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.quick-actions > button:nth-of-type(1) { border-top: 0; }
.quick-actions > button > span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--gold-line); border-radius: 12px; color: var(--accent-bright); }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions small { margin-top: 2px; color: var(--faint); }
.quick-actions > button:hover strong { color: var(--accent-bright); }

/* Editors */
.view-toolbar { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.view-toolbar p { max-width: 760px; margin: 0; color: var(--muted); }
.editor-form { display: grid; gap: 20px; }
.editor-form fieldset { margin: 0; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.022); }
.editor-form legend { padding: 0 10px; color: var(--accent-bright); font-family: Georgia, serif; font-size: 1.35rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 18px; }
.color-field, .upload-field { display: flex; gap: 8px; }
.color-field > input:first-child, .upload-field > input { flex: 1; }
.upload-field button { flex: 0 0 auto; min-width: 90px; border: 1px solid var(--gold-line); border-radius: 10px; background: rgba(217,173,85,.07); color: var(--accent-bright); cursor: pointer; }
.upload-field button:hover { background: rgba(217,173,85,.13); }
.check-label { grid-template-columns: auto 1fr !important; align-items: center; align-content: center; gap: 9px !important; min-height: 46px; }
.check-label > span { margin: 0; color: var(--paper) !important; font-size: .82rem !important; letter-spacing: 0 !important; text-transform: none !important; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.configuration-card { margin-top: 22px; }
.configuration-card p:last-child { max-width: 900px; margin: 0; color: var(--muted); }

/* Data lists */
.data-list { display: grid; gap: 12px; }
.data-row {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.022);
}
.data-row:hover { border-color: rgba(217,173,85,.23); }
.data-main { min-width: 0; }
.data-main h3 { margin: 0 0 5px; font-size: 1rem; }
.data-main p { margin: 0; color: var(--muted); font-size: .82rem; }
.data-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 7px; }
.status-pill { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .67rem; text-transform: capitalize; }
.status-pill.published, .status-pill.sent, .status-pill.read { border-color: rgba(107,195,154,.27); color: var(--success); }
.status-pill.new { border-color: rgba(217,173,85,.35); color: var(--accent-bright); }
.status-pill.cancelled, .status-pill.failed, .status-pill.spam { border-color: rgba(227,111,98,.3); color: #ff9185; }
.status-pill.draft, .status-pill.closed { color: var(--faint); }
.row-actions { display: flex; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; }
.icon-button:hover { border-color: var(--gold-line); color: var(--accent-bright); }
.icon-button.danger:hover { border-color: rgba(227,111,98,.4); color: #ff9185; }
.song-admin-list .data-row { grid-template-columns: 74px minmax(0,1fr) auto; }
.song-thumb { width: 74px; height: 74px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #050403; }
.song-thumb img { width: 100%; height: 100%; object-fit: cover; }
.audio-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--info); font-size: .72rem; }

/* Gallery management */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.gallery-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.gallery-admin-card figure { position: relative; aspect-ratio: 1; margin: 0; background: #050403; }
.gallery-admin-card img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-card figure > span { position: absolute; top: 10px; left: 10px; }
.gallery-admin-card .gallery-card-body { padding: 14px; }
.gallery-admin-card h3 { overflow: hidden; margin: 0 0 5px; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; }
.gallery-admin-card p { min-height: 40px; margin: 0; color: var(--muted); font-size: .74rem; }
.gallery-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 7px; }

/* Inbox */
.inbox-toolbar { align-items: stretch; }
.filter-row { display: flex; gap: 10px; flex: 1; }
.filter-row select { max-width: 170px; }
.filter-row input { max-width: 360px; }
.inbox-layout { min-height: 650px; display: grid; grid-template-columns: minmax(300px,.72fr) minmax(0,1.28fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.018); }
.message-list { overflow-y: auto; border-right: 1px solid var(--line); }
.message-item { width: 100%; padding: 17px 18px; display: grid; gap: 5px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.message-item:hover, .message-item.active { background: rgba(217,173,85,.055); }
.message-item.new { border-left: 3px solid var(--accent); }
.message-item-head { display: flex; justify-content: space-between; gap: 10px; }
.message-item strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-item time { flex: 0 0 auto; color: var(--faint); font-size: .68rem; }
.message-item .subject { overflow: hidden; color: #ded5c8; font-size: .82rem; white-space: nowrap; text-overflow: ellipsis; }
.message-item p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--faint); font-size: .74rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.message-detail { min-width: 0; padding: clamp(22px, 4vw, 42px); }
.empty-detail { min-height: 520px; display: grid; place-content: center; justify-items: center; color: var(--faint); text-align: center; }
.empty-detail > span { font-size: 2rem; color: var(--accent); }
.empty-detail h2 { margin: 10px 0 4px; color: var(--paper); font-family: Georgia, serif; font-weight: 500; }
.empty-detail p { margin: 0; }
.message-header { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.message-header-top { display: flex; justify-content: space-between; gap: 16px; }
.message-header h2 { margin: 5px 0 12px; font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 500; line-height: 1.1; }
.message-from { color: var(--muted); }
.message-from a { color: var(--accent-bright); }
.message-facts { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 9px; }
.message-facts span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .72rem; }
.message-body { padding: 28px 0; color: #e9e0d4; white-space: pre-wrap; }
.reply-history { display: grid; gap: 12px; }
.reply-card { padding: 16px; border-left: 3px solid var(--gold-line); border-radius: 0 12px 12px 0; background: rgba(217,173,85,.045); }
.reply-card header { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .72rem; }
.reply-card p { margin: 12px 0 0; white-space: pre-wrap; }
.reply-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.reply-form h3 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.reply-actions { margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; }
.message-status-select { width: 140px; }

/* Dialogs */
dialog { color: var(--paper); }
.editor-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--gold-line);
  border-radius: 22px;
  background: #100e0b;
  box-shadow: 0 40px 120px rgba(0,0,0,.7);
}
.editor-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.dialog-close-form { position: sticky; z-index: 3; top: 10px; height: 0; margin: 0; display: flex; justify-content: flex-end; pointer-events: none; }
.dialog-close-form button { width: 38px; height: 38px; margin-right: 10px; border: 1px solid var(--line); border-radius: 50%; background: #1a1610; font-size: 1.35rem; pointer-events: auto; cursor: pointer; }
.dialog-form { padding: clamp(24px, 5vw, 44px); }
.dialog-form header { margin-bottom: 26px; }
.dialog-form header h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 500; }
.dialog-form footer { margin-top: 28px; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.dialog-form footer > div { display: flex; gap: 9px; }
.compose-dialog { width: min(720px, calc(100vw - 28px)); }
.confirm-dialog { width: min(420px, calc(100vw - 28px)); padding: 0; border: 1px solid rgba(227,111,98,.32); border-radius: 18px; background: #130e0c; }
.confirm-dialog form { padding: 28px; }
.confirm-dialog h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; }
.confirm-dialog p { color: var(--muted); }
.confirm-dialog form > div { display: flex; justify-content: flex-end; gap: 9px; }

/* Misc */
.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 13px 17px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: #19140d;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(227,111,98,.5); }
.upload-progress { position: fixed; z-index: 250; right: 20px; bottom: 20px; min-width: 270px; padding: 15px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--gold-line); border-radius: 14px; background: #16120d; box-shadow: var(--shadow); }
.upload-progress > span { width: 28px; height: 28px; border: 3px solid rgba(217,173,85,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.upload-progress strong, .upload-progress small { display: block; }
.upload-progress small { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .gallery-admin-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar: 252px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 30px 0 70px rgba(0,0,0,.55); }
  .sidebar.open { transform: none; }
  .workspace { margin-left: 0; }
  .mobile-menu { display: block; flex: 0 0 auto; }
  .topbar { padding-inline: 18px; }
  .topbar-user div { display: none; }
  .dashboard-grid, .account-grid { grid-template-columns: 1fr; }
  .gallery-admin-grid { grid-template-columns: repeat(2,1fr); }
  .inbox-layout { grid-template-columns: minmax(260px,.85fr) minmax(0,1.15fr); }
}
@media (max-width: 700px) {
  .admin-main { padding: 18px 14px 32px; }
  .topbar { height: 70px; }
  .topbar h1 { font-size: 1.25rem; }
  .welcome-panel { min-height: 360px; align-items: flex-end; flex-direction: column; justify-content: flex-end; background: linear-gradient(180deg, rgba(8,7,5,.35), rgba(8,7,5,.96) 70%), url("/assets/images/david-maxx-hero.webp") 61% center/cover; }
  .welcome-panel .secondary-button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-grid article { min-height: 125px; padding: 16px; }
  .metric-grid strong { font-size: 2.25rem; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .view-toolbar > .primary-button { width: 100%; }
  .form-grid.two, .account-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .data-row, .song-admin-list .data-row { grid-template-columns: 1fr; }
  .song-thumb { width: 100%; height: 190px; }
  .row-actions { justify-content: flex-end; }
  .gallery-admin-grid { grid-template-columns: 1fr; }
  .inbox-toolbar { gap: 10px; }
  .filter-row { display: grid; }
  .filter-row select, .filter-row input { max-width: none; }
  .inbox-layout { display: block; min-height: 0; }
  .message-list { max-height: 460px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-detail { min-height: 520px; padding: 20px 17px; }
  .dialog-form footer { align-items: stretch; flex-direction: column; }
  .dialog-form footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary-button { width: 100%; }
}
@media (max-width: 440px) {
  .auth-shell { padding: 14px; }
  .auth-card { padding: 24px 19px; border-radius: 22px; }
  .auth-brand img { width: 68px; height: 68px; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar-user { display: none; }
  .topbar { justify-content: flex-start; }
  .color-field, .upload-field { flex-direction: column; }
  .upload-field button { min-height: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
