:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #f7f7f5;
}

body {
    margin: 0;
}

.site-header {
    min-height: 3.5rem;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.brand {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav a,
.form-actions a:not(.button) {
    color: inherit;
}

.operator-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.operator-menu form,
.actions form {
    margin: 0;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-panel {
    max-width: 28rem;
    margin: 4rem auto;
}

.form-stack {
    display: grid;
    gap: 1rem;
    max-width: 36rem;
}

.form-stack label {
    display: grid;
    gap: .35rem;
    font-weight: 600;
}

input {
    box-sizing: border-box;
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font: inherit;
}

.button,
button {
    font: inherit;
}

.button {
    display: inline-block;
    width: fit-content;
    padding: .6rem .9rem;
    border: 0;
    border-radius: .35rem;
    background: #1f2937;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    background: #334155;
    color: #fff;
}

.button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.button:disabled,
.button[aria-disabled="true"] {
    background: #475569;
    color: #f8fafc;
    cursor: not-allowed;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #334155;
    text-decoration: underline;
    cursor: pointer;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.validation {
    color: #991b1b;
    font-weight: 400;
}

.notice {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: .7rem .8rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-weight: 700;
}

.actions {
    width: 1%;
    white-space: nowrap;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto auto auto;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.filter-bar select {
    padding: .65rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font: inherit;
    background: #fff;
}

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

.wide-field {
    grid-column: span 2;
}

fieldset {
    border: 1px solid #d1d5db;
    border-radius: .4rem;
    padding: 1rem;
}

legend {
    padding: 0 .35rem;
    font-weight: 700;
}

.checkbox-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: .6rem !important;
    margin: .5rem 0;
}

.checkbox-row input {
    width: auto;
}

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

.card {
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: .4rem;
    background: #fff;
}

.card h2 {
    margin-top: 0;
}

.details-list {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: .4rem .8rem;
}

.details-list dt {
    font-weight: 700;
}

.details-list dd {
    margin: 0;
}

.muted {
    color: #64748b;
    font-size: .9rem;
}

@media (max-width: 760px) {
    .filter-bar,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .wide-field {
        grid-column: auto;
    }

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

select {
    box-sizing: border-box;
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font: inherit;
    background: #fff;
}

.article-filter {
    grid-template-columns: minmax(14rem, 1fr) minmax(10rem, auto) minmax(10rem, auto) auto auto;
}

.article-thumb {
    width: 72px;
    height: 54px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: .3rem;
    border: 1px solid #d1d5db;
}

.image-placeholder {
    display: inline-flex;
    width: 72px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: .3rem;
    color: #64748b;
    font-size: .75rem;
    text-align: center;
}

.catalog-detail {
    align-items: start;
}

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

.lifecycle-form {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.content-add-form {
    align-items: end;
}

.image-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.image-category {
    min-width: 0;
}

.image-list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .75rem;
}

.image-tile {
    width: 150px;
    margin: 0;
}

.image-tile img {
    display: block;
    width: 150px;
    height: 110px;
    object-fit: contain;
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: .35rem;
}

.image-tile figcaption {
    margin-top: .35rem;
    overflow-wrap: anywhere;
    font-size: .85rem;
}

.upload-form {
    display: grid;
    gap: .6rem;
}

.drop-zone {
    display: grid;
    gap: .5rem;
    min-height: 5rem;
    padding: 1rem;
    align-content: center;
    border: 2px dashed #cbd5e1;
    border-radius: .4rem;
    background: #f8fafc;
    cursor: pointer;
}

.drop-zone.drag-over {
    border-style: solid;
    background: #eef2ff;
}

.drop-zone input[type=file] {
    padding: .25rem 0;
    border: 0;
}

.inline-form {
    display: flex;
    gap: .6rem;
    align-items: end;
    margin-bottom: 1rem;
}

.inline-form input {
    flex: 1;
}

.compact-table {
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .article-filter,
    .image-category-grid {
        grid-template-columns: 1fr;
    }

    .full-span {
        grid-column: auto;
    }
}

.organization-logo-preview {
    display: block;
    max-width: 260px;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 1rem;
    padding: .5rem;
    border: 1px solid #e5e7eb;
    border-radius: .4rem;
    background: #fff;
}

.dual-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.dual-list .card {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dual-list-heading {
    display: grid;
    gap: .75rem;
    margin-bottom: .75rem;
}

.dual-list-heading h2 {
    margin-bottom: .15rem;
}

.dual-list-select {
    width: 100%;
    min-height: 30rem;
    padding: .35rem;
    font: inherit;
}

.dual-list-select option {
    padding: .4rem .5rem;
}

.dual-list-actions {
    display: grid;
    gap: .65rem;
    align-content: center;
}

.dual-list-actions .button {
    width: 100%;
    white-space: nowrap;
}

.selected-order-actions {
    display: flex;
    gap: 1rem;
    margin-top: .75rem;
}

.object-card-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.25rem;
}

.object-card-submit p {
    margin-right: auto;
}

@media (max-width: 900px) {
    .dual-list {
        grid-template-columns: 1fr;
    }

    .dual-list-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .object-card-submit {
        align-items: flex-start;
        flex-direction: column;
    }
}

textarea {
    box-sizing: border-box;
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font: inherit;
    resize: vertical;
}

.subscription-plan-form {
    max-width: 70rem;
}

.subscription-version-card,
.subscription-terms-card {
    margin-top: 1.5rem;
}

.subscription-contract-form {
    max-width: 52rem;
}

.card-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-heading-row h2 {
    margin-bottom: 0;
}

.entitlement-card .details-list {
    grid-template-columns: 11rem 1fr;
}

.terms-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: inherit;
}

.rental-transaction-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.rental-choice-list {
    display: grid;
    gap: .55rem;
    max-height: 34rem;
    overflow: auto;
}

.rental-choice {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .75rem;
    border: 1px solid #e5e7eb;
    border-radius: .4rem;
    cursor: pointer;
}

.rental-choice:hover {
    background: #f8fafc;
}

.rental-choice input {
    width: auto;
    margin-top: .2rem;
}

.rental-choice span {
    display: grid;
    gap: .15rem;
}

.rental-choice small {
    color: #64748b;
}

.rental-choice-overdue {
    border-color: #fca5a5;
}

.entitlement-summary,
.extra-credit-checkout {
    margin-bottom: 1.25rem;
}

.subtle-notice {
    margin-top: 1rem;
}

.rental-decision ul {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .rental-transaction-grid {
        grid-template-columns: 1fr;
    }
}

.return-queue-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.return-queue-stat {
    display: grid;
    gap: .2rem;
    text-decoration: none;
}

.return-queue-stat strong {
    font-size: 2rem;
}

.return-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 1.25rem 0;
}

.return-history {
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .return-queue-summary,
    .return-action-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-grid,
.overdue-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-stat,
.overdue-stat {
    display: grid;
    gap: .25rem;
    text-decoration: none;
}

.dashboard-stat strong,
.overdue-stat strong {
    font-size: 2rem;
}

.overdue-inline-action,
.overdue-history {
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .dashboard-grid,
    .overdue-summary-grid {
        grid-template-columns: 1fr;
    }
}

.communication-transport-card,
.communication-action-card {
    margin-bottom: 1.25rem;
}

.communication-settings-grid {
    margin-bottom: 1.25rem;
}

.communication-template-form {
    max-width: 70rem;
}

.communication-snapshot {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: inherit;
}

.transport-provider-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: 1rem;
}

.transport-provider-fieldset legend {
    padding: 0 .35rem;
    font-weight: 700;
}

.communication-transport-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.report-filter {
    grid-template-columns: repeat(3, minmax(11rem, 1fr)) auto;
    align-items: end;
}

.report-filter label {
    display: grid;
    gap: .35rem;
    font-weight: 600;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.metric-card {
    display: grid;
    gap: .25rem;
    padding: .85rem;
    border: 1px solid #e5e7eb;
    border-radius: .4rem;
    background: #f8fafc;
}

.metric-card span,
.metric-card small {
    color: #64748b;
}

.metric-card strong {
    font-size: 1.1rem;
}

.report-section {
    margin-top: 1rem;
}

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

@media (max-width: 760px) {
    .report-filter,
    .report-metric-grid {
        grid-template-columns: 1fr;
    }
}

/* Puffin Island web application tokens and common component refinements. */
:root {
 --brand-gold:#E9B44C; --brand-green:#00A330; --brand-blue:#08415C;
 --brand-ink:#162521; --brand-brown:#95764D; --brand-sage:#AFBF9E;
 --app-background:#F3F7F6; --surface:#FFFFFF; --line:#CBD5CF;
 --muted-ink:#52645C; --focus-color:#08415C; --radius:.65rem;
 --shadow:0 6px 24px rgb(8 65 92 / 7%);
 color:var(--brand-ink); background:var(--app-background);
}
*,*::before,*::after { box-sizing:border-box; }
body { min-height:100vh; display:flex; flex-direction:column; line-height:1.5; overflow-wrap:break-word; }
a { color:var(--brand-blue); text-underline-offset:.15em; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible { outline:3px solid var(--focus-color); outline-offset:3px; }
button,input,select,textarea { max-width:100%; }
h1,h2,h3 { color:var(--brand-ink); line-height:1.25; }
h1 { font-family:Georgia,serif; font-size:clamp(1.5rem,2.7vw,2.1rem); }
.site-header { flex-wrap:wrap; padding:.65rem 1rem; gap:.7rem 1rem; border-color:var(--line); box-shadow:0 2px 12px rgb(8 65 92 / 5%); }
.brand { display:inline-flex; align-items:center; gap:.65rem; color:var(--brand-blue); font-family:Georgia,serif; font-size:1.12rem; }
.brand img { width:44px; height:44px; object-fit:contain; }
.main-nav { flex:1 1 35rem; min-width:0; overflow-x:auto; gap:.2rem; padding:.25rem 0; scrollbar-width:thin; }
.main-nav a { display:inline-flex; align-items:center; flex:none; min-height:42px; padding:.45rem .65rem; border-radius:.45rem; color:var(--brand-blue); text-decoration:none; white-space:nowrap; font-size:.9rem; font-weight:600; }
.main-nav a:hover { background:var(--app-background); }
.main-nav a[aria-current=page] { background:var(--brand-blue); color:#fff; }
.operator-menu { gap:.6rem; font-size:.85rem; }
.nav-toggle { display:none; border:1px solid var(--line); background:#fff; border-radius:.5rem; padding:.6rem .8rem; min-height:44px; color:var(--brand-blue); font-weight:700; }
.skip-link { position:absolute; top:-10rem; left:1rem; z-index:10; padding:.5rem; background:#fff; }
.skip-link:focus { top:.5rem; }
.page-shell { flex:1; width:100%; min-width:0; max-width:1320px; padding:clamp(1rem,3vw,2rem); }
.site-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem 1rem; padding:1rem 1.5rem; border-top:1px solid var(--line); background:#fff; color:var(--muted-ink); font-size:.8rem; }
.card,.notice,.metric-card,fieldset { border-color:var(--line); border-radius:var(--radius); }
.card { background:#fff; box-shadow:var(--shadow); }
.metric-card { background:#F9F7F5; }
.button { background:var(--brand-blue); min-height:42px; padding:.65rem .9rem; border-radius:.5rem; font-weight:600; }
.button:hover,.button:focus-visible { background:#0b526f; }
.button:disabled,.button[aria-disabled=true] { background:#657c83; }
.link-button { color:var(--brand-blue); min-height:40px; }
input:not([type=checkbox]):not([type=radio]),select,textarea { border-color:#91a79f; border-radius:.5rem; background:#fff; min-height:42px; }
input[type=checkbox],input[type=radio] { accent-color:var(--brand-blue); min-width:18px; min-height:18px; }
.muted,.metric-card span,.metric-card small { color:var(--muted-ink); }
.validation { color:#942d2d; }
.notice { border-left:4px solid var(--brand-blue); background:#fff; }
.data-table { display:block; max-width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:.5rem; }
.data-table th,.data-table td { border-bottom-color:var(--line); }
.data-table th { background:var(--app-background); color:var(--brand-ink); }
.data-table tbody tr:hover { background:#f9fbfa; }
.details-list dd { overflow-wrap:anywhere; }
.form-actions,.page-actions,.inline-form { flex-wrap:wrap; }
.login-panel { padding:clamp(1.25rem,4vw,2rem); max-width:31rem; background:#fff; border-radius:1rem; border-top:5px solid var(--brand-gold); box-shadow:var(--shadow); }
.login-eyebrow { font-family:Georgia,serif; color:var(--brand-blue); font-weight:700; }
@media(max-width:991.98px) {
 .nav-toggle { display:inline-flex; margin-left:auto; align-items:center; }
 .main-nav { order:3; flex:1 0 100%; display:none; flex-wrap:wrap; overflow:visible; border-top:1px solid var(--line); padding-top:.7rem; }
 .main-nav.show { display:flex; }
 .main-nav a { flex:1 1 10rem; white-space:normal; }
 .operator-menu { margin-left:0; }
}
@media(max-width:760px) {
 .brand { font-size:1rem; }
 .brand img { width:38px; height:38px; }
 .operator-menu { order:4; flex:1 0 100%; justify-content:flex-end; }
 .page-shell { padding:1rem .75rem; }
 .form-grid,.detail-grid,.image-category-grid,.rental-transaction-grid,.return-action-grid,.dashboard-grid,.overdue-summary-grid,.report-metric-grid,.return-queue-summary,.report-filter,.article-filter,.filter-bar { grid-template-columns:minmax(0,1fr); }
 .details-list,.entitlement-card .details-list { grid-template-columns:minmax(0,1fr); }
 .details-list dt { margin-top:.5rem; }
 .site-footer { flex-direction:column; }
 .dual-list-actions .button { white-space:normal; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* Central visual language for Bootstrap 5 + third-party components.
   Keep all global widget theming here, never in individual Razor pages. */
@font-face {
  font-family:"Puffin Playfair";
  src:url("../fonts/playfair-display-latin-600-normal.woff2") format("woff2");
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face {
  font-family:"Puffin Playfair";
  src:url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  font-weight:700; font-style:normal; font-display:swap;
}
:root {
  --bs-primary:var(--brand-blue);
  --bs-primary-rgb:8,65,92;
  --bs-body-color:var(--brand-ink);
  --bs-body-bg:var(--app-background);
  --bs-secondary-color:var(--muted-ink);
  --bs-secondary-bg:#e8f0ed;
  --bs-border-color:var(--line);
  --bs-border-radius:.5rem;
  --bs-border-radius-lg:var(--radius);
  --bs-link-color:var(--brand-blue);
  --bs-link-hover-color:#0b526f;
  --bs-focus-ring-color:rgb(8 65 92 / 25%);
}
h1,.brand,.login-eyebrow { font-family:"Puffin Playfair",Georgia,serif; }
h1 { font-weight:700; letter-spacing:-.015em; }
body { background:var(--app-background); color:var(--brand-ink); }
fieldset legend { float:none; width:auto; margin:0 0 .5rem; font-size:1rem; line-height:1.4; }
.btn-primary,.button {
  --bs-btn-bg:var(--brand-blue);
  --bs-btn-border-color:var(--brand-blue);
  --bs-btn-color:#fff;
  --bs-btn-hover-bg:#0b526f;
  --bs-btn-hover-border-color:#0b526f;
  --bs-btn-hover-color:#fff;
  --bs-btn-active-bg:#063249;
  --bs-btn-active-border-color:#063249;
  --bs-btn-disabled-bg:#657c83;
  --bs-btn-disabled-border-color:#657c83;
  --bs-btn-focus-shadow-rgb:8,65,92;
  background-color:var(--brand-blue);
  border-color:var(--brand-blue);
  color:#fff;
}
.btn-primary:hover,.btn-primary:focus-visible,
.button:hover,.button:focus-visible { background-color:#0b526f; border-color:#0b526f; color:#fff; }
.btn-primary:active,.btn-primary.show { background-color:#063249; border-color:#063249; }
.btn-primary:disabled,.button:disabled { background-color:#657c83; border-color:#657c83; }
.form-control,.form-select,input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea {
  border-color:#91a79f;
  border-radius:.5rem;
  min-height:42px;
}
.form-control:focus,.form-select:focus,input:focus:not([type=checkbox]):not([type=radio]),
select:focus,textarea:focus { border-color:var(--brand-blue); box-shadow:0 0 0 .2rem rgb(8 65 92 / 12%); }
.form-control.is-invalid,.form-select.is-invalid,input.input-validation-error {
  border-color:#942d2d;
}
.field-validation-error,.validation { color:#942d2d; }
.nav-toggle[aria-expanded="true"] { background:var(--app-background); }
.collapse:not(.show).main-nav { display:none; }
@media(min-width:992px) {
  .main-nav.d-lg-flex { display:flex !important; }
}
.table { --bs-table-color:var(--brand-ink); --bs-table-bg:#fff; --bs-table-border-color:var(--line); }
table.data-table[data-ui-table] { display:table; overflow:visible; width:100% !important; border:0; border-collapse:collapse; border-radius:0; }
.data-table[data-ui-table] th { background:var(--app-background); }
.dt-container { min-width:0; width:100%; }
.dt-container .dt-layout-row { gap:.7rem; flex-wrap:wrap; }
.dt-container .dt-search,.dt-container .dt-length { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; }
.dt-container .dt-search input,.dt-container .dt-length select { width:auto; min-width:5rem; }
.dt-container .dt-layout-cell { min-width:0; }
.dt-container .pagination .page-link { color:var(--brand-blue); }
.dt-container .pagination .page-item.active .page-link {
  color:#fff; background:var(--brand-blue); border-color:var(--brand-blue);
}
.dt-container .dt-scroll-body { border-bottom:1px solid var(--line); }
.flatpickr-calendar { border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); font-family:inherit; }
.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,
.flatpickr-day.selected:hover,.flatpickr-day.selected:focus {
  background:var(--brand-blue); border-color:var(--brand-blue); color:#fff;
}
.flatpickr-day.today { border-color:var(--brand-gold); }
.flatpickr-day.today:hover { background:var(--brand-blue); border-color:var(--brand-blue); }
.flatpickr-day:focus-visible { outline:2px solid var(--brand-blue); outline-offset:1px; }
.filepond--root { font-family:inherit; margin-bottom:0; }
.filepond--panel-root { background:var(--app-background); border:2px dashed var(--line); border-radius:var(--radius); }
.filepond--label-action { color:var(--brand-blue); text-decoration-color:var(--brand-blue); font-weight:700; }
.filepond--file { color:#fff; }
.filepond--item-panel { background:var(--brand-blue); }
.upload-form.has-filepond .drop-zone { border:0; padding:0; min-height:0; background:transparent; cursor:default; }
.upload-form.has-filepond .drop-zone strong { display:block; margin-bottom:.3rem; }
@media(max-width:760px) {
  .dt-container .dt-layout-row { display:flex; align-items:stretch; }
  .dt-container .dt-layout-cell { width:100%; }
  .dt-container .dt-search input { flex:1; min-width:10rem; }
}


/* Authenticated Puffin sidebar shell: no change to the public/login layout. */
.app-layout {
    --sidebar-expanded-width: 248px;
    --sidebar-compact-width: 68px;
    display: grid;
    grid-template-columns: var(--sidebar-expanded-width) minmax(0, 1fr);
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
}
.app-layout[data-sidebar-state="collapsed"] {
    grid-template-columns: var(--sidebar-compact-width) minmax(0, 1fr);
}
.public-layout { display:flex; flex-direction:column; flex:1 0 auto; min-width:0; }
.app-main-column { display:flex; flex-direction:column; min-width:0; max-width:100%; }
.app-topbar.site-header {
    min-height:64px;
    flex-wrap:nowrap;
    justify-content:flex-end;
    padding:.65rem clamp(.75rem,2.3vw,1.5rem);
    background:#fff;
}
.app-topbar .operator-menu { min-width:0; margin-left:auto; flex-wrap:wrap; justify-content:flex-end; }
.app-topbar .operator-name { overflow-wrap:anywhere; }
.app-sidebar {
    position:sticky;
    top:0;
    height:100vh;
    min-width:0;
    display:flex;
    flex-direction:column;
    overflow-y:auto;
    overscroll-behavior:contain;
    background:var(--brand-blue);
    color:#fff;
    scrollbar-width:thin;
    scrollbar-color:#a0b8c5 transparent;
}
.sidebar-brand-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:4px;
    min-height:70px;
    padding:10px 11px;
    border-bottom:1px solid rgb(255 255 255 / 16%);
}
.sidebar-brand {
    display:inline-flex;
    align-items:center;
    gap:9px;
    min-width:0;
    color:#fff;
    text-decoration:none;
    font-family:"Puffin Playfair",Georgia,serif;
    font-size:1.02rem;
    font-weight:700;
}
.sidebar-brand:hover,.sidebar-brand:focus-visible { color:#fff; }
.sidebar-brand img { flex:none; object-fit:contain; width:38px; height:38px; }
.sidebar-brand-label { min-width:0; }
.sidebar-toggle {
    display:inline-flex;
    flex:none;
    align-items:center;
    justify-content:center;
    min-height:38px;
    min-width:38px;
    border:1px solid rgb(255 255 255 / 55%);
    border-radius:9px;
    padding:6px;
    color:#fff;
    background:rgb(255 255 255 / 9%);
    cursor:pointer;
}
.sidebar-toggle:hover,.sidebar-toggle:focus-visible { color:var(--brand-blue); background:#fff; }
.sidebar-toggle .sidebar-toggle-expand { display:none; }
.sidebar-navigation { display:block; padding:12px 9px 18px; min-width:0; }
.sidebar-group { margin:0 0 13px; }
.sidebar-group-title {
    margin:13px 10px 5px;
    color:#c8dbe4;
    font:700 .68rem/1.4 system-ui,sans-serif;
    text-transform:uppercase;
    letter-spacing:.075em;
}
.sidebar-link-list { list-style:none; padding:0; margin:0; }
.sidebar-link {
    display:flex;
    align-items:center;
    gap:12px;
    min-height:44px;
    padding:9px 11px;
    border-radius:9px;
    color:#fff;
    text-decoration:none;
    font-weight:600;
    font-size:.91rem;
    line-height:1.3;
}
.mdi-icon { flex:none; width:22px; height:22px; fill:currentColor; }
.sidebar-link:hover { color:#fff; background:#1f5773; }
.sidebar-link.is-active,.sidebar-link[aria-current="page"] {
    background:var(--brand-gold);
    color:#172c37;
    box-shadow:inset 3px 0 0 #fff;
}
.sidebar-link.is-active:hover { background:#f1c879; color:#172c37; }
.sidebar-link:focus-visible,.sidebar-toggle:focus-visible,.sidebar-brand:focus-visible {
    outline:3px solid #fff;
    outline-offset:-3px;
}
.app-layout[data-sidebar-state="collapsed"] .sidebar-brand-row {
    gap:2px;
    justify-content:center;
    padding:8px 3px;
}
.app-layout[data-sidebar-state="collapsed"] .sidebar-brand img { width:26px; height:26px; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-brand-label,
.app-layout[data-sidebar-state="collapsed"] .sidebar-link-label { display:none; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-toggle { min-width:29px; min-height:32px; padding:3px; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-toggle .sidebar-toggle-collapse { display:none; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-toggle .sidebar-toggle-expand { display:block; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-navigation { padding:12px 6px; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-group { border-top:1px solid rgb(255 255 255 / 18%); padding-top:8px; margin-bottom:8px; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-group-title {
    position:absolute;
    width:1px; height:1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap;
}
.app-layout[data-sidebar-state="collapsed"] .sidebar-link { padding:10px 0; justify-content:center; gap:0; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-link.is-active { box-shadow:inset 3px 0 0 #fff; }
.mobile-menu-button,.mobile-brand { display:none; }
.mobile-navigation.offcanvas {
    --bs-offcanvas-width:min(320px,90vw);
    color:#fff;
    background:var(--brand-blue);
}
.mobile-navigation .offcanvas-header { padding:15px 18px; border-bottom:1px solid rgb(255 255 255 / 16%); }
.mobile-navigation .offcanvas-brand { display:flex; align-items:center; gap:10px; color:#fff; text-decoration:none; font-family:"Puffin Playfair",Georgia,serif; font-weight:700; }
.mobile-navigation .offcanvas-brand img { object-fit:contain; }
.mobile-navigation .sidebar-navigation { padding:8px 12px 22px; overflow-y:auto; }
.mobile-navigation .sidebar-group-title { color:#c8dbe4; }
.mobile-navigation .sidebar-link:focus-visible,.mobile-navigation .offcanvas-brand:focus-visible,
.mobile-navigation .btn-close:focus-visible { outline:3px solid #fff; outline-offset:2px; }
.mobile-navigation .sidebar-link[aria-current="page"] { color:#172c37; }
@media (min-width:768px) and (max-width:991.98px) {
    .app-layout:not([data-sidebar-state="expanded"]) {
        grid-template-columns:var(--sidebar-compact-width) minmax(0,1fr);
    }
}
@media (max-width:767.98px) {
    .app-layout { grid-template-columns:minmax(0,1fr) !important; }
    .app-sidebar { display:none; }
    .app-topbar.site-header { justify-content:space-between; gap:8px; flex-wrap:wrap; }
    .mobile-menu-button {
        display:inline-flex;
        gap:5px;
        align-items:center;
        justify-content:center;
        min-width:44px;
        min-height:44px;
        padding:7px 9px;
        color:var(--brand-blue);
        border:1px solid var(--line);
        border-radius:9px;
        background:#fff;
        cursor:pointer;
        font-weight:650;
    }
    .mobile-menu-button:hover { background:var(--app-background); }
    .mobile-brand.brand { display:inline-flex; flex:1; min-width:0; white-space:normal; font-size:.92rem; }
    .mobile-brand img { flex:none; }
    .app-topbar .operator-menu { width:100%; justify-content:flex-end; }
    .app-main-column { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
    .mobile-navigation.offcanvas { transition:none; }
}

/* Keep DataTables usable on narrow touchscreens: scroll the table itself,
   never squeeze numeric columns or split pagination button labels. */
@media (max-width:767.98px) {
    .dt-container .dt-scroll-body { max-width:100%; overflow-x:auto !important; }
    .dt-container table.data-table[data-ui-table] th,
    .dt-container table.data-table[data-ui-table] td { white-space:nowrap; overflow-wrap:normal; }
    .dt-container .dt-paging .pagination { display:flex; justify-content:flex-start; flex-wrap:wrap; gap:4px; }
    .dt-container .dt-paging .page-link {
        display:inline-flex;
        align-items:center;
        justify-content:center;
        min-height:44px;
        min-width:44px;
        white-space:nowrap;
        overflow-wrap:normal;
        border-radius:6px;
    }
}


/* The public login shell needs to fill the viewport even on short pages.
   100dvh follows the visible viewport on mobile keyboard open/close;
   content can still grow naturally on smaller screens. */
body { min-height:100vh; min-height:100dvh; }
.public-layout { min-height:0; }
.public-layout > .app-main-column { flex:1 1 auto; }
.public-layout .page-shell { flex:1 0 auto; }
.public-layout .site-footer { flex-shrink:0; }

/* DEC-0096: separate parent destination and disclosure, shared by desktop/mobile. */
.sidebar-parent { display:flex; align-items:stretch; }
.sidebar-parent > .sidebar-link { flex:1; min-width:0; }
.sidebar-disclosure { flex:none; width:44px; min-height:44px; border:0; border-radius:6px; background:transparent; color:#fff; font-size:1.3rem; }
.sidebar-disclosure:hover,.sidebar-disclosure:focus-visible { background:#1f5773; outline:2px solid #f1c879; outline-offset:-2px; }
.sidebar-disclosure[aria-expanded="true"] span { display:inline-block; transform:rotate(180deg); }
.sidebar-submenu { list-style:none; margin:4px 0 8px 24px; padding:0 0 0 12px; border-left:1px solid #8caebe; }
.sidebar-submenu[hidden] { display:none !important; }
.sidebar-child { display:block; padding:10px 8px; min-height:44px; color:#e6f0f5; font-size:.9rem; border-radius:4px; }
.sidebar-child:hover,.sidebar-child:focus-visible { color:#fff; background:#1f5773; outline:2px solid #f1c879; outline-offset:-2px; }
.sidebar-child.is-active { color:#172c37; background:#f1c879; font-weight:600; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-parent { flex-wrap:wrap; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-parent > .sidebar-link { flex-basis:100%; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-disclosure { width:100%; }
.app-layout[data-sidebar-state="collapsed"] .sidebar-submenu { position:fixed; z-index:1040; width:260px; max-width:calc(100vw - 80px); max-height:calc(100vh - 24px); overflow:auto; margin:0; padding:8px; border:1px solid #8caebe; border-radius:8px; background:#153e53; box-shadow:0 8px 24px #0004; }
tr[data-record-row] { cursor:pointer; }
tr[data-record-row]:hover > td { background-color:#edf5fa; }
tr[data-record-row]:focus-within > td { background-color:#e4f0f8; box-shadow:inset 0 2px #246589,inset 0 -2px #246589; }
a[data-record-link]:focus-visible { outline:3px solid #246589; outline-offset:3px; }
.secondary-actions summary { cursor:pointer; padding:8px 0; font-weight:600; }
.secondary-actions form { margin-top:12px; }
.reference-data-links li { margin-block:12px; }
