/* ==========================================================================
   VS Store Dashboard - Premium Design System
   ========================================================================== */

:root {
    /* Primary Colors - Purple Theme */
    --vs-primary-50: #faf5ff;
    --vs-primary-100: #f3e8ff;
    --vs-primary-200: #e9d5ff;
    --vs-primary-300: #d8b4fe;
    --vs-primary-400: #c084fc;
    --vs-primary-500: #a855f7;
    --vs-primary-600: #9333ea;
    --vs-primary-700: #7c3aed;
    --vs-primary-800: #6b21a8;
    --vs-primary-900: #581c87;

    /* Gray Scale */
    --vs-gray-50: #f9fafb;
    --vs-gray-100: #f3f4f6;
    --vs-gray-200: #e5e7eb;
    --vs-gray-300: #d1d5db;
    --vs-gray-400: #9ca3af;
    --vs-gray-500: #6b7280;
    --vs-gray-600: #4b5563;
    --vs-gray-700: #374151;
    --vs-gray-800: #1f2937;
    --vs-gray-900: #111827;

    /* Status Colors */
    --vs-success: #10b981;
    --vs-warning: #f59e0b;
    --vs-danger: #ef4444;
    --vs-info: #3b82f6;

    /* Shadows */
    --vs-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --vs-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --vs-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --vs-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --vs-radius-sm: 0.375rem;
    --vs-radius: 0.5rem;
    --vs-radius-lg: 0.75rem;
    --vs-radius-xl: 1rem;

    /* Transitions */
    --vs-transition: all 0.2s ease-in-out;

    /* Sidebar Width */
    --vs-sidebar-width: 260px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

caption,
tr th,
tr td {
    text-align: right !important;
}

.vs-dashboard {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background-color: var(--vs-gray-50);
}

.vs-dashboard * {
    box-sizing: border-box;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.vs-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--vs-sidebar-width);
    height: 100vh;
    background-color: var(--vs-gray-100);
    border-left: 1px solid var(--vs-gray-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.vs-sidebar-logo {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--vs-gray-200);
}

.vs-sidebar-logo img {
    max-width: 140px;
    height: auto;
}

/* Store Switcher */
.vs-store-switcher {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--vs-gray-200);
    background: linear-gradient(135deg, var(--vs-primary-50) 0%, var(--vs-gray-50) 100%);
    position: relative;
}

.vs-store-switcher::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--vs-primary-500), var(--vs-primary-400));
}

.vs-switcher-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vs-gray-500);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.vs-switcher-label svg {
    color: var(--vs-primary-500);
}

.vs-store-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--vs-gray-200);
    border-radius: var(--vs-radius);
    background-color: #fff;
    color: var(--vs-gray-800);
    cursor: pointer;
    transition: var(--vs-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1rem;
    padding-left: 2.25rem;
}

.vs-store-select:hover {
    border-color: var(--vs-primary-300);
}

.vs-store-select:focus {
    outline: none;
    border-color: var(--vs-primary-500);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.vs-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vs-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--vs-radius);
    color: var(--vs-gray-700);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--vs-transition);
}

.vs-nav-link:hover {
    background-color: var(--vs-gray-200);
    color: var(--vs-gray-900);
    text-decoration: none;
}

.vs-nav-link.active {
    background-color: var(--vs-gray-200);
    color: var(--vs-gray-900);
}

.vs-nav-link svg,
.vs-nav-link .vs-nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.vs-nav-link--logout {
    margin-top: auto;
    color: var(--vs-danger);
}

.vs-nav-link--logout:hover {
    background-color: #fef2f2;
    color: var(--vs-danger);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.vs-dashboard-content {
    margin-right: var(--vs-sidebar-width);
    min-height: 100vh;
}

/* ==========================================================================
   Header
   ========================================================================== */

.vs-header {
    background-color: #fff;
    box-shadow: var(--vs-shadow);
    padding: 1.5rem 2rem;
}

.vs-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.vs-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vs-header-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--vs-gray-200);
}

.vs-header-welcome {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vs-gray-900);
    margin: 0;
}

.vs-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.vs-header-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--vs-gray-500);
}

.vs-header-meta-item svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--vs-gray-400);
}

.vs-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Status Badges */
.vs-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.vs-badge--success {
    background-color: #d1fae5;
    color: #065f46;
}

.vs-badge--success svg {
    color: var(--vs-success);
}

.vs-badge--danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.vs-badge--danger svg {
    color: var(--vs-danger);
}

.vs-badge--warning {
    background-color: #fef3c7;
    color: #92400e;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--vs-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--vs-transition);
    border: none;
    text-decoration: none;
}

.vs-btn:hover {
    text-decoration: none;
}

.vs-btn-primary {
    background-color: var(--vs-primary-600);
    color: #fff;
    box-shadow: var(--vs-shadow-sm);
}

.vs-btn-primary:hover {
    background-color: var(--vs-primary-500);
    color: #fff;
}

.vs-btn-secondary {
    background-color: #fff;
    color: var(--vs-gray-700);
    border: 1px solid var(--vs-gray-300);
    box-shadow: var(--vs-shadow-sm);
}

