/* General */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #202633;
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
    width: min(1300px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header and navigation */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e8ee;
}

.header-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 750;
    font-size: 19px;
    color: #202633;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-header nav > a:not(.button) {
    color: #596273;
    text-decoration: none;
}

/* Main content */
.main {
    min-height: calc(100vh - 130px);
    padding-top: 38px;
    padding-bottom: 50px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.page-heading h1 {
    font-size: 30px;
    line-height: 1.2;
    margin: 3px 0 5px;
    letter-spacing: -.7px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 750;
    color: #758096;
    margin: 0;
}

.muted {
    color: #788293;
    margin: 0;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #263f70;
    background: #263f70;
    color: white;
    text-decoration: none;
    border-radius: 7px;
    padding: 10px 16px;
    font: 600 14px inherit;
    cursor: pointer;
}

.button:hover {
    background: #1d3158;
}

.button-small {
    padding: 7px 11px;
    font-size: 13px;
}

.button-light {
    background: #fff;
    border-color: #d9dee7;
    color: #39465b;
}

.button-light:hover {
    background: #f0f2f6;
}

.button-danger {
    background: #a63737;
    border-color: #a63737;
}

/* Search toolbar */
.toolbar {
    display: flex;
    gap: 9px;
    margin-bottom: 17px;
}

.toolbar input {
    max-width: 440px;
    flex: 1;
}

.toolbar input,
input,
textarea {
    font: inherit;
}

.toolbar input,
.form-card input,
.form-card textarea {
    width: 100%;
    border: 1px solid #d9dee7;
    background: #fff;
    border-radius: 7px;
    padding: 10px 12px;
    color: #202633;
    outline: none;
}

.toolbar input:focus,
.form-card input:focus,
.form-card textarea:focus {
    border-color: #728bb8;
    box-shadow: 0 0 0 3px #e8edf6;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 10px;
}

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

th,
td {
    text-align: left;
    padding: 12px 13px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: top;
    font-size: 13px;
}

th {
    background: #fafbfc;
    color: #697487;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

th a {
    color: inherit;
    text-decoration: none;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* CHANGE THIS COLOUR TO ALTER THE ROW HOVER BACKGROUND */
tbody tr:hover {
    background: #cccccc;
}

.title-cell {
    font-weight: 650;
    min-width: 170px;
}

.title-cell a,
.actions a {
    color: #294d87;
    text-decoration: none;
}

.actions {
    white-space: nowrap;
}

.actions a {
    margin-right: 9px;
}

.notes-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 17px;
    color: #687386;
    font-size: 13px;
}

.pagination > div {
    display: flex;
    gap: 7px;
}

/* Empty state */
.empty-state {
    text-align: center;
    background: #fff;
    border: 1px dashed #d8dee8;
    border-radius: 12px;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 38px;
    color: #8192ae;
}

.empty-state h2 {
    margin: 8px 0 2px;
}

.empty-state p {
    color: #788293;
    margin: 0 0 20px;
}

/* Forms and detail cards */
.form-card,
.detail-card {
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 10px;
    padding: 25px;
    max-width: 900px;
}

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

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #465166;
}

.form-grid input,
.form-grid textarea {
    font-weight: 400;
}

.form-grid select {
    width: 100%;
    min-height: 130px;
    padding: 8px 10px;
    border: 1px solid #d9dee7;
    background: #fff;
    border-radius: 7px;
    color: #202633;
    font: inherit;
    font-weight: 400;
}

.form-grid select:focus {
    border-color: #728bb8;
    box-shadow: 0 0 0 3px #e8edf6;
    outline: none;
}

.form-grid select option {
    padding: 5px;
}

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

.required {
    color: #b63c3c;
}

.form-actions,
.heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
}

.heading-actions {
    margin-top: 0;
}

/* Detail page */
.detail-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.detail-grid dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #7b8596;
    font-weight: 750;
    margin-bottom: 4px;
}

.detail-grid dd {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

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

.notes-detail {
    line-height: 1.7;
}

/* Delete form */
.delete-form {
    margin-top: 20px;
}

/* Notices and messages */
.notice {
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 18px;
    background: #eaf5ed;
    color: #28643a;
}

.notice.error {
    background: #fff0ef;
    color: #963a32;
}

.notice ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

/* Footer */
.footer {
    border-top: 1px solid #e5e8ee;
    padding: 20px 0 28px;
    color: #8992a0;
    font-size: 12px;
}

.footer:empty {
    display: none;
}

/* Mobile layout */
@media (max-width: 700px) {
    .container {
        width: min(100% - 26px, 1240px);
    }

    .main {
        padding-top: 25px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-heading h1 {
        font-size: 26px;
    }

    .heading-actions {
        margin-top: 0;
    }

    .form-card,
    .detail-card {
        padding: 17px;
    }

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

    .form-grid .full-width,
    .detail-grid .full-width {
        grid-column: auto;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .toolbar input {
        flex-basis: 100%;
        max-width: none;
    }

    .site-header nav {
        gap: 12px;
    }

    .pagination {
        gap: 10px;
        align-items: flex-start;
        flex-direction: column;
    }
}
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #b42318;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}
.detail-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 20px;
    margin: 0;
}

.detail-list dt {
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
    white-space: pre-wrap;
}

@media (max-width: 600px) {
    .detail-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-list dd {
        margin-bottom: 12px;
    }
}

/* Public library table */
.library-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
}

.library-table th,
.library-table td {
    padding: 8px 12px;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.library-table th:first-child,
.library-table td:first-child {
    width: 45%;
}

.library-table th:nth-child(2),
.library-table td:nth-child(2),
.library-table th:nth-child(3),
.library-table td:nth-child(3) {
    width: 27.5%;
}

/* Smaller screens */
@media (max-width: 600px) {
    .library-table th,
    .library-table td {
        padding: 7px 6px;
        font-size: 13px;
    }

    .library-table th:first-child,
    .library-table td:first-child {
        width: 40%;
    }

    .library-table th:nth-child(2),
    .library-table td:nth-child(2),
    .library-table th:nth-child(3),
    .library-table td:nth-child(3) {
        width: 30%;
    }
}


/* Allow navigation links to wrap when necessary */
.header-inner {
    height: auto;
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 12px;
}

.site-header nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}
