/* ==========================================================================
   Gorilla Car Wash — admin panel
   Loaded after Bootstrap 5.3.8. Brand palette shared with the storefront.
   ========================================================================== */

:root {
    --black: #000000;
    --charcoal: #151515;
    --brand-red: #d80000;
    --dark-red: #a80000;
    --cream: #f2e5d2;
    --light-gray: #f4f4f4;
    --border: #e3e3e3;
    --mid-gray: #6d6d6d;
    --radius: 10px;
    --sidebar-w: 248px;
    --topbar-h: 58px;
    --font-head: "Barlow Condensed", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.admin-body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14.5px;
    color: #1c1c1c;
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .admin-brand span {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
}

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

:focus-visible {
    outline: 3px solid var(--brand-red);
    outline-offset: 2px;
}

/* Taka sign — money() emits this span, so it must be styled here too. */
.currency-symbol {
    display: inline-block;
    font-family: "Noto Sans Bengali", "Nirmala UI", "Arial Unicode MS", sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1;
    margin-right: 0.04em;
    color: inherit;
}

/* ---------------------------------------------------------------- topbar */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    background: var(--charcoal);
    color: #fff;
    border-bottom: 3px solid var(--brand-red);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
}
.admin-brand:hover { color: var(--cream); }
.admin-brand img { height: 30px; width: auto; display: block; }

.admin-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}
.admin-topbar-link { color: #cfcfcf; }
.admin-topbar-link:hover { color: #fff; }
.admin-user { color: var(--cream); font-weight: 600; }
.admin-logout {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
    padding: 6px 12px;
}
.admin-logout:hover { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }

.admin-burger {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    padding: 8px;
    cursor: pointer;
}
.admin-burger span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: #fff;
    border-radius: 2px;
}

/* --------------------------------------------------------------- shell */

.admin-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.admin-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: #1d1d1d;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 13px;
    border-radius: 8px;
    color: #d6d6d6;
    font-weight: 500;
}
.admin-nav-link:hover { background: #2a2a2a; color: #fff; }
.admin-nav-link.active { background: var(--brand-red); color: #fff; }

.admin-sidebar-foot { margin-top: auto; padding-top: 16px; }

.admin-overlay {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, .5);
    z-index: 25;
}

.admin-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 22px 24px 60px;
}

.admin-page-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.admin-page-head h1 {
    font-size: 28px;
    margin: 0;
    color: var(--charcoal);
}
.admin-page-head .spacer { margin-left: auto; }

/* --------------------------------------------------------------- cards */

.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.admin-card > h2 {
    font-size: 19px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--charcoal);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-red);
    border-radius: var(--radius);
    padding: 16px;
}
.stat-card .stat-label {
    display: block;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--mid-gray);
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-family: var(--font-head);
    font-size: 31px;
    line-height: 1;
    color: var(--charcoal);
}
/* Small caption under a stat, for figures that need a qualifier or a date. */
.stat-card .stat-meta {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--mid-gray);
}
.stat-card.accent { border-left-color: var(--charcoal); }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
.admin-table th,
.admin-table td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    background: #fafafa;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--mid-gray);
    white-space: nowrap;
}
.admin-table tbody tr:hover { background: #fcfcfc; }
.admin-table .num { text-align: right; white-space: nowrap; }
.admin-table .actions { white-space: nowrap; text-align: right; }

.admin-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--light-gray);
}

/*
 * Banners are wide and short, so the square 46px thumbnail above would crop one
 * down to an unreadable sliver. Same treatment, wider box.
 */
.admin-thumb-wide {
    width: 140px;
    height: 54px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--light-gray);
}

