* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f7fb;
    color: #112033;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: linear-gradient(90deg, #38a169, #1899d6);
    color: white;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 0 42px;
    box-shadow: 0 6px 18px rgba(26, 96, 116, .18);
}

.brand {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.nav a, .auth a {
    color: white;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.nav a:hover, .auth a:hover {
    background: rgba(255, 255, 255, .18);
}

.auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth form {
    margin: 0;
}

.logout {
    border: 0;
    color: white;
    background: #ef4444;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.user-badge, .role {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    font-size: 13px;
}

.role.admin {
    background: #f59e0b;
}

.role.user {
    background: #0ea5e9;
}

.content {
    width: min(1180px, calc(100% - 40px));
    margin: 28px auto;
    flex: 1;
}

.footer {
    background: #142132;
    color: #dbeafe;
    padding: 22px 42px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.hero {
    background: white;
    border-radius: 26px;
    padding: 36px;
    display: grid;
    grid-template-columns: 1.4fr .9fr;
    gap: 30px;
    align-items: center;
    box-shadow: 0 14px 34px rgba(17, 24, 39, .08);
}

.hero h1 {
    margin: 0 0 16px;
    font-size: 48px;
    color: #0f766e;
}

.hero p {
    font-size: 18px;
    line-height: 1.55;
}

.hero img {
    width: 100%;
    height: 300px;
    border-radius: 22px;
    object-fit: cover;
}

.label {
    color: #0891b2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

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

.primary-link, .secondary-link, .primary, .danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 0;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.primary-link, .primary {
    background: #06b6d4;
    color: white;
}

.secondary-link {
    background: #e0f2fe;
    color: #075985;
}

.danger {
    background: #ef4444;
    color: white;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 22px 0;
}

.stats div {
    background: white;
    border-radius: 20px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .07);
}

.stats b {
    display: block;
    font-size: 28px;
    color: #0f766e;
}

.stats span {
    color: #475569;
}

.section-head, .table-head, .card, .auth-card, .form-card, .delete-card, .feedback {
    background: white;
    border-radius: 22px;
    padding: 26px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .07);
}

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

.table-head h1, .card h1, .auth-card h1, .form-card h1 {
    margin: 0 0 10px;
    color: #0f766e;
}

.cards-grid, .feature-grid, .contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.feature-grid {
    grid-template-columns: repeat(3, 1fr);
}

.contact-grid {
    grid-template-columns: repeat(4, 1fr);
}

.mini-card, .feature, .contact-block {
    background: white;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .07);
}

.mini-card img, .feature img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 16px;
}

.table-wrap {
    background: white;
    overflow: auto;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(17, 24, 39, .08);
}

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

th {
    background: linear-gradient(90deg, #6ee7b7, #38bdf8);
    color: #10203a;
    font-weight: 800;
}

td, th {
    border: 1px solid #dce7f2;
    padding: 13px 14px;
    vertical-align: middle;
}

td {
    background: #fff;
}

.thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
}

.thumb-big {
    width: 180px;
    height: 140px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    margin-bottom: 20px;
}

.actions {
    white-space: nowrap;
    display: flex;
    gap: 8px;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
}

.btn-view, .btn-edit, .btn-delete {
    width: 48px;
    height: 42px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
}

.btn-view { background: #06b6d4; }
.btn-edit { background: #f59e0b; }
.btn-delete { background: #ef4444; }

.pagination {
    display: flex;
    gap: 8px;
    margin: 22px 0;
    flex-wrap: wrap;
}

.pagination a {
    min-width: 40px;
    height: 38px;
    border-radius: 10px;
    background: white;
    color: #075985;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(17,24,39,.08);
}

.pagination a.active {
    background: #0ea5e9;
    color: white;
}

.details {
    display: grid;
    grid-template-columns: 370px 1fr;
    gap: 28px;
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(17,24,39,.08);
    margin-bottom: 22px;
}

.details-photo {
    width: 100%;
    height: 330px;
    border-radius: 20px;
    object-fit: cover;
}

.details-info h1 {
    color: #0f766e;
    margin-top: 0;
}

dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 18px;
}

dt {
    font-weight: 800;
    color: #475569;
}

dd {
    margin: 0;
}

.form {
    display: grid;
    gap: 10px;
}

.form input, .form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
}

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

.validation {
    color: #dc2626;
    font-weight: 600;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-line input {
    width: auto;
}

@media (max-width: 900px) {
    .topbar, .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero, .details, .stats, .cards-grid, .feature-grid, .contact-grid {
        grid-template-columns: 1fr;
    }
}

.photo-contacts .contact-block img {
    width: 100%;
    height: 135px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 12px;
}

.contact-block h3 {
    margin-top: 6px;
    color: #0f766e;
}