.vs-btn-secondary:hover {
    background-color: var(--vs-gray-50);
    color: var(--vs-gray-700);
}

.vs-btn-warning {
    background-color: var(--vs-warning);
    color: #fff;
}

.vs-btn-warning:hover {
    background-color: #d97706;
    color: #fff;
}

.vs-btn-danger {
    background-color: var(--vs-danger);
    color: #fff;
}

.vs-btn-danger:hover {
    background-color: #dc2626;
    color: #fff;
}

.vs-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.vs-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.vs-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--vs-gray-900);
    margin: 0 0 1.25rem 0;
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */

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

.vs-stat-card {
    background-color: #fff;
    border-radius: var(--vs-radius-lg);
    box-shadow: var(--vs-shadow);
    padding: 1.25rem 1.5rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.vs-stat-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.vs-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--vs-radius);
    background-color: var(--vs-primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vs-stat-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #fff;
}

.vs-stat-label {
    font-size: 0.875rem;
    color: var(--vs-gray-500);
    margin: 0;
}

.vs-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vs-gray-900);
    margin: 0.25rem 0 0;
}

.vs-stat-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--vs-gray-50);
    padding: 0.75rem 1.5rem;
}

.vs-stat-footer a {
    font-size: 0.875rem;
    color: var(--vs-primary-600);
    text-decoration: none;
    font-weight: 500;
}

.vs-stat-footer a:hover {
    color: var(--vs-primary-500);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.vs-table-wrapper {
    background-color: #fff;
    border-radius: var(--vs-radius-lg);
    box-shadow: var(--vs-shadow);
    overflow: hidden;
}

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

.vs-table thead {
    background-color: var(--vs-gray-50);
}

.vs-table th {
    padding: 0.875rem 1rem;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vs-gray-900);
    border-bottom: 1px solid var(--vs-gray-200);
}

.vs-table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--vs-gray-700);
    border-bottom: 1px solid var(--vs-gray-200);
    vertical-align: middle;
}

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

.vs-table tbody tr:hover {
    background-color: var(--vs-gray-50);
}

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

.vs-table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--vs-gray-500);
}

.vs-table-image {
    width: 48px;
    height: 48px;
    border-radius: var(--vs-radius);
    object-fit: cover;
    background-color: var(--vs-gray-100);
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.vs-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.vs-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vs-gray-900);
    margin: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.vs-form-card {
    background-color: #fff;
    border-radius: var(--vs-radius-lg);
    box-shadow: var(--vs-shadow);
    padding: 2rem;
    max-width: 600px;
}

.vs-form-group {
    margin-bottom: 1.25rem;
}

.vs-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vs-gray-700);
    margin-bottom: 0.5rem;
}

.vs-form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--vs-gray-300);
    border-radius: var(--vs-radius);
    background-color: #fff;
    color: var(--vs-gray-900);
    transition: var(--vs-transition);
}

.vs-form-control:focus {
    outline: none;
    border-color: var(--vs-primary-500);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.vs-form-control::placeholder {
    color: var(--vs-gray-400);
}

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

.vs-form-error {
    color: var(--vs-danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.vs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.vs-modal.show {
    display: flex;
}

.vs-modal-content {
    background-color: #fff;
    border-radius: var(--vs-radius-lg);
    box-shadow: var(--vs-shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.vs-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--vs-gray-900);
    margin: 0;
}

.vs-modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--vs-gray-400);
    border-radius: var(--vs-radius);
    transition: var(--vs-transition);
}

.vs-modal-close:hover {
    background-color: var(--vs-gray-100);
    color: var(--vs-gray-600);
}

.vs-modal-body {
    padding: 1.5rem;
}

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

.vs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.vs-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: var(--vs-radius);
    font-size: 0.875rem;
    color: var(--vs-gray-700);
    text-decoration: none;
    transition: var(--vs-transition);
}

.vs-pagination .page-numbers:hover {
    background-color: var(--vs-gray-100);
}

.vs-pagination .page-numbers.current {
    background-color: var(--vs-primary-600);
    color: #fff;
}

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.vs-rating {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.vs-rating svg {
    width: 1rem;
    height: 1rem;
    color: var(--vs-warning);
}

.vs-rating-value {
    margin-right: 0.5rem;
    font-weight: 600;
    color: var(--vs-gray-900);
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.vs-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--vs-gray-500);
}

.vs-empty-state svg {
    width: 4rem;
    height: 4rem;
    color: var(--vs-gray-300);
    margin-bottom: 1rem;
}

.vs-empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vs-gray-700);
    margin: 0 0 0.5rem;
}

.vs-empty-state-text {
    font-size: 0.875rem;
    margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .vs-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .vs-sidebar.open {
        transform: translateX(0);
    }

    .vs-dashboard-content {
        margin-right: 0;
    }

    .vs-header {
        padding: 1rem;
    }

    .vs-main {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .vs-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .vs-header-actions {
        width: 100%;
    }

    .vs-header-actions .vs-btn {
        flex: 1;
    }

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

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