/* ══ TOKENS ══════════════════════════════════════════════════════════ */
:root {
    --bg:        #2c1a0e;
    --bg2:       #3a2213;
    --bg3:       #221408;
    --cream:     #fdf6ec;
    --gold:      #c8a98a;
    --gold2:     #e2c4a8;
    --muted:     #a88a72;
    --dark:      #1a0f06;
    --confirmed: #7caa8a;
    --declined:  #aa7c7c;
    --pending:   #c8a98a;
    --danger:    #c0614a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%,   rgba(200,169,138,.1)  0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 100%, rgba(200,169,138,.07) 0%, transparent 55%);
    pointer-events: none;
}

/* ══ LOGIN ══════════════════════════════════════════════════════════ */
#login-screen {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    transition: opacity .6s ease;
}
#login-screen.hidden { opacity: 0; pointer-events: none; }

.login-box {
    width: 100%; max-width: 360px;
    padding: 3rem 2.5rem;
    background: rgba(200,169,138,.05);
    border: 1px solid rgba(200,169,138,.2);
    display: flex; flex-direction: column; align-items: center; gap: 1.8rem;
    animation: fadeUp .7s ease forwards;
}
.login-crest { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.login-crest .orn { display: flex; align-items: center; gap: .7rem; }
.login-crest .ln  { width: 40px; height: 1px; background: rgba(200,169,138,.4); }
.login-crest .gem { width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }
.login-title { font-family: 'Cinzel', serif; font-size: .65rem; letter-spacing: .7em; color: var(--gold); text-transform: uppercase; margin-top: .3rem; }
.login-names { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 2.2rem; color: var(--cream); letter-spacing: .04em; line-height: 1.2; text-align: center; }

.pw-wrap { position: relative; width: 100%; }
.pw-input {
    width: 100%; padding: 1rem 3rem 1rem 1.2rem;
    background: rgba(200,169,138,.07);
    border: 1.5px solid rgba(200,169,138,.3);
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-style: italic;
    outline: none; transition: border-color .3s; -webkit-appearance: none;
}
.pw-input:focus { border-color: rgba(200,169,138,.7); }
.pw-input::placeholder { color: rgba(253,246,236,.3); }
.pw-toggle {
    position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: .7rem; font-family: 'Cinzel', serif; letter-spacing: .1em;
    transition: color .2s;
}
.pw-toggle:hover { color: var(--gold); }
.btn-enter {
    width: 100%; padding: 1rem;
    background: var(--gold); border: none; cursor: pointer;
    font-family: 'Cinzel', serif; font-size: .85rem; font-weight: 600; letter-spacing: .4em; text-transform: uppercase;
    color: var(--dark); transition: background .3s, transform .2s;
}
.btn-enter:hover { background: var(--gold2); transform: translateY(-1px); }
.login-err {
    font-family: 'Cinzel', serif; font-size: .65rem; letter-spacing: .3em;
    color: var(--declined); text-transform: uppercase;
    opacity: 0; transition: opacity .3s; text-align: center;
}
.login-err.show { opacity: 1; }

/* ══ DASHBOARD SHELL ══════════════════════════════════════════════════ */
#dashboard {
    position: relative; z-index: 1;
    max-width: 1040px; margin: 0 auto;
    padding: 3rem 2rem 8rem;
    opacity: 0; transform: translateY(20px);
    transition: opacity .7s ease, transform .7s ease;
}
#dashboard.visible { opacity: 1; transform: none; }

.dash-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem;
}
.dash-eyebrow { font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .7em; color: var(--gold); text-transform: uppercase; margin-bottom: .5rem; }
.dash-title   { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: clamp(1.8rem,5vw,2.6rem); color: var(--cream); letter-spacing: .03em; line-height: 1.1; }
.header-actions { display: flex; gap: .8rem; align-items: center; }
.btn-sm {
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
    color: var(--muted); background: none; border: 1px solid rgba(200,169,138,.25);
    padding: .6rem 1.2rem; cursor: pointer; transition: all .3s; white-space: nowrap;
}
.btn-sm:hover { color: var(--gold); border-color: rgba(200,169,138,.5); }
.btn-logout { font-family: 'Cinzel', serif; font-size: .55rem; letter-spacing: .4em; text-transform: uppercase; color: var(--muted); background: none; border: none; cursor: pointer; transition: color .2s; }
.btn-logout:hover { color: var(--gold); }

