:root {
    --primary: #00468c;
    --primary-hover: #003366;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --text-muted: #718096;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f1f5f9;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.page-header {
    background: linear-gradient(135deg, #00468c 0%, #002d5b 100%);
    color: #fff;
    padding: 15px 0 15px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.header-logo-link {
    justify-content: center;
    gap: 25px;
    align-items: center;
}

.header-emblem {
    height: 110px;
    width: auto;
}

.header-title {
    font-size: 1.8rem;
    letter-spacing: 1px;
    text-align: left;
    line-height: 1.2;
    font-weight: bold;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px 40px;
    flex-wrap: wrap;
}

.header-logo-link {
    flex-shrink: 0;
}

.header-contact {
    text-align: left;
    flex-shrink: 0;
}

.header-phone {
    display: block;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.3;
}

.header-phone:hover {
    color: #fde68a;
    text-decoration: none;
}

.header-hours {
    margin-top: 4px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .py-4 { padding: 1rem 10px; }
    .header-logo-link {
        gap: 15px;
    }
    .header-emblem {
        height: 60px;
    }
    .header-title {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }
    .header-top {
        flex-direction: column;
        gap: 16px;
    }
    .header-contact {
        text-align: center;
    }
    .header-phone {
        font-size: 1.15rem;
    }
    .header-hours {
        font-size: 0.85rem;
    }
}

.site-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.site-brand-icon-svg {
    width: 30px;
    height: 30px;
    display: block;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.breadcrumb a:hover { color: #fff; }

.header-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
}

.header-content h1 {
    margin: 0 0 10px;
    font-size: 2.2rem;
    font-weight: 700;
}

/* Badges */
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge.secondary { background: rgba(255,255,255,0.15); color: #fff; }
.badge.success { background: #dcfce7; color: #166534; }

/* Grid Layout */
.manager-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .manager-grid { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; text-align: center; }
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-header {
    padding: 15px 25px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.card-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
}

.card-body { padding: 25px; }

/* Detail Rows */
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    width: 200px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.detail-value {
    flex: 1;
    font-size: 1rem;
    color: #1e293b;
}

.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.msg-count { font-weight: 700; color: var(--primary); font-size: 1.1rem; }

/* Links & Buttons */
.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-link:hover { text-decoration: underline; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn.secondary { background: #f1f5f9; color: #475569; }
.btn.secondary:hover { background: #e2e8f0; }
.btn.outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn.outline:hover { background: var(--primary); color: #fff; }

.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.py-4 { padding: 2rem 10px; }

/* SRO status */
.sro-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.sro-status.success { background: #f0fdf4; color: #16a34a; }
.sro-status.error { background: #fef2f2; color: #dc2626; }
.sro-name { font-size: 1rem; font-weight: 600; line-height: 1.4; color: #334155; }

/* Калькулятор стоимости */
#cost-calculator-card .card-header {
    background: #004487;
    border-bottom-color: #003a73;
}

#cost-calculator-card .card-header h2 {
    color: #fff;
}

#cost-calculator-card .card-header h2 i {
    color: #fff;
}

.calculator-body .calc-step {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.calculator-body .calc-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.calc-question {
    margin: 0 0 12px;
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.45;
}

.calc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calc-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #334155;
    background: #fff;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    user-select: none;
}

.calc-option:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.calc-option input {
    accent-color: var(--primary);
}

.calc-branch[hidden],
.calc-result[hidden] {
    display: none !important;
}

.calc-result {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.calc-result-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: #1e293b;
}

.calc-result-text {
    margin: 0 0 20px;
    color: #64748b;
    line-height: 1.5;
}

.calc-form .form-group {
    margin-bottom: 16px;
}

.calc-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
}

.calc-form .form-group input[type="text"],
.calc-form .form-group input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.calc-form .form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    color: #64748b;
}

.calc-form .form-checkbox input {
    margin-top: 3px;
}

@media (max-width: 768px) {
    .calc-options {
        flex-direction: column;
    }
    .calc-option {
        width: 100%;
    }
}

/* Actions */
.last-update { font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert.info { background: #e0f2fe; color: #0369a1; }
.alert.success { background: #dcfce7; color: #15803d; }
.alert.error { background: #fee2e2; color: #b91c1c; }

/* Table & Search for Index */
.search-section input { width: 100%; outline: none; transition: border-color 0.2s; }
.search-section input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 70, 140, 0.1); }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.data-table th { background: #f8fafc; padding: 15px 20px; font-weight: 700; text-align: left; font-size: 0.85rem; text-transform: uppercase; color: #64748b; }
.data-table td { padding: 18px 20px; border-bottom: 1px solid #f1f5f9; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f8fafc; }
.table-responsive { width: 100%; }

.actions {
    margin-bottom: 15px;
    padding: 0 10px;
}

.stats {
    color: #64748b;
    font-size: 0.95rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.breadcrumbs li {
    display: flex;
    align-items: center;
}
.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin: 0 10px;
    color: #cbd5e0;
    font-size: 1.1rem;
    line-height: 1;
}
.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Consultation Block */
.consult-card {
    background: linear-gradient(135deg, #00468c 0%, #002d5b 100%);
    color: #fff;
    border: none;
    text-align: center;
}

.consult-card h2 {
    color: #fff !important;
}

.consult-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.consult-card .btn.white {
    background: #fff;
    color: #00468c;
}

.consult-card .btn.white:hover {
    background: #f1f5f9;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e293b;
    text-align: center;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.form-checkbox input {
    margin-top: 4px;
}

.form-checkbox label {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

.manager-name-link {
    color: #1e293b;
    text-decoration: none;
}

.manager-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0;
}

.pagination a { 
    min-width: 40px; 
    text-align: center; 
    padding: 10px 15px; 
    transition: all 0.2s; 
    text-decoration: none;
    color: #4a5568;
}

.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a:hover:not(.active) { background: #f1f5f9; }
.pagination span {
    padding: 10px 5px;
    color: var(--text-muted);
}

/* Alphabet Nav */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.alphabet-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    text-decoration: none;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.alphabet-nav a:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.alphabet-nav a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Кнопка "Все" (первая в списке) */
.alphabet-nav a:first-child {
    width: auto;
    padding: 0 15px;
}

/* Thanks Page */
.thanks-wrapper {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin: 20px auto;
    max-width: 1000px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.thanks-content {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.thanks-text {
    flex: 1.2;
    padding: 50px;
}

.thanks-photo {
    flex: 0.8;
    background: #f1f5f9;
    position: relative;
    min-height: 400px;
}

.thanks-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thanks-title {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
}

.thanks-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 40px;
}

.expert-info {
    border-top: 1px solid #f1f5f9;
    padding-top: 30px;
}

.expert-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e293b;
}

.expert-info p {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 15px;
    line-height: 1.6;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.check-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.4;
}

.check-list li i {
    color: var(--success);
    font-size: 1.2rem;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .thanks-content {
        flex-direction: column-reverse;
    }
    
    .thanks-text {
        padding: 30px 20px;
    }
    
    .thanks-photo {
        height: 350px;
        min-height: auto;
    }
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.certificate-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}

.certificate-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.certificate-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    display: block;
    padding: 10px;
}

@media (max-width: 900px) {
    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .certificates-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Accordion */
.faq-accordion .faq-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.faq-accordion .faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    line-height: 1.4;
}

.faq-question i {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-top 0.3s;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    max-height: 1000px; /* Достаточно большое значение */
    margin-top: 10px;
}

.faq-item.active .faq-question h3 {
    color: var(--primary);
}

/* Admin Logs */
.log-container { border: 1px solid #2d3748; line-height: 1.5; }

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        display: block;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin-bottom: 12px;
        overflow: hidden;
    }

    .data-table td {
        border: none;
        border-bottom: 1px solid #f1f5f9;
        padding: 10px 14px;
        text-align: left !important;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 0.78rem;
        text-transform: uppercase;
        color: #64748b;
        font-weight: 700;
        letter-spacing: 0.03em;
    }

    .data-table td:not([data-label])::before {
        content: none;
    }
}
