/* ============================================================
   ADMIN PANEL - KepriWebsite
   ============================================================ */

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

:root {
    --primary:    #119f8b;
    --primary-dk: #0b7f70;
    --secondary:  #f2a51f;
    --bg:         #f0f4f8;
    --surface:    #ffffff;
    --sidebar-bg: #0f1f2b;
    --sidebar-w:  240px;
    --text:       #102027;
    --muted:      #5d6f73;
    --border:     rgba(16,32,39,0.1);
    --radius:     12px;
    --shadow:     0 4px 20px rgba(15,49,52,0.08);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b1a24 0%, #0f2d3a 50%, #0b7f70 100%);
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo-icon-admin {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dk));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-icon-admin.small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.login-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.login-brand span { color: var(--primary); }
.login-subtitle { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.login-form-wrap { display: flex; flex-direction: column; gap: 0.75rem; }

.pw-row { display: flex; gap: 0.5rem; }
.btn-login {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dk));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(17,159,139,0.35); }

.login-err  { color: #ef4444; font-size: 0.85rem; }
.login-hint { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 0.25rem; }

/* ============================================================
   ADMIN APP LAYOUT
   ============================================================ */
.admin-app {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}
.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}
.sidebar-brand b { color: var(--primary); }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.nav-item:hover  { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(17,159,139,0.2); color: #fff; }
.nav-item.active svg { color: var(--primary); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    margin-top: 1rem;
}
.btn-logout:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* --- MAIN CONTENT --- */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* --- TABS --- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- PAGE HEADER --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.page-title { font-family: 'Outfit', sans-serif; font-size: 1.5rem; color: var(--text); }
.page-desc  { font-size: 0.88rem; color: var(--muted); margin-top: 0.2rem; }
.page-desc code {
    background: rgba(17,159,139,0.1);
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* --- BUTTONS --- */
.btn-primary-admin {
    padding: 0.65rem 1.4rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dk));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.btn-primary-admin:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(17,159,139,0.3); }

.btn-secondary-admin {
    padding: 0.65rem 1.2rem;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.btn-secondary-admin:hover { background: var(--bg); }

/* ============================================================
   DAFTAR ARTIKEL
   ============================================================ */
.artikel-list { display: flex; flex-direction: column; gap: 0.75rem; }

.artikel-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s;
}
.artikel-row:hover { box-shadow: var(--shadow); }

.artikel-row-num {
    width: 28px; height: 28px;
    background: rgba(17,159,139,0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.82rem;
    flex-shrink: 0;
}
.artikel-row-info { flex: 1; min-width: 0; }
.artikel-row-kota {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    color: var(--primary); background: rgba(17,159,139,0.08);
    padding: 0.18rem 0.55rem; border-radius: 999px;
    margin-right: 0.5rem;
}
.artikel-row-judul { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.artikel-row-file  { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

.artikel-row-actions { flex-shrink: 0; }
.btn-row-view {
    padding: 0.4rem 0.9rem;
    background: rgba(17,159,139,0.08);
    color: var(--primary);
    border: 1px solid rgba(17,159,139,0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-row-view:hover { background: var(--primary); color: #fff; }

/* ============================================================
   EDITOR
   ============================================================ */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } }

.editor-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.form-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.field-group { margin-bottom: 1rem; }
.field-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.req { color: #ef4444; }
.field-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
    resize: vertical;
}
.field-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17,159,139,0.1);
}
.field-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; transition: color 0.2s; }

.slug-row {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}
.slug-prefix, .slug-suffix {
    padding: 0.65rem 0.75rem;
    background: rgba(17,159,139,0.06);
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    font-weight: 600;
}
.slug-input { flex: 1; border: none !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.slug-input:focus { box-shadow: none !important; }

/* TOOLBAR */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.toolbar button {
    padding: 0.3rem 0.65rem;
    background: #f0f4f8;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}
.toolbar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.konten-area { font-family: 'Courier New', monospace; font-size: 0.85rem; line-height: 1.6; min-height: 380px; }

/* FAQ */
.faq-row { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; position: relative; }
.btn-add-faq {
    padding: 0.5rem 1rem; background: transparent; border: 1px dashed var(--primary);
    color: var(--primary); border-radius: 8px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
    transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-add-faq:hover { background: rgba(17,159,139,0.08); }
.btn-rm-faq {
    position: absolute; top: 0; right: 0;
    background: #fee2e2; border: none; color: #ef4444;
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 0.8rem;
}

/* ============================================================
   EDITOR ASIDE (SEO Checker + SERP)
   ============================================================ */
.editor-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1.5rem; }

.seo-checker, .serp-preview-box, .tips-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.checker-title {
    font-size: 0.9rem; font-weight: 700; color: var(--text);
    margin-bottom: 1rem; padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.check-item { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.45rem; transition: color 0.2s; }

.seo-score-wrap { margin-top: 1rem; }
.seo-score-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 0.35rem; }
.seo-score-bar { height: 8px; background: #e8f0ef; border-radius: 999px; overflow: hidden; }
.seo-score-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease, background 0.4s; }
.seo-score-num { font-size: 0.82rem; font-weight: 700; color: var(--text); margin-top: 0.35rem; text-align: right; }

/* SERP Preview */
.serp-url   { font-size: 0.78rem; color: #1a7836; margin-bottom: 0.2rem; }
.serp-title { font-size: 1rem; color: #1a0dab; font-weight: 600; line-height: 1.3; margin-bottom: 0.3rem; cursor: pointer; }
.serp-title:hover { text-decoration: underline; }
.serp-desc  { font-size: 0.82rem; color: #545454; line-height: 1.5; }

.tips-list { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.tips-list li { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.settings-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   MODAL PREVIEW
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 860px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border); background: transparent;
    cursor: pointer; font-size: 1rem; color: var(--muted);
}
.modal-close:hover { background: #fee2e2; color: #ef4444; }
.modal-body { flex: 1; overflow-y: auto; padding: 1.5rem; font-size: 0.88rem; line-height: 1.7; }
.modal-body h1, .modal-body h2 { font-family: 'Outfit', sans-serif; color: var(--text); margin: 1rem 0 0.5rem; }
.modal-body p  { color: var(--muted); margin-bottom: 0.75rem; }
.modal-body ul, .modal-body ol { padding-left: 1.4rem; margin-bottom: 0.75rem; }
.modal-body li { color: var(--muted); margin-bottom: 0.25rem; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}
