/* ============================================
   Dashboard Styles - public/assets/css/dashboard.css
   ============================================ */
 html {
        /* body dropped from this rule: overflow (even x-only) on body
           breaks position:sticky for its descendants -- html alone is
           enough to prevent the horizontal scrollbar. */
        overflow-x: hidden;
    }
/* Dashboard Navigation */
.dashboard-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    width: 100%;
}

.nav-wrapper,
.nav-dashboard {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search bar + notification bell added to the admin/vendor/customer
   dashboard nav -- same markup/IDs and the same .search-bar/.search-results
   base rules from main.css, just themed for this white/blue dashboard nav
   instead of reusing editorial.css's navy/gold theme (which only resolves
   its colors under body.editorial and would render blank here). */
.dash-search-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 320px;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: var(--ed-ink);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.dash-search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.88rem;
    width: 100%;
    color: var(--text-dark);
}

.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.05rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.nav-icon-btn:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.nav-icon-btn .icon-badge {
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 900px) {
    /* Matches the existing pattern for this nav: search is a "nice to
       have" on a wide dashboard screen, but there isn't room for it next
       to the sidebar toggle, home button, and user menu once things get
       narrow -- and the search bar was the concrete cause of the
       previous mobile-header overflow/clipping bug elsewhere in this
       nav, so it's hidden rather than left to fight for space. */
    .dash-search-bar {
        display: none;
    }
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: var(--transition);
}
.home-desktop{
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffff;
}

.user-menu-btn:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

/* An uploaded avatar is whatever size the visitor chose and main.css only caps
   images at max-width, so with no box here a 2000px photo filled the dashboard.
   The upload handlers in the profile pages inject a bare <img class="user-avatar">
   too, so the size has to live in CSS rather than inline on the markup. */
.user-avatar,
.user-avatar-placeholder {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.user-dropdown a i {
    width: 20px;
}

/* ---------------------------------------------------------
   Dashboard layout -- real CSS Grid instead of magic-number
   left/top offsets. Previously .dashboard-sidebar was
   position:fixed and .dashboard-main used left:110px;
   top:50px; width:80% to manually dodge it -- any change to
   sidebar width, nav height, or content length broke that
   math and caused overlap. Grid sizes both columns
   correctly regardless of content.
   --------------------------------------------------------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
    padding-top: 64px; /* clears the fixed nav */
    background: var(--bg-secondary);
}

.dashboard-sidebar {
    grid-column: 1;
    width: 100%;
    background: #fff;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    transform: none;
    transition: none;
    z-index: 10;
}

.sidebar-menu {
    padding: 1.25rem 0.75rem;
}
.menu-text{
    display: block !important;
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.9rem;
    color: var(--text-light);
    border-left: none;
    border-radius: var(--radius-md);
    margin: 0.15rem 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item i {
    width: 20px;
    font-size: 1.05rem;
    text-align: center;
}

.menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
    border-left: none;
}

.menu-item.active {
    background: rgba(26, 115, 232, 0.08);
    color: var(--primary);
    border-left: none;
    font-weight: 600;
}

.dashboard-main {
    grid-column: 2;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: static;
    /* Grid items default to min-width:auto, which floors their size at
       their content's min-content width -- so a non-wrapping filter row
       or a wide table inside here was silently forcing this whole
       column (and with it the page) wider than the viewport on mobile,
       instead of respecting the 1fr grid track and letting the
       table/.card-body's own overflow-x:auto handle it locally. This
       is what caused the horizontal scroll/cut-off content on mobile
       (Manage Products and similar pages). min-width:0 lets this
       column actually shrink to the track's real width again. */
    min-width: 0;
}

/* Mobile: sidebar becomes an off-canvas drawer again */
@media (max-width: 991px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar {
        grid-column: 1;
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-xl);
    }
    .dashboard-sidebar.active { transform: translateX(0); }
    .dashboard-main { grid-column: 1; }
}

/* Dashboard Header */
/* Consolidated: this used to be declared three times in this file (here,
   under "Vendor Add Product Page", and under "Customer Product Listing
   Page") with different align-items/margin/border values each time. Only
   the last one in the cascade ever actually rendered -- the other two
   were dead weight that made it look like editing this rule wouldn't
   affect the whole site, when it does. Merged to the values that were
   actually winning, so there's one place to change it. */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.dashboard-header p {
    color: #666;
    margin-top: .25rem;
    font-size: .9rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}
.mobile-only {
        display: none !important;
    }
/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: none;
    display: flex;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    /* Individual pages set an inline background per stat (revenue,
       orders, etc); this just gives sensible tinted defaults so an
       icon never renders on a plain white box with no color at all. */
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary);
}

.stat-details {
    flex: 1;
}

.stat-details h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.2rem;
}

.stat-details p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stat-details small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-link:hover {
    gap: 0.75rem;
}

