/* Реестр аккредитаций ИКРЗ - стили как у основного сайта */
* { margin: 0; padding: 0; box-sizing: border-box; }

input[type="password"] { width: 100% !important; box-sizing: border-box !important; }

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px; line-height: 1.6; color: #202020;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

body:has(main.main-list-page) {
    display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}

.container { max-width: calc(100vw - 24px); margin: 0 auto; padding: 12px; }
main.container { padding-bottom: 4px; }

main.main-list-page {
    flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
main.main-list-page .filters, main.main-list-page .view-switcher { flex-shrink: 0; }
main.main-list-page .table-container { flex: 1; min-height: 0; overflow-y: auto; }
main.main-list-page .footer-sticky { flex-shrink: 0; }

header {
    flex-shrink: 0; background: rgba(255,255,255,0.8); backdrop-filter: blur(20px);
    padding: 16px 0; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
header .container { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.header-left { display: flex; align-items: center; gap: 0; }
header h1 { font-size: 20px; font-weight: 600; color: #0067C0; margin: 0; }
.header-nav { display: flex; gap: 0; align-items: center; margin-left: 16px; }
.header-nav::before { content: ''; width: 1px; height: 18px; background: #c4c4c4; margin-right: 16px; }
.header-nav a, .header-nav .header-link {
    color: #2d5a87; text-decoration: none; font-size: 14px; padding: 4px 12px;
    border-radius: 4px; transition: background 0.15s, color 0.15s;
}
.header-nav a:hover, .header-nav .header-link:hover {
    background: rgba(0,103,192,0.08); color: #0067C0;
}
.header-nav .header-link { background: none; border: none; cursor: pointer; font-family: inherit; }

.user-info { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.user-info span { font-weight: 500; }
.org-badge { font-size: 12px; color: #666; background: #f0f0f0; padding: 2px 8px; border-radius: 4px; }
.user-info a { color: #2d5a87; text-decoration: none; font-size: 14px; padding: 4px 8px; border-radius: 4px; transition: background 0.15s, color 0.15s; }
.user-info a:hover { background: rgba(0,103,192,0.08); color: #0067C0; }

.btn {
    display: inline-block; padding: 10px 24px; background: #0067C0; color: white; text-decoration: none;
    border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn:hover { background: #005A9E; box-shadow: 0 2px 4px rgba(0,0,0,0.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #0067C0; }
.btn-secondary { background: #E1E1E1; color: #202020; }
.btn-secondary:hover { background: #D5D5D5; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0; font-size: 18px; font-weight: bold; }
.btn-icon.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="date"],
.form-group input[type="number"], .form-group input[type="password"], .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid rgba(0,0,0,0.15); border-radius: 6px;
    font-size: 14px; font-family: inherit; background: rgba(255,255,255,0.9); transition: all 0.2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #0067C0; box-shadow: 0 0 0 3px rgba(0,103,192,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[readonly], .form-group select[disabled] { background: #f8f8f8; cursor: not-allowed; }
input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; accent-color: #0067C0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-actions { margin-top: 30px; display: flex; gap: 10px; }
.form-hint, .form-meta { font-size: 13px; color: #666; margin-bottom: 12px; }
.required { color: #e74c3c; }

.table-container {
    background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto; margin-bottom: 16px;
}
main.main-list-page .table-container { margin-bottom: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead {
    background: linear-gradient(180deg,#f8f9fa 0%,#e9ecef 100%); color: #202020;
    position: sticky; top: 0; z-index: 10; border-bottom: 2px solid rgba(0,103,192,0.2);
}
.data-table th { padding: 14px 16px; text-align: left; font-weight: 600; white-space: nowrap; font-size: 13px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #e0e0e0; }
.data-table tbody tr:hover { background: #f8f9fa; }
.data-table tbody tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }

.filters {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(20px); padding: 20px; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 24px; border: 1px solid rgba(0,0,0,0.06);
}
.filter-form { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { flex: 1; min-width: 200px; }
.filter-input, .filter-select {
    width: 100%; padding: 10px 12px; border: 1px solid rgba(0,0,0,0.15); border-radius: 6px;
    font-size: 14px; background: rgba(255,255,255,0.9);
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: #0067C0; }

.footer-sticky { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.pagination-block, .footer-actions-block {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(20px); padding: 12px 16px;
    border-radius: 8px; box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.pagination { display: flex; align-items: center; gap: 16px; }
.pagination-info { font-size: 15px; color: #495057; }

.card {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(20px); padding: 24px; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 24px; border: 1px solid rgba(0,0,0,0.06);
}
.card h3 { margin-bottom: 20px; color: #0067C0; font-size: 18px; font-weight: 600; border-bottom: 2px solid rgba(0,103,192,0.2); padding-bottom: 12px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.page-header h2 { color: #0067C0; font-size: 28px; font-weight: 600; }

.error-message { background: #e74c3c; color: white; padding: 12px; border-radius: 4px; margin-bottom: 15px; }
.success-message { background: #27ae60; color: white; padding: 12px; border-radius: 4px; margin-bottom: 15px; }

.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg,#e8ecf1 0%,#f5f7fa 100%); }
.login-container { width: 100%; max-width: 440px; padding: 20px; }
.login-box {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(40px); padding: 48px; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12); border: 1px solid rgba(255,255,255,0.3);
}
.login-box h1 { color: #0067C0; margin-bottom: 8px; font-size: 24px; font-weight: 600; text-align: center; }
.login-box h2 { color: #606060; margin-bottom: 32px; font-size: 16px; font-weight: 400; text-align: center; }

.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); overflow: auto; align-items: center; justify-content: center;
}
.modal[style*="flex"] { display: flex !important; }
.modal-content {
    background: white; margin: auto; padding: 30px; border-radius: 8px; max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; max-height: 90vh; overflow-y: auto;
}
.close { position: absolute; right: 20px; top: 15px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; }
.close:hover { color: #000; }

.action-link { display: inline-block; font-size: 18px; text-decoration: none; padding: 5px 8px; border-radius: 4px; transition: background 0.2s; }
.action-link:hover { background: #e8f4f8; }
.action-delete:hover { background: #ffe8e8 !important; }

.accreditation-item {
    background: rgba(255,255,255,0.7);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
}
.accreditation-item .validity-display { background: #f5f5f5; color: #666; }

@media (max-width: 768px) {
    header .container { flex-direction: column; gap: 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-form { flex-direction: column; }
    .filter-group { width: 100%; }
    .table-container { overflow-x: scroll; }
    .data-table { min-width: 800px; }
}
