@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
}

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

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    color: #1f2937;
}

/* Темная тема */
body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    background-attachment: fixed;
    color: #f1f5f9;
}

/* Градиентная тема с Bootstrap градиентами */
body.gradient-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    background-attachment: fixed;
    animation: gradientShift 15s ease infinite;
    color: #1f2937;
    min-height: 100vh;
}

/* Анимация градиента */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Градиентная тема - улучшенная читаемость карточек */
body.gradient-theme .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    color: #1f2937;
}

body.gradient-theme .card-header {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    color: #1f2937;
}

body.gradient-theme .navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

body.gradient-theme .navbar-brand,
body.gradient-theme .nav-link {
    color: #1f2937 !important;
}

body.gradient-theme .nav-link:hover {
    color: var(--primary-color) !important;
}

body.gradient-theme .table {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1f2937 !important;
}

body.gradient-theme .table thead {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1f2937 !important;
}

body.gradient-theme .table thead th {
    color: #1f2937 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.gradient-theme .table tbody td {
    color: #1f2937 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.gradient-theme .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

body.gradient-theme .form-control,
body.gradient-theme .form-select {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

body.gradient-theme .form-control:focus,
body.gradient-theme .form-select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
    color: #1f2937;
}

body.gradient-theme h1,
body.gradient-theme h2,
body.gradient-theme h3,
body.gradient-theme h4,
body.gradient-theme h5,
body.gradient-theme h6 {
    color: #1f2937;
}

body.gradient-theme .text-muted {
    color: #6b7280 !important;
}

body.gradient-theme .badge:not([style*="background-color"]):not([style*="198754"]):not([style*="dc3545"]) {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

/* Принудительно белый текст для всех цветных бейджей в градиентной теме */
body.gradient-theme .badge[style*="198754"],
body.gradient-theme .badge[style*="dc3545"],
body.gradient-theme .badge[style*="color: #ffffff"] {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
    font-weight: bold !important;
}

/* Принудительно белый текст и правильные цвета для цветных бейджей */
body.gradient-theme .badge.bg-success,
body.gradient-theme .badge[style*="background-color: #198754"],
body.gradient-theme .badge[style*="background-color:#198754"] {
    background-color: #198754 !important;
    color: #ffffff !important;
    border: none !important;
}

body.gradient-theme .badge.bg-danger,
body.gradient-theme .badge[style*="background-color: #dc3545"],
body.gradient-theme .badge[style*="background-color:#dc3545"] {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border: none !important;
}

body.gradient-theme .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

body.gradient-theme .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}

body.dark-theme .badge.bg-success,
body.dark-theme .badge[style*="background-color: #198754"],
body.dark-theme .badge[style*="background-color:#198754"] {
    background-color: #198754 !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .badge.bg-danger,
body.dark-theme .badge[style*="background-color: #dc3545"],
body.dark-theme .badge[style*="background-color:#dc3545"] {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

body.dark-theme .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}

/* Универсальное правило для всех бейджей - принудительно белый текст для цветных бейджей */
.badge[style*="198754"],
.badge[style*="dc3545"],
.badge[style*="background-color: #198754"],
.badge[style*="background-color:#198754"],
.badge[style*="background-color: #dc3545"],
.badge[style*="background-color:#dc3545"],
span.badge[style*="198754"],
span.badge[style*="dc3545"],
.badge[style*="color: #ffffff"],
body .badge[style*="198754"],
body .badge[style*="dc3545"] {
    color: #ffffff !important;
    border: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    font-weight: bold !important;
}

body.gradient-theme .alert {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

body.gradient-theme .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

body.gradient-theme .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a91 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

body.dark-theme .card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

body.dark-theme .card-header {
    background: rgba(15, 23, 42, 0.6) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

body.dark-theme .table {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .table thead {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .table thead th {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .table tbody {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .table tbody td {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .table tbody tr {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .table tbody tr:hover {
    background: rgba(51, 65, 85, 0.7) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.9) !important;
}

body.dark-theme .table tbody tr:nth-child(even):hover {
    background: rgba(51, 65, 85, 0.7) !important;
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background: rgba(30, 41, 59, 0.9);
    border-color: #6366f1;
    color: #f1f5f9;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.dark-theme .text-muted {
    color: #94a3b8 !important;
}

/* Стили для card-body в темной теме */
body.dark-theme .card-body {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
}

/* Стили для списков пользователей и других элементов внутри карточек */
body.dark-theme .card-body .d-flex,
body.dark-theme .card-body .border,
body.dark-theme .card-body .rounded,
body.dark-theme .card-body .p-2,
body.dark-theme .card-body .p-3,
body.dark-theme .card-body .mb-2,
body.dark-theme .card-body .mb-3 {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
}

/* Стили для элементов с белым фоном внутри карточек */
body.dark-theme .card-body .bg-light,
body.dark-theme .card-body .bg-white,
body.dark-theme .card-body [style*="background-color: white"],
body.dark-theme .card-body [style*="background-color:#fff"],
body.dark-theme .card-body [style*="background-color:#ffffff"] {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0 !important;
}

/* Стили для чередующихся цветов фона */
body.dark-theme .card-body [style*="background-color: #f8f9fa"],
body.dark-theme .card-body [style*="background-color:#f8f9fa"] {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0 !important;
}

body.dark-theme .card-body [style*="background-color: white"],
body.dark-theme .card-body [style*="background-color:#fff"] {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
}

/* Стили для текста в элементах карточек */
body.dark-theme .card-body strong,
body.dark-theme .card-body b {
    color: #f1f5f9 !important;
}

body.dark-theme .card-body code {
    background: rgba(15, 23, 42, 0.8) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(129, 140, 248, 0.3) !important;
}

body.dark-theme .card-body small {
    color: #cbd5e1 !important;
}

/* Стили для списков и групп */
body.dark-theme .list-group-item {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .list-group-item:hover {
    background: rgba(51, 65, 85, 0.7) !important;
    color: #f1f5f9 !important;
}

/* Стили для таблиц внутри card-body */
body.dark-theme .card-body .table {
    background: transparent !important;
}

body.dark-theme .card-body .table td,
body.dark-theme .card-body .table th {
    background: transparent !important;
}

/* Стили для элементов dashboard */
body.dark-theme .dashboard-new-user,
body.dark-theme .dashboard-payment-row,
body.dark-theme .dashboard-vin-row,
body.dark-theme .dashboard-subscription-row {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .dashboard-new-user:hover,
body.dark-theme .dashboard-payment-row:hover,
body.dark-theme .dashboard-vin-row:hover,
body.dark-theme .table-hover tbody tr:hover {
    background: rgba(51, 65, 85, 0.7) !important;
}

/* Стили для таблиц со специальными классами */
body.dark-theme .table-sm {
    background: rgba(30, 41, 59, 0.8) !important;
}

body.dark-theme .table-hover tbody tr {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
}

body.dark-theme .table-hover tbody tr:hover td {
    background: rgba(51, 65, 85, 0.7) !important;
    color: #f1f5f9 !important;
}

/* Стили для всех элементов с белым/светлым фоном (переопределяем inline стили) */
body.dark-theme [style*="background-color: white"],
body.dark-theme [style*="background-color:#fff"],
body.dark-theme [style*="background-color:#ffffff"],
body.dark-theme [style*="background-color: white"],
body.dark-theme [style*="background-color:#fff"],
body.dark-theme [style*="background-color: #f8f9fa"],
body.dark-theme [style*="background-color:#f8f9fa"],
body.dark-theme [style*="background-color:#f8f9fa"] {
    background-color: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0 !important;
}

/* Специфичные стили для элементов dashboard с inline стилями */
body.dark-theme .dashboard-new-user[style*="background-color"],
body.dark-theme .dashboard-payment-row[style*="background-color"],
body.dark-theme .dashboard-vin-row[style*="background-color"] {
    background-color: rgba(30, 41, 59, 0.9) !important;
}

body.dark-theme .dashboard-new-user[style*="#f8f9fa"],
body.dark-theme .dashboard-new-user[style*="white"] {
    background-color: rgba(30, 41, 59, 0.95) !important;
}

body.dark-theme .dashboard-new-user:nth-child(even)[style*="background-color"] {
    background-color: rgba(30, 41, 59, 0.9) !important;
}

body.dark-theme .dashboard-new-user:nth-child(odd)[style*="background-color"] {
    background-color: rgba(30, 41, 59, 0.85) !important;
}

/* Стили для четных строк таблиц */
body.dark-theme .table tbody tr:nth-child(even) td {
    background: rgba(30, 41, 59, 0.95) !important;
}

/* Стили для ссылок в темной теме */
body.dark-theme .card-body a {
    color: #818cf8 !important;
}

body.dark-theme .card-body a:hover {
    color: #a78bfa !important;
}

/* Стили для текста в карточках */
body.dark-theme .card-body,
body.dark-theme .card-body p,
body.dark-theme .card-body div,
body.dark-theme .card-body span {
    color: #e2e8f0 !important;
}

/* Дополнительные стили для читаемости текста */
body.dark-theme .card-body strong,
body.dark-theme .card-body b {
    color: #f1f5f9 !important;
    font-weight: 600;
}

body.dark-theme .card-body .text-muted {
    color: #94a3b8 !important;
}

/* Стили для badge в темной теме */
body.dark-theme .badge {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Принудительно белый текст для всех цветных бейджей в темной теме */
body.dark-theme .badge[style*="198754"],
body.dark-theme .badge[style*="dc3545"],
body.dark-theme .badge[style*="color: #ffffff"] {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
    font-weight: bold !important;
}

/* Стили для input и select внутри карточек */
body.dark-theme .card-body .form-control,
body.dark-theme .card-body .form-select {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .card-body .form-control:focus,
body.dark-theme .card-body .form-select:focus {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: #818cf8 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .nav-link {
    color: #cbd5e1 !important;
}

body.dark-theme .nav-link:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8 !important;
}

body.dark-theme .navbar-brand {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-theme h1 {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: translateY(-4px) rotate(180deg) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

/* Стили navbar - НЕ переопределяем display, чтобы JavaScript мог управлять видимостью */
.navbar,
#main-navbar,
.navbar.navbar-expand-lg {
    visibility: visible;
    opacity: 1;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
}

/* Когда navbar виден, используем flex */
#main-navbar[style*="display: block"],
#main-navbar[style*="display: flex"] {
    display: flex !important;
}

/* КРИТИЧНО: Гарантируем работу Bootstrap dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}

.dropdown-item:hover {
    color: #1e2125;
    background-color: #e9ecef;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.navbar-brand {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #667eea !important; /* Fallback цвет */
}

.nav-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 500;
    color: #4b5563 !important;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 4px;
    padding: 8px 16px !important;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1 !important;
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1 !important;
}

.card {
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    border-radius: 20px 20px 0 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card.border-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.stat-card.border-danger {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.stat-card .card-body {
    position: relative;
    z-index: 1;
}

/* UIkit карточки с stat-card стилями */
.uk-card.stat-card {
    border: none !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

.uk-card.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.uk-card.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.uk-card.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.uk-card.stat-card.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.uk-card.stat-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.12) !important;
}

.uk-card.stat-card .uk-card-body {
    position: relative;
    z-index: 1;
    padding: 1.5rem !important;
}

/* UIkit grid для статистических карточек */
#stats-cards {
    margin-bottom: 2rem;
}

#stats-cards > div {
    margin-bottom: 1rem;
}

/* Темная тема для UIkit карточек */
body.dark-theme .uk-card.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

body.dark-theme .uk-card.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

body.dark-theme .uk-card.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

body.dark-theme .uk-card.stat-card.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* UIkit стили для Bootstrap кнопок - автоматическое применение */
.btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* UIkit button base styles */
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

/* UIkit primary button */
.btn-primary {
    background-color: #1e87f0 !important;
    border-color: #1e87f0 !important;
    color: #fff !important;
}

.btn-primary:hover {
    background-color: #0f7ae5 !important;
    border-color: #0f7ae5 !important;
    box-shadow: 0 4px 12px rgba(30, 135, 240, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    background-color: #0e6ed8 !important;
    transform: translateY(0);
}

/* UIkit outline primary */
.btn-outline-primary {
    background-color: transparent !important;
    border-color: #1e87f0 !important;
    color: #1e87f0 !important;
}

.btn-outline-primary:hover {
    background-color: #1e87f0 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* UIkit success button */
.btn-success {
    background-color: #32d296 !important;
    border-color: #32d296 !important;
    color: #fff !important;
}

.btn-success:hover {
    background-color: #28c085 !important;
    border-color: #28c085 !important;
    box-shadow: 0 4px 12px rgba(50, 210, 150, 0.4);
    transform: translateY(-2px);
}

.btn-outline-success {
    background-color: transparent !important;
    border-color: #32d296 !important;
    color: #32d296 !important;
}

.btn-outline-success:hover {
    background-color: #32d296 !important;
    color: #fff !important;
}

/* UIkit danger button */
.btn-danger {
    background-color: #f0506e !important;
    border-color: #f0506e !important;
    color: #fff !important;
}

.btn-danger:hover {
    background-color: #ee395b !important;
    border-color: #ee395b !important;
    box-shadow: 0 4px 12px rgba(240, 80, 110, 0.4);
    transform: translateY(-2px);
}

.btn-outline-danger {
    background-color: transparent !important;
    border-color: #f0506e !important;
    color: #f0506e !important;
}

.btn-outline-danger:hover {
    background-color: #f0506e !important;
    color: #fff !important;
}

/* UIkit warning button */
.btn-warning {
    background-color: #faa05a !important;
    border-color: #faa05a !important;
    color: #fff !important;
}

.btn-warning:hover {
    background-color: #f9903a !important;
    border-color: #f9903a !important;
    box-shadow: 0 4px 12px rgba(250, 160, 90, 0.4);
    transform: translateY(-2px);
}

/* UIkit info button */
.btn-info {
    background-color: #1e87f0 !important;
    border-color: #1e87f0 !important;
    color: #fff !important;
}

.btn-info:hover {
    background-color: #0f7ae5 !important;
    border-color: #0f7ae5 !important;
    box-shadow: 0 4px 12px rgba(30, 135, 240, 0.4);
    transform: translateY(-2px);
}

/* UIkit secondary button */
.btn-secondary {
    background-color: #222 !important;
    border-color: #222 !important;
    color: #fff !important;
}

.btn-secondary:hover {
    background-color: #0f0f0f !important;
    border-color: #0f0f0f !important;
    box-shadow: 0 4px 12px rgba(34, 34, 34, 0.4);
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background-color: transparent !important;
    border-color: #222 !important;
    color: #222 !important;
}

.btn-outline-secondary:hover {
    background-color: #222 !important;
    color: #fff !important;
}

/* UIkit small button */
.btn-sm {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
}

/* UIkit link button */
.btn-link {
    background-color: transparent !important;
    border: none !important;
    color: #1e87f0 !important;
    text-decoration: underline !important;
    padding: 0 !important;
}

.btn-link:hover {
    color: #0f7ae5 !important;
    text-decoration: underline !important;
}

/* UIkit button group */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Улучшения hover эффектов */
.btn:hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Темная тема для кнопок */
body.dark-theme .btn-primary {
    background-color: #1e87f0 !important;
    border-color: #1e87f0 !important;
}

body.dark-theme .btn-outline-primary {
    border-color: #1e87f0 !important;
    color: #1e87f0 !important;
}

body.dark-theme .btn-outline-primary:hover {
    background-color: #1e87f0 !important;
    color: #fff !important;
}

h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container-fluid {
    padding: 0 2rem;
}

#app-content {
    min-height: calc(100vh - 100px);
    padding: 2rem 0;
}

.loading {
    text-align: center;
    padding: 60px;
}

.skeleton {
    display: block;
    width: 100%;
    height: 12px;
    margin: 8px 0;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 37%, rgba(0,0,0,0.06) 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.2s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Highlight for new dynamic items (мягче и дольше) */
.flash-highlight {
    animation: flashHighlight 2.5s ease-in-out;
}

@keyframes flashHighlight {
    0% {
        background-color: rgba(99, 102, 241, 0.22); /* мягче фиолетовый */
    }
    100% {
        background-color: transparent;
    }
}

/* Анимация появления новых VIN запросов */
@keyframes fadeIn {
    from {
        opacity: 0;
        background-color: rgba(16, 185, 129, 0.3);
    }
    to {
        opacity: 1;
        background-color: transparent;
    }
}

.table-success {
    animation: fadeIn 1.5s ease-out;
}

/* Индикатор автообновления */
#auto-refresh-indicator {
    font-size: 0.85rem;
    color: #6c757d;
}

#auto-refresh-indicator i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Стили для карточек подписок */
.dashboard-subscription-row {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dashboard-subscription-row:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-left-width: 6px !important;
}

.dashboard-subscription-row:hover .hover-primary {
    color: #6366f1 !important;
    transition: color 0.3s ease;
}

.hover-primary {
    transition: color 0.3s ease;
}

.hover-primary:hover {
    color: #6366f1 !important;
}

/* Дополнительные стили для темной темы - исправление проблем с видимостью */

/* Стили для alert в темной теме */
body.dark-theme .alert {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

body.dark-theme .alert-info {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    color: #93c5fd !important;
}

body.dark-theme .alert-success {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #6ee7b7 !important;
}

body.dark-theme .alert-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
}

body.dark-theme .alert-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fcd34d !important;
}

/* Улучшенные стили для текста в таблицах */
body.dark-theme .table td strong,
body.dark-theme .table th strong {
    color: #f1f5f9 !important;
}

/* Стили для всех вложенных элементов в card-body */
body.dark-theme .card-body * {
    color: inherit;
}

/* Переопределение для конкретных классов Bootstrap */
body.dark-theme .bg-light,
body.dark-theme .bg-white {
    background-color: rgba(30, 41, 59, 0.9) !important;
}

body.dark-theme .text-dark {
    color: #e2e8f0 !important;
}

/* Стили для списков и групп в карточках */
body.dark-theme .list-group {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Улучшенные бейджи для подписок */
.dashboard-subscription-row .badge {
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.image-resizer-container {
    max-width: 100%;
}

.image-resizer-preview {
    position: relative;
    display: inline-flex;
    background: #f8fafc;
    min-width: 120px;
    min-height: 80px;
}

.image-resizer-img {
    display: block;
    max-width: 100%;
    height: auto;
}

.image-resizer-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    right: 8px;
    bottom: 8px;
    background: #0d6efd;
    color: #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    font-size: 0.75rem;
}

.image-resizer-toolbar .btn {
    padding: 4px 12px;
}

body.dark-theme .image-resizer-preview {
    background: rgba(15, 23, 42, 0.6);
}

body.dark-theme .image-resizer-handle {
    background: #a78bfa;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.4);
}

/* КРИТИЧНО: Принудительно белый текст для всех цветных бейджей - максимальная специфичность */
body.gradient-theme span.badge[style*="198754"],
body.gradient-theme span.badge[style*="dc3545"],
body.gradient-theme .badge[style*="background-color: #198754"],
body.gradient-theme .badge[style*="background-color:#198754"],
body.gradient-theme .badge[style*="background-color: #dc3545"],
body.gradient-theme .badge[style*="background-color:#dc3545"],
body.dark-theme span.badge[style*="198754"],
body.dark-theme span.badge[style*="dc3545"],
body.dark-theme .badge[style*="background-color: #198754"],
body.dark-theme .badge[style*="background-color:#198754"],
body.dark-theme .badge[style*="background-color: #dc3545"],
body.dark-theme .badge[style*="background-color:#dc3545"],
span.badge[style*="color: #ffffff"],
.badge[style*="color: #ffffff"] {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
    font-weight: 700 !important;
    border: none !important;
}



