/* ============================================================
   admin.css — tampilan panel admin Instagram
   ============================================================ */

:root {
    --grad: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --brand: #cc2366;
    --brand-dark: #a81c53;
    --bg: #f2f3f7;
    --panel: #ffffff;
    --text: #1f2030;
    --muted: #71717e;
    --line: #e6e7ee;
    --danger: #d92d20;
    --ok: #0f973d;
    --warn: #b54708;
    --radius: 14px;
    --shadow: 0 4px 18px rgba(20, 20, 40, 0.07);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
    background: #eef0f5; color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(204, 35, 102, 0.3); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: #f2f2f6; }
.btn--danger { background: #fef1f0; color: var(--danger); border-color: #f5c9c4; }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 8px; }

/* ---------- Alert / pill / chip ---------- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 14px; }
.alert--error { background: #fef1f0; color: var(--danger); border: 1px solid #f5c9c4; }
.alert--success { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }

.ap-pill {
    background: var(--grad); color: #fff;
    font-size: 0.75rem; font-weight: 700;
    padding: 5px 12px; border-radius: 999px;
}
.chip { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip--author { background: #eef0ff; color: #3538cd; }
.chip--ok { background: #ecfdf3; color: var(--ok); }
.chip--warn { background: #fffaeb; color: var(--warn); }

/* ---------- LOGIN ---------- */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--grad); }
.login__card {
    width: 100%; max-width: 400px;
    background: #fff; border-radius: 20px;
    padding: 34px 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: center;
}
.login__logo {
    width: 60px; height: 60px; margin: 0 auto 14px;
    background: var(--grad); color: #fff;
    border-radius: 18px; display: grid; place-items: center;
}
.login h1 { font-size: 1.3rem; letter-spacing: -0.01em; }
.login__sub { color: var(--muted); font-size: 0.86rem; margin: 4px 0 20px; }
.login__back { display: inline-block; margin-top: 16px; font-size: 0.82rem; }

/* ---------- Form field ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field span { font-size: 0.82rem; font-weight: 600; color: #3c3c48; }
.field span b { color: var(--danger); }
.field input, .field textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fbfbfd;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(204, 35, 102, 0.12);
    background: #fff;
}
.field small { color: var(--muted); font-size: 0.75rem; }
.field textarea { resize: vertical; }

/* ---------- Topbar ---------- */
.ap-topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.ap-topbar__inner {
    max-width: 1080px; margin: 0 auto; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ap-topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand); }
.ap-topbar__actions { display: flex; gap: 8px; }

/* ---------- Main layout ---------- */
.ap-main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 20px; }

.ap-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid var(--line);
}
.ap-card__head { margin-bottom: 18px; }
.ap-card__head h2 { font-size: 1.1rem; letter-spacing: -0.01em; }
.ap-card__head p { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.ap-card__head--row { display: flex; align-items: center; justify-content: space-between; }

.ap-form__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}
.field--span { grid-column: 1 / -1; }
.ap-form__foot { margin-top: 6px; }

/* ---------- Daftar postingan ---------- */
.ap-empty { color: var(--muted); padding: 20px 4px; text-align: center; }
.ap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.ap-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease;
}
.ap-item:hover { box-shadow: var(--shadow); }

.ap-item__thumb {
    position: relative; aspect-ratio: 4 / 3; background: #e8e8ec;
}
.ap-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-item__thumb.is-broken {
    display: grid; place-items: center;
    background: repeating-linear-gradient(45deg, #ececf0, #ececf0 10px, #e3e3e8 10px, #e3e3e8 20px);
}
.ap-item__thumb.is-broken::after { content: "Thumbnail tidak tersedia"; color: var(--muted); font-size: 0.75rem; }
.ap-item__type {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}

.ap-item__body { padding: 14px; }
.ap-item__row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ap-item__caption { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.ap-item__meta { font-size: 0.76rem; color: var(--muted); margin-bottom: 12px; word-break: break-all; }
.ap-item__meta a { color: var(--muted); }
.ap-item__meta a:hover { color: var(--brand); }
.ap-item__actions { display: flex; gap: 8px; }

/* ---------- Modal ---------- */
.ap-modal { position: fixed; inset: 0; z-index: 50; display: none; }
.ap-modal.is-open { display: block; }
.ap-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 15, 25, 0.55); backdrop-filter: blur(3px); }
.ap-modal__panel {
    position: relative; z-index: 1;
    width: calc(100% - 32px); max-width: 460px;
    margin: 8vh auto 0;
    background: #fff; border-radius: 16px;
    padding: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.3);
}
.ap-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ap-modal__head h3 { font-size: 1.05rem; }
.ap-modal__close {
    border: none; background: #f0f0f3; color: #444;
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; font-size: 0.95rem;
}
.ap-modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Toast ---------- */
.ap-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1f2030; color: #fff;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.88rem; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 90vw;
    z-index: 80;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.ap-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ap-toast.is-error { background: var(--danger); }
.ap-toast.is-success { background: var(--ok); }

@media (max-width: 640px) {
    .ap-form__grid { grid-template-columns: 1fr; }
    .ap-list { grid-template-columns: 1fr; }
}
