/* ==========================================
   SELLER DASHBOARD
   Uses the global style.css theme variables
========================================== */

.seller-dashboard {
    width: min(1500px, 94%);
    margin: 0 auto;
    padding: 10px 0 90px 330px;
}

.seller-sidebar {
    position: fixed;
    top: 110px;
    left: 30px;
    bottom: 30px;
    z-index: 20;
    width: 280px;
    padding: 24px 16px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.seller-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 10px 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.seller-sidebar-header h2 {
    margin-top: 3px;
    font-size: 1.35rem;
}

.seller-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.seller-close {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
}

.seller-nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 13px;
    margin: 4px 0;
    border-radius: 13px;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    font-weight: 600;
    text-align: left;
    transition: .2s ease;
}

.seller-nav-link i {
    width: 20px;
    color: var(--primary);
    text-align: center;
}

.seller-nav-link:hover,
.seller-nav-link.active {
    background: var(--primary);
    color: #fff;
    transform: translateX(3px);
}

.seller-nav-link:hover i,
.seller-nav-link.active i {
    color: #fff;
}

.seller-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 38px;
}

.seller-dashboard-header h1 {
    margin: 8px 0;
}

.seller-dashboard-header p,
.section-heading p {
    color: var(--text-light);
    margin: 0;
}

.seller-mobile-menu {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
}

.seller-section {
    display: none;
    animation: sellerFadeUp .3s ease both;
}

.seller-section.active {
    display: block;
}

@keyframes sellerFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin-bottom: 4px;
}

.seller-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.seller-metric {
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.seller-metric i {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(239, 68, 68, .14);
    color: var(--primary);
    font-size: 1.15rem;
}

.seller-metric span {
    color: var(--text-light);
    font-size: .9rem;
}

.seller-metric strong {
    color: var(--text);
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1;
}

.seller-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.seller-action-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow);
    transition: .2s ease;
}

.seller-action-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.seller-action-card i {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 1.65rem;
}

.seller-action-card strong {
    font-size: 1.08rem;
}

.seller-action-card span {
    color: var(--text-light);
    font-size: .92rem;
}

.add-item-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.add-item-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text-light);
    font: inherit;
    font-weight: 700;
}

.add-item-tab i {
    color: var(--primary);
}

.add-item-tab.active,
.add-item-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.add-item-tab.active i,
.add-item-tab:hover i {
    color: #fff;
}

