/* ==========================================================================
   Pood Design System — reusable across Landing + Admin
   ========================================================================== */

:root {
    --pood-primary: #fb485c;
    --pood-primary-light: #fd7459;
    --pood-gradient: linear-gradient(135deg, #fb485c 0%, #fd7459 100%);
    --pood-ink: #1c1424;
    --pood-ink-soft: #5c5566;
    --pood-bg: #fffaf8;
    --pood-surface: #ffffff;
    --pood-border: #f0e4e1;
    --pood-success: #1eaa63;
    --pood-warning: #f5a524;
    --pood-radius-sm: 8px;
    --pood-radius-md: 14px;
    --pood-radius-lg: 22px;
    --pood-shadow-sm: 0 2px 8px rgba(28, 20, 36, 0.06);
    --pood-shadow-md: 0 10px 30px rgba(251, 72, 92, 0.14);
    --font-display: 'Sora', 'Manrope', sans-serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--pood-ink);
    background: var(--pood-bg);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

p { margin: 0; line-height: 1.6; color: var(--pood-ink-soft); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; border: none; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons (reusable everywhere) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--pood-gradient);
    color: #fff;
    box-shadow: var(--pood-shadow-md);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(251,72,92,0.24); }
.btn-outline {
    background: transparent;
    color: var(--pood-primary);
    border: 2px solid var(--pood-primary);
}
.btn-outline:hover { background: rgba(251,72,92,0.06); }
.btn-ghost {
    background: transparent;
    color: var(--pood-ink);
    padding: 10px 16px;
    font-weight: 600;
}
.btn-ghost:hover { color: var(--pood-primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card {
    background: var(--pood-surface);
    border: 1px solid var(--pood-border);
    border-radius: var(--pood-radius-md);
    box-shadow: var(--pood-shadow-sm);
}

/* ---------- Forms (reusable across all modules) ---------- */
.form-group { margin-bottom: 18px; text-align: left; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--pood-ink);
}
.form-control {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--pood-radius-sm);
    border: 1.5px solid var(--pood-border);
    font-size: 15px;
    font-family: var(--font-body);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--pood-primary);
    box-shadow: 0 0 0 4px rgba(251,72,92,0.12);
}
.form-error {
    color: var(--pood-primary);
    font-size: 12.5px;
    margin-top: 5px;
    display: none;
}
.form-control.is-invalid { border-color: var(--pood-primary); }
.form-control.is-invalid + .form-error { display: block; }

/* OTP input group (reusable) */
.otp-group { display: flex; gap: 10px; justify-content: center; }
.otp-group input {
    width: 46px; height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border-radius: var(--pood-radius-sm);
    border: 1.5px solid var(--pood-border);
}
.otp-group input:focus { outline: none; border-color: var(--pood-primary); box-shadow: 0 0 0 4px rgba(251,72,92,0.12); }

/* ---------- Toasts (reusable feedback component) ---------- */
#toastStack {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    min-width: 260px;
    padding: 14px 18px;
    border-radius: var(--pood-radius-sm);
    background: var(--pood-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--pood-shadow-md);
    animation: toastIn .25s ease;
}
.toast--success { background: var(--pood-success); }
.toast--error { background: var(--pood-primary); }
.toast--warning { background: var(--pood-warning); color: #1c1424; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px);} to { opacity:1; transform:translateX(0);} }

/* ---------- Badges (reusable) ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge--pink { background: rgba(251,72,92,0.1); color: var(--pood-primary); }
.badge--green { background: rgba(30,170,99,0.1); color: var(--pood-success); }

/* ---------- Modal (reusable) ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(28,20,36,0.5);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--pood-radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    animation: modalIn .2s ease;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--pood-primary) transparent;
}
.modal-box::-webkit-scrollbar { width: 8px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: var(--pood-primary); border-radius: 999px; }
.modal-box::-webkit-scrollbar-thumb:hover { background: var(--pood-primary-dark, var(--pood-primary)); }

/* ---------- Centralized animated API loader ---------- */
/* Injected once by ajaxHelper.js and shown automatically around every
   Pood.ajax() call — no per-call wiring needed anywhere in the app. */
#poodLoaderBar {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    z-index: 99999; pointer-events: none; opacity: 0;
    transition: opacity .2s ease;
    overflow: hidden;
}
#poodLoaderBar.active { opacity: 1; }
#poodLoaderBar .poodLoaderBar__fill {
    position: absolute; top: 0; left: 0; height: 100%; width: 40%;
    background: linear-gradient(90deg, transparent, var(--pood-primary) 15%, var(--pood-primary-light) 50%, var(--pood-primary) 85%, transparent);
    box-shadow: 0 0 10px rgba(251,72,92,0.7);
    animation: poodLoaderSweep 1.05s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes poodLoaderSweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* Small branded pulse badge — appears alongside the bar for calls that run
   long enough to notice, giving a second, friendlier cue than just the bar. */
