:root {
    --admin-blue: #0b3b75;
    --admin-blue-dark: #082a55;
    --admin-red: #d32632;
    --admin-ink: #172033;
    --admin-muted: #667085;
    --admin-soft: #f4f7fb;
    --admin-border: #dfe6ef;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--admin-ink);
    background: var(--admin-soft);
}

a {
    text-decoration: none;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 278px;
    min-height: 100vh;
    background: var(--admin-blue-dark);
    color: #fff;
    position: sticky;
    top: 0;
    overflow-y: auto;
    flex: 0 0 278px;
}

.admin-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    padding: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    font-weight: 900;
}

.admin-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.admin-sidebar nav {
    padding: 12px;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, .82);
    padding: 11px 13px;
    border-radius: 8px;
    font-weight: 700;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    color: #fff;
    background: var(--admin-red);
}

.admin-main {
    flex: 1;
    min-width: 0;
}

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

.admin-topbar h1 {
    font-size: 24px;
    font-weight: 900;
    margin: 0;
}

.admin-topbar p {
    margin: 0;
    color: var(--admin-muted);
}

.admin-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    border: 1px solid var(--admin-border);
    background: #fff;
    border-radius: 8px;
    width: 42px;
    height: 42px;
}

.admin-content {
    padding: 28px;
}

.admin-card,
.stat-card,
.media-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(15, 35, 65, .06);
}

.admin-card {
    padding: 24px;
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-card-head h2,
.form-section-title {
    font-size: 21px;
    font-weight: 900;
    margin: 0;
}

.stat-card {
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card i {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    background: #eef4fb;
    color: var(--admin-red);
    border-radius: 8px;
    font-size: 26px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    color: var(--admin-blue);
}

.stat-card span,
.admin-list span {
    color: var(--admin-muted);
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 12px;
}

.form-control,
.form-select {
    border-color: var(--admin-border);
    border-radius: 6px;
    min-height: 44px;
}

textarea.form-control {
    min-height: 120px;
}

.form-label {
    font-weight: 800;
}

.form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
}

.image-preview {
    display: block;
    width: 180px;
    max-width: 100%;
    height: 110px;
    object-fit: contain;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-soft);
    margin-bottom: 8px;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.message-full td {
    background: #fbfdff;
    color: var(--admin-muted);
    border-bottom: 12px solid var(--admin-soft);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.media-card {
    overflow: hidden;
}

.media-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: var(--admin-soft);
}

.media-card div {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.settings-sidebar {
    position: sticky;
    top: 100px;
}

.settings-sidebar .list-group-item {
    border: 0;
    border-radius: 6px;
    margin-bottom: 5px;
    color: #4b5563;
    font-weight: 700;
}

.settings-sidebar .list-group-item:hover {
    background: #f3f6fb;
    color: var(--admin-blue);
}

.settings-sidebar .list-group-item.active {
    background: #eef4fb;
    color: var(--admin-red);
    border-left: 4px solid var(--admin-red);
}

.homepage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.homepage-manage-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(15, 35, 65, .06);
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.homepage-manage-card > i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef4fb;
    color: var(--admin-red);
    font-size: 22px;
    flex-shrink: 0;
}

.homepage-manage-card h2 {
    font-size: 17px;
    font-weight: 900;
    margin: 0 0 6px;
}

.homepage-manage-card p {
    color: var(--admin-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.homepage-settings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
    color: var(--admin-ink);
    font-weight: 800;
}

.homepage-settings-link:hover {
    border-color: var(--admin-red);
    color: var(--admin-red);
}

.homepage-settings-link i {
    color: var(--admin-red);
    font-size: 22px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(120deg, rgba(8, 42, 85, .96), rgba(211, 38, 50, .88)), url("../images/banner/banner-1.jpg") center/cover;
}

.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .22);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--admin-blue);
    font-weight: 900;
    margin-bottom: 22px;
}

.auth-logo img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 900;
}

.auth-card p,
.auth-links {
    color: var(--admin-muted);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 991px) {
    .admin-sidebar {
        position: fixed;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        width: 100%;
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .admin-user {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .admin-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 14px;
    }

    .admin-user {
        margin-left: 0;
        width: 100%;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-card-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ── Toast Notifications ──────────────────────────── */
#bjls-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100vw - 48px);
    pointer-events: none;
}

.bjls-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15,35,65,.18);
    padding: 16px 18px 22px;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    /* start hidden — slide in from right */
    transform: translateX(110%);
    opacity: 0;
    transition: transform .38s cubic-bezier(.16,1,.3,1), opacity .28s ease;
    border-left: 4px solid transparent;
}
.bjls-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.bjls-toast.hide {
    transform: translateX(110%);
    opacity: 0;
}
.bjls-toast-success { border-left-color: #16a34a; }
.bjls-toast-danger  { border-left-color: #d32632; }
.bjls-toast-warning { border-left-color: #eab308; }
.bjls-toast-info    { border-left-color: #0b3b75; }

.bjls-toast i {
    font-size: 20px;
    margin-top: 1px;
    flex-shrink: 0;
}
.bjls-toast-success i { color: #16a34a; }
.bjls-toast-danger  i { color: #d32632; }
.bjls-toast-warning i { color: #eab308; }
.bjls-toast-info    i { color: #0b3b75; }

.bjls-toast span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-ink);
    line-height: 1.5;
}

.bjls-toast-close {
    background: none;
    border: none;
    color: var(--admin-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color .2s;
}
.bjls-toast-close:hover { color: var(--admin-ink); }

.bjls-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 12px 12px;
}
.bjls-toast-success .bjls-toast-progress { background: #16a34a; }
.bjls-toast-danger  .bjls-toast-progress { background: #d32632; }
.bjls-toast-warning .bjls-toast-progress { background: #eab308; }
.bjls-toast-info    .bjls-toast-progress { background: #0b3b75; }

/* ── SEO Section in Forms ─────────────────────────── */
.seo-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--admin-muted);
    margin: 24px 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.seo-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: #eab308;
    border-radius: 2px;
}

.seo-counter {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

/* ── Image Preview ────────────────────────────────── */
.image-preview {
    max-width: 180px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--admin-border);
    display: block;
    margin-bottom: 10px;
}

/* ── TinyMCE container tweaks ─────────────────────── */
.tox-tinymce {
    border-radius: 8px !important;
    border-color: var(--admin-border) !important;
}
.tox-statusbar { display: none !important; }
