/*
 * Ajlal Seller Dashboard — modern lightweight UI
 * Mobile-first, Poppins font, Ajlal green (#FF4C29)
 */

/* ── Shell ─────────────────────────────────────────── */
.ajlal-sd-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 96px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Header ────────────────────────────────────────── */
.ajlal-sd-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e8ede9;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ajlal-sd-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ajlal-sd-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FF4C29;
    letter-spacing: -.02em;
}
.ajlal-sd-badge {
    font-size: .65rem;
    font-weight: 700;
    color: #FF4C29;
    background: #e6f5f0;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}
.ajlal-sd-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ajlal-sd-nav::-webkit-scrollbar { display: none; }
.ajlal-sd-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: #5a6b65;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}
.ajlal-sd-nav-item:hover {
    color: #FF4C29;
    background: #e6f5f0;
}
.ajlal-sd-nav-item.is-active {
    color: #FF4C29;
    background: #e6f5f0;
    font-weight: 700;
}
.ajlal-sd-icon {
    font-size: .9rem;
    line-height: 1;
}
.ajlal-sd-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.ajlal-sd-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FF4C29;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 700;
}
.ajlal-sd-logout {
    font-size: .72rem;
    color: #8a9b93;
    text-decoration: none;
    font-weight: 600;
}
.ajlal-sd-logout:hover { color: #c0392b; }

/* ── Hero ──────────────────────────────────────────── */
.ajlal-sd-overview-hero {
    margin-bottom: 24px;
}
.ajlal-sd-overview-hero h1 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 800;
    color: #FF4C29;
    margin: 0 0 6px;
    letter-spacing: -.02em;
}
.ajlal-sd-overview-hero p {
    margin: 0;
    color: #5a6b65;
    font-size: .88rem;
    line-height: 1.55;
}

/* ── Notices ───────────────────────────────────────── */
.ajlal-sd-notice {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: .82rem;
    line-height: 1.5;
    margin-bottom: 20px;
}
.ajlal-sd-notice a {
    font-weight: 700;
    text-decoration: none;
    margin-left: 8px;
}
.ajlal-sd-notice.is-warning {
    color: #7a5a10;
    background: #fdf6e3;
    border: 1px solid #f5deb3;
}
.ajlal-sd-notice.is-warning a { color: #b8860b; }
.ajlal-sd-notice.is-success {
    color: #155d42;
    background: #edfff6;
    border: 1px solid #bcebd5;
}

/* ── Stats Grid ────────────────────────────────────── */
.ajlal-sd-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.ajlal-sd-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8ede9;
    box-shadow: 0 2px 8px rgba(8, 84, 76, .04);
    transition: box-shadow .2s ease;
}
.ajlal-sd-stat-card:hover {
    box-shadow: 0 4px 16px rgba(8, 84, 76, .08);
}
.ajlal-sd-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    background: #e6f5f0;
    color: #FF4C29;
    flex-shrink: 0;
}
.ajlal-sd-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #FF4C29;
    line-height: 1.1;
}
.ajlal-sd-stat-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: #8a9b93;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
}

/* ── Storefront preview ────────────────────────────── */
.ajlal-sd-storefront-preview {
    padding: 20px;
    border-radius: 16px;
    background: #f8faf9;
    border: 1px solid #e8ede9;
    margin-bottom: 24px;
}
.ajlal-sd-storefront-preview h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #FF4C29;
    margin: 0 0 8px;
}
.ajlal-sd-storefront-preview p {
    margin: 0;
    font-size: .82rem;
    color: #5a6b65;
    line-height: 1.5;
}
.ajlal-sd-storefront-preview a {
    color: #FF4C29;
    font-weight: 700;
    text-decoration: none;
}

/* ── View headers ──────────────────────────────────── */
.ajlal-sd-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.ajlal-sd-view-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FF4C29;
    margin: 0;
}

