* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0c15 0%, #111827 100%);
    color: #eef2ff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== Авторизация ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0c15 0%, #111827 100%);
}
.login-card {
    background: rgba(30, 35, 48, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}
.login-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.login-card input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 1rem;
    background: #1e2538;
    border: 1px solid #2d3548;
    border-radius: 28px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}
.login-card input:focus {
    border-color: #3b82f6;
}
.btn {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    width: 100%;
}
.btn:hover {
    background: #2563eb;
    transform: scale(0.98);
}
.error {
    color: #ef4444;
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ========== Основное приложение ========== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2d3548;
}
.app-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #fff, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logout-btn {
    background: #2d3548;
    width: auto;
    padding: 8px 20px;
}

/* Табы */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    border-bottom: 1px solid #2d3548;
    padding-bottom: 8px;
}
.tab {
    padding: 10px 28px;
    border-radius: 40px;
    cursor: pointer;
    background: #1e2538;
    transition: 0.2s;
    font-weight: 500;
}
.tab.active {
    background: #3b82f6;
    color: white;
}
.tab:hover:not(.active) {
    background: #2d3548;
}

/* Панели */
.panel {
    display: none;
}
.panel.active-panel {
    display: block;
}

/* Карточки форм */
.form-card {
    background: #111827;
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #1f2937;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
input, select {
    background: #1e2538;
    border: 1px solid #2d3548;
    border-radius: 28px;
    padding: 12px 18px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}
input:focus, select:focus {
    border-color: #3b82f6;
}
.btn.secondary {
    background: #2d3548;
    width: auto;
    padding: 10px 20px;
}
.btn.cancel {
    background: #4b5563;
}

/* Строки товаров */
.item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #0f172a;
    padding: 16px;
    border-radius: 28px;
    margin-bottom: 16px;
    border: 1px solid #1e293b;
}
.item-row select, .item-row input {
    flex: 1 1 160px;
    min-width: 120px;
}
.badge {
    background: #3b82f6;
    border-radius: 40px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Таблицы */
.list-table {
    width: 100%;
    border-collapse: collapse;
    background: #111827;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.list-table th, .list-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #1f2937;
}
.list-table th {
    background: #1e293b;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.list-table tr:last-child td {
    border-bottom: none;
}
.action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    margin: 0 6px;
    font-size: 1.2rem;
    transition: 0.2s;
}
.action-btn:hover {
    color: #3b82f6;
}
.delete-btn {
    color: #ef4444;
}
.delete-btn:hover {
    color: #dc2626;
}

/* Статистика */
.summary-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.stat-card {
    background: #111827;
    border-radius: 28px;
    padding: 20px 24px;
    flex: 1;
    min-width: 180px;
    text-align: center;
    border: 1px solid #1f2937;
}
.stat-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #94a3b8;
}
.stat-card p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #3b82f6;
}

/* Профиль */
#profileInfo {
    line-height: 1.8;
}
#profileInfo p {
    margin: 8px 0;
}
#profileInfo strong {
    color: #94a3b8;
    min-width: 120px;
    display: inline-block;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #111827;
    border-radius: 32px;
    padding: 28px;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #2d3548;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
#changePasswordContent input {
    width: 100%;
    margin-bottom: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    .app-header h1 {
        font-size: 1.4rem;
    }
    .tab {
        padding: 6px 18px;
        font-size: 0.9rem;
    }
    .form-card {
        padding: 18px;
    }
    .item-row {
        flex-direction: column;
        align-items: stretch;
    }
    .item-row select, .item-row input {
        width: 100%;
    }
    .list-table th, .list-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    .stat-card p {
        font-size: 1.4rem;
    }
}