/* ---------------------------------------------------------------- pills */

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.pill-active, .pill-delivered { background: #e3f5e8; color: #14663a; }
.pill-inactive, .pill-cancelled { background: #f2f2f2; color: #5d5d5d; }
.pill-pending { background: #fff4d6; color: #8a5a00; }
.pill-confirmed { background: #e2effb; color: #14507f; }
.pill-processing { background: #ece4fb; color: #4b2a86; }
.pill-out_for_delivery { background: #fde8e0; color: #9a3a12; }
.pill-stock-out { background: #fbe3e3; color: #96201d; }

/* --------------------------------------------------------------- forms */

.admin-form .form-label,
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #2b2b2b;
    margin-bottom: 5px;
}
.form-control, .form-select {
    border-radius: 8px;
    border-color: #d5d5d5;
    padding: 9px 12px;
    font-size: 14.5px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(216, 0, 0, .14);
}
.form-text { font-size: 12.5px; color: var(--mid-gray); }
.required::after { content: " *"; color: var(--brand-red); }

.btn { border-radius: 8px; font-weight: 600; }
.btn-brand { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--dark-red); border-color: var(--dark-red); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid #cfcfcf; color: #2b2b2b; }
.btn-ghost:hover { background: var(--light-gray); color: #000; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}
.filter-bar .form-control,
.filter-bar .form-select { min-width: 170px; }

/* ------------------------------------------------------------ image box */

.image-drop {
    border: 1.5px dashed #c9c9c9;
    border-radius: var(--radius);
    padding: 16px;
    background: #fcfcfc;
    text-align: center;
}
.image-drop img {
    max-width: 170px;
    max-height: 170px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 10px;
    object-fit: contain;
    background: #fff;
}

/*
 * A banner keeps its own aspect ratio in the form preview: the square 170px box
 * above is sized for a catalogue thumbnail, and would make a wide slide look
 * like a letterbox of itself.
 */
.image-drop.is-banner img {
    max-width: 100%;
    max-height: 190px;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.gallery-item {
    position: relative;
    width: 86px;
    height: 86px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item label {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 3px 0;
    cursor: pointer;
}

/* ---------------------------------------------------------- order detail */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}
.detail-row { margin-bottom: 9px; }
.detail-row .k {
    display: block;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--mid-gray);
}
.detail-row .v { font-weight: 500; word-break: break-word; }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
    border-left: 2px solid var(--border);
    padding: 0 0 14px 14px;
    position: relative;
}
.history-list li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-red);
}
.history-list li:last-child { border-left-color: transparent; padding-bottom: 0; }

/* ---------------------------------------------------------------- login */

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(160deg, #151515 0%, #000 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    padding: 30px 26px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
}
.login-card .login-logo {
    display: block;
    height: 52px;
    width: auto;
    margin: 0 auto 16px;
}
.login-card h1 {
    font-size: 25px;
    text-align: center;
    margin: 0 0 4px;
}
.login-card .login-sub {
    text-align: center;
    color: var(--mid-gray);
    font-size: 13px;
    margin-bottom: 22px;
}

/* -------------------------------------------------------------- empty */

.admin-empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--mid-gray);
}
.admin-empty h3 { font-size: 20px; color: var(--charcoal); margin-bottom: 6px; }

/* ------------------------------------------------------------ pagination */

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}
.admin-pagination a,
.admin-pagination span {
    min-width: 38px;
    text-align: center;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: #333;
    font-size: 13.5px;
}
.admin-pagination .current {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
    font-weight: 600;
}
.admin-pagination .disabled { opacity: .45; }

/* ----------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .admin-burger { display: block; }

    .admin-sidebar {
        position: fixed;
        top: var(--topbar-h);
        bottom: 0;
        left: 0;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform .22s ease;
        overflow-y: auto;
    }
    .admin-sidebar.open { transform: translateX(0); }

    .admin-main { padding: 18px 14px 50px; }
    .admin-user { display: none; }
}

@media (max-width: 575.98px) {
    .admin-page-head h1 { font-size: 23px; }
    .stat-card .stat-value { font-size: 26px; }
    .admin-topbar-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}