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

:root {
    --bg:       #0d1117;
    --bg2:      #161b22;
    --bg3:      #21262d;
    --border:   rgba(212,175,55,0.2);
    --gold:     #d4af37;
    --gold2:    #f4c430;
    --cream:    #f5f5dc;
    --cream2:   #faf8f3;
    --red:      #e74c3c;
    --green:    #2ecc71;
    --font:     'Inter', sans-serif;
    --font-h:   'Playfair Display', serif;
    --font-acc: 'Cinzel', serif;
}

html { font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--cream); min-height: 100vh; }

/* ── LOGIN ──────────────────────────────────────────── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 50%, rgba(212,175,55,0.06) 0%, transparent 60%), var(--bg);
}

.login-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 56px 48px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-mark {
    font-family: var(--font-acc);
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    border: 2px solid var(--gold);
    padding: 4px 10px;
    border-radius: 4px;
}

.logo-text {
    font-family: var(--font-acc);
    font-size: 16px;
    color: var(--cream);
    letter-spacing: 2px;
}

.login-box h2 {
    font-family: var(--font-h);
    font-size: 28px;
    color: var(--cream2);
    margin-bottom: 8px;
}

.login-box > p {
    font-size: 14px;
    color: rgba(245,245,220,0.55);
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.login-field label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(245,245,220,0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-field input {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--cream);
    outline: none;
    transition: border-color 0.3s;
}

.login-field input:focus { border-color: var(--gold); }

.btn-login {
    width: 100%;
    background: var(--gold);
    color: #0d1117;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-login:hover { background: var(--gold2); transform: translateY(-1px); }

.login-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
    flex-grow: 1;
}

.snav-item {
    background: none;
    border: none;
    color: rgba(245,245,220,0.6);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.snav-item:hover { background: rgba(212,175,55,0.08); color: var(--cream); }
.snav-item.active { background: rgba(212,175,55,0.15); color: var(--gold); font-weight: 600; }

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

.btn-preview {
    display: block;
    text-align: center;
    background: rgba(212,175,55,0.1);
    border: 1px solid var(--border);
    color: var(--gold);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-preview:hover { background: rgba(212,175,55,0.2); }

.btn-logout {
    background: rgba(231,76,60,0.1);
    border: 1px solid rgba(231,76,60,0.3);
    color: var(--red);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover { background: rgba(231,76,60,0.2); }

/* ── MAIN ───────────────────────────────────────────── */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 22px;
    cursor: pointer;
}

.admin-topbar h1 {
    font-family: var(--font-h);
    font-size: 22px;
    color: var(--cream2);
    flex-grow: 1;
}

.topbar-actions { display: flex; gap: 10px; }

.btn-save-all {
    background: var(--gold);
    color: #0d1117;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-save-all:hover { background: var(--gold2); transform: translateY(-1px); }

.btn-reset-all {
    background: rgba(231,76,60,0.1);
    border: 1px solid rgba(231,76,60,0.3);
    color: var(--red);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset-all:hover { background: rgba(231,76,60,0.2); }

.admin-content {
    padding: 32px 28px;
    overflow-y: auto;
    flex: 1;
}

/* ── EDITOR COMPONENTS ──────────────────────────────── */
.editor-section {
    display: none;
}

.editor-section.active { display: block; }

.editor-intro {
    background: rgba(212,175,55,0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.editor-intro p {
    font-size: 14px;
    color: rgba(245,245,220,0.6);
    line-height: 1.7;
}

.editor-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
}

.editor-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(212,175,55,0.1);
}

.editor-card-header h3 {
    font-family: var(--font-h);
    font-size: 18px;
    color: var(--gold);
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field-group label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(245,245,220,0.65);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.field-group input,
.field-group textarea,
.field-group select {
    background: var(--bg3);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--cream);
    outline: none;
    transition: border-color 0.3s;
    width: 100%;
    resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus { border-color: var(--gold); }

.field-group textarea { min-height: 100px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── GALLERY ADMIN ──────────────────────────────────── */
.gallery-upload-zone {
    border: 2px dashed rgba(212,175,55,0.3);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    margin-bottom: 28px;
    position: relative;
}

.gallery-upload-zone:hover,
.gallery-upload-zone.dragover {
    border-color: var(--gold);
    background: rgba(212,175,55,0.05);
}

.gallery-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon { font-size: 40px; color: var(--gold); margin-bottom: 12px; display: block; }
.upload-text { font-size: 16px; color: var(--cream2); font-weight: 600; margin-bottom: 6px; }
.upload-hint { font-size: 13px; color: rgba(245,245,220,0.45); }

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

.gallery-admin-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg3);
}

.gallery-admin-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.gallery-admin-item-info {
    padding: 10px 12px;
}

.gallery-admin-item-info input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(212,175,55,0.2);
    color: var(--cream);
    font-size: 12px;
    width: 100%;
    padding: 4px 0;
    outline: none;
}

.gallery-admin-item-info input:focus { border-bottom-color: var(--gold); }

.gallery-item-del {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231,76,60,0.85);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gallery-item-del:hover { background: var(--red); }

.gallery-empty-admin {
    text-align: center;
    padding: 32px;
    color: rgba(245,245,220,0.35);
    font-size: 14px;
}

/* ── TOAST ──────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg2);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 200;
        transition: left 0.3s ease;
    }

    .admin-sidebar.open { left: 0; }
    .sidebar-toggle { display: block; }
    .admin-content { padding: 20px 16px; }
    .admin-topbar { padding: 14px 16px; }
    .topbar-actions { gap: 8px; }
    .btn-save-all, .btn-reset-all { padding: 8px 12px; font-size: 12px; }
    .field-row { grid-template-columns: 1fr; }
    .gallery-admin-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
