/* =========================================================
   Neelyouth — Layout & Components
   ========================================================= */

:root {
    --es-primary: #4f46e5;
    --es-primary-dark: #3730a3;
    --es-primary-soft: #eef2ff;
    --es-accent: #f59e0b;
    --es-accent-soft: #fef3c7;
    --es-dark: #0f172a;
    --es-body: #475569;
    --es-muted: #64748b;
    --es-border: #e2e8f0;
    --es-bg: #ffffff;
    --es-bg-soft: #f8fafc;
    --es-bg-tint: #f1f5f9;
    --es-success: #10b981;
    --es-radius-sm: 10px;
    --es-radius: 16px;
    --es-radius-lg: 24px;
    --es-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --es-shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --es-shadow-lg: 0 20px 40px -12px rgba(79, 70, 229, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
    --es-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--es-body);
    --bs-body-bg: var(--es-bg);
    --bs-link-color: var(--es-primary);
    --bs-link-hover-color: var(--es-primary-dark);
    --bs-primary: var(--es-primary);
    --bs-primary-rgb: 79, 70, 229;
    --bs-border-color: var(--es-border);
}

.admin-body {
    background: var(--es-bg-tint);
    min-height: 100vh;
}

/* ---------- Layout ---------- */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

@media (max-width: 991px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

/* ---------- Sidebar ---------- */
.admin-sidebar {
    background: var(--es-dark);
    color: rgba(255, 255, 255, 0.75);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (max-width: 991px) {
    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

        .admin-sidebar.is-open {
            transform: translateX(0);
        }
}

.admin-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 1.5rem 1.5rem;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

    .admin-sidebar-brand:hover {
        color: #fff;
    }

    .admin-sidebar-brand small {
        display: block;
        color: var(--es-accent);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.admin-nav-section {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 1.25rem 1.5rem 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.94rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--es-transition);
}

    .admin-nav-link i {
        font-size: 1.1rem;
        width: 22px;
        text-align: center;
    }

    .admin-nav-link:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.04);
    }

    .admin-nav-link.active {
        color: #fff;
        background: rgba(79, 70, 229, 0.18);
        border-left-color: var(--es-primary);
    }

.admin-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

    .admin-sidebar-backdrop.is-open {
        display: block;
    }

/* ---------- Main column ---------- */
.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---------- Topbar ---------- */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--es-border);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.admin-topbar-toggle {
    background: transparent;
    border: 1px solid var(--es-border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--es-dark);
    display: none;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    .admin-topbar-toggle {
        display: inline-flex;
    }
}

.admin-topbar-search {
    position: relative;
    flex: 1;
    max-width: 380px;
}

    .admin-topbar-search i {
        position: absolute;
        left: 0.85rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--es-muted);
    }

    .admin-topbar-search input {
        width: 100%;
        border: 1px solid var(--es-border);
        background: var(--es-bg-soft);
        border-radius: 10px;
        padding: 0.55rem 0.9rem 0.55rem 2.4rem;
        font-size: 0.92rem;
    }

        .admin-topbar-search input:focus {
            outline: none;
            border-color: var(--es-primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
        }

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-topbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--es-bg-soft);
    color: var(--es-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    position: relative;
}

    .admin-topbar-icon:hover {
        color: var(--es-primary);
        border-color: var(--es-border);
    }

    .admin-topbar-icon .dot {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 8px;
        height: 8px;
        background: var(--es-accent);
        border-radius: 50%;
        border: 2px solid #fff;
    }

.admin-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.7rem 0.3rem 0.4rem;
    border-radius: 999px;
    background: var(--es-bg-soft);
}

    .admin-topbar-user img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
    }

    .admin-topbar-user .user-name {
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--es-dark);
    }

    .admin-topbar-user .user-role {
        font-size: 0.75rem;
        color: var(--es-muted);
    }

/* ---------- Content area ---------- */
.admin-content {
    padding: 1.75rem;
    flex: 1;
}

@media (max-width: 575px) {
    .admin-content {
        padding: 1.25rem;
    }
}

.admin-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .admin-page-head h1 {
        font-size: 1.6rem;
        margin-bottom: 0.25rem;
    }

    .admin-page-head p {
        color: var(--es-muted);
        margin: 0;
        font-size: 0.95rem;
    }

/* ---------- Cards / panels ---------- */
.admin-card {
    background: #fff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow-sm);
}

.admin-card-head {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--es-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

    .admin-card-head h3 {
        font-size: 1.05rem;
        margin: 0;
    }

    .admin-card-head .small {
        color: var(--es-muted);
        font-size: 0.85rem;
    }

.admin-card-body {
    padding: 1.4rem;
}

/* ---------- Stat cards ---------- */
.admin-stat {
    background: #fff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    padding: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--es-primary-soft);
    color: var(--es-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

    .admin-stat-icon.is-amber {
        background: var(--es-accent-soft);
        color: var(--es-accent);
    }

    .admin-stat-icon.is-emerald {
        background: #d1fae5;
        color: var(--es-success);
    }

    .admin-stat-icon.is-rose {
        background: #ffe4e6;
        color: #e11d48;
    }

.admin-stat .label {
    font-size: 0.82rem;
    color: var(--es-muted);
    margin-bottom: 0.15rem;
}

.admin-stat .value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--es-dark);
    line-height: 1.1;
}

.admin-stat .delta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--es-success);
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

    .admin-stat .delta.is-down {
        color: #e11d48;
    }

