/* ====== Глобальные стили ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: #f1f5f9;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ====== Layout ====== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--gray-100);
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* ====== Top Navigation ====== */
.top-nav {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 40;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.seller-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.seller-details {
    display: flex;
    flex-direction: column;
}

.seller-name {
    font-weight: 600;
    font-size: 0.95rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-id {
    font-size: 0.75rem;
    opacity: 0.9;
}

.notification-badge {
    position: relative;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-badge:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

/* ====== User Menu ====== */
.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.dropdown-header strong {
    display: block;
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.dropdown-header span {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.dropdown-divider {
    border-top: 1px solid var(--gray-200);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

.text-danger {
    color: var(--danger) !important;
}

.text-danger:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

/* ====== Mobile Sidebar ====== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

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

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    margin: 0.25rem 0;
}

.sidebar-nav .nav-item:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--gray-100);
    border-radius: var(--radius);
}

.user-info-mini i {
    color: var(--primary);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #fee2e2;
    color: #dc2626;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: #fecaca;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ====== Modal Styles ====== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

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

/* ====== Form Styles ====== */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group label i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.required {
    color: var(--danger);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.input-group {
    display: flex;
    position: relative;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.btn-toggle-password {
    padding: 0 1rem;
    background: white;
    border: 1.5px solid var(--gray-200);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ====== Button Styles ====== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

/* ====== Cards ====== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--primary);
}

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

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info {
    flex: 1;
    margin-left: 1rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-change {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ====== Table Styles ====== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

.table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.95rem;
}

.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.table tr {
    transition: all 0.2s;
}

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

/* ====== API Keys Grid ====== */
.api-keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.api-key-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.api-key-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.api-key-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.api-key-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
}

.api-key-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.api-key-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.api-key-value {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    word-break: break-all;
}

.api-key-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.api-key-meta i {
    margin-right: 0.25rem;
}

.api-key-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.api-key-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* ====== Empty State ====== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* ====== Footer ====== */
.main-footer {
    background: white;
    padding: 1.5rem 2rem;
    margin-top: auto;
    border-top: 1px solid var(--gray-200);
}

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

.footer-left p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.footer-right {
    display: flex;
    gap: 1.5rem;
}

.footer-version,
.footer-support {
    color: var(--gray-500);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-version i,
.footer-support i {
    color: var(--primary);
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }
    
    .seller-details {
        display: none;
    }
    
    .seller-info {
        padding: 0.5rem;
    }
    
    .seller-avatar {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }
    
    .top-nav {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .seller-info {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .api-keys-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* ====== Animations ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}
/* ====== Product Table Styles ====== */
.price-green {
    color: #059669 !important;
    background-color: #d1fae5;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.price-red {
    color: #dc2626 !important;
    background-color: #fee2e2;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.price-green {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.price-red {
    background: #fee2e2;
    color: #991b1b;
}

.nmid {
    font-family: monospace;
    background: #dbeafe;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    color: #1e40af;
    font-size: 13px;
}

.price-discounted {
    font-weight: 700;
    color: #dc2626;
    font-size: 16px;
}

.rrc-price {
    font-weight: 600;
    color: #1e40af;
    font-size: 15px;
}

.table-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.filter-group {
    display: flex;
    align-items: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px;
}

.btn-page {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-page.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--gray-500);
    padding: 0 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .table-filters {
        flex-direction: column;
    }
    
    .filter-group .form-control {
        width: 100% !important;
    }
    
    .header-actions {
        flex-direction: column;
    }
    
    .nmid {
        font-size: 12px;
        padding: 2px 6px;
    }
}

/* Дополнительные стили для страницы РРЦ */
.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    font-size: 24px;
    color: #667eea;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rrc-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Стили для пустого состояния */
.text-center.py-4 i {
    color: #dee2e6;
    font-size: 48px;
}

.text-center.py-4 p {
    color: #6c757d;
    font-size: 16px;
}