/* ══ TABS ══════════════════════════════════════════════════════════ */
.tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid rgba(200,169,138,.15);
    margin-bottom: 2.5rem;
    overflow-x: auto;
}
.tab-btn {
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
    color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent;
    padding: .9rem 1.5rem; cursor: pointer; transition: all .25s; white-space: nowrap;
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--gold); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ══ STAT CARDS ══════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px,1fr));
    gap: 1rem; margin-bottom: 3rem;
}
.stat-card {
    padding: 1.6rem 1.4rem;
    background: rgba(200,169,138,.05);
    border: 1px solid rgba(200,169,138,.13);
    position: relative; overflow: hidden;
    transition: border-color .3s, transform .3s;
}
.stat-card:hover { border-color: rgba(200,169,138,.3); transform: translateY(-2px); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.total::before     { background: linear-gradient(90deg, var(--gold), transparent); }
.stat-card.confirmed::before { background: linear-gradient(90deg, var(--confirmed), transparent); }
.stat-card.declined::before  { background: linear-gradient(90deg, var(--declined), transparent); }
.stat-card.pending::before   { background: linear-gradient(90deg, var(--pending), transparent); }
.stat-label  { font-family: 'Cinzel', serif; font-size: .55rem; letter-spacing: .5em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.stat-number { font-family: 'Cinzel', serif; font-size: clamp(2.2rem,4vw,3rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card.total     .stat-number { color: var(--gold); }
.stat-card.confirmed .stat-number { color: var(--confirmed); }
.stat-card.declined  .stat-number { color: var(--declined); }
.stat-card.pending   .stat-number { color: var(--pending); }
.stat-bar-track { margin-top: 1rem; height: 2px; background: rgba(200,169,138,.1); overflow: hidden; }
.stat-bar-fill  { height: 100%; width: 0%; transition: width 1s cubic-bezier(.4,0,.2,1) .3s; }
.stat-card.confirmed .stat-bar-fill { background: var(--confirmed); }
.stat-card.declined  .stat-bar-fill { background: var(--declined); }
.stat-card.pending   .stat-bar-fill { background: var(--pending); }

/* ══ GUEST COLUMNS ══════════════════════════════════════════════════ */
.cols-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}
.col-panel {
    background: rgba(200,169,138,.03);
    border: 1px solid rgba(200,169,138,.1);
    border-top: 2px solid transparent;
    display: flex;
    flex-direction: column;
}
.col-panel.confirmed { border-top-color: var(--confirmed); }
.col-panel.declined  { border-top-color: var(--declined); }
.col-panel.pending   { border-top-color: var(--pending); }

.col-head {
    padding: .9rem 1rem .7rem;
    border-bottom: 1px solid rgba(200,169,138,.08);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}
.col-label {
    font-family: 'Cinzel', serif;
    font-size: .58rem;
    letter-spacing: .5em;
    text-transform: uppercase;
}
.col-panel.confirmed .col-label { color: var(--confirmed); }
.col-panel.declined  .col-label { color: var(--declined); }
.col-panel.pending   .col-label { color: var(--pending); }
.col-n {
    font-family: 'Cinzel', serif;
    font-size: .85rem;
    font-weight: 600;
    color: var(--cream);
    opacity: .5;
}
.col-body {
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,169,138,.15) transparent;
}
.col-body::-webkit-scrollbar { width: 3px; }
.col-body::-webkit-scrollbar-thumb { background: rgba(200,169,138,.2); }

.g-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: 1px;
    transition: background .2s;
    animation: fadeUp .3s ease both;
}
.g-row:hover { background: rgba(200,169,138,.05); }
.g-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.col-panel.confirmed .g-dot { background: var(--confirmed); }
.col-panel.declined  .g-dot { background: var(--declined); }
.col-panel.pending   .g-dot { border: 1.5px solid var(--pending); background: transparent; border-radius: 0; transform: rotate(45deg); }
.g-name { font-size: 1rem; color: var(--cream); flex: 1; min-width: 0; }
.g-date { font-size: .78rem; font-style: italic; color: var(--muted); flex-shrink: 0; }

.p-block {
    border: 1px solid rgba(200,169,138,.1);
    animation: fadeUp .3s ease both;
}
.col-panel.confirmed .p-block { border-color: rgba(124,170,138,.15); }
.col-panel.declined  .p-block { border-color: rgba(170,124,124,.15); }
.p-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .7rem .4rem;
    border-bottom: 1px solid rgba(200,169,138,.07);
}
.p-label {
    font-family: 'Cinzel', serif;
    font-size: .52rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .7;
}
.p-date { font-size: .75rem; font-style: italic; color: var(--muted); }
.p-members { padding: .3rem .4rem; display: flex; flex-direction: column; }
.p-member {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .3rem;
    border-bottom: 1px solid rgba(200,169,138,.05);
}
.p-member:last-child { border-bottom: none; }
.p-member-name { font-size: .95rem; color: var(--cream); opacity: .9; flex: 1; }

