:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-soft: #e0ecff;
    --border: #e2e8f0;
    --muted: #6b7280;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
}

.site-footer {
    background-color: var(--surface);
    border-color: var(--border) !important;
    box-shadow: 0 -1px 0 var(--border);
}

.site-footer-phone:hover {
    color: var(--primary) !important;
}

.site-footer-mail {
    color: var(--muted) !important;
}

.site-footer-mail:hover {
    color: var(--primary) !important;
}

.site-header {
    background-color: #0f172a;
    color: #ffffff;
}

    .site-header .navbar {
        padding: 0.75rem 0;
    }

    .site-header .navbar-brand {
        color: #ffffff;
    }

        .site-header .navbar-brand:hover {
            color: #e5e7eb;
        }

    .site-header .nav-link {
        color: #cbd5f5;
    }

        .site-header .nav-link:hover {
            color: #ffffff;
        }

    .site-header .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .site-header .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

    .page-header.text-center {
        justify-content: center;
        text-align: center;
    }

        .page-header.text-center > div {
            max-width: 800px;
        }

    .page-header-title {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .page-header-title h1 {
        font-size: 1.75rem;
        margin: 0;
    }

    .page-header-description {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .page-header-description .text-muted {
        margin: 0;
        width: 100%;
        max-width: none;
    }

    .page-header .text-muted {
        max-width: 640px;
    }

    .page-header.text-center .text-muted {
        margin: 0 auto;
    }

.cta-block {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.auth-section {
    max-width: 480px;
    margin: 3rem auto;
}

.auth-card {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    text-align: center;
}

.auth-form .form-group + .form-group {
    margin-top: 1rem;
}

.auth-form .btn {
    margin-top: 1.25rem;
}

.profile-section {
    margin-top: 2rem;
}

.section-header {
    margin-bottom: 2rem;
}

    .section-header h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .section-header p {
        color: var(--muted);
        margin: 0;
    }

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-accepted {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-in-progress {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-closed {
    background-color: #f3f4f6;
    color: #374151;
}

.order-card-body {
    color: var(--muted);
    margin-bottom: 1rem;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.order-details {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.order-details-header {
    margin-bottom: 2rem;
}

.order-details-section {
    margin-bottom: 2rem;
}

    .order-details-section h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        color: #0f172a;
    }

.order-details-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

    .order-details-row:last-child {
        border-bottom: none;
    }

.order-details-label {
    font-weight: 600;
    color: var(--muted);
}

.order-details-value {
    color: #0f172a;
}

.comments-section {
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.comment-item {
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

    .comment-item:last-child {
        margin-bottom: 0;
    }

.comment-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-text {
    color: var(--muted);
}

.search-section {
    margin-bottom: 2rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.user-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.calculation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calculation-card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.calculation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calculation-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.form-edit-mode input {
    display: block;
}

.form-view-mode label {
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.form-view-mode .form-value {
    color: #0f172a;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .order-details-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Модальное окно чата: фиксированный размер (как прежний максимум) */
.order-chat-modal {
    width: 480px;
    max-width: calc(100% - 2rem);
    margin: 1.75rem auto;
    height: 560px;
    max-height: calc(100vh - 3.5rem);
}

.order-chat-modal .modal-content {
    height: 560px;
    max-height: min(560px, calc(100vh - 3.5rem));
    display: flex;
    flex-direction: column;
}

.order-chat-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.order-chat-body .chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 220px;
    max-height: 360px;
    padding-right: 0.25rem;
}

.order-chat-body form {
    flex-shrink: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.profile-summary {
    font-size: 1.15rem;
    line-height: 1.55;
}

.profile-summary strong {
    font-weight: 600;
}

/* Уведомления: прочитанные — слегка приглушены; непрочитанные — акцент до следующего захода */
.notification-item-read {
    background-color: #f8fafc;
    border-color: var(--border, #e2e8f0);
}

.notification-read-title {
    color: #334155;
}

.notification-read-message {
    color: #475569;
}

.notification-read-date {
    color: #64748b;
}

.notification-item-unread.list-group-item-primary {
    border-left: 3px solid #0d6efd;
}

.order-create-ms-heading {
    margin-bottom: 1.75rem;
}