/* Shared application theme over locally served Bootstrap 5.3.9. */
:root {
    --app-ink: #172536;
    --app-muted: #617186;
    --app-line: #dce3ec;
    --app-bg: #f4f6fa;
    --app-accent: #2459b7;
    --bs-primary: #2459b7;
    --bs-primary-rgb: 36,89,183;
    --bs-body-font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
    --bs-body-color: var(--app-ink);
    --bs-body-bg: var(--app-bg);
    --bs-border-color: var(--app-line);
    --bs-link-color: #2459b7;
    --bs-link-hover-color: #173f85;
}
body {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.55;
}
a {
    text-underline-offset: .18em;
}
button,input,select,textarea {
    font: inherit;
}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible {
    outline: 3px solid #477de0;
    outline-offset: 3px;
}
h1,h2,h3,h4 {
    letter-spacing: -.025em;
}
h1 {
    font-size: 1.85rem;
    font-weight: 720;
    line-height: 1.2;
}
h2 {
    font-size: 1.45rem;
    font-weight: 700;
}
h3 {
    font-size: 1.15rem;
    font-weight: 700;
}
.btn {
    --bs-btn-padding-y: .6rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: .45rem;
    min-height: 42px;
    white-space: normal;
}
.btn-primary {
    --bs-btn-bg: var(--app-accent);
    --bs-btn-border-color: var(--app-accent);
    --bs-btn-hover-bg: #1b4695;
    --bs-btn-hover-border-color: #1b4695;
    --bs-btn-active-bg: #173f85;
    --bs-btn-active-border-color: #173f85;
}
.btn-sm {
    --bs-btn-padding-y: .4rem;
    --bs-btn-padding-x: .7rem;
    --bs-btn-font-size: .82rem;
    min-height: 36px;
}
.btn-outline-secondary {
    --bs-btn-color: #47586e;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-bg: #edf2f9;
    --bs-btn-hover-color: #172536;
    --bs-btn-hover-border-color: #9eafc5;
}
.form-control,.form-select {
    min-height: 44px;
    border-radius: .4rem;
    border-color: #c6d0df;
    background-color: #fff;
    color: var(--app-ink);
    font-size: .9375rem;
}
.form-label {
    font-size: .82rem;
    font-weight: 650;
    margin-bottom: .4rem;
    color: #43536a;
}
.form-control:focus,.form-select:focus {
    border-color: #477de0;
    box-shadow: 0 0 0 .2rem #2459b71a;
}
.skip-link {
    position: fixed;
    left: 1rem;
    top: -5rem;
    z-index: 2000;
    background: white;
    padding: .6rem 1rem;
}
.skip-link:focus {
    top: 1rem;
}
.app-shell {
    display: grid;
    grid-template-columns: 246px minmax(0,1fr);
    min-height: 100vh;
}
.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--app-line);
    padding: 1.75rem 1.15rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.app-brand {
    display: flex;
    gap: .75rem;
    align-items: center;
    text-decoration: none;
    color: var(--app-ink);
    font-size: 1.05rem;
    font-weight: 750;
    margin-bottom: 2rem;
}
.company-wordmark {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.nav-group {
    font-size: .66rem;
    letter-spacing: .11em;
    text-transform: uppercase;
    font-weight: 750;
    color: #617186;
    margin: 1.65rem .75rem .55rem;
}
.app-sidebar .nav-item {
    display: flex;
    gap: .65rem;
    align-items: center;
    min-height: 44px;
    border-radius: .5rem;
    padding: .6rem .75rem;
    margin: .12rem 0;
    text-decoration: none;
    color: #4b5a70;
    font-size: .87rem;
    font-weight: 550;
}
.nav-item strong {
    font-size: .82rem;
    font-weight: 700;
}
.nav-item small {
    display: block;
    font-size: .72rem;
    color: #6c7a8f;
    font-weight: 450;
}
.app-sidebar .nav-item:hover {
    background: #f2f5fa;
}
.app-sidebar .nav-item.is-active {
    background: #eaf0fc;
    color: #1c4caa;
    box-shadow: inset 3px 0 0 var(--app-accent);
}
.nav-item.is-active small {
    color: #42649f;
}
.sidebar-footer {
    margin-top: auto;
    padding: .9rem .75rem 0;
    font-size: .72rem;
    font-weight: 600;
    color: #617186;
}
.sidebar-footer span {
    font-size: .65rem;
    font-weight: 400;
    color: #617186;
}
.app-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-topbar {
    height: 80px;
    background: #fff;
    border-bottom: 1px solid var(--app-line);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 2rem;
}
.workspace-name {
    font-size: .78rem;
    color: #617186;
    margin-right: auto;
}
.user-context {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}
.user-context strong {
    font-size: .8rem;
    display: block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-context small {
    display: block;
    font-size: .7rem;
    color: var(--app-muted);
}
.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #2d5493;
    background: #eaf0fc;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.app-topbar form {
    margin: 0;
}
.nav-toggle,.nav-close {
    display: none;
}
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: #14213b66;
    border: 0;
    z-index: 1090;
}
.app-main {
    padding: 1.5rem 2rem 2rem;
    min-width: 0;
    flex: 1;
}
.app-main:focus {
    outline: none;
}
.app-footer {
    padding: 0 2rem 1.25rem;
    font-size: .7rem;
    color: #617186;
}
.environment-notice {
    display: flex;
    gap: .65rem;
    align-items: center;
    flex-wrap: wrap;
    padding: .55rem .85rem;
    border: 1px solid #d6e5dc;
    background: #f1f8f4;
    border-radius: .4rem;
    margin-bottom: 1.5rem;
    color: #39604a;
    font-size: .73rem;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 750;
    font-size: .66rem;
    color: #617186;
    margin: 0 0 .45rem;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    margin: 0 0 .55rem;
}
.page-description {
    color: var(--app-muted);
    font-size: .9rem;
    max-width: 52rem;
    margin: 0;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}