/* ── Buttons ───────────────────────────────────────── */
.ajlal-sd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
    text-decoration: none;
}
.ajlal-sd-btn-primary {
    background: #FF4C29;
    color: #fff;
}
.ajlal-sd-btn-primary:hover {
    background: #064540;
}
.ajlal-sd-btn-secondary {
    background: #e8ede9;
    color: #5a6b65;
}
.ajlal-sd-btn-secondary:hover {
    background: #d5ddd8;
}
.ajlal-sd-btn-outline {
    background: transparent;
    color: #FF4C29;
    border: 1.5px solid #c8d8d2;
}
.ajlal-sd-btn-outline:hover {
    background: #e6f5f0;
}
.ajlal-sd-btn-sm {
    padding: 6px 12px;
    font-size: .72rem;
    border-radius: 8px;
}

/* ── Products grid ─────────────────────────────────── */
.ajlal-sd-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.ajlal-sd-product-card {
    background: #fff;
    border: 1px solid #e8ede9;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.ajlal-sd-product-card:hover {
    box-shadow: 0 4px 16px rgba(8, 84, 76, .08);
}
.ajlal-sd-product-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
}
.ajlal-sd-product-info {
    padding: 12px;
}
.ajlal-sd-product-name {
    font-size: .8rem;
    font-weight: 700;
    color: #FF4C29;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ajlal-sd-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.ajlal-sd-product-price {
    font-size: .95rem;
    font-weight: 800;
    color: #FF4C29;
}
.ajlal-sd-product-stock {
    font-size: .68rem;
    font-weight: 600;
    color: #8a9b93;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f0f4f2;
}
.ajlal-sd-product-stock.is-low {
    color: #b8860b;
    background: #fdf6e3;
}
.ajlal-sd-product-stock.is-out {
    color: #c0392b;
    background: #fde8e8;
}
.ajlal-sd-product-actions {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
}

/* ── Orders list ───────────────────────────────────── */
.ajlal-sd-orders-list {
    display: grid;
    gap: 12px;
}
.ajlal-sd-order-card {
    background: #fff;
    border: 1px solid #e8ede9;
    border-radius: 14px;
    padding: 16px;
    transition: box-shadow .2s ease;
}
.ajlal-sd-order-card:hover {
    box-shadow: 0 4px 16px rgba(8, 84, 76, .08);
}
.ajlal-sd-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ajlal-sd-order-number {
    font-size: .85rem;
    font-weight: 700;
    color: #FF4C29;
}
.ajlal-sd-order-date {
    font-size: .72rem;
    color: #8a9b93;
}
.ajlal-sd-order-status {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ajlal-sd-order-status.is-pending {
    color: #b8860b;
    background: #fdf6e3;
}
.ajlal-sd-order-status.is-processing {
    color: #2980b9;
    background: #e8f4fd;
}
.ajlal-sd-order-status.is-completed {
    color: #155d42;
    background: #edfff6;
}
.ajlal-sd-order-status.is-cancelled,
.ajlal-sd-order-status.is-refunded {
    color: #c0392b;
    background: #fde8e8;
}
.ajlal-sd-order-items {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}
.ajlal-sd-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ajlal-sd-order-item-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}
.ajlal-sd-order-item-name {
    font-size: .78rem;
    font-weight: 600;
    color: #FF4C29;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ajlal-sd-order-item-qty {
    font-size: .72rem;
    color: #8a9b93;
    flex-shrink: 0;
}
.ajlal-sd-order-item-price {
    font-size: .78rem;
    font-weight: 700;
    color: #FF4C29;
    flex-shrink: 0;
}
.ajlal-sd-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f4f2;
    flex-wrap: wrap;
}
.ajlal-sd-order-total {
    font-size: 1rem;
    font-weight: 800;
    color: #FF4C29;
}

/* ── Storefront embed ──────────────────────────────── */
.ajlal-sd-storefront-embed {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e8ede9;
}
.ajlal-sd-storefront-embed iframe {
    display: block;
    border: none;
}