#poodLoaderBadge {
    position: fixed; top: 14px; right: 16px; z-index: 99999;
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 999px; padding: 7px 14px 7px 10px;
    box-shadow: 0 6px 20px rgba(28,20,36,0.15);
    font-size: 12px; font-weight: 700; color: var(--pood-ink-soft);
    opacity: 0; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
#poodLoaderBadge.active { opacity: 1; transform: translateY(0); }
#poodLoaderBadge .poodLoaderBadge__dot {
    width: 16px; height: 16px; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--pood-primary), var(--pood-primary-light), var(--pood-primary));
    animation: poodLoaderSpin .7s linear infinite;
    position: relative;
}
#poodLoaderBadge .poodLoaderBadge__dot::after {
    content: ""; position: absolute; inset: 3px; background: #fff; border-radius: 50%;
}
@keyframes poodLoaderSpin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    #poodLoaderBadge { top: auto; bottom: 18px; right: 14px; }
}
.modal-close-btn {
    position: sticky; top: -8px; display: flex; margin: -8px -8px 8px auto; z-index: 5;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--pood-bg); color: var(--pood-ink-soft);
    font-size: 18px; line-height: 1; align-items: center; justify-content: center;
    border: none; cursor: pointer;
    box-shadow: 0 2px 6px rgba(28,20,36,0.08);
}
.modal-close-btn:hover { background: var(--pood-border); color: var(--pood-ink); }

/* Reusable confirm dialog (delete confirmations etc.) */
.confirm-dialog { max-width: 380px; text-align: center; }
.confirm-dialog__icon { font-size: 32px; margin-bottom: 10px; }
.confirm-dialog__actions { display: flex; gap: 10px; margin-top: 22px; }
.confirm-dialog__actions .btn { flex: 1; }
@keyframes modalIn { from { opacity:0; transform: translateY(10px) scale(.98);} to {opacity:1; transform: translateY(0) scale(1);} }

/* ---------- Spinner (reusable) ---------- */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

@media (max-width: 640px) {
    .container { padding: 0 18px; }
}

/* Respects the OS-level "reduce motion" setting — matters most on mobile,
   where most of our traffic actually is, since it's tied to battery saver
   and accessibility settings people already have on for a reason. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ---------- Dashboard stat cards ----------
   Dashboard.cshtml has always referenced these classes, but no CSS file
   loaded on that page ever defined them (they only existed, unstyled for
   this purpose, in superadmin.css) — this was rendering as bare unstyled
   divs. Fixed here, in the right file, with the store admin's own brand
   colors rather than borrowing the superadmin blue accent. */
.sa-stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px;
    margin-bottom: 20px;
}
.sa-stat-card {
    background: #fff; border: 1px solid var(--pood-border); border-radius: var(--pood-radius-md);
    padding: 18px 20px; transition: transform .15s ease, box-shadow .15s ease;
}
.sa-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28,20,36,0.06); }
.sa-stat-card__label { font-size: 12px; color: var(--pood-ink-soft); font-weight: 700; display: block; margin-bottom: 8px; }
.sa-stat-card__value { font-size: 26px; font-family: var(--font-display); font-weight: 800; color: var(--pood-primary); }
@media (max-width: 480px) {
    .sa-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sa-stat-card { padding: 14px 16px; }
    .sa-stat-card__value { font-size: 21px; }
}

/* Global order-alert popup — moved here from orders-admin.css since the
   markup now lives in _AdminLayout and renders on every admin page, but
   orders-admin.css only loads on the Orders page — left unstyled (and
   visible by default, a <div> with no CSS) everywhere else. */
