/* ============================================================================
   SHILI Admin CMS — self-contained styles for the /admin area
   ----------------------------------------------------------------------------
   Deliberately NOT scoped under .skb-immersive — the admin is a clean utility
   UI, not the marketing site. Uses the Pearl Trust palette for brand continuity.
   Link this in index.html (it's small and only matters on /admin* routes).
   ========================================================================== */

.adm-auth,
.adm-shell {
    --a-pearl: #f7f9fc;
    --a-surface: #ffffff;
    --a-ink: #0e1a35;
    --a-ink2: #1d2b4a;
    --a-muted: #5a6878;
    --a-muted2: #8a98ac;
    --a-line: rgba(45, 108, 223, 0.12);
    --a-line2: rgba(45, 108, 223, 0.20);
    --a-blue: #4f87e0;
    --a-blue2: #6c9beb;
    --a-bluedeep: #2d6cdf;
    --a-mint: #5cc191;
    --a-danger: #d97a8a;
    --a-danger2: #c9566b;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    color: var(--a-ink);
    -webkit-font-smoothing: antialiased;
}

    .adm-auth h1, .adm-auth h2, .adm-auth h3,
    .adm-shell h1, .adm-shell h2, .adm-shell h3 {
        font-family: 'Outfit', sans-serif;
        letter-spacing: -0.02em;
    }

/* ── shared controls ─────────────────────────────────────────── */
.adm-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--a-surface);
    border: 1px solid var(--a-line2);
    color: var(--a-ink);
    font-family: inherit;
    font-size: 0.94rem;
    transition: border-color .2s, box-shadow .2s;
}

    .adm-input:focus {
        outline: none;
        border-color: var(--a-mint);
        box-shadow: 0 0 0 3px rgba(94, 193, 145, 0.18);
    }

.adm-textarea {
    resize: vertical;
    line-height: 1.6;
}

    .adm-textarea.tall {
        min-height: 240px;
    }

select.adm-input {
    cursor: pointer;
}

.adm-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

    .adm-field label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--a-ink);
    }

    .adm-field .req {
        color: var(--a-mint);
    }

    .adm-field .hint {
        color: var(--a-muted2);
        font-weight: 400;
        font-size: 0.8rem;
    }

.adm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--a-blue);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 6px 18px rgba(79, 135, 224, 0.28);
    transition: background .2s, transform .2s, box-shadow .2s;
}

    .adm-btn-primary:hover:not(:disabled) {
        background: var(--a-blue2);
        transform: translateY(-1px);
    }

    .adm-btn-primary:disabled {
        opacity: .65;
        cursor: progress;
    }

.adm-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    color: var(--a-ink2);
    border: 1px solid var(--a-line2);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: border-color .2s, color .2s, background .2s;
}

    .adm-btn-ghost:hover {
        border-color: var(--a-mint);
        color: var(--a-bluedeep);
    }

.adm-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--a-danger2);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    transition: opacity .2s;
}

    .adm-btn-danger:hover {
        opacity: .9;
    }

.adm-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: rgba(217, 122, 138, 0.10);
    border: 1px solid rgba(217, 122, 138, 0.35);
    color: var(--a-danger2);
    font-size: 0.88rem;
}

.adm-flash {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    background: rgba(94, 193, 145, 0.14);
    border: 1px solid rgba(94, 193, 145, 0.40);
    color: var(--a-ink);
    font-size: 0.9rem;
    font-weight: 500;
}

    .adm-flash i {
        color: var(--a-mint);
    }

/* ── login ───────────────────────────────────────────────────── */
.adm-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(60% 50% at 30% 20%, rgba(168, 212, 255, 0.30), transparent 65%), radial-gradient(45% 45% at 75% 85%, rgba(158, 229, 192, 0.26), transparent 65%), var(--a-pearl);
}

.adm-auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-radius: 22px;
    padding: 44px 40px;
    box-shadow: 0 30px 80px rgba(14, 26, 53, 0.12);
    text-align: center;
}

.adm-auth-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.adm-auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 6px;
    color: var(--a-ink);
}

.adm-auth-sub {
    color: var(--a-muted);
    font-size: 0.92rem;
    margin: 0 0 28px;
}

.adm-auth-card form {
    text-align: left;
}

.adm-auth-card .adm-btn-primary {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
}

/* ── dashboard shell ─────────────────────────────────────────── */
.adm-shell {
    min-height: 100vh;
    background: var(--a-pearl);
}

.adm-loading {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--a-muted);
    font-size: 0.95rem;
}

.adm-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(45, 108, 223, 0.25);
    border-top-color: var(--a-blue);
    animation: admSpin .7s linear infinite;
}

@keyframes admSpin {
    to {
        transform: rotate(360deg);
    }
}

.adm-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px 32px;
    background: var(--a-surface);
    border-bottom: 1px solid var(--a-line);
}

.adm-top-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .adm-top-brand > i {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        background: linear-gradient(140deg, rgba(168, 212, 255, 0.35), rgba(158, 229, 192, 0.22));
        color: var(--a-bluedeep);
        font-size: 1.25rem;
    }