/* Card */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: none;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
    overflow-x: auto;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    /* Was a solid --primary band with white uppercase text. A filled
       header row is the loudest element on every list page and says
       nothing about the data; the column labels do the work. */
    background: var(--surface-3);
    border-bottom: 1px solid var(--line-strong);
}

.table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--ink-500);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-700);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ---------------------------------------------------------
   Mobile: tables become stacked cards instead of a cramped,
   horizontally-scrolling grid.

   Below this breakpoint, every `.table` row switches from a normal
   table row to a small bordered card, and each cell becomes its own
   "label: value" line -- the label comes from that column's <th> text,
   copied onto the cell as a data-label attribute by
   site/assets/js/responsive-tables.js (see that file for why this is
   done in JS rather than by hand-editing every table's markup).

   This intentionally keeps every column's data visible and readable
   rather than hiding "less important" columns on mobile -- for admin
   screens especially (Orders, Payouts, Unpaid Items) the columns that
   feel secondary on desktop are often exactly the ones someone's
   double-checking from a phone.
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: visible; /* no longer needed -- rows stack instead of scrolling sideways */
    }

    .table thead {
        /* Column headers are replaced by each cell's own data-label,
           so the header row itself is redundant on this layout. */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md, 8px);
        margin-bottom: 1rem;
        padding: 0.25rem 0;
        box-shadow: var(--shadow-sm);
    }

    .table tr:last-child {
        margin-bottom: 0;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.6rem 1rem;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

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

    .table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        color: var(--text-light);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
    }

    /* A cell with no data-label (colspan cells, e.g. an empty-results
       row) -- don't show a bare bullet for a label that doesn't exist. */
    .table td:not([data-label])::before {
        content: none;
    }

    /* Cells whose value is itself multi-line (e.g. a customer's name
       above their email) or contains action buttons read better
       left-aligned and stacked under the label than squeezed to the
       right of it. */
    .table td:has(> div),
    .table td:has(.btn) {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 0.35rem;
    }
}

/* Status-update rows (order details, message details) -- a label+select
   next to an action button, sized so the button never stretches full
   width inside a flex/grid container. */
