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

/* Базовые стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 15px;
    color: #333;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 18px;
}

/* Шапка */
header {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-right: 15px;
}

nav a {
    color: #fff;
    text-decoration: none;
}

nav a:hover {
    color: #ccc;
}

nav li.active a {
    color: #3b82f6;
    font-weight: bold;
}

/* SPA Progress Bar */
.spa-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    z-index: 10001;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: width 0.3s ease;
    display: none;
    pointer-events: none;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info a {
    color: #fff;
    margin-left: 10px;
}

/* Основной контент */
main {
    padding: 20px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

main.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

main.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Подвал */
footer {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    margin-top: auto;
}

/* Формы */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button,
.button,
input[type="submit"] {
    background-color: #0066cc;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled,
.button:disabled,
input[type="submit"]:disabled {
    background-color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none !important;
    box-shadow: none !important;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background-color: #0055aa;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

button:active,
.button:active {
    transform: translateY(0);
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

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

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
}

/* Таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th,
.data-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.data-table .column-number,
.data-table .column-quantity,
.data-table .column-price,
.data-table .column-discount {
    width: 80px;
}

.data-table .column-actions {
    width: 90px;
}

.data-table .column-code,
.data-table .column-cross,
.data-table .column-location {
    width: 120px;
}

.data-table .column-brand {
    width: 100px;
}

.data-table .column-warehouse {
    width: 130px;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f0f0f0;
}

/* Сообщения */
.error {
    color: #d9534f;
    background-color: #fdf7f7;
    border: 1px solid #d9534f;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.success {
    color: #5cb85c;
    background-color: #f4fcf4;
    border: 1px solid #5cb85c;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Авторизация */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Дашборд */
.dashboard {
    padding: 20px 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dashboard-recent {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Корзина */
.cart-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

.carts-sidebar {
    width: 300px;
    min-width: 300px;
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cart-content {
    flex: 1;
    width: 100%;
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.active-carts {
    margin-bottom: 20px;
}

.cart-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
}

.cart-item.active {
    border-color: #0066cc;
    background-color: #f0f7ff;
}

.cart-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-info {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.new-cart-form {
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.quantity-input,
.price-input,
.discount-input {
    width: 60px;
    text-align: right;
}

.delete-cart-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    background-color: #d9534f;
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
}

.delete-cart-icon:hover {
    opacity: 1;
}

/* Global Modal Base */
.modal,
.modal-premium {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

/* Visibility Trigger */
.modal.show,
.modal-premium.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Standard Modal Content */
.modal-content {
    background: #fff;
    margin: 5vh auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 650px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.1s;
    line-height: 1;
}

.close:hover {
    color: #1e293b;
}

/* Товары */
.products-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-row:hover {
    background-color: #e9f5ff;
    cursor: pointer;
}

.stock-value {
    display: inline-block;
    margin-right: 8px;
}

.add-to-cart-inline-btn {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    background-color: #5cb85c;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.add-to-cart-inline-btn:hover {
    background-color: #4cae4c;
    text-decoration: none;
    color: white;
}

.filters {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.product-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Просмотр товара */
.product-view {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.breadcrumbs {
    margin-bottom: 20px;
    font-size: 12px;
    color: #666;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.detail-group {
    margin-bottom: 10px;
}

.detail-group label {
    font-weight: bold;
    margin-bottom: 3px;
    color: #666;
}

.full-width {
    grid-column: 1 / -1;
}

.product-tabs {
    margin-top: 30px;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    margin-right: 5px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.tab.active {
    background-color: #fff;
    border-color: #ddd;
    margin-bottom: -1px;
    border-bottom: 1px solid #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Редактирование товара */
.product-edit {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

/* Заказы */
.orders-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.order-row:hover {
    background-color: #e9f5ff;
    cursor: pointer;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.status-new {
    color: #6c757d;
    font-weight: bold;
}

.status-processing {
    color: #fd7e14;
    font-weight: bold;
}

.status-ready {
    color: #20c997;
    font-weight: bold;
}

.status-completed {
    color: #28a745;
    font-weight: bold;
}

.status-no {
    color: #dc3545;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    font-weight: bold;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s ease-out forwards;
}

.toast-success {
    background: #16a34a;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Просмотр заказа */
.order-view {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.order-info,
.customer-info {
    width: 48%;
}

.info-group {
    margin-bottom: 10px;
}

.info-group label {
    font-weight: bold;
    color: #666;
    margin-bottom: 3px;
}

.order-items {
    margin-bottom: 30px;
}

.order-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.total-label {
    text-align: right;
    font-weight: bold;
}

.total-amount {
    font-weight: bold;
}

/* Клиенты */
.customers-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.customer-view {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.customer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.customer-info {
    flex: 1;
}

.customer-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Заказные запчасти */
.ordered-parts-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Возвраты */
.returns-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.return-view {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Отчеты */
.reports-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.card-value {
    font-size: 20px;
    font-weight: bold;
}

.report-chart {
    margin-bottom: 30px;
}

/* Настройки */
.settings-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.settings-tabs {
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.non-editable-setting {
    padding: 8px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Сотрудники */
.employees-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Кнопки действий */
.view-btn,
.edit-btn,
.delete-btn,
.add-btn,
.print-btn,
.adjust-btn,
.complete-btn,
.cancel-btn,
.return-btn,
.import-btn,
.export-btn,
.save-btn,
.reset-btn,
.add-to-cart-btn {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    margin: 2px;
    color: #fff;
    text-decoration: none;
}

.view-btn {
    background-color: #0066cc;
}

.edit-btn {
    background-color: #5bc0de;
}

.delete-btn {
    background-color: #d9534f;
}

.add-btn,
.add-to-cart-btn {
    background-color: #5cb85c;
}

.print-btn {
    background-color: #6f5499;
}

.adjust-btn {
    background-color: #f0ad4e;
}

.complete-btn {
    background-color: #5cb85c;
}

.cancel-btn {
    background-color: #d9534f;
}

.return-btn {
    background-color: #f0ad4e;
}

.import-btn,
.export-btn {
    background-color: #5bc0de;
}

.save-btn {
    background-color: #5cb85c;
}

.reset-btn {
    background-color: #777;
}

.view-btn:hover,
.edit-btn:hover,
.delete-btn:hover,
.add-btn:hover,
.print-btn:hover,
.adjust-btn:hover,
.complete-btn:hover,
.cancel-btn:hover,
.return-btn:hover,
.import-btn:hover,
.export-btn:hover,
.save-btn:hover,
.reset-btn:hover,
.add-to-cart-btn:hover {
    opacity: 0.8;
    text-decoration: none;
    color: #fff;
}

.delete-item-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    background-color: #d9534f;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.8;
    margin-left: 8px;
    vertical-align: middle;
}

.delete-item-icon:hover {
    opacity: 1;
}

/* Медиазапросы для адаптивности */
@media (max-width: 768px) {
    .cart-container {
        flex-direction: column;
    }

    .carts-sidebar {
        width: 100%;
        min-width: 100%;
        margin-bottom: 20px;
    }

    .cart-content {
        width: 100%;
    }

    .product-details {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .order-header {
        flex-direction: column;
    }

    .order-info,
    .customer-info {
        width: 100%;
        margin-bottom: 20px;
    }

    .filters .search-form {
        flex-direction: column;
    }

    .data-table {
        font-size: 12px;
    }

    .cart-actions {
        flex-wrap: wrap;
    }
}

/* Premium Modal Styles */



.modal-content-premium {
    background: #fff;
    margin: 10vh auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-premium {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header-premium h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
}

.close-premium {
    position: absolute;
    right: 20px;
    top: 18px;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    z-index: 10;
}

.close-premium:hover {
    color: #1e293b;
}

.premium-form {
    padding: 25px;
}

.form-row-premium {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group-premium {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-premium label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.form-control-premium {
    height: 44px;
    padding: 0 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-control-premium:focus {
    background: #fff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer-premium {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.btn-cancel-premium {
    height: 40px;
    padding: 0 20px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-premium:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.btn-save-premium {
    height: 40px;
    padding: 0 20px;
    border-radius: 10px;
    background: #3b82f6;
    border: none;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-premium:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Custom Dropdown for Live Search */
.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 5px;
}

.dropdown-list {
    width: 100%;
}

.dropdown-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: #f1f5f9;
}


/* Premium Checkbox */
.checkbox-container-premium {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.checkbox-container-premium:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.checkbox-container-premium input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}