.breadcrumb {
    font-size: .75rem;
    margin-bottom: 1rem;
}
.breadcrumb a {
    color: #63758d;
    text-decoration: none;
}
.breadcrumb span {
    color: #4a5a70;
}
.surface {
    border: 1px solid var(--app-line);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 2px 3px #17253603;
    min-width: 0;
}
.module-shortcuts {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.module-shortcut {
    display: block;
    border: 1px solid var(--app-line);
    border-radius: .65rem;
    background: #fff;
    padding: 1rem;
    text-decoration: none;
    transition: border-color .15s,box-shadow .15s;
    color: var(--app-ink);
    min-width: 0;
}
.module-shortcut:hover {
    border-color: #9cb5df;
    box-shadow: 0 3px 8px #254e8d0a;
}
.module-shortcut strong {
    display: block;
    font-size: .83rem;
    margin-bottom: .25rem;
}
.module-shortcut span {
    font-size: .75rem;
    color: var(--app-muted);
    display: block;
}
.module-shortcut small {
    color: var(--app-accent);
    font-size: .7rem;
    display: block;
    margin-top: .7rem;
}
.section-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 1rem;
}
.section-heading h2 {
    font-size: 1.1rem;
    margin: 0;
}
.scope-links {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.scope-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    border-radius: .4rem;
    padding: .45rem .8rem;
    color: #5a6980;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.scope-links a[aria-current] {
    color: #224d97;
    background: #e8effb;
    border-color: #d6e2f8;
}
.scope-links a:hover {
    background: #edf2f8;
}
.listing-toolbar {
    padding: 1.15rem;
    border-bottom: 1px solid var(--app-line);
}
.filter-grid {
    display: grid;
    grid-template-columns: minmax(180px,2fr) repeat(3,minmax(130px,1fr));
    gap: .85rem;
    align-items: end;
}
.filter-grid > [data-listing-feedback] { grid-column: 1 / -1; margin: 0; }
.filter-grid>.filter-search {
    grid-column: span 2;
}
.filter-grid label {
    display: block;
}
.filter-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    grid-column: 1/-1;
}
.filter-actions .per-page {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--app-muted);
    font-size: .75rem;
}
.per-page select {
    min-height: 36px;
    max-width: 75px;
    font-size: .75rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.listing-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin: 0;
}
.listing-table th {
    background: #f8fafc;
    border-bottom: 1px solid var(--app-line);
    font-size: .72rem;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 700;
    white-space: nowrap;
    padding: .9rem 1rem;
}
.listing-table td {
    font-size: .8rem;
    padding: 1.05rem 1rem;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
    overflow-wrap: anywhere;
    max-width: 20rem;
}
.listing-table tbody tr:last-child td {
    border-bottom: 0;
}
.listing-table tbody tr:hover {
    background: #fbfcfe;
}
.listing-table .record-reference {
    font-weight: 700;
    color: #2454a4;
    text-decoration: none;
    white-space: nowrap;
}
.record-secondary {
    display: block;
    color: #617186;
    font-size: .75rem;
    margin-top: .25rem;
}
.record-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 20rem;
    overflow-wrap: anywhere;
}
.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 26px;
}
.sort-link:hover {
    color: var(--app-accent);
}
.sort-link>span {
    color: #8495ac;
}
.date-time {
    display: block;
    font-size: .7rem;
    color: #617186;
}
.row-actions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
    min-width: 100px;
}
.row-actions form {
    margin: 0;
}
.row-actions .btn {
    font-size: .75rem;
    padding: .3rem .5rem;
    min-height: 36px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 6px;
    padding: .28rem .5rem;
    font-size: .73rem;
    font-weight: 650;
    white-space: nowrap;
    background: #f0f3f7;
    color: #59697e;
    border: 1px solid #e3e8f0;
}
.status-badge>span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.status-finished {
    color: #946019;
    background: #fff7e9;
    border-color: #f8e7c7;
}
.status-reviewed,.status-active {
    color: #29674c;
    background: #edf7f0;
    border-color: #d7ecde;
}
.status-inactive {
    color: #77717a;
    background: #f4f2f4;
    border-color: #e7e2e7;
}
.listing-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--app-line);
    padding: 1rem 1.15rem;
}
.listing-pagination>p {
    margin: 0;
    font-size: .75rem;
    color: #617186;
}
.pagination {
    gap: .25rem;
    flex-wrap: wrap;
    --bs-pagination-font-size: .75rem;
    --bs-pagination-border-radius: .35rem;
    --bs-pagination-color: #55667d;
    --bs-pagination-border-color: #dce3ec;
    --bs-pagination-active-bg: #2459b7;
    --bs-pagination-active-border-color: #2459b7;
}
.page-link {
    min-height: 36px;
    display: flex;
    align-items: center;
    border-radius: .35rem!important;
}
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--app-muted);
}
.empty-state h3 {
    font-size: 1rem;
    color: var(--app-ink);
    margin-bottom: .5rem;
}
.empty-state p {
    font-size: .85rem;
    margin-bottom: 0;
}
.create-menu {
    position: relative;
}
.create-menu>summary {
    list-style: none;
}
.create-menu>summary::-webkit-details-marker {
    display: none;
}
.create-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    width: 340px;
    max-width: calc(100vw - 2rem);
    z-index: 20;
    padding: 1rem;
    background: white;
    border: 1px solid var(--app-line);
    border-radius: .6rem;
    box-shadow: 0 8px 30px #14213b20;
}
.create-panel label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .8rem;
}
.create-panel select {
    margin-top: .3rem;
}
.alert {
    border-radius: .55rem;
    font-size: .85rem;
}
.error-summary a {
    color: inherit;
}
.guest {
    background: linear-gradient(#142a45a6,#142a45c9),url('../images/brand/field-work.jpg') center/cover no-repeat;
    min-height: 100vh;
}
.guest-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}
.guest-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2rem;
    width: min(440px,100%);
    padding: 1.1rem 1.25rem;
    background: white;
    border-radius: .65rem;
}
.guest-card {
    width: 100%;
    max-width: 440px;
    padding: 2.2rem;
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: .85rem;
    box-shadow: 0 8px 35px #17253605;
}
.guest-card h1 {
    font-size: 1.65rem;
}
.guest-form {
    margin-top: 1.75rem;
}
.guest-footer {
    font-size: .72rem;
    color: #fff;
    text-align: center;
    margin-top: 1.5rem;
}
.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}
[hidden] {
    display: none!important;
}
@media(min-width:1200px) {
    .app-main {
        max-width: 1720px;
        width: 100%;
        margin-inline: auto;
    }
}
@media(max-width:1199px) {
    .filter-grid {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }
    .app-topbar {
        padding: 1rem 1.5rem;
    }
    .app-main {
        padding: 1.25rem 1.5rem;
    }
    .workspace-name {
        display: none;
    }
    .user-context {
        margin-left: auto;
    }
    .listing-table th,.listing-table td {
        padding: .8rem .7rem;
    }
    .module-shortcuts {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}
@media(max-width:991px) {
    .app-shell {
        display: block;
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 270px;
        max-width: calc(100vw - 3rem);
        height: 100dvh;
        z-index: 1100;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .2s,visibility .2s;
    }
    .nav-open .app-sidebar {
        transform: translateX(0);
        visibility: visible;
    }
    .nav-open {
        overflow: hidden;
    }
    .nav-toggle {
        display: flex;
        align-items: center;
        gap: .5rem;
        border: 1px solid var(--app-line);
        border-radius: .4rem;
        background: #fff;
        min-height: 42px;
        padding: .4rem .7rem;
        font-size: .8rem;
    }
    .nav-close {
        display: block;
        background: none;
        border: 0;
        align-self: flex-end;
        font-size: .8rem;
        color: #63758d;
        min-height: 40px;
    }
    .app-brand {
        margin-bottom: .5rem;
    }
    .app-topbar {
        height: 72px;
        gap: .75rem;
    }
    .page-header h1 {
        font-size: 1.65rem;
    }
}
@media(max-width:767px) {
    .app-main {
        padding: 1rem;
    }
    .app-topbar {
        padding: .75rem 1rem;
    }
    .user-avatar {
        display: none;
    }
    .user-context strong {
        max-width: 135px;
        font-size: .74rem;
    }
    .user-context small {
        max-width: 145px;
        font-size: .62rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-topbar .btn {
        font-size: .75rem;
        padding: .35rem .55rem;
        min-height: 38px;
    }
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .page-header h1 {
        font-size: 1.55rem;
    }
    .page-description {
        font-size: .83rem;
    }
    .environment-notice {
        font-size: .66rem;
        margin-bottom: 1.25rem;
        gap: .2rem;
    }
    .module-shortcuts {
        gap: .6rem;
    }
    .module-shortcut {
        padding: .85rem;
    }
    .module-shortcut span {
        font-size: .69rem;
    }
    .module-shortcut small {
        margin-top: .4rem;
    }
    .filter-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: .75rem;
    }
    .listing-toolbar {
        padding: 1rem;
    }
    .filter-grid > [data-listing-feedback] { grid-column: 1 / -1; margin: 0; }
.filter-grid>.filter-search {
        grid-column: 1/-1;
    }
    .filter-actions .per-page {
        margin-left: 0;
    }
    .listing-table {
        display: block;
    }
    .listing-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .listing-table tbody {
        display: grid;
        gap: .75rem;
        padding: .75rem;
    }
    .listing-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        background: #fff;
        border: 1px solid var(--app-line);
        border-radius: .5rem;
        overflow: hidden;
        min-width: 0;
    }
    .listing-table td {
        display: block;
        border: 0;
        min-width: 0;
        max-width: none;
        padding: .65rem .85rem;
        font-size: .82rem;
    }
    .listing-table td:before {
        content: attr(data-label);
        display: block;
        font-size: .62rem;
        color: #617186;
        letter-spacing: .04em;
        margin-bottom: .25rem;
        font-weight: 650;
    }
    .listing-table .cell-identity {
        grid-column: 1/-1;
        background: #f8fafc;
        border-bottom: 1px solid #edf0f5;
    }
    .listing-table .cell-identity:before {
        display: none;
    }
    .listing-table .cell-context,.listing-table .cell-actions,.listing-table .cell-empty {
        grid-column: 1/-1;
    }
    .listing-table .cell-actions {
        border-top: 1px solid #edf0f5;
    }
    .listing-table .cell-actions:before {
        display: none;
    }
    .row-actions .btn {
        min-height: 40px;
        padding: .4rem .7rem;
    }
    .record-summary {
        max-width: none;
    }
    .listing-pagination {
        padding: 1rem;
    }
    .listing-pagination nav {
        width: 100%;
    }
    .pagination .page-item:not(:first-child):not(:last-child):not(.active) {
        display: none;
    }
    .create-panel {
        left: 0;
        right: auto;
    }
    .guest-card {
        padding: 1.75rem;
    }
    .app-footer {
        padding: 0 1rem 1rem;
    }
}
@media(prefers-reduced-motion:reduce) {
    *,*:before,*:after {
        transition: none!important;
        scroll-behavior: auto!important;
    }
}
.password-panel {
    max-width: 540px;
}
.listing-scroll {
    max-width: 100%;
    overflow-x: auto;
    border-radius: .75rem;
}
.listing-table time {
    display: inline-block;
    white-space: nowrap;
}
.per-page {
    white-space: nowrap;
}

.guest-home-link { display: inline-block; margin-top: 1.25rem; }
