:root {
    --bg: #07111d;
    --panel: #0f1b2d;
    --panel-alt: #132338;
    --panel-soft: #1b2d44;
    --line: rgba(153, 176, 206, 0.18);
    --text: #eef3f8;
    --muted: #9fb0c6;
    --accent: #5e8dbd;
    --accent-strong: #8bb7e7;
    --danger: #b94c4c;
    --success: #4f9c6f;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    --radius: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(94, 141, 189, 0.18), transparent 30%),
        linear-gradient(180deg, #050b13 0%, var(--bg) 45%, #091522 100%);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

input,
select,
textarea,
button {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.public-page .container {
    width: min(1460px, calc(100% - 2.5rem));
}

.page-shell {
    padding: 1.25rem 0 2.5rem;
}

.site-header,
.site-footer {
    background: rgba(7, 17, 29, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.site-footer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    margin-top: 3rem;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
}

.public-page .site-header__inner {
    padding: 0.65rem 0;
}

.logo {
    display: inline-flex;
    gap: 0.85rem;
    align-items: center;
    color: var(--text);
}

.logo--image {
    gap: 0;
}

.logo__image {
    display: block;
    width: min(380px, 100%);
    height: auto;
    max-height: 68px;
    object-fit: contain;
}

.logo__mark {
    width: 2.85rem;
    height: 2.85rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 1px solid rgba(139, 183, 231, 0.35);
    background: linear-gradient(180deg, rgba(97, 145, 194, 0.34), rgba(10, 18, 30, 0.8));
    font-weight: 800;
    letter-spacing: 0.08em;
}

.logo__text strong,
.logo__text small {
    display: block;
}

.logo__text small,
.site-footer p,
.muted {
    color: var(--muted);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.15rem;
}

.site-nav a {
    color: var(--text);
    font-size: 0.96rem;
}

.hero,
.card,
.callout {
    background: linear-gradient(180deg, rgba(19, 35, 56, 0.95), rgba(10, 20, 33, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.hero h1,
.page-header h1,
.section-heading {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.hero p,
.page-header p {
    max-width: 70ch;
    color: var(--muted);
}

.stats-grid,
.card-grid,
.page-grid,
.detail-grid,
.footer-grid,
.admin-summary {
    display: grid;
    gap: 1.25rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 1.75rem;
}

.stat-card {
    padding: 1.25rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.card,
.callout,
.filters {
    padding: 1.25rem;
}

.hero--home .hero-copy {
    max-width: 54rem;
}

.homepage-section {
    margin-bottom: 1.9rem;
}

.homepage-section--compact {
    margin-top: 0;
}

.homepage-search-section .page-header {
    margin-bottom: 1rem;
}

.homepage-search-card {
    padding: 1.5rem;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card-grid--search-results {
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    justify-content: start;
}

.page-grid {
    grid-template-columns: 310px minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}

.button,
button,
.button--ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.75rem 1.05rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 183, 231, 0.24);
    background: linear-gradient(180deg, rgba(79, 123, 171, 0.35), rgba(12, 22, 35, 0.85));
    color: var(--text);
    cursor: pointer;
}

.button--ghost {
    background: rgba(10, 20, 33, 0.7);
}

.search-form,
.filters-form,
.admin-form {
    display: grid;
    gap: 1rem;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.35rem;
}

.search-form--home {
    gap: 1.2rem;
}

.search-form--home .search-grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 1fr));
    gap: 1.05rem 1rem;
}

.search-form--home label {
    gap: 0.45rem;
}

.search-form--home .search-field--keyword {
    grid-column: 1 / 2;
}

.search-form--home .search-field--charge {
    grid-column: 1 / 3;
}

.search-form--home .search-field--date {
    min-width: 0;
}

.search-form--home .search-actions {
    gap: 0.9rem;
    margin-top: 0.15rem;
}

.search-form--home .search-actions .button,
.search-form--home .search-actions .button--ghost {
    flex: 0 1 210px;
}

label span,
.eyebrow,
.offender-card__eyebrow,
.admin-section__title {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(153, 176, 206, 0.22);
    background: rgba(6, 14, 24, 0.72);
    color: var(--text);
}

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

.search-actions,
.filters-inline,
.split-actions,
.detail-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.disclaimer-strip,
.compliance-box {
    border: 1px solid rgba(139, 183, 231, 0.26);
    background: rgba(10, 22, 36, 0.85);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    color: #dbe6f2;
    margin-bottom: 1.5rem;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--muted);
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.4rem;
}

.offender-card {
    padding: 0;
    overflow: hidden;
}

.offender-card__image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #0b1320;
}

.offender-card__body {
    padding: 1rem;
}

.offender-card--search .offender-card__body {
    display: flex;
    flex-direction: column;
    padding: 0.9rem;
}

.offender-card--search .offender-card__image img {
    aspect-ratio: 1 / 1;
}

.offender-card--search h3 {
    margin: 0.25rem 0;
}

.offender-card--search .offender-card__meta,
.offender-card--search .offender-card__charges {
    margin: 0.35rem 0;
}

.offender-card h3 {
    margin: 0.35rem 0;
}

.offender-card__meta,
.offender-card__summary,
.offender-card__charges,
.directory-card p {
    color: var(--muted);
}

.offender-card__action {
    align-self: flex-start;
    min-height: 2.2rem;
    margin-top: 0.55rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.84rem;
}

.directory-card__code {
    display: inline-flex;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(94, 141, 189, 0.15);
    color: var(--accent-strong);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.status-active,
.status-updated {
    background: rgba(79, 156, 111, 0.18);
    color: #98ddb2;
}

.status-hidden,
.status-unpublished,
.status-restricted,
.status-sealed {
    background: rgba(185, 76, 76, 0.18);
    color: #f0b3b3;
}

.page-header {
    margin-bottom: 1.1rem;
}

.page-header p:last-child {
    margin-bottom: 0;
}

.search-results-header {
    margin-bottom: 0.85rem;
    padding-block: 1rem;
}

.search-results-header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.search-results-header h2 {
    margin: 0.35rem 0 0;
}

.page-grid > div > .card + .card,
.page-grid > div > .card + .card-grid,
.page-grid > div > .card-grid + .pagination,
.page-grid > div > .card + .pagination,
.page-grid > div > .empty-state + .pagination {
    margin-top: 0.9rem;
}

.detail-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.detail-image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 16px;
}

.detail-list,
.legal-list,
.two-column-list {
    display: grid;
    gap: 0.7rem;
}

.detail-list div,
.two-column-list div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(153, 176, 206, 0.12);
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.flash {
    border-radius: 14px;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
}

.flash--success {
    background: rgba(79, 156, 111, 0.16);
    border: 1px solid rgba(79, 156, 111, 0.28);
}

.flash--error {
    background: rgba(185, 76, 76, 0.16);
    border: 1px solid rgba(185, 76, 76, 0.3);
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.pagination a {
    display: inline-flex;
    min-width: 2.5rem;
    justify-content: center;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(10, 20, 33, 0.8);
}

.pagination a.active {
    background: rgba(94, 141, 189, 0.28);
    color: var(--text);
}

.footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 2rem;
}

.site-footer__bottom {
    padding: 1rem 0 2rem;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 0.85rem 0.65rem;
    border-bottom: 1px solid rgba(153, 176, 206, 0.12);
}

@media (max-width: 1180px) {
    .search-form--home .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-form--home .search-field--keyword,
    .search-form--home .search-field--charge {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .page-grid,
    .detail-grid,
    .stats-grid,
    .footer-grid,
    .search-grid {
        grid-template-columns: 1fr;
    }

    .homepage-search-card {
        padding: 1.25rem;
    }

    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo__image {
        width: min(265px, 100%);
        max-height: 53px;
    }

    .public-page .container {
        width: min(100%, calc(100% - 2rem));
    }

    .detail-list div,
    .two-column-list div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}