.status-update-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.status-update-field {
    display: flex;
    flex-direction: column;
    width: 220px;
    max-width: 100%;
}
.status-update-row .btn {
    flex: none;
    align-self: flex-end;
}
.order-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.order-summary-grid .summary-label {
    display: block;
    font-size: .8rem;
    color: #6b7280;
    margin-bottom: .15rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-processing {
    background: #cfe2ff;
    color: #084298;
}

.badge-shipped {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-delivered {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-cancelled {
    background: #f8d7da;
    color: #842029;
}

.badge-approved {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-rejected {
    background: #f8d7da;
    color: #842029;
}

.badge-success {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-active {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-paid {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-failed {
    background: #f8d7da;
    color: #842029;
}

/* Warning badge for unpaid/vendor-unpaid state */
.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-suspended {
    background: #f8d7da;
    color: #842029;
}

.badge-payment_pending_verification {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* Role badges (admin/customers, admin/users) */
.badge-role-admin {
    background: #e2d9f3;
    color: #4c2a85;
}

.badge-role-vendor {
    background: #cfe2ff;
    color: #084298;
}

.badge-role-customer {
    background: #d1e7dd;
    color: #0f5132;
}

/* Small helper for vendor paid badge alignment */
.vendor-paid-badge {
    min-width: 80px;
    text-align: center;
    display: inline-block;
}

/* Empty State -- was declared a second time further down (under "Products
   List Section") with different padding/icon-size/color values; that later
   one always won the cascade so this copy never actually rendered. Removed
   here rather than left as dead, misleading weight. */

.empty-state-sm {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-sm i {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state-sm p {
    color: var(--text-light);
}

/* Filters */
.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    /* Was `color: #ffff`, which is not a valid colour -- the
       declaration was discarded and the at-rest label inherited a
       white text colour, so every inactive filter rendered as an
       empty pill. */
    color: var(--ink-600);
    background: var(--surface);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.filter-btn:hover {
    border-color: var(--ink-400);
    color: var(--ink-900);
    background: var(--surface-3);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--action-ring);
    outline-offset: 2px;
}

.filter-btn.active {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: #fff;
    font-weight: 600;
}

.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* On mobile, stack each filter one-per-row instead of an uneven 2-up
   wrap (which is what you get from flex-wrap alone once .dashboard-main
   can actually shrink to the screen width -- see the min-width:0 fix
   above). Full-width fields and a full-width submit button are also
   easier to tap accurately than half-width ones. */
@media (max-width: 600px) {
    .filters-row > .form-group {
        flex: 1 1 100%;
    }
    .filters-row > .btn {
        width: 100%;
    }
}

.search-form-inline {
    display: flex;
    gap: 0.5rem;
}

.filters-form .form-row {
    display: flex;
    gap: .1rem;
    flex-wrap: wrap;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form helpers */
.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--danger);
    background: #fff5f5;
}

/* ---------------------------------------------------------
   Product forms (add/edit) -- sections, affixed inputs, and
   the drag/drop image uploader. The markup for these already
   existed (form-section, input-affix, upload-dropzone, etc.)
   but had no matching CSS at all, so it rendered as plain
   unstyled divs/labels.
   --------------------------------------------------------- */
.form-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.form-section:first-child { padding-top: 0; }
.form-section:last-of-type { border-bottom: none; padding-bottom: 0.5rem; }

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}
.form-section-title i { color: var(--primary); font-size: 0.95rem; }
.form-section-subtitle {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.req { color: var(--danger); margin-left: 2px; }

.form-hint {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.char-count {
    text-align: right;
    color: var(--text-light);
    font-size: 0.78rem;
    margin-top: 0.35rem;
}
.char-count.is-near-limit { color: var(--danger); font-weight: 600; }

/* Price-with-currency-prefix inputs (the "K" affix) */
.input-affix {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}
.input-affix:focus-within { border-color: var(--primary); }
.input-affix .affix {
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-light);
    font-weight: 600;
    border-right: 1px solid var(--border-color);
}
.input-affix .form-input {
    border: none;
    border-radius: 0;
    flex: 1;
}
.input-affix .form-input:focus { box-shadow: none; }

/* Drag/drop image uploader */
.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}
.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--primary);
    background: rgba(26, 115, 232, 0.04);
}
.upload-dropzone i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}
.upload-dropzone strong { color: var(--dark); }
.upload-dropzone .form-hint { margin-top: 0.25rem; }

.upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.upload-thumb {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb .primary-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 115, 232, 0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 2px 0;
}
.upload-thumb .remove-thumb {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-thumb .remove-thumb:hover { background: var(--danger); }

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-actions .btn {
    min-width: 140px;
}

/* Image previews for product uploads */
.image-previews {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.image-previews .preview-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.row{
    display: flex;
    justify-content: space-between;
}
.row button{
    padding: 10px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-left: 3px solid #be0013;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffecb5;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Product Info in Table */
.product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-info img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.product-placeholder {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* Vendor Info */
.vendor-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vendor-info img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.vendor-placeholder {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* Order Card */
.order-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.order-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-header h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.order-body {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.order-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

/* Profile */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-avatar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.profile-avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-light);
    margin: 0 auto 1rem;
}

.profile-info {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.profile-info h3 {
    margin-bottom: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.action-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.action-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Earnings */
.earnings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.earning-item {
    text-align: center;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.earning-item:last-child {
    border-right: none;
}

.earning-label {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.earning-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.earning-orders {
    font-size: 0.875rem;
    color: var(--text-light);
}

.earnings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.earning-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.earning-card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.earnings-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

/* Status Select */
.status-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

/* Vendor/Order Lists */
.vendor-list,
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vendor-item,
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.vendor-actions {
    display: flex;
    gap: 0.5rem;
}

.order-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Top Lists */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.rank {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
}

.item-stats {
    text-align: right;
}

/* ============================
   Vendor Add Product Page
   Clean, Modern, Glass UI
=============================== */

.btn {
    padding: .55rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .9rem;
    cursor: pointer;
    transition: .25s ease;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.btn-primary {
    background: #2b6cb0;
    border: none;
    color: white !important;
}

.btn-primary:hover {
    background: #225fa0;
}

.btn-outline {
    border: 1px solid #aaa;
    background: transparent;
    color: #333;
}

.btn-outline:hover {
    background: #eee;
    color: #0056a7;
}

/* .btn-danger and .btn-secondary are already defined in main.css (which
   loads before this file) -- .btn-success/.btn-warning/.btn-info were
   used across ~18 admin/vendor/customer views (Approve, Mark Paid, Mark
   Refunded, Mark Received, Activate, Submit Review, etc.) with no CSS
   backing them at all, so those buttons rendered with no color -- just
   default/transparent, no visual sense that they're a positive/caution
   action. Reusing the same palette as the rest of the app rather than
   inventing new colors. */
.btn-success {
    background: var(--secondary);
    border: none;
    color: white;
}

.btn-success:hover {
    background: #2d8e46;
}

.btn-warning {
    background: var(--accent);
    border: none;
    color: #1a1a2e;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #0dcaf0;
    border: none;
    color: #aeb0b1;
}

.btn-info:hover {
    background: #0aa8c9;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: .35rem;
    font-size: .9rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
    padding: .6rem .7rem;
    font-size: .95rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    transition: .25s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .2);
}

/* Alerts */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-danger {
    background: #ffe5e7;
    color: #b72020;
}

/* Form Actions */
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* Image Preview Styling */
.image-previews img {
    border-radius: 6px;
    width: 96px;
    height: 96px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: .25s ease;
}

.image-previews img:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 600px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* =============================
   Customer Product Listing Page
   Clean, Modern Marketplace UI
================================ */

/* Header + Search */
.search-inline {
    display: flex;
    gap: .5rem;
}

.search-inline input {
    padding: .55rem .9rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 220px;
    font-size: .9rem;
    transition: .25s ease;
}

.search-inline input:focus {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .2);
}

/* Layout */
.products-grid-layout {
    display: flex;
    gap: 2rem;
}

/* Sidebar */
.products-sidebar {
    width: 240px;
    background: rgba(255, 255, 255, 0.65);
    padding: 1.25rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    height: fit-content;
}

.products-sidebar h4 {
    margin-bottom: .5rem;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.sidebar-list li {
    margin-bottom: .35rem;
}

.sidebar-list a {
    text-decoration: none;
    color: #333;
    padding: .35rem .4rem;
    display: block;
    border-radius: 4px;
    transition: .25s;
}

.sidebar-list a:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Products List Section */
.products-list {
    flex: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: #999;
}

.empty-state h3 {
    margin-top: 1rem;
    font-size: 1.4rem;
}

.empty-state p {
    color: #666;
    font-size: .95rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    /* auto-fit, not auto-fill -- see the matching note in editorial.css.
       Keeps this in sync so any page using dashboard.css's grid alone
       (without the editorial overrides) doesn't reintroduce the same
       dead-space bug. */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}

/* Product Card */
.product-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    overflow: hidden;
    transition: .3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

/* Product Image */
.product-image {
    display: block;
    width: 100%;
    height: 180px;
    background: #f3f3f3;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Placeholder */
.product-placeholder {
    width: 100%;
    height: 100%;
    background: #e3e3e3;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.3rem;
    color: #666;
}

/* Product Body */
.product-body {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    margin-bottom: .3rem;
}

.product-title a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.product-price {
    font-size: 1.1rem;
    font-weight: bold;
    margin: .4rem 0 .8rem;
}

/* Product Actions */
.product-actions {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
}

.btn-sm {
    padding: .45rem .7rem;
    font-size: .85rem;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
    display: flex;
    gap: .4rem;
    justify-content: center;
}

/* FOOTER */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1rem;
}
/* Responsive Adjustments */
@media (max-width: 900px) {
    .products-grid-layout {
        flex-direction: column;
    }

    .products-sidebar {
        width: 100%;
    }
}
/* Checkout Progress */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.progress-step.completed .step-icon {
    background: var(--secondary);
    color: white;
}

.progress-step.active .step-icon {
    background: var(--primary);
    color: white;
    animation: pulse 2s infinite;
}

.progress-line {
    width: 80px;
    height: 2px;
    background: var(--border-color);
    margin: 0 1rem;
}

.progress-line.completed {
    background: var(--secondary);
}

/* Checkout Container */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

.checkout-forms {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checkout-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
}

.badge-required {
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.section-body {
    padding: 1.5rem;
}

/* Payment Methods */
.payment-methods {
    display: grid;
    gap: 1rem;
}

.payment-option {
    cursor: pointer;
    display: block;
}

.payment-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.payment-option input:checked + .payment-card {
    border-color: var(--primary);
    background: rgba(26, 115, 232, 0.05);
}

.payment-option:not(.disabled):hover .payment-card {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.payment-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.payment-details {
    flex: 1;
}

.payment-details strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.payment-details p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.payment-check {
    font-size: 1.5rem;
    color: var(--text-light);
    transition: var(--transition);
}

.payment-option input:checked + .payment-card .payment-check {
    color: var(--primary);
}

.payment-details-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Order Summary Sidebar */
.order-summary-sidebar {
    position: relative;
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.summary-card.sticky {
    position: sticky;
    top: 100px;
}

.summary-header {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
}

.item-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.summary-items {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.summary-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.summary-item:hover {
    background: var(--bg-secondary);
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-details strong {
    font-size: 0.95rem;
    line-height: 1.3;
}

.item-details small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.item-qty {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

.item-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-price strong {
    font-size: 1rem;
    color: var(--primary);
}

.item-price small {
    font-size: 0.75rem;
    color: var(--text-light);
}

.summary-calculations {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.calc-row span {
    color: var(--text-light);
}

.summary-total {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total span {
    font-size: 1.125rem;
    font-weight: 600;
}

.total-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

.trust-badge i {
    font-size: 1.25rem;
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .summary-card.sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    .checkout-progress {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .progress-line {
        width: 50px;
    }
}
/* Responsive */
@media (max-width: 1024px) {
    /* .dashboard-layout / .dashboard-sidebar are intentionally NOT touched
       here anymore -- this used to set flex-direction:column (meaningless
       on a grid container) and position:static on the sidebar, which
       executes later in the cascade than the correct off-canvas drawer
       rules at 991px above and was silently overriding them for any
       screen in the 768-991px range, breaking the mobile sidebar. */

    .profile-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
   .dashboard-main {
    padding: 2rem;
    margin: 0 auto;
    width: 100%;
    position: relative;
    left: 0px;
}

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Additional styles for admin add form and vendor order status */
.admin-add-form .form-group {
    margin-bottom: 1rem;
}

.admin-add-form .form-actions {
    justify-content: flex-start;
}

.status-select {
    min-width: 140px;
}

.badge {
    text-transform: none;
}


 .bm{
        display: block !important;

    }
     .bm img{
        display: block !important;

    }
/* Show sidebar normally on larger screens */
/* Desktop sidebar behavior now lives in the .dashboard-layout grid rule
   above (position:sticky) -- the old position:relative override here
   fought with it, so it's removed rather than left dead. */

/* ======================================= */
/* Admin dashboard -- small-screen tweaks   */
/* ======================================= */
/* Sidebar open/close (position, left, transform, width, z-index) is
   handled entirely by the single .dashboard-sidebar / .dashboard-sidebar.active
   pair in the "Mobile: sidebar becomes an off-canvas drawer again" rule
   above (max-width: 991px). Everything below is cosmetic-only for
   narrower screens and deliberately does NOT re-declare position/left/
   transform on .dashboard-sidebar/.dashboard-layout/.dashboard-main --
   three overlapping legacy blocks used to do that here (at 567px, and
   again in a second "RESPONSIVE ADMIN HEADER & SIDEBAR" section at
   1024/768/480px), each setting a different combination of those
   properties. Whichever one won the cascade at a given width would
   often leave a lingering transform/position that kept the drawer
   off-screen even after .active was added -- the toggle button would
   flip its icon and the class would be there, but nothing visible
   would open. Consolidated to one rule, this can't happen again. */

@media (max-width: 768px) {
    .dashboard-nav {
        padding: 0 10px;
    }
    .dashboard-nav .logo span {
        font-size: 1.1rem;
    }
    .dashboard-nav .logo i {
        font-size: .8rem;
    }

    /* Hide the 'Home' link text and user-menu name so the nav fits */
    .dashboard-nav .nav-links span,
    .dashboard-nav .user-menu .desktop-only,
    .desktop-only,
    .dashboard-nav .user-menu-btn .fa-chevron-down {
        display: none !important;
    }
    .bm { display: block !important; }
    .bm img {
        width: 50px;
        position: relative;
        bottom: .4em;
    }
    .mobile-only { display: block !important; }

    .dashboard-nav .nav-auth { display: none; }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: inherit;
        font-size: 1.4rem;
        cursor: pointer;
        margin-left: 10px;
    }

    .user-menu-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 200px;
    }

    .card { padding: 15px; width: 100%; }
    .card-body { padding: 0; overflow-x: auto; }
    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        color: white;
        flex-shrink: 0;
    }

    .stats-grid { grid-template-columns: 1fr; gap: 15px; }
    .dashboard-grid { grid-template-columns: 1fr; }

    table { font-size: 13px; }
    table th, table td { padding: 8px; }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .dashboard-nav .logo strong { display: none; }
    .user-menu-btn span { display: none; }
    .stat-card { padding: 15px; }
    .stat-card h3 { font-size: 20px; }
    .btn { padding: 8px 15px; font-size: 13px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* Fix user dropdown positioning */
@media (max-width: 768px) {
    .nav-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .user-dropdown {
        position: fixed;
        top: 60px;
        right: 10px;
        left: auto;
    }
}   

/* ============================================
   Vendor Action Modal Styles
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Navy-tinted scrim, not black. It dims the page so the dialog
       reads as the front window without a blur pass behind it. */
    background: rgba(15, 27, 61, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-pop);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.modal-sm {
    max-width: 400px;
}

/* The header used to be a filled blue band with white type, which made
   every dialog look like the same alert regardless of what it asked.
   Quiet header, title carries the meaning. */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close,
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--ink-400);
    opacity: 0.85;
    transition: opacity 0.2s;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.close-btn:hover {
    opacity: 1;
    color: #ffffff;
}

.modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

.modal-icon {
    margin-bottom: 1rem;
}

.modal-body p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-body strong {
    color: var(--primary-color, #2563eb);
}

.text-muted {
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
    display: block;
    margin-top: 0.5rem;
}

/* Settings page: label/value pairs laid out in a responsive grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.settings-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.25rem;
}

.settings-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    word-break: break-word;
}

.settings-item code {
    background: var(--bg-secondary, #f3f4f6);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================
   Pagination Improvements
   ============================================ */

.pagination-top,
.pagination-bottom {
    margin: 1rem 0;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.page-item {
    display: inline-block;
}

.page-item.disabled .page-link {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.page-link:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Stock Status Colors */
.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

/* Product Info Layout */
.product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-info img,
.product-placeholder {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.product-info small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* The old mobile strategy for tables was to force a wide min-width here
   and let .products-table-container/.table-responsive scroll sideways.
   That's now superseded by the stacked-card transform above (see the
   big ".table" block earlier in this file, under the same 768px
   breakpoint) -- min-width:800px on .table would have fought that
   directly, undoing display:block/width:100% and dragging every table
   back out to 800px wide regardless of screen size. */
/* ============================================================
   Shared dashboard shell -- navy sidebar + gold accents, used
   across all three account types (admin, vendor, customer) for a
   consistent look. Scoped to body.dashboard-shell, which every
   admin/vendor/customer view now opts into from its own file
   (see header.php / admin-header.php's $data['body_class']).
   Same hue family as site/assets/css/editorial.css (the public
   storefront rework) so the two feel like one brand, but declared
   independently here since editorial.css is scoped to
   body.editorial and intentionally hides .dashboard-sidebar.
   ============================================================ */
body.dashboard-shell {
    /* Aliased, not re-declared: the private navy/gold scale is gone and
       every --vs-* reference now resolves from main.css :root. */
    --vs-navy: var(--ink-900);
    --vs-navy-soft: var(--ink-700);
    --vs-gold: var(--gold);
    --vs-gold-ink: var(--gold-ink);
    --vs-on-navy: var(--ink-900);
    --vs-on-navy-soft: var(--ink-500);
}

/* Chrome is light. Navy is ink, gold marks position -- neither is a
   background you read off. */
body.dashboard-shell .dashboard-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
}
body.dashboard-shell .menu-text {
    color: var(--ink-600);
}
body.dashboard-shell .menu-item {
    color: var(--ink-600);
}
body.dashboard-shell .menu-item i {
    color: var(--ink-500);
}
body.dashboard-shell .menu-item:hover {
    background: var(--surface-3);
    color: var(--ink-900);
}
body.dashboard-shell .menu-item.active {
    background: var(--gold-tint);
    color: var(--ink-900);
    box-shadow: inset 3px 0 0 var(--gold);
    font-weight: 600;
}
body.dashboard-shell .menu-item.active i {
    color: var(--gold-ink);
}

body.dashboard-shell .sidebar-promo {
    margin: 1.25rem 0.9rem 0.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-3);
    color: var(--ink-700);
}
body.dashboard-shell .sidebar-promo-icon {
    color: var(--action);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    display: block;
}
body.dashboard-shell .sidebar-promo strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    color: var(--ink-900);
}
body.dashboard-shell .sidebar-promo p {
    font-size: 0.8rem;
    color: var(--ink-500);
    margin-bottom: 0.75rem;
}
body.dashboard-shell .sidebar-promo-link {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-sm);
    background: var(--action);
    color: var(--surface);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Primary buttons are blue everywhere. This rule used to repaint them
   gold on dashboard pages only, and to take their text colour from
   --ed-surface, a token owned by editorial.css -- so a load-order change
   in another file could make the label invisible. */
body.dashboard-shell .btn-primary {
    background: var(--action);
    border-color: var(--action);
    color: #fff;
}
body.dashboard-shell .btn-primary:hover {
    background: var(--action-hover);
    border-color: var(--action-hover);
}
body.dashboard-shell .dashboard-header h1 i {
    color: var(--ink-500);
}

/* Fallback: .sidebar-promo gets sane default styling even on pages
   that don't (yet) opt into body.dashboard-shell. */
.sidebar-promo {
    margin: 1.25rem 0.9rem 0.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}
.sidebar-promo-icon { color: var(--primary); font-size: 1.4rem; margin-bottom: 0.5rem; display: block; }
.sidebar-promo strong { display: block; font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.4rem; }
.sidebar-promo p { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.75rem; }
.sidebar-promo-link {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============================================================
   Add Product page -- numbered sections, live preview sidebar,
   vendor info summary, delivery options, listing status.
   Self-contained: uses its own --ap- color variables (matching
   the dashboard-shell navy/gold) so it looks right whether or not
   the page has opted into body.dashboard-shell.
   ============================================================ */
.add-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
    --ap-navy: #0f1b3d;
    --ap-gold: #e0a63a;
    --ap-gold-ink: #8a6423;
}
@media (max-width: 992px) {
    .add-product-layout { grid-template-columns: 1fr; }
    .add-product-aside { order: -1; }
}

.ap-card + .ap-card { margin-top: 1.25rem; }

.ap-section-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.05rem;
    margin-bottom: 1.1rem;
    color: var(--text-dark);
}
.ap-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--ap-navy);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.input-affix-right .affix { left: auto; right: 0.9rem; }
.input-affix-right input { padding-left: 0.9rem; padding-right: 2rem; }

/* Vendor info summary (read-only) */
.vendor-info-summary { display: flex; flex-direction: column; gap: 0.9rem; }
.vendor-info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.vendor-info-row > div { display: flex; flex-direction: column; gap: 0.2rem; }
.vendor-info-label { font-size: 0.78rem; color: var(--text-light); }
.vendor-info-rating {
    grid-template-columns: auto auto auto 1fr;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}
.vendor-rating-stars { color: var(--ap-gold); font-size: 0.85rem; }
.vendor-info-edit { margin-left: auto; font-size: 0.85rem; }
.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #e6f4ea;
    color: #1e7e34;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-verified-sm { margin-left: 0.4rem; }

/* Delivery options */
.delivery-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.25rem;
}

/* Listing status */
.listing-status-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}
.listing-status-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem 0.9rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}
.listing-status-option input {
    position: absolute;
    left: 0.9rem;
    top: 1.05rem;
}
.listing-status-option:has(input:checked) {
    border-color: var(--ap-gold);
    background: #fbf3e3;
}
.listing-status-title { font-weight: 600; color: var(--text-dark); font-size: 0.92rem; }
.listing-status-desc { font-size: 0.8rem; color: var(--text-light); }

/* Sidebar: product preview */
.preview-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}
.preview-image-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: 0.9rem;
}
.preview-image { width: 100%; height: 100%; object-fit: cover; }
.preview-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
}
.preview-condition-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(15, 27, 61, 0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
}
.preview-name {
    font-size: 1.02rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
    word-break: break-word;
}
.preview-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}
.preview-price { font-size: 1.3rem; font-weight: 700; color: var(--ap-navy); }
.preview-compare-price { text-decoration: line-through; color: var(--text-light); font-size: 0.9rem; display: none; }
.preview-discount-badge {
    display: none;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm);
    background: #fbf3e3;
    color: var(--ap-gold-ink);
    font-size: 0.75rem;
    font-weight: 700;
}
.preview-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.preview-vendor-card { display: flex; align-items: center; gap: 0.7rem; }
.preview-vendor-avatar {
    width: 2.4rem; height: 2.4rem;
    border-radius: 50%;
    background: var(--ap-navy);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Sidebar: guidelines box */
.guidelines-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}
.guidelines-box ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.guidelines-box li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.83rem; color: var(--text-light); }
.guidelines-box li i { color: #1e7e34; margin-top: 0.2rem; }

/* Sidebar: promo banner */
.promo-banner {
    background: var(--ap-navy);
    color: var(--ap-gold);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}
.promo-banner i { font-size: 1.4rem; margin-bottom: 0.5rem; display: block; }
.promo-banner p { color: #f3efe4; font-size: 0.95rem; margin-bottom: 0.3rem; }
.promo-banner p strong { color: var(--ap-gold); }
.promo-banner span { font-size: 0.78rem; color: rgba(243, 239, 228, 0.7); }

/* ============================================================
   DASHBOARD RESPONSIVE OVERHAUL
   Applies to admin / vendor / customer dashboards.
   Appended. Nothing above is modified.
   ============================================================ */

/* ---------------------------------------------------------
   Container padding — dashboards were flush to screen edges
   --------------------------------------------------------- */
.dashboard-main {
    padding: 2rem;
}

@media (max-width: 1200px) {
    .dashboard-main { padding: 1.5rem; }
}
@media (max-width: 768px) {
    .dashboard-main { padding: 1rem; }
}
@media (max-width: 480px) {
    .dashboard-main { padding: 0.85rem; }
}

/* ---------------------------------------------------------
   Dashboard header — stack cleanly on mobile
   --------------------------------------------------------- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.dashboard-header h1 {
    font-size: clamp(1.35rem, 3.5vw, 1.8rem);
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-header p {
    font-size: 0.9rem;
}

.dashboard-header .header-actions,
.dashboard-header .btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    .dashboard-header h1 {
        font-size: 1.35rem;
    }
    .dashboard-header .header-actions {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }
    .dashboard-header .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
    .dashboard-header > .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------------------------------------------------------
   Stats grid — responsive column counts
   --------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1199px) and (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}

/* Stat cards — tighter on mobile */
.stat-card {
    min-width: 0; /* allow shrinking inside grid track */
    padding: 1.25rem;
    /* The customer console's cards hold a third child (a .stat-link) that
       the vendor and admin cards don't. At four columns in a ~220px track,
       icon + link left the label column about 9px wide, and the word-break
       below then rendered "Items in Cart" one character per line. Let the
       link drop onto its own row instead. */
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

@media (max-width: 639px) {
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
        align-items: center;
    }
}

.stat-icon {
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }
}

.stat-details {
    flex: 1 1 auto;
    min-width: 0;
}
.stat-link {
    margin-left: auto;
}

.stat-details h3 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.stat-details p {
    font-size: 0.85rem;
}

/* ---------------------------------------------------------
   Cards — full width, no overflow
   --------------------------------------------------------- */
.card {
    margin-bottom: 1.5rem;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 640px) {
    .card { margin-bottom: 1rem; }
}

.card-header {
    padding: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

@media (max-width: 640px) {
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .card-header h2 {
        font-size: 1.05rem;
        line-height: 1.3;
    }
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
}

.card-body {
    padding: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
}

@media (max-width: 640px) {
    .card-body {
        padding: 1rem;
    }
}

/* ---------------------------------------------------------
   Earnings grid (vendor dashboard) — stack on mobile
   --------------------------------------------------------- */
.earnings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .earnings-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.earning-item {
    text-align: center;
    padding: 1.25rem 1rem;
    border-right: 1px solid var(--border-color);
}

.earning-item:last-child {
    border-right: none;
}

@media (max-width: 640px) {
    .earning-item {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0.5rem;
    }
    .earning-item:last-child {
        border-bottom: none;
    }
}

.earning-amount {
    font-size: clamp(1.5rem, 4vw, 2rem);
    word-break: break-word;
}

/* ---------------------------------------------------------
   Vendor/order lists inside cards — stack cleanly
   --------------------------------------------------------- */
.vendor-list,
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vendor-item,
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

@media (max-width: 560px) {
    .vendor-item,
    .order-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .vendor-actions,
    .order-details {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }
}

.vendor-info,
.order-info { min-width: 0; }

.vendor-info strong,
.order-info strong {
    display: block;
    word-break: break-word;
}

/* ---------------------------------------------------------
   Quick actions (customer dashboard)
   --------------------------------------------------------- */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 639px) {
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.action-card {
    padding: 1.5rem;
    text-align: center;
}

@media (max-width: 639px) {
    .action-card { padding: 1.1rem; }
    .action-card i { font-size: 1.9rem; margin-bottom: 0.6rem; }
    .action-card h3 { font-size: 1rem; }
}

/* ---------------------------------------------------------
   Dashboard grid (2-col on desktop, 1-col on mobile)
   --------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ---------------------------------------------------------
   Tables — polish the stacked-card look at ≤ 768px
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .table tr {
        padding: 0.6rem 0;
    }
    .table td {
        font-size: 0.85rem;
        padding: 0.55rem 0.9rem;
    }
    .table td::before {
        font-size: 0.68rem;
    }
}

/* ---------------------------------------------------------
   Charts — constrain on mobile
   --------------------------------------------------------- */
.card-body canvas {
    max-width: 100%;
    height: auto !important;
}

/* Chart legend — stack on narrow screens */
@media (max-width: 560px) {
    .card-body canvas {
        min-height: 220px;
    }
}

/* ---------------------------------------------------------
   Charts container: allow horizontal scroll as a last resort
   --------------------------------------------------------- */
.chart-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------
   Sidebar (mobile) — clean off-canvas drawer with backdrop
   --------------------------------------------------------- */
@media (max-width: 991px) {
    .dashboard-sidebar {
        z-index: 1050; /* above nav (1000) but below backdrop */
    }

    /* Dimming backdrop for the drawer. Self-contained: no markup
       change needed -- it renders as a ::before on the sidebar when
       .active is set. */
    .dashboard-sidebar::before {
        content: none;
    }
}

/* Backdrop element (injected by JS on demand) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 61, 0.5) !important;
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease;
}

@media (max-width: 991px) {
    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop { display: none !important; }
}

/* ---------------------------------------------------------
   Mobile nav — visible hamburger, hidden clutter
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .nav-wrapper, .nav-dashboard {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .dashboard-nav .logo span,
    .dashboard-nav .logo strong {
        font-size: 1rem;
    }

    /* Home button on the nav-right cluster was crowding on small phones;
       it's reachable from the sidebar's Dashboard link. */
    .dashboard-nav .home-desktop {
        display: none;
    }

    .nav-right { gap: 0.6rem; }

    .user-menu-btn {
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
        max-width: 60vw;
    }
    .user-menu-btn .user-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        flex-shrink: 0;
        order: 3;
    }

    /* User dropdown: full-width slide-down, right-margin inset */
    .user-dropdown {
        position: fixed;
        top: 64px;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        min-width: 0;
        max-width: none;
        margin-top: 0;
        border-radius: 10px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 480px) {
    .user-menu-btn {
        padding: 0.35rem 0.5rem;
    }
    .user-menu-btn .user-name {
        display: none;
    }
    .user-menu-btn .fa-chevron-down {
        display: none;
    }
}

/* ---------------------------------------------------------
   Alerts — don't crowd on mobile
   --------------------------------------------------------- */
@media (max-width: 640px) {
    .alert {
        padding: 0.85rem 1rem;
        font-size: 0.88rem;
    }
}

/* ---------------------------------------------------------
   Empty states
   --------------------------------------------------------- */
@media (max-width: 640px) {
    .empty-state,
    .empty-state-sm {
        padding: 2rem 0.75rem;
    }
    .empty-state i {
        font-size: 2rem;
    }
    .empty-state h3 {
        font-size: 1.1rem;
    }
}

/* ---------------------------------------------------------
   Status select in tables — make tappable
   --------------------------------------------------------- */
.status-select {
    min-width: 0;
    width: 100%;
    max-width: 180px;
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
}

@media (max-width: 768px) {
    .status-select {
        max-width: none;
        font-size: 0.85rem;
        padding: 0.5rem 0.7rem;
    }
}

/* ---------------------------------------------------------
   Badges — don't wrap mid-word
   --------------------------------------------------------- */
.badge {
    white-space: nowrap;
}