/* ===============================================
   NSN Data Collection System — DaisyUI Theme
   =============================================== */

/*
   For development we load DaisyUI 4 via CDN (see cmd/server/main.go).
   This file is reserved for custom variables, dark mode overrides,
   and high-contrast WCAG compliance tweaks.
*/

:root {
    --brand-red: #d11242;
    --brand-red-dark: #a40d34;
    --brand-blue: #174a7c;
    --brand-blue-dark: #0f3257;
    --brand-blue-tint: #e8f0fa;
    --ink: #0e1a2b;
    --ink-soft: #3b4a60;
    --ink-mute: #5e6c80;
    --line: #c8d2df;
    --line-soft: #e3e8ef;
    --surface: #ffffff;
    --canvas: #f3f5f8;
    --row-stripe: #f7f9fc;
    --row-attested: #e5e7eb;
    --warn-bg: #fff5d6;
    --warn-line: #f0c419;
    --ok-bg: #e6f4ec;
    --ok-line: #1f8a5b;
    --focus: #ffbf00;
    --topbar-h: 76px;
    --primary: var(--brand-blue);
    --success: var(--ok-line);
    --warning: #a16207;
    --font-mono:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

body.app-body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family:
        "Public Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    width: 100%;
}

.app-main {
    max-width: none;
    margin: 28px 0 60px;
    padding: 0 32px;
}

body.modal-open {
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 200;
    transform: translateY(-160%);
    padding: 10px 14px;
    border: 2px solid #ffffff;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.16s ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.toast-region {
    position: fixed;
    top: calc(var(--topbar-h) + 16px);
    right: 24px;
    z-index: 120;
    display: flex;
    width: min(420px, calc(100vw - 32px));
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    padding: 14px;
    border: 1.5px solid var(--line);
    border-left-width: 6px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgb(13 30 50 / 0.16);
    color: var(--ink);
    pointer-events: auto;
    animation: toast-in 0.16s ease-out;
}

.app-toast.info {
    border-left-color: var(--brand-blue);
}

.app-toast.success {
    border-left-color: var(--ok-line);
}

.app-toast.error {
    border-left-color: var(--brand-red);
}

.app-toast.is-leaving {
    animation: toast-out 0.16s ease-in forwards;
}

.toast-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 999px;
    background: var(--brand-blue-tint);
    color: var(--brand-blue);
}

.app-toast.success .toast-icon {
    background: var(--ok-bg);
    color: #11623f;
}

.app-toast.error .toast-icon {
    background: #fde7ed;
    color: var(--brand-red);
}

.toast-message {
    padding-top: 5px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.toast-close {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-mute);
    cursor: pointer;
}

.toast-close:hover {
    background: var(--line-soft);
    color: var(--ink);
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgb(14 26 43 / 0.48);
}

.confirm-backdrop[hidden] {
    display: none;
}

.confirm-card {
    display: grid;
    width: min(520px, 100%);
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgb(13 30 50 / 0.32);
}

.confirm-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1.5px solid var(--warn-line);
    border-radius: 999px;
    background: var(--warn-bg);
    color: #6b4d00;
    font-size: 20px;
}

.confirm-content {
    min-width: 0;
}

.confirm-title {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.confirm-message {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.45;
}

.confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.confirm-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.confirm-btn.secondary {
    border: 1.5px solid var(--line);
    background: #ffffff;
    color: var(--ink);
}

.confirm-btn.secondary:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.confirm-btn.primary {
    border: 1.5px solid var(--brand-red);
    background: var(--brand-red);
    color: #ffffff;
}

.confirm-btn.primary:hover {
    border-color: var(--brand-red-dark);
    background: var(--brand-red-dark);
}

.upload-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgb(7 18 33 / 0.48);
}

.upload-modal-backdrop[hidden] {
    display: none;
}

.upload-modal-card {
    width: min(780px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgb(7 18 33 / 0.32);
}

.upload-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: var(--brand-blue);
    color: #ffffff;
}

