/* FG Store Admin Panel - Минималистичный дизайн */

:root {
    /* Минималистичная цветовая палитра */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    
    /* Нейтральные цвета */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Фон */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    
    /* Радиусы */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Переходы */
    --transition: all 0.15s ease;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Header */
header {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--gray-200);
}

header h1 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    color: var(--gray-600);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
    border: 1px solid transparent;
}

.logout-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Navigation */
.main-nav {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    gap: 0.125rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--gray-200);
}

.nav-item {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--gray-600);
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
main {
    flex: 1;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
}

.card-header {
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.card-header h3 {
    color: var(--gray-900);
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.875rem;
    text-align: center;
    background: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-info {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.btn-info:hover {
    background: #0e7490;
    border-color: #0e7490;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #c2410c;
    border-color: #c2410c;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:hover {
    border-color: var(--gray-400);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 3px solid;
    font-weight: 500;
    position: relative;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: var(--success);
}

.alert-error, .alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-info {
    background: #f0f9ff;
    color: #1e40af;
    border-left-color: var(--info);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    background: var(--bg-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.data-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 0.875rem;
}

.data-table tr {
    transition: var(--transition);
}

.data-table tr:hover {
    background: var(--gray-50);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.stat-value {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.75rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-available, .count-good, .status-good {
    background: #dcfce7;
    color: #166534;
}

.status-reserved, .status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-issued, .status-in_use {
    background: #dbeafe;
    color: #1e40af;
}

.status-used, .status-banned {
    background: #fee2e2;
    color: #991b1b;
}

.status-invalid, .status-danger, .count-low {
    background: #fee2e2;
    color: #991b1b;
}

.status-suspended {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Action badges */
.action-badge {
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.action-issued {
    background: #dbeafe;
    color: #1e40af;
}

.action-status_changed {
    background: #fef3c7;
    color: #92400e;
}

.action-created {
    background: #dcfce7;
    color: #166534;
}

/* Dashboard */
.dashboard h2 {
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

.stat-card h3 {
    color: var(--gray-900);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.stat-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
}

.stat-label {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Upload area */
.batch-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin: 0.75rem 0;
}

.batch-upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.batch-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Code preview */
.codes-preview {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    border: 1px solid var(--gray-200);
    margin-top: 0.75rem;
}

/* Batch info */
.batch-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.batch-stat {
    text-align: center;
}

.batch-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.batch-stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Sort headers */
.sort-header {
    cursor: pointer;
    user-select: none;
}

.sort-header:hover {
    background: var(--gray-100);
}

/* Bulk actions */
.bulk-actions {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: none;
}

.bulk-actions.active {
    display: block;
}

.code-row.selected {
    background: rgba(37, 99, 235, 0.1);
}

/* Mini stats */
.stats-mini {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-mini {
    background: var(--bg-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    text-align: center;
    min-width: 100px;
}

.stat-mini-value {
    font-size: 1rem;
    font-weight: 600;
}

.stat-mini-label {
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 1rem; }
.d-none { display: none; }
.flex { display: flex; }
.gap-10 { gap: 0.5rem; }
.gap-5 { gap: 0.25rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Code blocks */
code {
    background: var(--gray-100);
    color: var(--gray-800);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85em;
}

/* ============================================ */
/*      УЛУЧШЕННЫЕ СТИЛИ ДЛЯ МОДУЛЯ           */
/*           "ИСТОРИЯ ВЫДАЧ"                    */
/* ============================================ */

/* Анимации для уведомлений */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: slideDown 0.3s ease-out;
}

/* Кнопка закрытия уведомления */
.alert .close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    padding: 0.25rem;
    border-radius: var(--radius);
}

.alert .close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

/* Анимация загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Выделение строк таблицы */
.data-table tbody tr.selected {
    background: rgba(37, 99, 235, 0.1) !important;
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* Индикаторы сортировки */
.data-table th.sorted-asc:after {
    content: ' ↑';
    color: var(--primary);
    font-weight: bold;
}

.data-table th.sorted-desc:after {
    content: ' ↓';
    color: var(--primary);
    font-weight: bold;
}

/* Анимированные карточки статистики */
.pulse-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.pulse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.8s;
}

.pulse-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(37, 99, 235, 0.3);
}

.pulse-card:hover::before {
    left: 100%;
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.stat-icon-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stat-icon {
    font-size: 1.75rem;
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.stat-trend {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    font-weight: 600;
    display: inline-block;
}

/* Переключатель режимов */
.view-toggle {
    margin-bottom: 2rem;
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    gap: 0.5rem;
    border: 1px solid var(--gray-200);
}

.view-toggle .btn {
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.view-toggle .btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: scale(1.05);
}

/* Улучшенная форма фильтров */
.filter-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.filter-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #06b6d4, #10b981);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 0;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--gray-300);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Улучшенные кнопки */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.button-group .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.button-group .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.button-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.button-group .btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
}

.btn-outline {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}

/* Улучшенные таблицы */
.table-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: white;
    margin-bottom: 2rem;
}

.data-table th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: var(--gray-700);
    font-weight: 700;
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    position: relative;
}

.data-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.data-table th:hover::after {
    transform: scaleX(1);
}

.data-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.2s ease;
}

.data-table tr {
    transition: all 0.3s ease;
}

.data-table tr:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02), rgba(59, 130, 246, 0.02));
    transform: scale(1.005);
}

/* Улучшенные статусы */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.status-badge:hover::before {
    left: 100%;
}

.status-badge.status-available {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.status-badge.status-issued {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.status-badge.status-returned {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.status-badge.status-expired {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* Форма возврата товара */
.return-form {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #fcd34d;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(252, 211, 77, 0.1);
}

.return-form h4 {
    margin-bottom: 1rem;
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
    padding-bottom: 0.5rem;
}

.return-form textarea {
    border: 2px solid #f59e0b;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 120px;
    font-family: inherit;
    resize: vertical;
    width: 100%;
    margin: 0.75rem 0 1rem 0;
    padding: 0.75rem;
}

.return-form textarea:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.return-options {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #fde68a;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #dc2626;
}

.checkbox-text {
    font-weight: 600;
    color: #92400e;
    line-height: 1.4;
}

.help-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    font-style: italic;
    margin-left: 2.25rem;
}

.return-form label {
    font-weight: 600;
    color: #92400e;
    display: block;
    margin-bottom: 0.5rem;
}

.return-form .action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.btn-view-details {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(8, 145, 178, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    margin: 0.125rem;
}

.btn-view-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(8, 145, 178, 0.3);
    text-decoration: none;
    color: white;
}

.btn-view-details:hover::before {
    left: 100%;
}

.btn-return {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
    margin: 0.125rem;
    white-space: nowrap;
}

.btn-return:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(217, 119, 6, 0.3);
}

/* Контейнер для кнопок действий */
.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Поисковая подсветка */
.search-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

/* Информационные элементы */
.worker-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.worker-main {
    font-weight: 600;
    color: var(--gray-900);
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.worker-details {
    font-size: 0.75rem;
    color: var(--gray-500);
    padding: 0.25rem 0.5rem;
    background: var(--gray-50);
    border-radius: 6px;
    display: inline-block;
}

.item-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: var(--gray-800);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    border: 1px solid var(--gray-200);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.item-value:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-1px);
}

/* Форма возврата */
.return-form {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #fcd34d;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(252, 211, 77, 0.1);
}

.return-form textarea {
    border: 2px solid #f59e0b;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.return-form textarea:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Дополнительные элементы */
.transaction-items {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.cost-badge {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(22, 101, 52, 0.1);
    position: relative;
    overflow: hidden;
}

.cost-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.cost-badge:hover::before {
    left: 100%;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.8));
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    color: var(--gray-500);
    border: 2px dashed var(--gray-300);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Адаптивные стили для модуля истории */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .view-toggle {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pulse-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 90vh;
        padding: 1rem;
    }
    
    .quick-filters {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .btn-view-details {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .worker-info,
    .item-details {
        gap: 0.125rem;
    }
    
    .item-value {
        font-size: 0.7rem;
        padding: 0.125rem 0.25rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/*               RESPONSIVE                     */
/* ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .nav-item {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .form-grid, .form-row {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Адаптивность для модуля истории */
    .button-group {
        flex-direction: column;
    }
    
    .view-toggle {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 90vh;
        padding: 1rem;
    }
    
    .quick-filters {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .btn-view-details {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .worker-info,
    .item-details {
        gap: 0.125rem;
    }
    
    .item-value {
        font-size: 0.7rem;
        padding: 0.125rem 0.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    header {
        padding: 0.75rem;
    }
    
    main {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .form-control {
        padding: 0.375rem 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}