/* Admin Panel Styles */
:root {
    --admin-primary: #e80052;
    --admin-primary-dark: #c70046;
    --admin-bg: #f5f7fa;
    --admin-sidebar-bg: #1e2530;
    --admin-sidebar-text: #8b95a5;
    --admin-sidebar-active: #ffffff;
    --admin-card-bg: #ffffff;
    --admin-border: #e5e9ef;
    --admin-text: #2d3748;
    --admin-text-muted: #718096;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.5;
}

#admin-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.admin-sidebar__header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-logo strong {
    background: var(--admin-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.admin-sidebar__nav {
    flex: 1;
    padding: 1rem 0;
}

.admin-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.admin-sidebar__nav a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.admin-sidebar__nav a.active {
    background: rgba(232, 0, 82, 0.15);
    color: var(--admin-primary);
    border-right: 3px solid var(--admin-primary);
}

.admin-sidebar__nav a svg {
    flex-shrink: 0;
}

.admin-sidebar__nav .badge {
    background: var(--admin-primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

.admin-sidebar__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar__footer a,
.admin-sidebar__footer button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

.admin-sidebar__footer a:hover,
.admin-sidebar__footer button:hover {
    color: white;
}

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

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-header__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--admin-text-muted);
}

.admin-content {
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid--secondary {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    background: var(--admin-card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card--small {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}

.stat-card--small .stat-card__label {
    order: -1;
    font-size: 0.75rem;
}

.stat-card--small .stat-card__value {
    font-size: 1.5rem;
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card__icon.orders { background: #e0f2fe; color: #0284c7; }
.stat-card__icon.new { background: #fef3c7; color: #d97706; }
.stat-card__icon.customers { background: #d1fae5; color: #059669; }
.stat-card__icon.revenue { background: #ede9fe; color: #7c3aed; }

.stat-card__content {
    display: flex;
    flex-direction: column;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-text);
}

.stat-card__label {
    font-size: 0.875rem;
    color: var(--admin-text-muted);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--admin-border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.875rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--admin-primary);
}

.search-box button {
    padding: 0.625rem 1.25rem;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 500;
}

.search-box button:hover {
    background: var(--admin-primary-dark);
}

.filters-bar select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

/* Tables */
.table-container {
    background: var(--admin-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

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

.admin-table .price {
    font-weight: 600;
    color: var(--admin-text);
}

.admin-table .text-right {
    text-align: right;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.contact-info small {
    color: var(--admin-text-muted);
    font-size: 0.75rem;
}

.loading-cell,
.empty-cell {
    text-align: center;
    padding: 3rem !important;
    color: var(--admin-text-muted);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.new { background: #fef3c7; color: #92400e; }
.status-badge.processing { background: #dbeafe; color: #1e40af; }
.status-badge.shipped { background: #e0e7ff; color: #3730a3; }
.status-badge.delivered { background: #d1fae5; color: #065f46; }
.status-badge.cancelled { background: #fee2e2; color: #991b1b; }

/* Status Select */
.status-select {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
    font-size: 0.8125rem;
    cursor: pointer;
    background: white;
}

.status-select.new { border-color: #fcd34d; background: #fef3c7; }
.status-select.processing { border-color: #60a5fa; background: #dbeafe; }
.status-select.shipped { border-color: #818cf8; background: #e0e7ff; }
.status-select.delivered { border-color: #34d399; background: #d1fae5; }
.status-select.cancelled { border-color: #f87171; background: #fee2e2; }

/* Buttons */
.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--admin-text-muted);
    border-radius: 6px;
    transition: all 0.2s;
}

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

.btn-primary {
    background: var(--admin-primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--admin-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.pagination button:hover:not(:disabled) {
    background: var(--admin-bg);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 0.875rem;
    color: var(--admin-text-muted);
}

/* Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.catalog-card {
    background: var(--admin-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.catalog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.catalog-card__image {
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.catalog-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.catalog-card__content {
    padding: 1rem;
}

.catalog-card__title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.catalog-card__sku {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    margin-bottom: 0.75rem;
}

.catalog-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-card__price {
    font-weight: 700;
    color: var(--admin-primary);
}

.catalog-card__stock {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.catalog-card__stock.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.catalog-card__stock.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* Recent Section */
.recent-section {
    background: var(--admin-card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recent-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--admin-text-muted);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--admin-text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-body h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

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

.order-details-grid p,
.customer-details-grid p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 70px;
    }
    
    .admin-sidebar__header {
        padding: 1rem;
        text-align: center;
    }
    
    .admin-logo strong {
        padding: 0.5rem;
    }
    
    .admin-sidebar__nav a span,
    .admin-sidebar__footer span,
    .admin-sidebar__footer a span {
        display: none;
    }
    
    .admin-sidebar__nav a {
        justify-content: center;
        padding: 1rem;
    }
    
    .admin-sidebar__nav .badge {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        margin: 0;
    }
    
    .admin-main {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-header {
        padding: 1rem;
    }
    
    .admin-header h1 {
        font-size: 1.2rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-box {
        max-width: none;
    }
    
    .modal {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .order-details-grid,
    .customer-details-grid {
        grid-template-columns: 1fr;
    }
    
    /* Orders table mobile */
    .orders-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .orders-table thead {
        display: none;
    }
    
    .orders-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--admin-card-bg);
        border-radius: 10px;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .orders-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--admin-border);
        font-size: 0.9rem;
    }
    
    .orders-table tbody td:last-child {
        border-bottom: none;
    }
    
    .orders-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--admin-text-muted);
        margin-right: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-header h1 {
        font-size: 1rem;
    }
    
    .admin-content {
        padding: 0.75rem;
    }
    
    .filters-bar input,
    .filters-bar select {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Hide elements initially to prevent FOUC */
[v-cloak] {
    display: none;
}