.upload-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.upload-modal-close {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.upload-modal-close:hover,
.upload-modal-close:focus-visible {
    background: rgb(255 255 255 / 0.16);
}

.upload-modal-copy,
.upload-modal-question {
    margin: 0;
    padding: 0 20px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}

.upload-modal-copy {
    padding-top: 18px;
}

.upload-modal-question {
    padding-top: 8px;
    font-weight: 800;
}

.upload-instructions {
    display: grid;
    gap: 10px;
    margin: 12px 20px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.upload-instructions[hidden] {
    display: none;
}

.upload-instructions-copy {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.45;
}

.upload-instructions-copy a {
    color: var(--brand-blue);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-instructions-link {
    margin: 0;
}

.upload-instructions-link a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-question-choices {
    display: grid;
    gap: 8px;
    margin: 14px 20px 0;
}

.upload-question-choices[hidden],
.upload-question-choices.hidden {
    display: none;
}

.upload-question-choice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.upload-question-choice input {
    margin-top: 2px;
    accent-color: var(--brand-blue);
}

.upload-modal-drop {
    display: grid;
    min-height: 44px;
    margin: 14px 20px 12px;
    place-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px dashed var(--brand-blue);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    text-align: center;
}

.upload-modal-drop.dragover,
.upload-modal-drop:focus-visible {
    background: var(--brand-blue-tint);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.claim-editor-wrap {
    display: grid;
    gap: 8px;
    margin: 14px 20px 0;
}

.claim-editor-wrap[hidden],
.claim-editor-wrap.hidden {
    display: none;
}

.claim-editor-label {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.claim-guidance {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.claim-guidance[hidden] {
    display: none;
}

.claim-guidance a {
    color: var(--brand-blue);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.claim-editor {
    width: 100%;
    min-height: 168px;
    resize: vertical;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
}

.claim-editor:focus {
    border-color: var(--brand-blue);
    outline: 3px solid rgb(28 88 138 / 0.18);
}

.question-browse-btn {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.question-browse-btn::after {
    display: none;
    content: none;
}

.question-browse-btn i {
    font-size: 14px;
}

.question-browse-note {
    color: var(--ink-mute);
    font-size: 12px;
    font-weight: 700;
}

.upload-file-list {
    display: grid;
    max-height: 154px;
    margin: 0 20px 12px;
    padding: 0;
    gap: 8px;
    overflow-y: auto;
    list-style: none;
}

.upload-file-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    font-size: 13px;
}

.upload-file-thumb {
    width: 44px;
    height: 36px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--brand-blue-tint);
    object-fit: cover;
}

.upload-file-name {
    width: 100%;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--brand-blue);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-file-name:hover,
.upload-file-name:focus-visible {
    color: var(--brand-blue-dark);
    text-decoration: underline;
}

.upload-file-remove {
    border: 0;
    background: transparent;
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.upload-file-status {
    color: #11623f;
    font-size: 12px;
    font-weight: 800;
}

.upload-modal-card .upload-progress {
    width: calc(100% - 40px);
    margin: 0 20px 12px;
}

.upload-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
}

.upload-modal-actions .confirm-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.image-preview-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgb(7 18 33 / 0.66);
}

.image-preview-backdrop[hidden] {
    display: none;
}

.image-preview-card {
    display: grid;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 26px 90px rgb(7 18 33 / 0.42);
}

.image-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: var(--brand-blue);
    color: #ffffff;
}

.image-preview-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 18px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.image-preview-close:hover,
.image-preview-close:focus-visible {
    background: rgb(255 255 255 / 0.16);
}

.image-preview-body {
    display: grid;
    min-height: 320px;
    max-height: min(68vh, 680px);
    place-items: center;
    overflow: auto;
    padding: 18px;
    background:
        linear-gradient(45deg, #eef2f7 25%, transparent 25%),
        linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2f7 75%),
        linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
    background-color: #ffffff;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.image-preview-img {
    display: block;
    max-width: 100%;
    max-height: calc(min(68vh, 680px) - 36px);
    object-fit: contain;
}

.image-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 18px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    max-width: 100%;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    background: var(--surface);
    border-bottom: 2px solid var(--line);
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    width: 96px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
}

.brand-logo {
    display: block;
    width: 96px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.brand-code {
    color: var(--brand-red);
}

.topbar-search {
    position: relative;
    flex: 1 1 360px;
    max-width: 520px;
    margin-left: auto;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 86px 0 44px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.search-input::placeholder {
    color: var(--ink-mute);
}

.search-input:focus-visible {
    border-color: var(--brand-blue);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--ink-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    height: 32px;
    align-items: center;
    padding: 0 12px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    transform: translateY(-50%);
    cursor: pointer;
}

.clear-search-btn:hover:not(:disabled) {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.clear-search-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.topbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: inline-flex;
    height: 48px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
}

.avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--brand-blue);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.logout-btn {
    display: inline-flex;
    height: 48px;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    border: 2px solid var(--brand-red);
    border-radius: 10px;
    background: var(--brand-red);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.logout-btn:hover {
    border-color: var(--brand-red-dark);
    background: var(--brand-red-dark);
}

.nsn-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 0 rgb(13 30 50 / 0.04);
}

.nsn-card-body {
    padding: 0;
}

.nsn-card-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--line-soft);
}

.page-head {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}

.page-head h1 {
    margin: 0;
    color: var(--brand-blue);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.page-head .subtitle {
    margin: 4px 0 0;
    color: var(--ink-mute);
    font-size: 14px;
}

.stats {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.stat-card {
    display: flex;
    min-width: 132px;
    min-height: 96px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px 22px;
    border: 2px solid #b7c5d8;
    border-radius: 20px;
    background: #ffffff;
    background-clip: padding-box;
    box-shadow:
        inset 0 0 0 1px rgb(255 255 255 / 0.78),
        0 2px 0 rgb(13 30 50 / 0.04),
        0 10px 22px rgb(13 30 50 / 0.06);
    text-align: center;
}

.stat-value {
    color: var(--ink);
    font-size: 34px;
    font-weight: 800;
    line-height: 0.9;
}

.stat-label {
    color: var(--ink-mute);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat-card.attested {    
    border: 2px solid #48a875;    
    border-radius: 20px;
    background: var(--ok-bg);
    box-shadow:
        inset 0 0 0 1px rgb(255 255 255 / 0.72),
        0 2px 0 rgb(17 98 63 / 0.06),
        0 10px 22px rgb(17 98 63 / 0.08);
}

.stat-card.attested .stat-value,
.stat-card.attested .stat-label {
    color: #11623f;
}

.stat-card.pending {
    border-color: #d9a400;
    color: #d9a400;
    border: 2px solid;
    border-radius: 20px;
    background: var(--warn-bg);
    box-shadow:
        inset 0 0 0 1px rgb(255 255 255 / 0.74),
        0 2px 0 rgb(107 77 0 / 0.06),
        0 10px 22px rgb(107 77 0 / 0.08);
}

.stat-card.pending .stat-value,
.stat-card.pending .stat-label {
    color: #6b4d00;
}

.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line-soft);
    background: #fafbfd;
    flex-wrap: wrap;
}

.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.filter-btn:hover {
    color: var(--brand-blue);
}

.filter-btn.is-active,
.filter-btn[aria-current="true"] {
    background: var(--brand-blue);
    color: #ffffff;
}

.filter-count {
    margin-left: auto;
    color: var(--ink-mute);
    font-size: 14px;
    font-weight: 700;
}

.table-header-brand th {
    background: var(--brand-blue);
    color: #ffffff;
    vertical-align: middle;
}

.table-th {
    background: var(--brand-blue);
    color: #ffffff;
}

.th-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.25;
    white-space: normal;
}

.th-label {
    min-width: 0;
    overflow-wrap: normal;
    text-wrap: balance;
    white-space: normal;
}

.help-wrap {
    position: relative;
    display: inline-flex;
    flex-basis: 100%;
    justify-content: center;
    margin-top: 2px;
}

.help-btn {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    padding: 0;
    border: 1.5px solid rgb(255 255 255 / 0.72);
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}

.help-btn:hover,
.help-btn:focus-visible {
    background: #ffffff;
    color: var(--brand-blue);
}

.app-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 160;
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 14px;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 8px;
    background: #000000;
    box-shadow: 0 14px 34px rgb(0 0 0 / 0.28);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
}

.app-tooltip[hidden] {
    display: none;
}

.app-tooltip::before {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #000000;
    content: "";
    transform: translateY(-50%) rotate(45deg);
}

.app-tooltip.is-right::before {
    left: -6px;
}

.app-tooltip.is-left::before {
    right: -6px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(1040px, calc(100vh - 150px));
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.nsn-table {
    width: 100%;
    min-width: 1338px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.nsn-table th:nth-child(1),
.nsn-table td:nth-child(1) {
    width: 176px;
}

.nsn-table th:nth-child(n + 2):nth-child(-n + 9),
.nsn-table td:nth-child(n + 2):nth-child(-n + 9) {
    width: 128px;
}

.nsn-table th:nth-child(2),
.nsn-table td:nth-child(2) {
    width: 140px;
}

.nsn-table th:nth-child(4),
.nsn-table td:nth-child(4) {
    width: 148px;
}

.nsn-table th:nth-child(5),
.nsn-table td:nth-child(5) {
    width: 158px;
}

.nsn-table th:nth-child(6),
.nsn-table td:nth-child(6) {
    width: 138px;
}

.nsn-table th:nth-child(7),
.nsn-table td:nth-child(7),
.nsn-table th:nth-child(8),
.nsn-table td:nth-child(8),
.nsn-table th:nth-child(9),
.nsn-table td:nth-child(9) {
    width: 118px;
}

.nsn-table th:nth-child(10),
.nsn-table td:nth-child(10) {
    width: 146px;
}

.nsn-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 14px 10px;
    border-right: 1px solid rgb(255 255 255 / 0.12);
    background: var(--brand-blue);
    box-shadow: 0 2px 0 rgb(13 30 50 / 0.08);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    vertical-align: middle;
}

.nsn-table thead th:first-child {
    padding-left: 24px;
    text-align: left;
}

.nsn-table thead th:first-child .th-inner {
    justify-content: flex-start;
}

.nsn-table thead th:last-child {
    padding-right: 24px;
    border-right: 0;
}

.nsn-col {
    width: 176px;
}

.actions-col {
    width: 146px;
}

.nsn-row {
    background: #ffffff;
    transition: background-color 0.15s ease;
}

.nsn-row:nth-child(even) {
    background: var(--row-stripe);
}

.nsn-row:hover {
    background: var(--brand-blue-tint);
}

.nsn-row.is-attested {
    background: var(--row-attested);
}

.nsn-row.is-attested:nth-child(even),
.nsn-row.is-attested:hover {
    background: var(--row-attested);
}

.nsn-cell {
    padding: 16px 10px;
    border-bottom: 1px solid var(--line-soft);
    background-clip: padding-box;
    text-align: center;
    vertical-align: middle;
}

.nsn-cell:first-child {
    padding-left: 24px;
    text-align: left;
}

.nsn-cell:last-child {
    padding-right: 24px;
}

.nsn-cell-main {
    min-width: 0;
}

.nsn-number {
    display: block;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.nsn-desc {
    display: block;
    max-width: 17ch;
    margin-top: 4px;
    color: var(--ink-mute);
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-zone {
    display: flex;
    min-height: 46px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upload-form {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-control {
    display: inline-flex;
    min-height: 38px;
    width: 100%;
    max-width: 240px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 2px dashed var(--brand-blue);
    border-radius: 9px;
    background: #ffffff;
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.upload-control:hover,
.upload-control.dragover {
    background: var(--brand-blue-tint);
    border-color: var(--brand-blue-dark);
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-label {
    font-weight: 800;
}

.upload-note {
    color: var(--ink-mute);
    font-size: 11px;
    font-weight: 600;
}

.required-mark {
    color: var(--brand-red);
    font-weight: 900;
}

.upload-progress {
    width: 100%;
    height: 8px;
    accent-color: var(--ok-line);
}

.file-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.file-tile {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 11px;
}

.file-preview-img {
    display: block;
    width: 100%;
    height: 52px;
    object-fit: cover;
}

.file-preview-kind {
    display: flex;
    height: 52px;
    align-items: center;
    justify-content: center;
    background: var(--brand-blue-tint);
    color: var(--brand-blue-dark);
    font-size: 12px;
    font-weight: 900;
}

.file-delete-form {
    position: absolute;
    top: 4px;
    right: 4px;
}

.file-delete-btn {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--brand-red);
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.24);
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.file-delete-btn:hover {
    background: var(--brand-red-dark);
}

.file-name {
    display: block;
    width: 100%;
    padding: 3px 5px;
    overflow: hidden;
    border: 0;
    background: rgb(15 50 87 / 0.88);
    color: #ffffff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name:hover,
.file-name:focus-visible {
    background: var(--brand-blue);
    text-decoration: underline;
}

.attest-action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.attest-btn {
    display: inline-flex;
    min-width: 88px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.attest-form {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
}

.attest-btn.is-ready {
    border: 2px solid var(--brand-red);
    background: var(--brand-red);
    color: #ffffff;
    cursor: pointer;
}

.attest-btn.is-ready:hover {
    border-color: var(--brand-red-dark);
    background: var(--brand-red-dark);
}

.attest-btn.is-disabled,
.attest-btn:disabled {
    border: 2px dashed var(--ink-soft);
    background: #ffffff;
    color: var(--ink);
    cursor: not-allowed;
    opacity: 1;
}

.attested-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1.5px solid var(--ok-line);
    border-radius: 999px;
    background: var(--ok-bg);
    color: #11623f;
    font-size: 13px;
    font-weight: 800;
}

.question-upload-cell {
    display: inline-flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.question-upload-btn {
    display: inline-flex;
    max-width: 112px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border: 1.5px solid var(--brand-blue);
    border-radius: 7px;
    background: #ffffff;
    color: var(--brand-blue);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
}

.question-upload-btn[hidden] {
    display: none;
}

.question-upload-btn:hover,
.question-upload-btn:focus-visible {
    background: var(--brand-blue-tint);
}

.question-upload-btn.is-uploaded {
    border-color: var(--ok-line);
    background: var(--ok-bg);
    color: #11623f;
}

.question-upload-btn.claims-btn {
    max-width: 96px;
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .topbar-search {
        order: 3;
        width: 100%;
        max-width: none;
        flex-basis: 100%;
        margin-left: 0;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .app-main {
        padding: 0 16px;
    }

    .page-head {
        padding: 18px;
    }

    .stats {
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
    }

    .filter-count {
        width: 100%;
        margin-left: 0;
    }

    .table-wrap {
        overflow-x: auto;
        max-height: calc(100vh - 130px);
    }

    .nsn-table {
        min-width: 1348px;
        table-layout: auto;
    }

    .nsn-cell-main {
        min-width: 190px;
    }

    .toast-region {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .confirm-card {
        grid-template-columns: 1fr;
    }
}

/* High-contrast support for WCAG 2.2 AA */
@media (prefers-contrast: more) {
    .toggle {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Table mono font for NSN numbers */
.font-mono {
    font-family: var(--font-mono);
    letter-spacing: 0.025em;
}

/* Custom progress bar style (used in file uploads) */
.progress {
    --progress-color: var(--success);
}

.btn-brand {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-brand:hover:not(:disabled) {
    background: #005a9c;
    border-color: #005a9c;
}

.btn-brand-outline {
    border-color: rgb(0 103 177 / 0.45);
    color: var(--primary);
}

.btn-brand-outline:hover {
    background: rgb(0 103 177 / 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.badge-brand {
    background: rgb(0 103 177 / 0.12);
    border-color: rgb(0 103 177 / 0.2);
    color: var(--primary);
}

.search-input-brand {
    border-color: rgb(0 103 177 / 0.35);
    box-shadow:
        inset 4px 0 0 rgb(0 103 177 / 0.18),
        inset -4px 0 0 rgb(0 103 177 / 0.18);
}

.search-input-brand:focus {
    border-color: var(--primary);
    outline-color: rgb(0 103 177 / 0.25);
    box-shadow:
        inset 4px 0 0 rgb(0 103 177 / 0.24),
        inset -4px 0 0 rgb(0 103 177 / 0.24),
        0 0 0 3px rgb(0 103 177 / 0.12);
}

.file-drop-zone:focus-within {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.yes-no-switch {
    position: relative;
    width: 58px;
    height: 28px;
    margin-inline: auto;
}

.yes-no-switch-track {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #e5e7eb;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    pointer-events: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.yes-no-switch-label {
    position: relative;
    z-index: 2;
    text-align: center;
}

.yes-no-switch-thumb {
    position: absolute;
    top: 3px;
    left: 50%;
    z-index: 1;
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgb(15 23 42 / 0.25);
    transform: translateX(-50%);
    transition:
        left 0.18s ease,
        background-color 0.15s ease;
}

.yes-no-switch-hit {
    position: absolute;
    top: 0;
    z-index: 5;
    width: 50%;
    height: 100%;
    cursor: pointer;
}

.yes-no-switch-hit-left {
    left: 0;
}

.yes-no-switch-hit-right {
    right: 0;
}

.yes-no-switch-hit input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.yes-no-switch.selected-n .yes-no-switch-track,
.yes-no-switch:has(input[value="N"]:checked) .yes-no-switch-track,
.yes-no-switch:has(input[value="false"]:checked) .yes-no-switch-track {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #ffffff;
}

.yes-no-switch.selected-n .yes-no-switch-thumb,
.yes-no-switch:has(input[value="N"]:checked) .yes-no-switch-thumb,
.yes-no-switch:has(input[value="false"]:checked) .yes-no-switch-thumb {
    left: calc(100% - 14px);
}

.yes-no-switch.selected-n .yes-no-switch-label-no,
.yes-no-switch:has(input[value="N"]:checked) .yes-no-switch-label-no,
.yes-no-switch:has(input[value="false"]:checked) .yes-no-switch-label-no {
    color: var(--brand-red);
}

.yes-no-switch.selected-n .yes-no-switch-label-yes,
.yes-no-switch:has(input[value="N"]:checked) .yes-no-switch-label-yes,
.yes-no-switch:has(input[value="false"]:checked) .yes-no-switch-label-yes {
    color: #ffffff;
}

.yes-no-switch.selected-y .yes-no-switch-track,
.yes-no-switch:has(input[value="Y"]:checked) .yes-no-switch-track,
.yes-no-switch:has(input[value="true"]:checked) .yes-no-switch-track {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #ffffff;
}

.yes-no-switch.selected-y .yes-no-switch-thumb,
.yes-no-switch:has(input[value="Y"]:checked) .yes-no-switch-thumb,
.yes-no-switch:has(input[value="true"]:checked) .yes-no-switch-thumb {
    left: 14px;
}

.yes-no-switch.selected-y .yes-no-switch-label-yes,
.yes-no-switch:has(input[value="Y"]:checked) .yes-no-switch-label-yes,
.yes-no-switch:has(input[value="true"]:checked) .yes-no-switch-label-yes {
    color: var(--brand-blue);
}

.yes-no-switch.selected-y .yes-no-switch-label-no,
.yes-no-switch:has(input[value="Y"]:checked) .yes-no-switch-label-no,
.yes-no-switch:has(input[value="true"]:checked) .yes-no-switch-label-no {
    color: #ffffff;
}

.yes-no-switch:has(input:focus-visible) .yes-no-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.yes-no-switch:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
}

.yes-no-switch:has(input:disabled) .yes-no-switch-hit,
.yes-no-switch:has(input:disabled) .yes-no-switch-hit input {
    cursor: not-allowed;
}

/* Yes/No toggle with the value rendered on the white thumb */
.modern-toggle {
    position: relative;
}

.modern-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 9999px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.1);
    overflow: hidden;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.toggle-no {
    color: #6b7280;
}

.toggle-yes {
    display: none;
    color: #619FCB;
}

.modern-toggle input:checked ~ .toggle-track {
    background: #619FCB;
}

.modern-toggle input:checked ~ .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

.modern-toggle input:checked ~ .toggle-track .toggle-no {
    display: none;
}

.modern-toggle input:checked ~ .toggle-track .toggle-yes {
    display: inline;
}

.modern-toggle input:focus-visible ~ .toggle-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.modern-toggle input:disabled + .toggle-track {
    cursor: not-allowed;
    opacity: 0.6;
}

.npa-submission-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.35fr) minmax(320px, 1fr);
    gap: 2rem;
    align-items: stretch;
    margin-top: 1rem;
    padding: 1.75rem 2rem;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgb(15 23 42 / 0.06);
}

.npa-submission-question {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.npa-submission-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.npa-submission-heading h2 {
    margin: 0;
    color: var(--brand-navy);
    font-size: 1.1rem;
    font-weight: 800;
}

.npa-submission-heading p,
.npa-submission-help,
.npa-submission-meta {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.npa-submission-heading p {
    margin: 0.25rem 0 0;
}

.npa-submission-help {
    display: flex;
    max-width: 28rem;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    line-height: 1.35;
}

.npa-submission-help i {
    margin-top: 0.1rem;
    color: var(--brand-blue);
}

.npa-submission-toggle {
    flex: 0 0 auto;
    margin-inline: 0;
}

.npa-submission-claim {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.5rem;
}

.npa-submission-textarea {
    min-height: 106px;
    width: 100%;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: #172033;
    font: inherit;
    line-height: 1.45;
    outline: none;
}

.npa-submission-textarea:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgb(0 103 177 / 0.14);
}

.npa-submission-textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.npa-submission-guidance {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
}

.npa-submission-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.npa-submission-meta-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}

.npa-submission-status {
    color: #64748b;
}

.npa-submission-save {
    flex: 0 0 auto;
    min-height: 38px;
    gap: 0.45rem;
    padding-inline: 1rem;
}

.npa-submission-save:disabled {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}

.npa-submission-textarea[aria-invalid="true"] {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgb(210 44 71 / 0.14);
}

@media (max-width: 900px) {
    .npa-submission-panel {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .npa-submission-meta {
        align-items: flex-start;
        flex-direction: column;
    }
}
