:root {
    --blue: #2f4698;
    --blue-dark: #1c2d68;
    --ink: #172033;
    --muted: #647084;
    --line: #dde3ee;
    --soft: #f5f7fb;
    --white: #ffffff;
    --success: #176b46;
    --danger: #a43131;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

img {
    max-width: 100%;
}

.site-header,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 4vw, 56px);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.brand img {
    display: block;
    width: min(280px, 54vw);
    height: auto;
}

.brand-compact img {
    width: 210px;
}

.top-nav,
.admin-header-actions,
.hero-actions,
.form-actions,
.detail-header,
.admin-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.top-nav a {
    font-weight: 700;
}

main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    min-height: 430px;
    display: grid;
    align-items: center;
    padding: clamp(36px, 6vw, 72px);
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    color: var(--white);
    border-radius: 8px;
}

.hero-copy {
    width: min(760px, 100%);
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: inherit;
    opacity: .78;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
    margin-bottom: 18px;
}

h2 {
    font-size: 22px;
}

.lead {
    font-size: 18px;
    max-width: 780px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--blue);
    border-radius: 6px;
    background: var(--blue);
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
}

.button-secondary,
.button-ghost {
    background: var(--white);
    color: var(--blue);
}

.button-ghost {
    min-height: 36px;
    padding: 8px 14px;
}

.info-grid,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.info-grid article,
.panel,
.table-panel,
.login-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.panel {
    margin-bottom: 18px;
}

.narrow,
.login-card {
    width: min(620px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.section-heading {
    margin-bottom: 22px;
}

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

.full {
    grid-column: 1 / -1;
}

label,
legend {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #c9d2e2;
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--white);
    font: inherit;
}

textarea {
    resize: vertical;
}

.choice-box {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.choice-box label,
.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
}

.choice-box input,
.checkbox-line input {
    width: auto;
    min-height: auto;
    margin-top: 5px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--white);
}

.notice-error {
    color: var(--danger);
    border-color: #e9c4c4;
}

.notice-success {
    color: var(--success);
    border-color: #b8dccb;
}

.credential-box {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.credential-box strong {
    font-size: 24px;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 14px;
    border-left: 4px solid var(--blue);
    background: var(--soft);
    border-radius: 6px;
}

.timeline-item time {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.compact {
    margin-top: 16px;
}

.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.auth-shell {
    width: min(520px, calc(100% - 32px));
    padding: 24px 0;
}

.login-card img {
    width: 260px;
    display: block;
    margin-bottom: 24px;
}

.admin-body {
    background: #eef2f8;
}

.admin-main {
    width: min(1280px, calc(100% - 32px));
}

.admin-title {
    justify-content: space-between;
    margin-bottom: 18px;
}

.admin-title h1 {
    font-size: 32px;
    margin-bottom: 0;
}

.filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

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

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

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8ecf8;
    color: var(--blue-dark);
    font-weight: 800;
    font-size: 12px;
}

.detail-header,
.admin-title {
    justify-content: space-between;
}

.data-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 14px;
}

.data-list dt {
    color: var(--muted);
    font-weight: 800;
}

.data-list dd {
    margin: 0;
}

.preline {
    white-space: normal;
}

.attachment-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.attachment-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px clamp(18px, 4vw, 56px);
    color: var(--muted);
    background: var(--white);
    border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
    .site-header,
    .admin-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .info-grid,
    .detail-grid,
    .form-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding: 30px 20px;
    }

    h1 {
        font-size: 34px;
    }

    .data-list {
        grid-template-columns: 1fr;
    }
}

/* Visual refresh - header, logo, hero and cards */
body {
    background: #f2f5fa;
}

.site-header {
    min-height: 132px;
    padding: 22px clamp(24px, 5vw, 88px);
    box-shadow: 0 8px 28px rgba(23, 32, 51, .06);
}

.brand {
    display: block;
    width: min(390px, 58vw);
    height: 112px;
    overflow: hidden;
    position: relative;
}

.brand img {
    max-width: none;
    width: 390px;
    transform: translateY(-146px);
}

.brand-compact {
    width: 260px;
    height: 78px;
}

.brand-compact img {
    width: 270px;
    transform: translateY(-101px);
}

.top-nav {
    gap: 10px;
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 6px;
    color: var(--blue-dark);
}

.top-nav a:hover {
    background: #eef2ff;
}

main {
    width: min(1480px, calc(100% - 64px));
    padding-top: 36px;
}

.hero {
    min-height: 440px;
    padding: clamp(42px, 5vw, 86px);
    border: 1px solid rgba(255, 255, 255, .2);
    background: linear-gradient(135deg, rgba(28, 45, 104, .98), rgba(47, 70, 152, .98)), var(--blue);
    box-shadow: 0 22px 55px rgba(28, 45, 104, .18);
}

.hero-copy {
    width: min(940px, 100%);
}

.hero .lead {
    max-width: 900px;
}

.hero-actions {
    margin-top: 24px;
}

.button {
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(47, 70, 152, .16);
}

.button-secondary {
    border-color: #dbe3f5;
    box-shadow: none;
}

.info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.info-grid article,
.panel,
.table-panel,
.login-card {
    border-color: #d5deed;
    box-shadow: 0 12px 28px rgba(23, 32, 51, .05);
}

.info-grid article {
    min-height: 190px;
    padding: 28px;
}

.info-grid h2 {
    margin-bottom: 16px;
    color: #071226;
}

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

@media (max-width: 820px) {
    .site-header {
        min-height: auto;
        padding: 18px 20px;
    }

    .brand {
        width: min(320px, 86vw);
        height: 92px;
    }

    .brand img {
        width: 320px;
        transform: translateY(-120px);
    }

    main {
        width: min(100% - 28px, 720px);
        padding-top: 22px;
    }

    .hero {
        padding: 30px 22px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