.notify-backdrop {
    position: fixed; inset: 0; background: rgba(28,20,36,0.65); z-index: 500;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.notify-backdrop.active { display: flex; }
.notify-box {
    background: #fff; border-radius: var(--pood-radius-lg); padding: 0; max-width: 400px; width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35); overflow: hidden; animation: notifyPop .3s cubic-bezier(.34,1.56,.64,1);
    position: relative;
}
@keyframes notifyPop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.notify-box__header {
    background: var(--pood-gradient); color: #fff; padding: 20px 24px; text-align: center;
    animation: notifyFlash 1s ease-in-out infinite;
}
@keyframes notifyFlash { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
.notify-box__header .icon { font-size: 30px; display: block; margin-bottom: 6px; }
.notify-box__header h3 { color: #fff; font-size: 17px; }
.notify-box__body { padding: 20px 24px; }
.notify-box__row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--pood-border); font-size: 13.5px; }
.notify-box__row strong { text-align: right; }
.notify-box__amount { text-align: center; margin: 14px 0; }
.notify-box__amount strong { font-size: 26px; color: var(--pood-primary); font-family: var(--font-display); display: block; }
.notify-box__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.notify-box__actions .btn { width: 100%; }
.notify-box__secondary-row { display: flex; gap: 8px; }
.notify-box__secondary-row .btn { flex: 1; font-size: 12.5px; padding: 9px; }
.notify-box__mute-row { text-align: center; margin-top: 12px; }
.notify-box__mute-row a { font-size: 12px; color: var(--pood-ink-soft); text-decoration: underline; }
.notify-queue-badge {
    position: absolute; top: -10px; right: -10px; background: var(--pood-ink); color: #fff;
    font-size: 11px; font-weight: 800; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   AJAX in-app navigation loader — full-screen backdrop, shown only during
   sidebar-driven page swaps, never during a real browser navigation/refresh.
   ========================================================================== */
.pood-navloader {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(255, 250, 248, 0.85);
    backdrop-filter: blur(2px);
    display: none; align-items: center; justify-content: center;
}
.pood-navloader.active { display: flex; }
.pood-navloader__spinner {
    width: 52px; height: 52px; border-radius: 50%;
    border: 4px solid rgba(251, 72, 92, 0.15);
    border-top-color: var(--pood-primary);
    animation: poodNavSpin 0.7s linear infinite;
}
@keyframes poodNavSpin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Reusable tab component — one consistent look across every admin page that
   needs tabs (WhatsApp, Partnership, Tax Compliance, etc.) instead of each
   page inventing its own ad-hoc button row.
   ========================================================================== */
.pood-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--pood-border); padding-bottom: 0; }
.pood-tab-btn {
    background: none; border: none; padding: 10px 18px; font-size: 13.5px; font-weight: 700;
    color: var(--pood-ink-soft); cursor: pointer; border-radius: var(--pood-radius-sm) var(--pood-radius-sm) 0 0;
    position: relative; top: 1px; transition: color .15s ease, background .15s ease;
}
.pood-tab-btn:hover { background: var(--pood-bg); color: var(--pood-ink); }
.pood-tab-btn.active { color: var(--pood-primary); border-bottom: 2px solid var(--pood-primary); }
.pood-tab-panel { animation: poodTabFadeIn .15s ease; }
@keyframes poodTabFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Generous, consistent spacing inside tab panels regardless of which page uses them */
.pood-tab-panel .form-group { margin-bottom: 18px; }
.pood-tab-panel h3 { margin-bottom: 6px; }
.pood-tab-panel h3 + .field-hint { margin-bottom: 18px; }
.pood-tab-panel .card-section-divider { border-top: 1px solid var(--pood-border); padding-top: 20px; margin-top: 24px; }

/* ---------- Plan-gate upgrade banner (shared across every gated module) ---------- */
.pood-plan-gate-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(251,72,92,0.1) 0%, rgba(253,116,89,0.1) 100%);
    border: 1px solid rgba(251,72,92,0.25); border-radius: var(--pood-radius-md);
    padding: 12px 16px; margin: 16px 0; font-size: 13.5px; font-weight: 600; color: var(--pood-ink);
}
.pood-plan-gate-disabled { opacity: 0.45; cursor: not-allowed !important; pointer-events: none; }

/* ==========================================================================
   Global fallback defaults — cards and tables that don't have their own
   page-specific styling still get consistent spacing/design instead of
   looking flush/unstyled. Deliberately low-specificity (bare element/class
   selectors, not chained) so any page's own more specific rules (.cust-table,
   .bulk-table, etc.) still win via normal CSS cascade — this only fills the
   gap where nothing more specific exists, not for every table going forward.
   New pages should still prefer .data-table below over a bare <table>.
   ========================================================================== */
.card { padding: 20px; }

#adminPageBody table {
    width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff;
    border: 1px solid var(--pood-border); border-radius: var(--pood-radius-md); overflow: hidden;
}
#adminPageBody table th {
    text-align: left; padding: 10px 14px; background: var(--pood-bg); font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; color: var(--pood-ink-soft); white-space: nowrap;
}
#adminPageBody table td { padding: 12px 14px; border-top: 1px solid var(--pood-border); vertical-align: middle; }
#adminPageBody table tr:hover td { background: var(--pood-bg); }

/* Opt-in class for any NEW table going forward — same visual result as the
   fallback above, but explicit rather than relying on a bare <table> tag. */
.data-table-wrap { background: #fff; border: 1px solid var(--pood-border); border-radius: var(--pood-radius-md); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
    text-align: left; padding: 10px 14px; background: var(--pood-bg); font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; color: var(--pood-ink-soft); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--pood-border); vertical-align: middle; }
.data-table tr:hover td { background: var(--pood-bg); }
.ob-check-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--pood-border); border-radius: var(--pood-radius-md); margin-bottom: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ob-check-row input { width: 18px; height: 18px; }

.ob-category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ob-cat-tile {
    border: 2px solid var(--pood-border); border-radius: var(--pood-radius-md); padding: 16px 12px;
    text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; font-size: 13px; font-weight: 700;
}
.ob-cat-tile:hover { border-color: var(--pood-primary); }
.ob-cat-tile.selected { border-color: var(--pood-primary); background: rgba(251,72,92,0.06); color: var(--pood-primary); }

.ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }

.cd-report-grid { border: 1px solid var(--pood-border); border-radius: var(--pood-radius-md); overflow: hidden; }
.cd-dns-row { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 13px; }
.cd-dns-row:not(:last-child) { border-bottom: 1px solid var(--pood-border); }
.cd-dns-row span:last-child { font-weight: 700; }