/* =============================================================================
   backend.css — Abnormal Toys Admin Panel
   ============================================================================= */

/* ── Layout ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; background: #f5f5f5; color: #1a1a1a; }
a { color: inherit; text-decoration: none; }

/* Admin Layout: sidebar + content */
.at-admin-body { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.at-admin-sidebar {
    width: 240px; flex-shrink: 0;
    background: #0a0a0a; color: #fff;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; overflow-y: auto;
}
.at-admin-sidebar__logo {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.at-admin-sidebar__brand { font-size: 1.5rem; font-weight: 900; letter-spacing: -.03em; color: #fff; }
.at-admin-sidebar__brand-sub { font-size: .65rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #ff2d87; }
.at-admin-sidebar__nav { padding: 1rem 0; list-style: none; flex: 1; }
.at-admin-sidebar__nav li { }
.at-admin-sidebar__link {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.25rem; font-size: .8125rem; font-weight: 600;
    color: rgba(255,255,255,.55); transition: all .2s ease;
}
.at-admin-sidebar__link:hover, .at-admin-sidebar__link.active {
    color: #fff; background: rgba(255,255,255,.06);
    border-left: 3px solid #ff2d87;
    padding-left: calc(1.25rem - 3px);
}
.at-admin-sidebar__icon { font-size: 1rem; width: 1.25rem; text-align: center; }
.at-admin-sidebar__footer { padding: 1.25rem; border-top: 1px solid rgba(255,255,255,.07); }
.at-admin-sidebar__admin-name { font-size: .75rem; color: rgba(255,255,255,.4); margin-bottom: .4rem; }
.at-admin-sidebar__logout { font-size: .8125rem; color: #ff2d87; font-weight: 600; }
.at-admin-sidebar__logout:hover { color: #ff6aab; }

/* ── Main Content ────────────────────────────────────────────────────────── */
.at-admin-content { flex: 1; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }

.at-admin-topbar {
    background: #fff; padding: 1rem 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 50;
}
.at-admin-topbar__title { font-size: 1.25rem; font-weight: 700; }
.at-admin-topbar__welcome { font-size: .875rem; color: #888; }
.at-admin-main { padding: 1.5rem; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.at-admin-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden; }
.at-admin-card__header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #f0f0f0; }
.at-admin-card__title { font-size: .9375rem; font-weight: 700; margin: 0; }
.at-admin-card__body { padding: 1.25rem; }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.at-admin-stat-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 1.5rem; text-align: center; }
.at-admin-stat-card--pink { border-top: 3px solid #ff2d87; }
.at-admin-stat-card--blue { border-top: 3px solid #00f0ff; }
.at-admin-stat-card__icon { font-size: 1.75rem; margin-bottom: .5rem; }
.at-admin-stat-card__value { font-size: 1.75rem; font-weight: 800; margin-bottom: .25rem; }
.at-admin-stat-card__label { font-size: .8125rem; color: #888; text-transform: uppercase; letter-spacing: .08em; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.at-admin-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.at-admin-table th { background: #fafafa; font-weight: 700; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #888; padding: .75rem 1rem; text-align: left; border-bottom: 1px solid #e8e8e8; white-space: nowrap; }
.at-admin-table td { padding: .875rem 1rem; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.at-admin-table tbody tr:last-child td { border-bottom: none; }
.at-admin-table tbody tr:hover { background: #fafafa; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.at-admin-status { display: inline-block; padding: .25rem .65rem; font-size: .75rem; font-weight: 700; border-radius: 20px; text-transform: capitalize; }
.at-admin-status--pending    { background: #fff3cd; color: #856404; }
.at-admin-status--paid       { background: #d1e7dd; color: #0f5132; }
.at-admin-status--processing { background: #cff4fc; color: #055160; }
.at-admin-status--shipped    { background: #d0d4f7; color: #2c35a0; }
.at-admin-status--delivered  { background: #d1e7dd; color: #0f5132; }
.at-admin-status--cancelled  { background: #f8d7da; color: #842029; }
.at-admin-status--refunded   { background: #e2e3e5; color: #495057; }
.at-admin-status--active     { background: #d1e7dd; color: #0f5132; }
.at-admin-status--draft      { background: #e2e3e5; color: #495057; }
.at-admin-status--inactive   { background: #f8d7da; color: #842029; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.at-admin-badge { display: inline-block; padding: .15rem .5rem; font-size: .65rem; font-weight: 800; letter-spacing: .08em; border-radius: 3px; background: #f0f0f0; color: #333; margin: 0 .1rem; }
.at-admin-badge--pink { background: #ff2d87; color: #fff; }
.at-admin-badge--blue { background: #00f0ff; color: #000; }
.at-admin-badge--dark { background: #0a0a0a; color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.at-admin-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; font-size: .8125rem; font-weight: 700; border-radius: 6px; border: 1.5px solid #e0e0e0; background: #fff; color: #333; cursor: pointer; transition: all .2s ease; text-decoration: none; }
.at-admin-btn:hover { border-color: #999; color: #000; }
.at-admin-btn--primary { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.at-admin-btn--primary:hover { background: #333; border-color: #333; color: #fff; }
.at-admin-btn--sm { padding: .3rem .75rem; font-size: .75rem; }

/* ── Links ───────────────────────────────────────────────────────────────── */
.at-admin-link { color: #0a0a0a; font-weight: 600; text-decoration: underline; background: none; border: none; cursor: pointer; font-size: .8125rem; padding: 0; }
.at-admin-link--danger { color: #dc3545; }
.at-admin-link:hover { opacity: .7; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.at-admin-label { display: block; font-size: .8125rem; font-weight: 700; margin-bottom: .4rem; color: #444; }
.at-admin-input { width: 100%; padding: .6rem .875rem; border: 1.5px solid #e0e0e0; border-radius: 6px; font-size: .875rem; font-family: inherit; color: #1a1a1a; background: #fff; transition: border-color .2s; outline: none; }
.at-admin-input:focus { border-color: #0a0a0a; }
.at-admin-textarea { width: 100%; padding: .6rem .875rem; border: 1.5px solid #e0e0e0; border-radius: 6px; font-size: .875rem; font-family: inherit; color: #1a1a1a; resize: vertical; outline: none; transition: border-color .2s; }
.at-admin-textarea:focus { border-color: #0a0a0a; }
.at-admin-checkbox-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.at-admin-checkbox { width: 16px; height: 16px; accent-color: #ff2d87; cursor: pointer; }
.at-admin-checkbox-label { font-size: .875rem; cursor: pointer; }
.at-admin-meta-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #888; margin-bottom: .25rem; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.at-admin-alert { padding: .875rem 1.1rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: .875rem; font-weight: 500; }
.at-admin-alert--success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.at-admin-alert--error   { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.at-admin-alert--info    { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.at-admin-login-body { background: #0a0a0a; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.at-admin-login { width: 100%; }
.at-admin-login__box { background: #fff; border-radius: 12px; padding: 2.5rem; max-width: 400px; margin: 0 auto; }
.at-admin-login__logo { text-align: center; margin-bottom: 1.5rem; }
.at-admin-login__brand { display: block; font-size: 2rem; font-weight: 900; letter-spacing: .1em; color: #0a0a0a; }
.at-admin-login__sub { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: #ff2d87; }
.at-admin-login__title { font-size: 1.25rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }
.at-admin-login__form { }

/* ── Mobile menu button ──────────────────────────────────────────────────── */
.at-admin-topbar__menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.at-admin-topbar__menu span {
    display: block;
    width: 18px;
    height: 2px;
    background: #0a0a0a;
    margin: 0 auto;
    border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
}

.at-admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
    opacity: 0;
    transition: opacity .25s ease;
}
.at-admin-sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
}

.at-admin-sidebar__logo-text {
    display: flex;
    align-items: baseline;
    gap: .5rem;
}
.at-admin-sidebar__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
}
.at-admin-sidebar__close:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.at-admin-nav-open {
    overflow: hidden;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .at-admin-sidebar {
        width: min(280px, 85vw);
        transform: translateX(-100%);
        transition: transform .28s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }
    .at-admin-sidebar.is-open {
        transform: translateX(0);
    }
    .at-admin-sidebar__logo {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .at-admin-sidebar__close {
        display: inline-flex;
    }
    .at-admin-content {
        margin-left: 0;
        width: 100%;
    }
    .at-admin-topbar__menu {
        display: inline-flex;
    }
    .at-admin-topbar {
        padding: .875rem 1rem;
        gap: .75rem;
    }
    .at-admin-topbar__title {
        font-size: 1.05rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .at-admin-topbar__welcome {
        display: none;
    }
    .at-admin-main {
        padding: 1rem;
    }
    .at-admin-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }
    .at-admin-stat-card {
        padding: 1rem;
    }
    .at-admin-stat-card__value {
        font-size: 1.35rem;
    }
    .at-admin-stat-card__icon {
        font-size: 1.35rem;
    }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.25rem;
        padding: 0 .25rem;
    }
    .at-admin-table {
        min-width: 560px;
    }
    .at-admin-btn {
        width: auto;
    }
    .at-admin-topbar .at-admin-btn {
        font-size: .75rem;
        padding: .4rem .75rem;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .at-admin-topbar {
        flex-wrap: wrap;
    }
    .at-admin-topbar__title {
        order: 2;
        flex: 1 1 calc(100% - 52px);
    }
    .at-admin-topbar .at-admin-btn {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: .25rem;
    }
    .at-admin-login__box {
        padding: 1.75rem 1.25rem;
    }
    .at-admin-stat-card__label {
        font-size: .7rem;
    }
}
