/* ==========================================================
   mystory - gaya halaman admin
   ========================================================== */

.admin-body { background: var(--cream); }

.admin-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    position: relative;
}
.admin-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
    flex-wrap: wrap;
}
.admin-nav a { color: var(--ink-soft); padding: 6px 4px; white-space: nowrap; }
.admin-nav a:hover { color: var(--coral-dark); }
.logout-link { color: var(--coral-dark) !important; }
.admin-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

.admin-main { padding: 28px 20px 60px; }

.dashboard-welcome h1 { font-size: 1.7rem; margin-bottom: 6px; }
.kata-semangat {
    background: #fff4de;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    color: #b8730a;
    display: inline-block;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 22px 0 26px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-num {
    display: block;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--coral-dark);
}
.stat-label { font-size: .82rem; color: var(--ink-soft); font-weight: 700; }

.filter-tabs {
    display: flex;
    gap: 10px;
    margin: 24px 0 18px;
    border-bottom: 2px solid var(--border);
}
.tab {
    padding: 10px 6px;
    font-weight: 800;
    color: var(--ink-soft);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tab-active { color: var(--coral-dark); border-color: var(--coral); }

.admin-story-list { display: flex; flex-direction: column; gap: 14px; }
.admin-story-item {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-story-cover {
    width: 72px; height: 72px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    font-size: 1.8rem;
}
.admin-story-cover img { width: 100%; height: 100%; object-fit: cover; }
.admin-story-info { flex: 1; min-width: 160px; }
.admin-story-info h3 { font-size: 1.05rem; margin-bottom: 4px; }
.status-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
}
.status-published { background: #d3f9d8; color: #2b8a3e; }
.status-draft { background: #fff3bf; color: #997404; }
.admin-story-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.btn-small { padding: 8px 14px; font-size: .85rem; }
.btn-danger { background: #ffe3e3; color: #c92a2a; }
.btn-danger:hover { background: #ffc9c9; }

.story-form { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.story-form textarea { resize: vertical; min-height: 260px; line-height: 1.7; font-family: 'Nunito', sans-serif; }
.word-counter { margin-top: -8px; color: var(--ink-soft); font-size: .85rem; font-weight: 700; }

#cover-preview-wrap { display: flex; align-items: center; gap: 14px; }
#cover-preview-wrap.hidden { display: none; }
#cover-preview { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 2px solid var(--border); }
.remove-cover-label { font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: 6px; }

.status-choice { display: flex; gap: 14px; flex-wrap: wrap; }
.status-option {
    flex: 1;
    min-width: 200px;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    cursor: pointer;
}
.status-option:has(input:checked) { border-color: var(--coral); background: #fff5f5; }

.settings-section {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.settings-section h2 { font-size: 1.2rem; }
.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }

.help-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.help-step {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.help-emoji { font-size: 2.2rem; margin-bottom: 8px; }
.help-step h3 { font-size: 1.05rem; }
.help-step p { color: var(--ink-soft); margin: 0; }

@media (max-width: 720px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .help-steps { grid-template-columns: 1fr; }
    .admin-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--card-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px 18px;
        border-bottom: 1px solid var(--border);
        gap: 4px;
    }
    .admin-nav.open { display: flex; }
    .admin-nav-toggle { display: block; }
}
