/* Стили для модального окна счетов */
.invoices-modal {
    max-width: 600px;
    max-height: 99vh;
}

.invoices-modal .modal-content {
    display: flex;
    flex-direction: column;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #343541;
    border-radius: 6px;
    background: #1a1b23;
    color: #ffffff;
    font-size: 13px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #4a90e2;
}

.filter-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.refresh-btn {
    padding: 8px 15px;
    background: linear-gradient(to bottom, #4a90e2 0%, #357ae8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: linear-gradient(to bottom, #357ae8 0%, #2a65cc 100%);
    transform: translateY(-1px);
}

/* Список счетов */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invoice-item {
    background: linear-gradient(145deg, #1a1b23 0%, #16171e 100%);
    border: 1px solid #24252e;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.invoice-item:hover {
    background: linear-gradient(145deg, #24252e 0%, #1a1b23 100%);
    border-color: #343541;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.invoice-item.selected {
    border-color: #4a90e2;
    background: linear-gradient(145deg, #2a3652 0%, #1a2438 100%);
}

.invoice-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.invoice-number {
    font-weight: bold;
    color: #ffffff;
    font-size: 14px;
}

.invoice-date {
    color: #8c8e9a;
    font-size: 12px;
    text-align: right;
}

.invoice-item-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8px;
}

.invoice-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invoice-hall {
    color: #8c8e9a;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.invoice-cashier {
    color: #8c8e9a;
    font-size: 11px;
}

.invoice-amount {
    font-weight: bold;
    color: #ffffff;
    font-size: 16px;
    text-align: right;
}

.invoice-payment {
    color: #8c8e9a;
    font-size: 11px;
    text-align: right;
    margin-top: 2px;
}

.invoice-status {
    position: absolute;
    top: 12px;
    right: 100px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-served {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.status-pending {
    background: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
}

.status-cancelled {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

/* Загрузка */
.loading-invoices {
    text-align: center;
    padding: 40px;
    color: #8c8e9a;
}

.no-invoices {
    text-align: center;
    padding: 40px;
    color: #8c8e9a;
}

.no-invoices i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Анимация спиннера */
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .invoices-modal {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .invoices-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Стили для предпросмотра счета */
.invoice-preview-modal {
    max-width: 600px;
    max-height: 99vh;
    width: 95%;
}

.invoice-preview-modal .modal-content {
    display: flex;
    flex-direction: column;
}

/* Кнопки управления предпросмотром */
.preview-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-control-btn {
    padding: 6px 12px;
    background: #2a2b35;
    border: 1px solid #343541;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.preview-control-btn:hover {
    background: #343541;
    border-color: #4a90e2;
}

/* Контейнер предпросмотра */
.preview-container {
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
}

/* Стили самого счета в предпросмотре */
.receipt-preview {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.3;
    min-width: 380px;
    max-width: 380px;
    transform-origin: top center;
    transition: transform 0.3s ease;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.receipt-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.receipt-subtitle {
    font-size: 11px;
    color: #555;
    margin-bottom: 3px;
}

.receipt-divider {
    border-bottom: 1px dashed #000;
    margin: 8px 0;
}

.receipt-divider-thick {
    border-bottom: 2px solid #000;
    margin: 10px 0;
}

.receipt-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.receipt-label {
    font-weight: bold;
    color: #555;
}

.receipt-value {
    text-align: right;
}

/* Таблица товаров в предпросмотре */
.receipt-items-table {
    width: 100%;
    margin: 15px 0;
    border-collapse: collapse;
}

.receipt-items-header {
    border-bottom: 2px solid #000;
    font-weight: bold;
    font-size: 12px;
    padding-bottom: 5px;
}

.receipt-items-header th {
    padding: 5px 0;
    text-align: left;
}

.receipt-items-header th:first-child {
    width: 40%;
}

.receipt-items-header th:nth-child(2) {
    width: 15%;
    text-align: center;
}

.receipt-items-header th:nth-child(3) {
    width: 20%;
    text-align: right;
}

.receipt-items-header th:last-child {
    width: 25%;
    text-align: right;
}

.receipt-item-row {
    border-bottom: 1px dotted #ccc;
    font-size: 12px;
}

.receipt-item-row td {
    padding: 6px 0;
    vertical-align: top;
}

.receipt-item-name {
    word-break: break-word;
}

.receipt-item-note {
    font-size: 10px;
    color: #666;
    font-style: italic;
    margin-top: 2px;
}

.receipt-item-qty {
    text-align: center;
}

.receipt-item-price {
    text-align: right;
}

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

/* Итоги в предпросмотре */
.receipt-totals {
    margin: 15px 0;
    padding-top: 10px;
    border-top: 2px dashed #000;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.receipt-grand-total {
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #000;
}

/* Оплата в предпросмотре */
.receipt-payment {
    margin: 15px 0;
    padding-top: 10px;
    border-top: 1px dashed #000;
}

/* Подвал в предпросмотре */
.receipt-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #333;
}

.receipt-thankyou {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 10px;
}

.receipt-cutline {
    color: #999;
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 20px;
    padding-top: 5px;
    border-top: 1px dashed #ccc;
}

/* Информация в предпросмотре */
.preview-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Кнопки модального окна */
.modal-btn.view {
    background: linear-gradient(to bottom, #5856d6 0%, #4846c6 100%);
    color: white;
}

.modal-btn.view:hover {
    background: linear-gradient(to bottom, #4846c6 0%, #3836b6 100%);
}

/* Адаптивность */
@media (max-width: 768px) {
    .invoice-preview-modal {
        width: 98%;
        height: 95vh;
    }
    
    .receipt-preview {
        min-width: 100%;
        max-width: 100%;
        padding: 15px;
        font-size: 11px;
    }
    
    .preview-controls {
        justify-content: center;
    }
    
    .preview-control-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
}