:root {
    --blue: #1d4ed8;
    --blue-dark: #0f2f80;
    --blue-deep: #0b1f55;
    --blue-light: #e7f0ff;
    --sky: #f3f8ff;
    --text: #12213a;
    --muted: #5c6d85;
    --border: #bfd2f3;
    --danger: #b42318;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(15, 47, 128, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #f7fbff 0%, #e6f1ff 42%, #d8eaff 100%);
    min-height: 100vh;
}

a { color: var(--blue-dark); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(90deg, var(--blue-deep), var(--blue));
    border-bottom: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 12px 30px rgba(11, 31, 85, 0.18);
}

.site-header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
}

.site-logo {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 900;
    color: white;
    text-decoration: none;
    letter-spacing: -0.4px;
    white-space: nowrap;
}

.site-nav,
.site-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.site-nav { justify-content: center; }
.site-auth { justify-content: flex-end; }

.site-nav a {
    color: white;
    text-decoration: none;
    font-weight: 800;
    padding: 9px 11px;
    border-radius: 12px;
}

.site-nav a:hover { background: rgba(255,255,255,0.16); }

.user-name { font-weight: 800; color: white; }

.role-badge {
    color: var(--blue-deep);
    background: white;
    border: 1px solid rgba(255,255,255,0.55);
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.page-container {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    background: var(--blue);
    color: white;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}

.btn:hover { background: var(--blue-dark); }

.btn-light {
    background: var(--white);
    color: var(--blue-dark);
    border: 1px solid var(--border);
    box-shadow: none;
}

.site-header .btn {
    background: white;
    color: var(--blue-dark);
    box-shadow: none;
}

.site-header .btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger { background: var(--danger); }
.btn-large { padding: 14px 20px; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-text,
.hero-panel,
.section-card,
.notice {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-text { padding: 52px; }

.hero-text h1,
.page-title h1,
.table-header h1 {
    margin: 8px 0 16px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    color: var(--blue-dark);
    letter-spacing: -1.5px;
}

.hero-text p,
.page-title p,
.section-card p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-panel {
    padding: 34px;
    display: grid;
    gap: 10px;
    align-content: center;
    background: linear-gradient(160deg, var(--blue-deep), var(--blue));
    color: white;
}

.hero-panel strong { font-size: 28px; }
.hero-panel span { margin-bottom: 18px; opacity: 0.92; }

.eyebrow {
    display: inline-block;
    color: var(--blue);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
}

.section-card {
    padding: 30px;
    margin-bottom: 28px;
}

.section-card h1,
.section-card h2,
.photo-card h3 { color: var(--blue-dark); }

.page-title,
.table-header { margin-bottom: 24px; }

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
}

.info-list { display: grid; gap: 14px; }

.info-list div {
    padding: 18px;
    border-radius: 18px;
    background: var(--blue-light);
}

.info-list strong {
    display: block;
    font-size: 28px;
    color: var(--blue-dark);
}

.info-list span { color: var(--muted); }

.photo-grid {
    display: grid;
    gap: 22px;
}

.photo-grid.three { grid-template-columns: repeat(3, 1fr); }
.photo-grid.four { grid-template-columns: repeat(4, 1fr); }
.photo-grid.five { grid-template-columns: repeat(5, 1fr); }
.photo-grid.six { grid-template-columns: repeat(3, 1fr); }

.photo-card {
    background: var(--sky);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 16px;
    min-height: 100%;
}

.photo-shell,
.detail-photo,
.table-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: repeating-linear-gradient(45deg, #eaf3ff, #eaf3ff 10px, #d9e9ff 10px, #d9e9ff 20px);
    color: var(--blue-dark);
    font-weight: 900;
    border: 1px dashed var(--blue);
    text-align: center;
}

.photo-shell { height: 220px; border-radius: 18px; }

.photo-shell img,
.detail-photo img,
.table-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.data-table th {
    background: var(--blue-light);
    color: var(--blue-dark);
    font-weight: 900;
}

.data-table tbody tr:hover { background: #f6faff; }

.table-photo {
    width: 82px;
    height: 58px;
    border-radius: 12px;
    font-size: 11px;
}

.actions-cell { min-width: 180px; }
.actions-cell form { display: inline; }
.row-actions { margin-top: 8px; }

.small-link,
.small-danger {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 6px 8px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.small-link { background: var(--blue-light); color: var(--blue-dark); }
.small-danger { border: 0; background: #fee4e2; color: var(--danger); cursor: pointer; }

.pagination-box { margin-top: 18px; }

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.pagination-info { color: var(--muted); font-weight: 700; font-size: 14px; }
.pagination-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.page-link,
.page-disabled,
.page-current {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    line-height: 1;
}

.page-link { color: var(--blue-dark); background: var(--blue-light); border: 1px solid var(--border); }
.page-link:hover { color: white; background: var(--blue); }
.page-current { color: white; background: var(--blue); }
.page-disabled { color: #93a6c8; background: #eef4ff; border: 1px solid var(--border); }

.detail-card {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.detail-photo {
    min-height: 420px;
    border-radius: 22px;
    font-size: 20px;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-content h1 { margin: 0; color: var(--blue-dark); font-size: clamp(30px, 4vw, 46px); }

.detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-field {
    min-height: 86px;
    padding: 16px;
    border-radius: 18px;
    background: var(--blue-light);
    border: 1px solid var(--border);
}

.detail-field.full { grid-column: 1 / -1; }
.detail-label { display: block; color: var(--blue-dark); font-weight: 900; margin-bottom: 7px; }
.detail-value { color: var(--text); line-height: 1.55; }

.nice-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }

label {
    display: grid;
    gap: 8px;
    font-weight: 800;
    color: var(--blue-dark);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    background: white;
}

textarea { min-height: 120px; resize: vertical; }

.notice { padding: 16px 18px; margin-bottom: 18px; }
.notice-success { border-color: #9fc2ff; background: #edf5ff; color: var(--blue-dark); }
.notice-error { border-color: #fda29b; background: #fff1f0; color: #7a271a; }
.contacts-box p { margin: 8px 0; }

@media (max-width: 1050px) {
    .site-header-inner { align-items: flex-start; flex-direction: column; }
    .site-nav, .site-auth { justify-content: flex-start; }
    .photo-grid.five { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .hero,
    .two-columns,
    .detail-card { grid-template-columns: 1fr; }
    .photo-grid.three,
    .photo-grid.four,
    .photo-grid.five,
    .photo-grid.six,
    .form-grid,
    .detail-fields { grid-template-columns: 1fr; }
    .hero-text { padding: 32px; }
    .detail-photo { min-height: 260px; }
}
/* ===== Таблицы ===== */

.table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #b8cff5;
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(20, 70, 150, 0.16);
    padding: 0;
}

/* Сама таблица */
.data-table,
.table-wrap table {
    width: 100%;
    min-width: 1050px;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    overflow: hidden;
    border-radius: 22px;
}

/* ЕДИНАЯ синяя шапка таблицы */
.data-table thead,
.table-wrap table thead {
    background: linear-gradient(90deg, #0b2c6f 0%, #1456d9 50%, #1e73ff 100%);
}

.data-table thead tr,
.table-wrap table thead tr {
    background: transparent;
}

.data-table th,
.table-wrap table th {
    background: transparent !important;
    color: #ffffff;
    font-weight: 800;
    padding: 16px 14px;
    text-align: left;
    font-size: 14px;
    border: none;
    white-space: nowrap;
}

/* Скругление шапки */
.data-table th:first-child,
.table-wrap table th:first-child {
    border-top-left-radius: 22px;
}

.data-table th:last-child,
.table-wrap table th:last-child {
    border-top-right-radius: 22px;
}

/* Ячейки */
.data-table td,
.table-wrap table td {
    padding: 15px 14px;
    font-size: 14px;
    color: #17345f;
    border-bottom: 1px solid #d4e4ff;
    vertical-align: middle;
}

/* Чередование строк */
.data-table tbody tr:nth-child(odd),
.table-wrap table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.data-table tbody tr:nth-child(even),
.table-wrap table tbody tr:nth-child(even) {
    background: #edf5ff;
}

/* Наведение на строку */
.data-table tbody tr:hover,
.table-wrap table tbody tr:hover {
    background: #d8eaff;
    transition: 0.2s;
}

/* Чтобы цвет строки точно применялся к ячейкам */
.data-table tbody tr:nth-child(odd) td,
.table-wrap table tbody tr:nth-child(odd) td {
    background: transparent;
}

.data-table tbody tr:nth-child(even) td,
.table-wrap table tbody tr:nth-child(even) td {
    background: transparent;
}

.data-table tbody tr:hover td,
.table-wrap table tbody tr:hover td {
    background: transparent;
}

/* Первое поле ID */
.data-table td:first-child,
.table-wrap table td:first-child {
    font-weight: 900;
    color: #0b2c6f;
}

/* Последняя строка без нижней границы */
.data-table tbody tr:last-child td,
.table-wrap table tbody tr:last-child td {
    border-bottom: none;
}

/* Фото в таблицах */
.table-photo {
    width: 82px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid #9fc2ff;
    background: repeating-linear-gradient(
        45deg,
        #e7f1ff,
        #e7f1ff 10px,
        #d5e8ff 10px,
        #d5e8ff 20px
    );
}

/* Ячейка действий */
.actions-cell {
    min-width: 210px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Маленькие кнопки в таблице */
.small-link,
.actions-cell a,
.actions-cell button {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

/* Просмотр / изменить */
.small-link,
.actions-cell a {
    background: #e3efff;
    color: #0b2c6f;
    border: 1px solid #a9c8ff;
}

.small-link:hover,
.actions-cell a:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* Удалить */
.small-danger,
.actions-cell button {
    background: #ffe4e6;
    color: #b42318;
    border: 1px solid #fecdd3;
}

.small-danger:hover,
.actions-cell button:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Пагинация под таблицей */
.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #b8cff5;
    color: #0b2c6f;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination a:hover {
    background: #1d4ed8;color: #ffffff;
}

.pagination .active span,
.pagination span[aria-current="page"] {
    background: #1d4ed8;
    color: #ffffff;
}
.validation-summary-valid { display: none; }
.field-validation-error { color: var(--danger); font-size: 13px; font-weight: 800; }
.input-validation-error { border-color: var(--danger) !important; }

.pagination span.active { background: #1d4ed8; color: #ffffff; }
