/*
 * admin.css — App shell (sidebar, topbar, content) and feature-specific blocks.
 * Shared tokens/components live in admin-base.css (loaded first).
 */


.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 12px 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 64px;
    box-sizing: border-box;
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-logo i {
    color: var(--primary);
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar-logo-img {
    height: 32px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.sidebar-logo-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity 0.2s, width 0.2s;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.sidebar-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.sidebar-nav {
    flex: 1;
    padding: 0.625rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.375rem;
    color: var(--gray-600);
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item--locked {
    cursor: not-allowed;
    opacity: 0.72;
    color: var(--gray-500);
}

.nav-item--locked .nav-item-lock {
    font-size: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--gray-400);
}

.nav-item--locked.active {
    background: rgba(0, 0, 0, 0.04);
    border-left-color: transparent;
    color: var(--gray-500);
    font-weight: 500;
}

.nav-item-sub {
    font-size: 0.8375rem;
    padding: 0.55rem 1.375rem 0.55rem 1.25rem;
}

.nav-item-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    overflow: hidden;
}

.nav-count-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    min-width: 1.35rem;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* Inset matches .nav-divider (1.375rem) and icon column matches .nav-item (3px border + padding). */
.nav-item--view-store {
    box-sizing: border-box;
    width: auto;
    margin: 0.625rem 1.375rem 0.75rem;
    padding: 0.7rem 1.375rem 0.7rem calc(1.375rem + 3px) !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    border-radius: 10px;
    border-left: none !important;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    /* Solid base + gradient so text never sits on a failed / light --primary */
    background-color: var(--primary-dark, #1d4ed8);
    background-image: linear-gradient(
        135deg,
        var(--primary, #2563eb) 0%,
        var(--primary-dark, #1d4ed8) 100%
    );
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.nav-item--view-store i {
    color: #ffffff !important;
    flex-shrink: 0;
}

.nav-item--view-store span {
    color: #ffffff !important;
}

.nav-item--view-store:hover {
    text-decoration: none;
    /* Same as default: no hover color shift, no brightness wash */
    background-color: var(--primary-dark, #1d4ed8);
    background-image: linear-gradient(
        135deg,
        var(--primary, #2563eb) 0%,
        var(--primary-dark, #1d4ed8) 100%
    );
    filter: none;
}

.nav-item--view-store:focus-visible {
    outline: 2px solid var(--primary-mid, #3b82f6);
    outline-offset: 2px;
}

.sidebar-nav-group > summary {
    font-weight: 600;
    color: var(--gray-700);
}

.nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.625rem 1.375rem;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-more {
    border: none;
    margin: 0;
    padding: 0;
}

.sidebar-more > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.375rem;
    color: var(--gray-600);
    border-left: 3px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s;
}

.sidebar-more > summary::-webkit-details-marker {
    display: none;
}

.sidebar-more > summary i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-more-content {
    padding-left: 0.375rem;
    border-left: 2px solid var(--gray-200);
    margin: 0.125rem 0 0.375rem 1.5rem;
    overflow: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 1.5rem 14px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    min-height: var(--topbar-height);
    box-sizing: border-box;
}

.topbar-cluster {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

/* Single horizontal row everywhere: title | store URL + actions | user */
.topbar-main,
.topbar-main--with-store {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(8px, 1.5vw, 14px);
}

.topbar-heading {
    flex: 0 1 auto;
    min-width: 0;
    align-self: center;
    padding-top: 0;
    max-width: min(12rem, 26vw);
}

.topbar-main:not(.topbar-main--with-store) .topbar-heading {
    flex: 1 1 auto;
    max-width: none;
}

.topbar-actions {
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    margin-left: auto;
}

@media (min-width: 768px) {
    .topbar-heading {
        max-width: min(16rem, 30vw);
    }

    .topbar-main:not(.topbar-main--with-store) .topbar-heading {
        max-width: none;
    }

    .topbar-actions {
        max-width: min(380px, 46vw);
    }
}

@media (min-width: 1025px) {
    .topbar-heading {
        max-width: min(22rem, 34vw);
    }

    .topbar-main:not(.topbar-main--with-store) .topbar-heading {
        max-width: none;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    align-self: center;
}

.menu-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.topbar-heading .topbar-title-inner {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-heading .topbar-title-inner .page-title-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-store-row {
    display: flex;
    flex: 1 1 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    min-width: 0;
}

.topbar-store-row .form-control {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding: 8px 12px;
    font-size: 0.8125rem;
    min-height: 40px;
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--gray-800);
}

.topbar-store-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-store-actions .btn {
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    min-width: 0;
}

.user-menu .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(11rem, 26vw);
}

@media (min-width: 1025px) {
    .user-menu .user-name {
        max-width: min(18rem, 22vw);
    }
}

.user-menu i {
    font-size: 1.5rem;
    color: var(--primary);
}

.content-area {
    flex: 1;
    padding: 1.5rem;
    background: var(--bg-page);
}

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

.product-listing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
}

.product-listing-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.product-listing-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 0.4rem;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
}

.product-add-btn {
    background: var(--primary);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.product-add-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.product-listing-toolbar {
    padding: 0.875rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.product-listing-filters {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.product-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.product-search-wrap i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.875rem;
}

.product-search-wrap .form-control {
    padding-left: 2.375rem;
    background: var(--white);
}

.product-filter-select {
    min-width: 130px;
    background: var(--white);
}

.product-filter-btn { white-space: nowrap; }

.product-listing-table-wrap { padding: 0; }
.product-listing-table { display: flex; flex-direction: column; }

.product-listing-thead {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) 120px 100px 100px 120px;
    gap: 1rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.product-row {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) 120px 100px 100px 120px;
    gap: 1rem;
    align-items: center;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.product-row:hover { background: var(--gray-50); }

.product-row-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.product-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.product-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-300);
}

.product-details { flex: 1; min-width: 0; }

.product-name {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.2rem;
    transition: color 0.15s;
}

.product-name:hover { color: var(--primary); }

.product-meta { font-size: 0.75rem; color: var(--gray-400); }
.product-id { margin-right: 0.4rem; }

.product-tags { display: flex; gap: 0.3rem; margin-top: 0.3rem; }

.product-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
}

.product-tag-featured { background: var(--warning-light); color: #78350f; }
.product-tag-bestseller { background: var(--info-light); color: #0c4a6e; }

.product-price { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }
.product-mrp { display: block; font-size: 0.72rem; color: var(--gray-400); text-decoration: line-through; }
.product-discount { font-size: 0.68rem; color: #15803d; font-weight: 700; }
.product-stock { font-size: 0.8125rem; }
.product-stock-ok { color: var(--gray-600); }
.product-stock-none { color: var(--danger); }

.product-status {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-status-live { background: var(--success-light); color: #14532d; }
.product-status-inactive { background: var(--gray-100); color: var(--gray-500); }

.product-col-actions { display: flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap; }

.product-action-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s;
}

.product-action-link:hover { text-decoration: underline; }
.product-action-delete:hover { color: var(--danger); }
.product-action-divider { color: var(--gray-300); font-size: 0.75rem; }

.product-listing-empty { text-align: center; padding: 4rem 2rem; }
.product-listing-empty-icon { font-size: 3.5rem; color: var(--gray-200); margin-bottom: 1rem; }
.product-listing-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-700); margin: 0 0 0.4rem; }
.product-listing-empty-desc { color: var(--gray-500); margin: 0 0 1.5rem; font-size: 0.875rem; }

.product-listing-card .pagination { margin: 1rem 1.5rem; }
.product-listing-body { padding: 0; }

@media (max-width: 1024px) {
    .product-listing-thead,
    .product-row {
        grid-template-columns: minmax(200px, 1fr) 100px 80px 90px 100px;
    }
}

@media (max-width: 767px) {
    .product-listing-toolbar .product-listing-filters { display: none; }
    .product-listing-card {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: var(--radius-md);
    }
    .product-listing-header,
    .product-listing-toolbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .product-listing-body {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}


.reports-hub .card-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.125rem;
}

.report-tile {
    display: block;
    padding: 1.375rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
}

.report-tile:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
    box-shadow: var(--shadow-md);
    color: var(--gray-900);
}

.report-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 0.875rem;
}

.report-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.report-card-desc { font-size: 0.8rem; color: var(--text-muted); }

.report-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
}

.report-export-buttons { display: flex; gap: 0.5rem; }

.report-filters {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.report-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.875rem;
}

.report-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.report-filter-group label {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-filter-actions { flex-direction: row; align-items: flex-end; }
.report-summary-cards { margin-bottom: 1.5rem; }
.report-table-wrap { position: relative; }

.report-table-wrap.report-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
}

.report-sort { color: var(--gray-600); text-decoration: none; transition: color 0.15s; }
.report-sort:hover { color: var(--primary); }
.report-empty { text-align: center; color: var(--gray-400); padding: 2rem; }

.report-order-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.report-order-link:hover { text-decoration: underline; }
.report-amount { font-weight: 700; }
.report-pagination { margin-top: 1.5rem; }

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.order-detail-info-row { display: block; margin-bottom: 1rem; }
.order-detail-info-row:last-child { margin-bottom: 0; }

.order-detail-info-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.order-detail-info-value { font-size: 0.9rem; font-weight: 500; color: var(--gray-900); }
.order-detail-info-value a { color: var(--primary); text-decoration: none; }
.order-detail-info-value a:hover { text-decoration: underline; }
.order-detail-info-value .badge { font-weight: 700; }

.order-detail-divider { margin: 1.125rem 0; border: none; border-top: 1px solid var(--gray-200); }

.order-detail-status-form {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-detail-status-form .form-control { flex: 1; min-width: 140px; }

.order-detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.order-detail-tracking-timeline { padding-top: 0.75rem; border-top: 1px solid var(--gray-200); }
.order-detail-timeline-list { list-style: none; padding: 0; margin: 0; }

.order-detail-timeline-item {
    padding: 0.5rem 0;
    border-left: 2px solid var(--gray-200);
    padding-left: 1rem;
    margin-left: 0.25rem;
    position: relative;
}

.order-detail-timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.order-detail-timeline-date { display: block; font-size: 0.72rem; color: var(--gray-400); margin-bottom: 0.1rem; }
.order-detail-timeline-text { font-size: 0.875rem; color: var(--gray-700); }
.order-detail-timeline-location { font-size: 0.825rem; }

.order-detail-phone-row { display: flex; align-items: center; gap: 0.5rem; }
.order-detail-phone-row a[href^="tel:"] { flex: 1; min-width: 0; color: var(--primary) !important; text-decoration: none; }

.order-detail-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #25D366 !important;
    font-weight: 600;
    flex-shrink: 0;
    text-decoration: none;
}

.order-detail-totals {
    display: grid;
    gap: 0.5rem;
    max-width: 300px;
    margin-left: auto;
}

.order-detail-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.order-detail-totals-row.total-row {
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 2px solid var(--gray-300);
    font-size: 1.05rem;
    font-weight: 700;
}

.order-detail-totals-row.total-row .amount { color: var(--gray-900); }

.order-detail-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: flex-start;
}

.order-detail-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.order-detail-contact a { color: var(--primary); text-decoration: none; }


@media (min-width: 1025px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: none;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .menu-toggle {
        display: none !important;
    }

    .filter-trigger,
    .filter-overlay,
    .filters-sheet {
        display: none !important;
    }

    .content-area {
        padding: 2rem 2.5rem;
    }

    .topbar {
        padding: 16px 2.5rem 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .nav-item:hover:not(.nav-item--view-store) {
        background: var(--gray-50);
        color: var(--primary);
    }

    .sidebar-more > summary:hover {
        background: var(--gray-50);
        color: var(--primary);
    }

    .logout-btn:hover {
        color: var(--danger) !important;
    }

    .table tbody tr:hover,
    .data-table tbody tr:hover {
        background: var(--table-row-hover);
    }
}

@media (min-width: 1400px) {
    .content-area {
        padding: 2rem 3rem;
    }

    .topbar {
        padding: 16px 3rem 14px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        transform: none;
        overflow: hidden;
    }

    .sidebar.active {
        width: var(--sidebar-width);
        box-shadow: var(--shadow-lg);
        z-index: 1002;
    }

    .sidebar:not(.active) .sidebar-header {
        padding: 1.125rem;
        justify-content: center;
    }

    .sidebar:not(.active) .sidebar-logo {
        gap: 0;
        justify-content: center;
    }

    .sidebar:not(.active) .sidebar-logo-text,
    .sidebar:not(.active) .sidebar-logo > span:not(.sidebar-logo-img) {
        display: none;
    }

    .sidebar:not(.active) .nav-item {
        padding: 0.875rem;
        justify-content: center;
        gap: 0;
    }

    .sidebar:not(.active) .nav-item span,
    .sidebar:not(.active) .nav-item .nav-item-label,
    .sidebar:not(.active) .nav-count-badge {
        display: none;
    }

    .sidebar:not(.active) .sidebar-more > summary {
        padding: 0.875rem;
        justify-content: center;
        gap: 0;
    }

    .sidebar:not(.active) .sidebar-more > summary span {
        display: none;
    }

    .sidebar:not(.active) .sidebar-more-content {
        display: none;
    }

    .sidebar:not(.active) .nav-divider {
        margin: 0.5rem 0.5rem;
    }

    .sidebar:not(.active) .logout-btn span {
        display: none;
    }

    .sidebar:not(.active) .nav-item--view-store {
        width: auto;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        padding: 0.7rem !important;
        justify-content: center;
        gap: 0;
    }

    .sidebar:not(.active) .nav-item--view-store span {
        display: none;
    }

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

    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }

    .menu-toggle {
        display: block;
    }

    .filter-trigger {
        display: inline-flex !important;
    }

    .filters-inline {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .topbar {
        padding: 10px 0.75rem 10px;
    }

    /* Single compact row: menu | title | store URL + icons | profile */
    .topbar-cluster {
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .menu-toggle {
        padding: 0.35rem;
        flex-shrink: 0;
    }

    .topbar-main,
    .topbar-main--with-store {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        min-width: 0;
        row-gap: 0;
        column-gap: 6px;
    }

    .topbar-heading {
        grid-column: unset;
        grid-row: unset;
        align-self: unset;
        padding-top: 0;
        flex: 0 1 auto;
        min-width: 0;
        max-width: min(7.5rem, 30vw);
    }

    .topbar-main:not(.topbar-main--with-store) .topbar-heading {
        flex: 1 1 auto;
        max-width: none;
    }

    .topbar-heading .topbar-title-inner {
        font-size: 1.05rem;
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-store-row {
        grid-column: unset;
        grid-row: unset;
        flex: 1 1 0;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .topbar-store-row .form-control {
        min-width: 0;
        flex: 1 1 0;
        min-height: 34px;
        padding: 5px 8px;
        font-size: 0.6875rem;
    }

    .topbar-store-actions {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .topbar-store-actions .btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar-actions {
        max-width: none;
    }

    .user-menu i {
        font-size: 1.35rem;
    }

    .user-menu .user-name {
        display: none;
    }

    /* Dashboard: store link lives in hero — keep topbar to menu, title, profile */
    .admin-page-dashboard .topbar-store-row {
        display: none !important;
    }

    .admin-page-dashboard .topbar-main--with-store .topbar-heading {
        flex: 1 1 auto;
        max-width: none;
    }

    .content-area {
        padding: 1rem;
        padding-bottom: calc(var(--bottom-nav-height) + 1.5rem + env(safe-area-inset-bottom, 0px));
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table th,
    .table td,
    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .order-detail-status-form {
        flex-direction: column;
    }

    .order-detail-status-form .form-control {
        min-width: 100%;
    }

    .order-detail-totals {
        max-width: 100%;
    }

    .order-detail-contact {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-2 {
        grid-template-columns: 1fr !important;
    }

    .report-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-export-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.375rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}
