* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0b1329;
    color: #ffffff;
    padding-bottom: 40px; /* Этот отступ создаст красивое пространство под копирайтом */
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 40px auto 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Универсальные карточки разделов */
.section-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-bottom: 25px;
}

/* Сетка страниц и адаптивность */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(300px, 400px) 1fr;
    gap: 25px;
    align-items: start;
    width: 100%;
}

@media (max-width: 930px) {
    .settings-grid { 
        grid-template-columns: 1fr; 
        gap: 20px;
    }
}

/* Универсальные элементы форм и уведомления */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Системные уведомления и ошибки */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #f87171;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

/* Кнопки управления */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-blue, 
.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-blue:hover, 
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-blue:active, 
.btn-primary:active {
    transform: scale(0.98);
}

div[style*="display: flex"] .btn-blue {
    width: auto !important;
}
/* Страница авторизации (login.ejs) */
.auth-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
    margin: 0 auto;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.auth-header p {
    color: #8da2bb;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 40px;
}

.divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
    margin-bottom: 50px;
}

.auth-card {
    background-color: #1c2541;
    border: 1px solid #23315a;
    border-radius: 8px;
    padding: 40px 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.auth-card .form-group input {
    background-color: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 14px 16px;
}

.auth-card .form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Список заказов (admin-orders.ejs) */
.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #23315a;
    margin-bottom: 12px;
}

.order-info h5 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.order-info p {
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.95rem;
}

.order-date {
    color: #64748b;
    font-size: 0.85rem;
    text-align: right;
}

.order-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-status {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status:hover {
    background-color: #10b981;
    color: white;
}

.btn-delete {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background-color: #ef4444;
    color: white;
}

.order-row.is-completed {
    opacity: 0.4;
    background: #0b0f19;
    border-color: #161f30;
}

.order-row.is-completed .order-info h5, 
.order-row.is-completed .order-info p {
    text-decoration: line-through;
    color: #475569 !important;
}

.order-row.is-completed .btn-status {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.order-row.is-completed .btn-status:hover {
    background-color: #475569;
    color: white;
}

/* Управление калькулятором (admin-calc.ejs) */
.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #23315a;
    margin-bottom: 10px;
}

.qty-input {
    width: 70px;
    padding: 6px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #fff;
    text-align: center;
    font-weight: bold;
}

.discount-input {
    width: 80px;
    padding: 8px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
}

.total-box {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-pdf {
    background-color: #10b981;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-pdf:hover {
    background-color: #059669;
}

.calc-separator {
    background: linear-gradient(90deg, #1e3a8a 0%, #0f172a 100%);
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Печатная форма */
#printableInvoice {
    display: none;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 25px;
}

.print-table th, 
.print-table td {
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #334155;
}

.print-table th {
    background-color: #f8fafc;
    color: #1e293b;
    font-weight: 600;
}

.print-row-separator {
    background-color: #f1f5f9 !important;
    font-weight: bold;
    color: #1e3a8a !important;
    font-size: 12px !important;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0;
        margin: 0;
    }
    .admin-nav, 
    .container, 
    .btn-pdf {
        display: none !important;
    }
    #printableInvoice {
        display: block !important;
    }
}

/* Модальные окна предпросмотра карточек */
.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(15, 23, 42, 0.85); 
    z-index: 9999; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
    backdrop-filter: blur(4px);
}

.modal-window {
    background: #1e293b; 
    border: 1px solid #334155; 
    max-width: 600px; 
    width: 100%; 
    border-radius: 12px; 
    padding: 25px; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); 
    position: relative; 
    max-height: 90vh; 
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: none; 
    border: none; 
    color: #94a3b8; 
    font-size: 28px; 
    cursor: pointer; 
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.preview-img-box {
    width: 100%; 
    max-height: 300px; 
    overflow: hidden; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    border: 1px solid #334155;
}

.preview-img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.preview-content {
    text-align: left;
}

.preview-title {
    color: #fff; 
    font-size: 1.3rem; 
    margin-bottom: 12px; 
    font-weight: 700; 
    padding-right: 20px;
}

.preview-desc {
    color: #cbd5e1; 
    font-size: 0.95rem; 
    line-height: 1.6; 
    white-space: pre-line; 
    margin: 0;
}