/* Стили в духе 1C.ru */
.style-1c {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background: #1C6CBD;
    color: white;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 15px;
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.register-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn {
    padding: 10px 15px;
    background: #1C6CBD;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.dashboard-section, .history-section, .profile-section {
    background: white;
    padding: 20px;
    margin-top: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.card-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.qr-code img {
    width: 150px;
    height: 150px;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

.card-stats p {
    margin: 10px 0;
}

.chart-container {
    height: 300px;
    margin: 20px 0;
}

.top-products ul {
    list-style-type: none;
    padding: 0;
}

.top-products li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th, .table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.table th {
    background-color: #1C6CBD;
    color: white;
}

footer {
    margin-top: 30px;
    padding: 20px 0;
    text-align: center;
    color: #666;
    border-top: 1px solid #ddd;
}

/* Flash сообщения */
.flash-messages {
    margin-top: 20px;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.text-danger {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        margin-top: 15px;
    }
    
    nav a {
        display: block;
        margin: 5px 0;
    }
    
    .card-info {
        flex-direction: column;
        text-align: center;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
}
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}

/* Для полей с ошибками */
.is-invalid {
    border-color: #dc3545;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 10px 15px;
    margin-top: 20px;
    border-radius: 4px;
}
.receipt-section {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.receipt-section h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #1C6CBD;
}

.print-header {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    .receipt-section, .receipt-section * {
        visibility: visible;
    }
    .receipt-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }
}
/* Стиль для отрицательных сумм */
tr.negative td:nth-child(4) {
    color: #dc3545;
    font-weight: bold;
}

/* Стили для сортировки */
th[data-sort] {
    cursor: pointer;
    position: relative;
    padding-right: 25px;
}

th[data-sort]::after {
    content: "↕";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

th[data-order="asc"]::after {
    content: "↑";
    opacity: 1;
}

th[data-order="desc"]::after {
    content: "↓";
    opacity: 1;
}

/* Стили для фильтров */
.filters {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Стили для модального окна */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
}

.loading-gear {
    font-size: 50px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mt-2 {
    margin-top: 10px;
}

/* Добавим стили для модального окна */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
}

.loading-gear {
    font-size: 50px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Добавлю эти стили в конец файла */

/* Медиа-запросы для адаптивности */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .card-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 10px;
    }
    
    header {
        flex-direction: column;
        padding: 15px 0;
    }
    
    .logo {
        margin-bottom: 15px;
        justify-content: center;
    }
    
    nav {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav a {
        margin: 5px 10px;
        font-size: 0.9rem;
    }
    
    .login-container,
    .register-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .filters .row {
        flex-direction: column;
    }
    
    .filters .col-md-3,
    .filters .col-md-2 {
        margin-bottom: 10px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .container {
        width: 100%;
        padding: 0 5px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .dashboard-section,
    .history-section,
    .profile-section,
    .receipt-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    .qr-code img {
        width: 120px;
        height: 120px;
    }
    
    .card-stats h2 {
        font-size: 1.2rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .receipt-section .d-flex {
        flex-direction: column;
    }
    
    .receipt-section .btn {
        margin-bottom: 10px;
    }
}

/* Улучшения для мобильной навигации */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 15px;
        top: 15px;
    }
    
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    nav.active {
        display: flex;
    }
    
    nav a {
        margin: 5px 0;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

/* Адаптивные таблицы */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Улучшения для форм на мобильных */
@media (max-width: 576px) {
    .form-control {
        font-size: 16px; /* Предотвращает масштабирование в iOS */
    }
}

/* Адаптивные карточки */
.card-responsive {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .card-responsive {
        flex-direction: column;
    }
}
.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}