/* Talabat Admin: DoorDash-style ops portal (matches the mobile apps' core_ui
   palette: brand red #EB1700, near-black ink, white surfaces, pill buttons). */

:root {
    --brand: #eb1700;
    --brand-pressed: #c21400;
    --brand-soft: #fdecea;
    --ink: #191919;
    --muted: #6b6b6b;
    --bg: #f7f7f7;
    --surface: #ffffff;
    --fill: #f1f1f1;
    --border: #e7e7e7;
    --success: #00838a;
    --success-soft: #e3f4f4;
    --warning: #b36b00;
    --warning-soft: #fff4e0;
    --info: #1f5eff;
    --info-soft: #e9efff;
    --danger: #d91400;
    --danger-soft: #fdecea;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
    --sidebar: 248px;
    --header: 64px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ---- shell: sidebar (left, full height) + header (top of content) + body ---- */

[nav] {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    z-index: 20;
    overflow-y: auto;
}

[header] {
    position: fixed;
    top: 0;
    left: var(--sidebar);
    right: 0;
    height: var(--header);
    z-index: 15;
}

[body] {
    margin-left: var(--sidebar);
    padding-top: var(--header);
    min-height: 100vh;
}

/* ---- sidebar ---- */

.admin-nav {
    min-height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 12px 24px;
    display: flex;
    flex-direction: column;
}

.admin-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 20px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.3px;
}

.admin-nav__logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 18px;
}

.admin-nav__brand small {
    display: block;
    font-weight: 600;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0;
}

.admin-nav__group {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: 16px 12px 6px;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
    transition: background .12s;
}

.admin-nav__link svg {
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-nav__link.is-hidden,
.admin-nav__group.is-hidden {
    display: none;
}

.admin-nav__link:hover {
    background: var(--fill);
}

.admin-nav__link.active {
    background: var(--brand-soft);
    color: var(--brand);
}

/* ---- header ---- */

.admin-header {
    height: var(--header);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.admin-header__brand {
    font-weight: 700;
    font-size: 15px;
    color: var(--muted);
}

.admin-header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.admin-header__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.admin-header__who {
    line-height: 1.25;
}

.admin-header__who strong {
    display: block;
    font-size: 13px;
}

.admin-header__role {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    text-transform: capitalize;
}

.admin-header__signout {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.admin-header__signout:hover {
    background: var(--fill);
}

/* ---- page ---- */

.admin-page {
    padding: 28px 32px 48px;
    max-width: 1240px;
}

.admin-page__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-page h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 20px;
}

.admin-page__head h1 {
    margin: 0;
}

.admin-page__sub {
    color: var(--muted);
    margin: -14px 0 20px;
}

.dash-subhead,
.marketing-subhead {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.2px;
    margin: 32px 0 12px;
}

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

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.stat-card__value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.stat-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 4px;
}

.stat-card--p0 .stat-card__value {
    color: var(--brand);
}

.tracker-banner {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.tracker-banner a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

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

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.admin-table th {
    background: #fbfbfb;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.admin-table tbody tr:hover td {
    background: #fcfcfc;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--fill);
    color: var(--ink);
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .8;
}

.badge--open,
.badge--ok {
    background: var(--success-soft);
    color: var(--success);
}

.badge--closed,
.badge--bad {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge--warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge--info {
    background: var(--info-soft);
    color: var(--info);
}

/* ---- buttons ---- */

.admin-btn {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
}

.admin-btn:hover {
    background: var(--brand-pressed);
}

.admin-btn:disabled {
    background: var(--fill);
    color: var(--muted);
    cursor: default;
}

.admin-btn--dark {
    background: var(--ink);
}

.admin-btn--dark:hover {
    background: #000;
}

.admin-btn--ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.admin-btn--ghost:hover {
    background: var(--fill);
}

.admin-btn-sm {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.admin-btn-sm:hover {
    background: var(--fill);
}

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

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.admin-form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.admin-form__row input,
.admin-form__row select,
.admin-form__row textarea,
.auth-input {
    width: 100%;
    background: var(--fill);
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 11px 14px;
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    outline: none;
}

.admin-form__row input:focus,
.admin-form__row select:focus,
.admin-form__row textarea:focus,
.auth-input:focus {
    border-color: var(--ink);
    background: var(--surface);
}

.admin-form__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.admin-form__checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

.admin-form__error,
.auth-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

.admin-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.admin-form__divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.admin-order__summary,
.dispute-note,
.admin-refund-inline {
    background: var(--fill);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}

/* ---- modals (LumenJS popup: [pop-c] card, [pop-h] header, [pop-b] body) ---- */

popup {
    background: rgba(25, 25, 25, .45) !important;
}

[pop-c] {
    max-width: 560px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
    text-align: left;
    overflow: hidden;
}

[pop-h] {
    background: var(--surface);
    padding: 18px 22px 10px;
    align-items: center;
}

[pop-t] {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.3px;
}

[pop-d] {
    color: var(--muted);
    font-size: 13px;
}

[pop-x] {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--fill);
    display: grid;
    place-items: center;
    cursor: pointer;
}

[pop-b] {
    padding: 8px 22px 22px;
}

/* ---- sign-in ---- */

.auth-wrap {
    /* V2 always renders the nav/header regions (empty on this view), so
       cover them rather than relying on [body] being the only child. */
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow-y: auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface);
}

.auth-wrap::before {
    content: "";
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .18), transparent 40%),
        linear-gradient(135deg, #eb1700, #b31200);
}

.auth-card {
    align-self: center;
    justify-self: center;
    width: 100%;
    max-width: 380px;
    padding: 32px;
}

.auth-card h1,
.auth-card h2 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.6px;
    margin: 0 0 6px;
}

.auth-btn {
    width: 100%;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

.auth-btn:hover {
    background: var(--brand-pressed);
}

.auth-back {
    background: none;
    border: 0;
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 14px;
}

.auth-code-input {
    letter-spacing: .5em;
    font-size: 20px;
    text-align: center;
}

@media (max-width: 900px) {
    :root {
        --sidebar: 0px;
    }

    [nav] {
        display: none;
    }

    .admin-page {
        padding: 20px 16px 40px;
    }

    .auth-wrap {
        grid-template-columns: 1fr;
    }

    .auth-wrap::before {
        display: none;
    }
}

/* Phones: wide tables scroll sideways inside their own box instead of
   widening the whole page (2026-10-07). */
@media (max-width: 900px) {
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 2026-10-07: secondary line under a table cell (e.g. refunded amount) */
.admin-muted {
    color: var(--muted);
    font-size: 0.85em;
}