.adm-top-title {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--a-ink);
}

.adm-top-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--a-muted);
}

.adm-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.adm-body {
    max-width: 980px;
    margin: 0 auto;
    padding: 36px 32px 80px;
}

.adm-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
    flex-wrap: wrap;
}

    .adm-list-head h2 {
        font-size: 1.3rem;
        margin: 0;
        color: var(--a-ink);
    }

.adm-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 14px;
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    transition: border-color .2s, box-shadow .2s;
}

    .adm-row:hover {
        border-color: var(--a-line2);
        box-shadow: 0 6px 20px rgba(14, 26, 53, 0.05);
    }

.adm-row-main {
    min-width: 0;
}

.adm-row-title {
    font-weight: 600;
    color: var(--a-ink);
    font-size: 0.98rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.adm-row-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 7px;
    font-size: 0.82rem;
    color: var(--a-muted);
}

.adm-chip {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--a-mint);
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(94, 193, 145, 0.14);
}

.adm-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .adm-badge.feat {
        color: #b5851f;
        background: rgba(230, 169, 59, 0.16);
    }

    .adm-badge.draft {
        color: var(--a-muted);
        background: rgba(90, 104, 120, 0.12);
    }

.adm-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.adm-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--a-line2);
    color: var(--a-ink2);
    font-size: 0.95rem;
    transition: border-color .2s, color .2s, background .2s;
}

    .adm-icon-btn:hover {
        border-color: var(--a-mint);
        color: var(--a-bluedeep);
    }

    .adm-icon-btn.danger:hover {
        border-color: var(--a-danger);
        color: var(--a-danger2);
        background: rgba(217, 122, 138, 0.06);
    }

.adm-empty {
    padding: 50px;
    text-align: center;
    color: var(--a-muted);
    background: var(--a-surface);
    border: 1px dashed var(--a-line2);
    border-radius: 14px;
}

/* ── editor ──────────────────────────────────────────────────── */
.adm-editor-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

    .adm-editor-head h2 {
        font-size: 1.3rem;
        margin: 0;
        color: var(--a-ink);
    }

.adm-form {
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-radius: 18px;
    padding: 32px;
}

.adm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.adm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}

.adm-toggles {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin: 8px 0 24px;
}

.adm-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--a-ink);
}

    .adm-toggle input {
        width: 18px;
        height: 18px;
        accent-color: var(--a-blue);
        cursor: pointer;
    }

    .adm-toggle .hint {
        color: var(--a-muted2);
        font-weight: 400;
        font-size: 0.8rem;
    }

.adm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--a-line);
}

/* ── delete modal ────────────────────────────────────────────── */
.adm-modal-back {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(14, 26, 53, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 24px;
}

.adm-modal {
    width: 100%;
    max-width: 420px;
    background: var(--a-surface);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(14, 26, 53, 0.25);
}

    .adm-modal h3 {
        margin: 0 0 12px;
        font-size: 1.2rem;
        color: var(--a-ink);
    }

    .adm-modal p {
        margin: 0 0 24px;
        color: var(--a-muted);
        font-size: 0.92rem;
        line-height: 1.6;
    }

.adm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
    .adm-grid-2, .adm-grid-3 {
        grid-template-columns: 1fr;
    }

    .adm-body {
        padding: 24px 18px 60px;
    }

    .adm-top {
        padding: 16px 18px;
    }

    .adm-form {
        padding: 22px;
    }

    .adm-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .adm-row-actions {
        align-self: flex-end;
    }
}
/* ============================================================================
   COVER IMAGE CONTROL  (.adm-image*)  — append to admin.css
   ========================================================================== */
.adm-image {
    display: flex;
    gap: 18px;
    align-items: stretch;
}

.adm-image-preview {
    position: relative;
    width: 220px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--a-line2);
    display: grid;
    place-items: center;
    background: var(--a-pearl);
}

    .adm-image-preview img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* gradient fallbacks reuse the public site's accent helpers */
    .adm-image-preview.is-grad-blue {
        background: linear-gradient(135deg, #7ab3ef 0%, #a8d4ff 100%);
    }

    .adm-image-preview.is-grad-mint {
        background: linear-gradient(135deg, #5cc191 0%, #9ee5c0 100%);
    }

    .adm-image-preview.is-grad-mixed {
        background: linear-gradient(135deg, #7ab3ef 0%, #5cc191 100%);
    }

.adm-image-placeholder {
    position: relative;
    z-index: 1;
    padding: 0 16px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(14, 26, 53, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

    .adm-image-placeholder i {
        font-size: 1.6rem;
    }

.adm-image-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.adm-upload-btn {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.adm-img-err {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--a-danger2);
    font-size: 0.82rem;
}

.adm-spinner.sm {
    width: 13px;
    height: 13px;
    border-width: 2px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
}

@media (max-width: 680px) {
    .adm-image {
        flex-direction: column;
    }

    .adm-image-preview {
        width: 100%;
    }
}