/* ---------- Tables ---------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

    .admin-table thead th {
        text-align: left;
        background: var(--es-bg-soft);
        color: var(--es-muted);
        font-weight: 600;
        font-size: 0.78rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 0.85rem 1.4rem;
        border-bottom: 1px solid var(--es-border);
        white-space: nowrap;
    }

    .admin-table tbody td {
        padding: 1rem 1.4rem;
        border-bottom: 1px solid var(--es-border);
        color: var(--es-body);
        vertical-align: middle;
    }

    .admin-table tbody tr:last-child td {
        border-bottom: none;
    }

    .admin-table tbody tr:hover {
        background: var(--es-bg-soft);
    }

    .admin-table .row-title {
        color: var(--es-dark);
        font-weight: 600;
        display: block;
    }

    .admin-table .row-sub {
        color: var(--es-muted);
        font-size: 0.82rem;
    }

.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--es-radius);
}

.admin-table-thumb {
    width: 56px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-table-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 220px;
}

/* ---------- Badges ---------- */
.admin-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

    .admin-badge.is-success {
        background: #d1fae5;
        color: #047857;
    }

    .admin-badge.is-warn {
        background: var(--es-accent-soft);
        color: #92400e;
    }

    .admin-badge.is-info {
        background: var(--es-primary-soft);
        color: var(--es-primary-dark);
    }

    .admin-badge.is-muted {
        background: var(--es-bg-tint);
        color: var(--es-muted);
    }

/* ---------- Action buttons (icons in tables) ---------- */
.admin-action {
    background: transparent;
    border: 1px solid var(--es-border);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--es-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--es-transition);
}

    .admin-action:hover {
        color: var(--es-primary);
        border-color: var(--es-primary);
        background: var(--es-primary-soft);
    }

    .admin-action.is-danger:hover {
        color: #e11d48;
        border-color: #e11d48;
        background: #ffe4e6;
    }

/* ---------- Forms ---------- */
.admin-form .form-label {
    font-size: 0.84rem;
    margin-bottom: 0.4rem;
}

.admin-form .form-control,
.admin-form .form-select {
    font-size: 0.93rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
}

.admin-form textarea.form-control {
    min-height: 110px;
}

.admin-form-help {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--es-muted);
}

.admin-form-section + .admin-form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--es-border);
}

.admin-form-section h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.admin-form-section .small {
    color: var(--es-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

/* ---------- Toast ---------- */
.admin-toast-host {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.admin-toast {
    background: #fff;
    border: 1px solid var(--es-border);
    border-left: 4px solid var(--es-success);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    box-shadow: var(--es-shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 240px;
    max-width: 360px;
    pointer-events: auto;
    font-size: 0.92rem;
    color: var(--es-dark);
    animation: adminToastIn 0.25s ease;
}

    .admin-toast i {
        color: var(--es-success);
        font-size: 1.15rem;
    }

    .admin-toast.is-info {
        border-left-color: var(--es-primary);
    }

        .admin-toast.is-info i {
            color: var(--es-primary);
        }

    .admin-toast.is-error {
        border-left-color: #e11d48;
    }

        .admin-toast.is-error i {
            color: #e11d48;
        }

@keyframes adminToastIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------- Modal ---------- */
.modal-content {
    border: none;
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--es-border);
    padding: 1rem 1.4rem;
}

    .modal-header .modal-title {
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-size: 1.1rem;
    }

.modal-body {
    padding: 1.4rem;
}

.modal-footer {
    border-top: 1px solid var(--es-border);
    padding: 0.9rem 1.4rem;
}

/* ---------- Login ---------- */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%), var(--es-bg-tint);
}

.admin-login-card {
    background: #fff;
    border-radius: var(--es-radius-lg);
    padding: 2.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--es-shadow-lg);
}

    .admin-login-card h1 {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    .admin-login-card .es-brand {
        margin-bottom: 1.5rem;
    }

    .admin-login-card .small-note {
        font-size: 0.82rem;
        color: var(--es-muted);
        text-align: center;
        margin-top: 1rem;
        background: var(--es-bg-soft);
        padding: 0.7rem;
        border-radius: 10px;
    }

/* ---------- Empty state ---------- */
.admin-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--es-muted);
}

    .admin-empty i {
        font-size: 2.5rem;
        color: var(--es-border);
        margin-bottom: 0.5rem;
        display: block;
    }

/* ---------- Misc ---------- */
.admin-divider {
    height: 1px;
    background: var(--es-border);
    margin: 1.5rem 0;
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: var(--es-bg-soft);
    border: 1px solid var(--es-border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--es-muted);
}

.es-sticky-card {
    background: #fff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    padding: 1.75rem;
    box-shadow: var(--es-shadow);
    position: sticky;
    top: 150px;
}