.col-empty {
    padding: 1.5rem 1rem;
    font-family: 'Cinzel', serif;
    font-size: .55rem;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: .4;
    text-align: center;
}

@media (max-width: 700px) {
    .cols-wrap { grid-template-columns: 1fr; }
    .col-body  { max-height: none; }
}

/* ══ WALL POSTS ══════════════════════════════════════════════════════ */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-label { font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .6em; text-transform: uppercase; color: var(--gold); }
.section-count { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--muted); font-size: 1rem; }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1rem; }

.post-card {
    background: rgba(200,169,138,.04);
    border: 1px solid rgba(200,169,138,.12);
    padding: 1.2rem;
    transition: border-color .25s;
    animation: fadeUp .35s ease both;
}
.post-card:hover { border-color: rgba(200,169,138,.25); }

.post-card-img      { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: .8rem; opacity: .8; }
.post-card-name     { font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); margin-bottom: .4rem; }
.post-card-msg      { font-style: italic; color: rgba(253,246,236,.7); font-size: 1.05rem; line-height: 1.5; margin-bottom: .8rem; }
.post-card-time     { font-family: 'Cinzel', serif; font-size: .55rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.post-card-actions  { display: flex; gap: .6rem; }

.btn-delete {
    font-family: 'Cinzel', serif; font-size: .55rem; letter-spacing: .35em; text-transform: uppercase;
    background: rgba(192,97,74,.1); border: 1px solid rgba(192,97,74,.3); color: var(--danger);
    padding: .45rem .9rem; cursor: pointer; transition: all .25s;
}
.btn-delete:hover    { background: rgba(192,97,74,.2); border-color: rgba(192,97,74,.6); }
.btn-delete:disabled { opacity: .4; cursor: not-allowed; }

/* ══ SONG REQUESTS ══════════════════════════════════════════════════ */
.songs-list { display: flex; flex-direction: column; gap: .7rem; }

.song-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(200,169,138,.04);
    border: 1px solid rgba(200,169,138,.1);
    transition: border-color .25s;
    animation: fadeUp .35s ease both;
}
.song-row:hover { border-color: rgba(200,169,138,.22); }

