:root {
    --page: #f5f8fb;
    --panel: #ffffff;
    --ink: #1f2937;
    --muted: #5f6b7a;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --border: #d7dee8;
    --danger: #a32016;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

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

/* Header */

.site-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--panel);
    border-bottom: 0.0625rem solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 3rem;
    height: 3rem;
}

.company-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.system-name {
    color: var(--muted);
    font-size: 0.95rem;
}

.main-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.main-menu a,
.logout-link {
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    padding: 0.7rem 0.9rem;
    border-radius: 999em;
}

.main-menu a:hover,
.logout-link:hover {
    background: #e0f2f1;
    color: var(--brand-dark);
}

.logout-link {
    border: 0.0625rem solid var(--border);
}

/* Main layout */

.content {
    width: min(100% - 2rem, 68.75rem);
    margin: 1.5rem auto 3rem;
}

.site-footer {
    background: var(--panel);
    border-top: 0.0625rem solid var(--border);
    color: var(--muted);
    padding: 1rem;
    text-align: center;
}

/* Panels */

.hero,
.detail-card,
.login-card,
.form-panel {
    background: var(--panel);
    border: 0.0625rem solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

.hero h1 {
    margin-top: 0;
    font-size: 1.8rem;
    color: var(--brand-dark);
    line-height: 1.2;
}

.hero p {
    font-size: 1rem;
    color: var(--muted);
}

.hero-image {
    width: 100%;
    max-width: 22rem;
    height: auto;
    justify-self: center;
}

/* Page headings and actions */

.page-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-heading h1 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.7rem;
    line-height: 1.2;
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.button {
    display: inline-block;
    border: 0.0625rem solid var(--border);
    background: var(--panel);
    color: var(--ink);
    padding: 0.65rem 0.9rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.button.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

/* Tables */

.data-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    background: var(--panel);
    border: 0.0625rem solid var(--border);
    border-radius: 0.75rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    border-bottom: 0.0625rem solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.data-table th {
    background: #eef6f6;
    color: var(--brand-dark);
}

.data-table a {
    color: var(--brand-dark);
    font-weight: 700;
}

/* Detail lists */

dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    margin: 0;
}

dt {
    font-weight: 700;
    color: var(--brand-dark);
}

dd {
    margin: 0 0 0.75rem;
}

/* Forms */

.field-row {
    margin-bottom: 1rem;
}

.field-row label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--brand-dark);
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.7rem;
    border: 0.0625rem solid var(--border);
    border-radius: 0.5rem;
    font: inherit;
}

textarea {
    min-height: 10rem;
}

.error,
.errorlist {
    color: var(--danger);
    font-weight: 700;
}

/* Documents */

.document-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--brand-dark);
    font-weight: 700;
}

.pdf-icon {
    width: 2.25rem;
    height: 2.25rem;
}

/* Medium screens */

@media (min-width: 40em) {
    .site-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand logout"
            "menu menu";
        align-items: center;
        gap: 1rem 2rem;
        padding: 1.25rem 1.5rem;
    }

    .brand {
        grid-area: brand;
    }

    .main-menu {
        grid-area: menu;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .logout-link {
        grid-area: logout;
        white-space: nowrap;
        width: auto;
        min-width: max-content;
        text-align: center;
    }

    .action-group {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
    }

    .button {
        text-align: left;
    }

    dl {
        grid-template-columns: 12rem 1fr;
        gap: 0.65rem 1rem;
    }

    dd {
        margin: 0;
    }
}

/* Large screens */

@media (min-width: 48em) {
    .site-header {
        padding: 1rem 2rem;
    }

    .logo {
        width: 3.5rem;
        height: 3.5rem;
    }

    .company-name {
        font-size: 1.35rem;
    }

    .content {
        margin: 2rem auto 4rem;
    }

    .hero,
    .detail-card,
    .login-card,
    .form-panel {
        padding: 1.5rem;
    }

    .hero {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 2rem;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .hero p {
        font-size: 1.08rem;
    }

    .page-heading {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .data-table {
        display: table;
    }

    .data-table th,
    .data-table td {
        white-space: normal;
        padding: 0.8rem;
    }

    input,
    select,
    textarea {
        max-width: 42.5rem;
    }
}
/* Wider screens */

@media (min-width: 70em) {
    .content {
        width: min(100% - 3rem, 68.75rem);
    }
}