/* ── Loading ───────────────────────────────────────── */
.ajlal-sd-loading {
    text-align: center;
    padding: 40px 20px;
    color: #8a9b93;
    font-size: .85rem;
}

/* ── Pagination ────────────────────────────────────── */
.ajlal-sd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}
.ajlal-sd-pagination button {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid #e8ede9;
    background: #fff;
    color: #5a6b65;
    cursor: pointer;
    transition: all .2s ease;
}
.ajlal-sd-pagination button:hover:not(:disabled) {
    border-color: #FF4C29;
    color: #FF4C29;
}
.ajlal-sd-pagination button:disabled {
    opacity: .4;
    cursor: default;
}
.ajlal-sd-pagination .ajlal-sd-page-info {
    font-size: .75rem;
    color: #8a9b93;
    font-weight: 600;
}

/* ── Modal ─────────────────────────────────────────── */
.ajlal-sd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.ajlal-sd-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.ajlal-sd-modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.ajlal-sd-modal-overlay.is-open .ajlal-sd-modal {
    transform: translateY(0);
}
.ajlal-sd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e8ede9;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 1;
}
.ajlal-sd-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FF4C29;
    margin: 0;
}
.ajlal-sd-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f4f2;
    color: #5a6b65;
    font-size: 1.2rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .2s ease;
}
.ajlal-sd-modal-close:hover {
    background: #e8ede9;
    color: #FF4C29;
}
.ajlal-sd-modal-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e8ede9;
    position: sticky;
    bottom: 0;
    background: #fff;
}
.ajlal-sd-modal-actions .ajlal-sd-btn {
    flex: 1;
    justify-content: center;
}

/* ── Form fields ───────────────────────────────────── */
.ajlal-sd-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.ajlal-sd-field span {
    font-size: .72rem;
    font-weight: 700;
    color: #5a6b65;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ajlal-sd-field input,
.ajlal-sd-field textarea,
.ajlal-sd-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e8e4;
    border-radius: 12px;
    font-size: .85rem;
    font-family: inherit;
    color: #FF4C29;
    background: #fff;
    transition: border-color .2s ease;
    box-sizing: border-box;
}
.ajlal-sd-field input:focus,
.ajlal-sd-field textarea:focus {
    outline: none;
    border-color: #FF4C29;
    box-shadow: 0 0 0 3px rgba(8, 84, 76, .1);
}
.ajlal-sd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Image upload ──────────────────────────────────── */
.ajlal-sd-image-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ajlal-sd-image-preview {
    width: 100%;
    aspect-ratio: 16/9;
    border: 2px dashed #d5ddd8;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: .78rem;
    color: #8a9b93;
    background: #f8faf9;
    overflow: hidden;
}
.ajlal-sd-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Toast notification ────────────────────────────── */
.ajlal-sd-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #FF4C29;
    color: #fff;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: .82rem;
    font-weight: 600;
    z-index: 999999;
    opacity: 0;
    transition: all .3s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(8, 84, 76, .25);
}
.ajlal-sd-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.ajlal-sd-toast.is-error {
    background: #c0392b;
}

/* ── Desktop adjustments ───────────────────────────── */
@media (min-width: 768px) {
    .ajlal-sd-modal {
        border-radius: 20px;
        max-height: 80vh;
        margin: auto 0;
    }
    .ajlal-sd-modal-header {
        border-radius: 20px 20px 0 0;
    }
    .ajlal-sd-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ajlal-sd-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .ajlal-sd-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .ajlal-sd-shell {
        padding-bottom: 60px;
    }
}

/* ── Hide mobile nav when on seller dashboard ──────── */
body.ajlal-seller-dashboard-page .mobile-nav {
    display: none;
}

/* ── Edit product inline ───────────────────────────── */
.ajlal-sd-edit-form {
    padding: 16px;
    border-top: 1px solid #e8ede9;
    background: #f8faf9;
}
.ajlal-sd-edit-form .ajlal-sd-field {
    margin-bottom: 12px;
}
.ajlal-sd-edit-form .ajlal-sd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