.song-rank      { font-family: 'Cinzel', serif; font-size: .65rem; color: var(--muted); width: 1.4rem; flex-shrink: 0; text-align: center; }
.song-info      { flex: 1; min-width: 0; }
.song-title     { font-style: italic; font-size: 1.1rem; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist    { font-family: 'Cinzel', serif; font-size: .55rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: .15rem; }
.song-requester { font-style: italic; font-size: .85rem; color: rgba(200,169,138,.5); margin-top: .1rem; }
.song-votes     { font-family: 'Cinzel', serif; font-size: .7rem; letter-spacing: .2em; color: var(--gold); min-width: 3rem; text-align: right; flex-shrink: 0; }

/* ══ SITE CONTENT EDITOR ══════════════════════════════════════════ */
.content-grid { display: flex; flex-direction: column; gap: 1.5rem; }

.content-field {
    background: rgba(200,169,138,.04);
    border: 1px solid rgba(200,169,138,.12);
    padding: 1.4rem 1.6rem;
}
.content-field-label  { font-family: 'Cinzel', serif; font-size: .58rem; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }
.content-field-desc   { font-family: 'Cinzel', serif; font-size: .52rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; opacity: .7; }
.content-input {
    width: 100%; background: rgba(200,169,138,.06); border: 1px solid rgba(200,169,138,.2);
    color: var(--cream); font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.1rem;
    padding: .7rem 1rem; outline: none; resize: vertical;
    transition: border-color .3s;
}
.content-input:focus   { border-color: rgba(200,169,138,.5); }
.content-field-footer  { display: flex; justify-content: flex-end; margin-top: .8rem; }
.btn-save {
    font-family: 'Cinzel', serif; font-size: .58rem; letter-spacing: .4em; text-transform: uppercase;
    background: rgba(200,169,138,.15); border: 1px solid rgba(200,169,138,.35); color: var(--gold);
    padding: .55rem 1.2rem; cursor: pointer; transition: all .25s;
}
.btn-save:hover { background: rgba(200,169,138,.25); border-color: var(--gold); }
.btn-save.saved { background: rgba(124,170,138,.15); border-color: var(--confirmed); color: var(--confirmed); }

.content-section-title {
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .6em; text-transform: uppercase;
    color: var(--muted); margin-top: 2rem; margin-bottom: 1rem;
    padding-bottom: .6rem; border-bottom: 1px solid rgba(200,169,138,.1);
}

/* ══ TOAST ══════════════════════════════════════════════════════════ */
#toast {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
    padding: .8rem 1.4rem; background: rgba(58,34,19,.95); border: 1px solid rgba(200,169,138,.3);
    color: var(--gold); opacity: 0; transform: translateY(10px);
    transition: all .35s ease; pointer-events: none;
}
#toast.show  { opacity: 1; transform: translateY(0); }
#toast.error { border-color: rgba(192,97,74,.5); color: var(--danger); }

/* ══ CONFIRM MODAL ══════════════════════════════════════════════════ */
#confirm-modal {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(26,15,6,.85); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
#confirm-modal.show { display: flex; }
.confirm-box {
    background: var(--bg2); border: 1px solid rgba(200,169,138,.25);
    padding: 2.5rem; max-width: 380px; width: 90%;
    text-align: center;
}
.confirm-title   { font-family: 'Cinzel', serif; font-size: .65rem; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.confirm-msg     { font-style: italic; color: rgba(253,246,236,.6); font-size: 1.1rem; margin-bottom: 2rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: .8rem; justify-content: center; }
.btn-confirm-yes {
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
    background: rgba(192,97,74,.15); border: 1px solid rgba(192,97,74,.4); color: var(--danger);
    padding: .7rem 1.5rem; cursor: pointer; transition: all .25s;
}
.btn-confirm-yes:hover { background: rgba(192,97,74,.3); }
.btn-confirm-no {
    font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
    background: transparent; border: 1px solid rgba(200,169,138,.25); color: var(--muted);
    padding: .7rem 1.5rem; cursor: pointer; transition: all .25s;
}
.btn-confirm-no:hover { color: var(--gold); border-color: rgba(200,169,138,.5); }

/* ══ SKELETON / LOADING ══════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, rgba(200,169,138,.07) 25%, rgba(200,169,138,.13) 50%, rgba(200,169,138,.07) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.loading-placeholder { padding: 3rem 0; text-align: center; font-family: 'Cinzel', serif; font-size: .6rem; letter-spacing: .5em; text-transform: uppercase; color: var(--muted); opacity: .5; }

/* ══ KEYFRAMES ══════════════════════════════════════════════════════ */
@keyframes shimmer { 0%  { background-position: 200% center } 100% { background-position: -200% center } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ══ RESPONSIVE ══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    #dashboard  { padding: 2rem 1rem 5rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .tabs       { gap: 0; }
    .tab-btn    { padding: .8rem 1rem; font-size: .55rem; letter-spacing: .3em; }
}
.p-member-pending .p-member-name { opacity: 0.45; }
.p-member-declined .p-member-name { opacity: 0.35; text-decoration: line-through; }
.p-member-tag {
    font-family: 'Cinzel', serif;
    font-size: 0.48rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-muted);
    opacity: 0.6;
    margin-left: 0.5rem;
    vertical-align: middle;
}