.add-item-panel {
    display: none;
    padding: clamp(20px, 4vw, 38px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.add-item-panel.active {
    display: block;
    animation: sellerFadeUp .25s ease both;
}

.add-item-panel h3 {
    margin-bottom: 5px;
    font-size: 1.45rem;
}

.add-item-panel > p {
    margin-bottom: 24px;
    color: var(--text-light);
}

.dashboard-form {
    display: grid;
    gap: 18px;
    margin-top: 25px;
}

.dashboard-form label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.dashboard-form input,
.dashboard-form select,
.dashboard-form textarea {
    color: var(--text);
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    color: var(--text-light) !important;
}

.dashboard-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.listing-manager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-listing-card {
    display: grid;
    grid-template-columns: 115px 1fr;
    gap: 18px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.dashboard-listing-image {
    width: 115px;
    height: 115px;
    overflow: hidden;
    border-radius: 15px;
    background: var(--surface-2);
}

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

.dashboard-listing-content {
    min-width: 0;
}

.dashboard-listing-content h3 {
    overflow: hidden;
    margin-bottom: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-listing-category {
    color: var(--primary);
    font-size: .8rem;
    font-weight: 800;
}

.dashboard-listing-price {
    margin: 8px 0;
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 800;
}

.dashboard-listing-stock {
    color: var(--text-light);
    font-size: .88rem;
}

.dashboard-listing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.dashboard-listing-actions button {
    padding: 8px 11px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .78rem;
    font-weight: 700;
}

.dashboard-listing-actions button:hover {
    background: var(--primary);
    color: #fff;
}

.bulk-dashboard-card,
.analytics-placeholder {
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 280px;
    padding: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.bulk-dashboard-card i,
.analytics-placeholder i {
    color: var(--primary);
    font-size: 3rem;
}

.bulk-dashboard-card p,
.analytics-placeholder p {
    max-width: 560px;
    color: var(--text-light);
}

.settings-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.settings-card a {
    display: grid;
    grid-template-columns: 28px 1fr 20px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 15px;
    color: var(--text);
}

.settings-card a:hover {
    background: var(--surface-2);
}

.settings-card a > i:first-child {
    color: var(--primary);
    font-size: 1.15rem;
    text-align: center;
}

.settings-card a > i:last-child {
    color: var(--text-light);
}

.settings-card span {
    display: grid;
    gap: 3px;
}

.settings-card small {
    color: var(--text-light);
}

.dashboard-loading,
.dashboard-empty {
    grid-column: 1 / -1;
    padding: 55px 20px;
    color: var(--text-light);
    text-align: center;
}

.dashboard-error {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px solid var(--danger);
    border-radius: 15px;
    color: var(--danger);
    text-align: center;
}

@media (max-width: 1100px) {
    .seller-dashboard {
        width: min(100% - 28px, 620px);
        margin: 0 auto;
        padding: 32px 0 70px;
    }

    .seller-sidebar {
        position: fixed;
        top: 72px;
        left: -300px;
        bottom: 15px;
        width: min(290px, calc(100vw - 30px));
        transition: left .25s ease;
    }

    .seller-sidebar.open {
        left: 15px;
    }

    .seller-mobile-menu {
        display: inline-flex;
    }

    .seller-close {
        display: grid;
        place-items: center;
    }

    .seller-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .seller-dashboard {
        width: min(100% - 28px, 620px);
        padding-top: 32px;
    }

    .seller-dashboard-header,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .seller-dashboard-header h1 {
        font-size: 2rem;
    }

    .seller-metrics,
    .seller-quick-grid,
    .listing-manager,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .add-item-tabs {
        grid-template-columns: 1fr;
    }

    .dashboard-listing-card {
        grid-template-columns: 90px 1fr;
    }

    .dashboard-listing-image {
        width: 90px;
        height: 90px;
    }

    .seller-sidebar {
        top: 72px;
        bottom: 15px;
        width: min(290px, calc(100vw - 30px));
    }
}

/* ==========================================
   SELLER ANALYTICS
========================================== */

.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.analytics-metric {
    display: grid;
    gap: 10px;
    min-height: 145px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.analytics-metric i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(239, 68, 68, .14);
    color: var(--primary);
}

.analytics-metric span {
    color: var(--text-light);
    font-size: .9rem;
    font-weight: 600;
}

.analytics-metric strong {
    color: var(--text);
    font-size: clamp(1.3rem, 2vw, 2rem);
    line-height: 1.1;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.analytics-card {
    min-width: 0;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.analytics-wide {
    grid-column: span 2;
}

.analytics-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.analytics-card-heading h3 {
    margin-bottom: 4px;
}

.analytics-card-heading p {
    color: var(--text-light);
    font-size: .92rem;
}

.analytics-card-heading > i {
    color: var(--primary);
    font-size: 1.35rem;
}

.chart-container {
    position: relative;
    height: 330px;
}

.chart-small {
    height: 290px;
}

.top-listings-analytics {
    display: grid;
    gap: 10px;
}

.top-listing-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: 13px;
    background: var(--surface-2);
}

.top-listing-rank {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.top-listing-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-listing-name small {
    display: block;
    overflow: hidden;
    color: var(--text-light);
    font-size: .76rem;
    font-weight: 500;
    text-overflow: ellipsis;
}

.top-listing-row strong {
    color: var(--primary);
    font-size: .9rem;
    white-space: nowrap;
}

.analytics-empty {
    padding: 40px 15px;
    color: var(--text-light);
    text-align: center;
}

@media (max-width: 1000px) {
    .analytics-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .analytics-metrics,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-wide {
        grid-column: span 1;
    }

    .analytics-card {
        padding: 18px;
    }

    .chart-container {
        height: 260px;
    }

    .chart-small {
        height: 250px;
    }

    .top-listing-row {
        grid-template-columns: 30px 1fr;
    }

    .top-listing-row strong {
        grid-column: 2;
    }
}

@media (max-width: 1100px) {
    .seller-sidebar {
        z-index: 1002;
        pointer-events: none;
    }

    .seller-sidebar.open {
        pointer-events: auto;
    }

    .seller-sidebar .seller-nav-link,
    .seller-sidebar button,
    .seller-sidebar a {
        position: relative;
        z-index: 1003;
        pointer-events: auto;
    }

    #mobileOverlay {
        z-index: 1000;
    }

    .seller-sidebar {
        background: var(--surface);
    }
}

.food-options-builder {
    display: grid;
    gap: 22px;
    margin-top: 25px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.food-options-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.food-options-heading h3 {
    margin-bottom: 5px;
}

.food-options-heading p {
    margin: 0;
    color: var(--text-light);
}

.food-option-groups {
    display: grid;
    gap: 18px;
}

.food-option-group {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
}

.food-option-group-header {
    display: grid;
    grid-template-columns: 1fr auto 42px;
    align-items: center;
    gap: 12px;
}

.food-option-group-header input {
    min-width: 0;
}

.food-option-items {
    display: grid;
    gap: 10px;
}

.food-option-row {
    display: grid;
    grid-template-columns: 1fr 150px 42px;
    align-items: center;
    gap: 10px;
}

.food-option-row input {
    min-width: 0;
}

.remove-food-group,
.remove-food-option {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(239, 68, 68, .12);
    color: var(--danger);
}

.remove-food-group:hover,
.remove-food-option:hover {
    background: var(--danger);
    color: #fff;
}

.add-food-option {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
}

.add-food-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.food-option-group-header label {
    margin: 0;
}

@media (max-width: 700px) {
    .food-options-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .food-option-group-header,
    .food-option-row {
        grid-template-columns: 1fr;
    }

    .remove-food-group,
    .remove-food-option {
        width: 100%;
    }
}