:root {
    --olypen-blue: #0057a8;
    --olypen-blue-dark: #003f7d;
    --olypen-blue-soft: #e8f2ff;
    --app-bg: #f3f6fa;
    --app-panel: #ffffff;
    --app-border: #d9e2ec;
    --app-text: #17212f;
    --app-muted: #64748b;
    --app-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --app-shadow-soft: 0 10px 28px rgba(15, 23, 42, .06);
}

* {
    box-sizing: border-box;
}

body.app-body {
    background:
        radial-gradient(circle at top left, rgba(0, 87, 168, .08), transparent 32rem),
        var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
}

body.login-body {
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(0, 87, 168, .1), transparent 30rem),
        var(--app-bg);
    color: var(--app-text);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.app-container {
    margin: 0 auto;
    max-width: 1360px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}

.app-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(148, 163, 184, .28);
    box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header-inner {
    align-items: center;
    display: grid;
    gap: 1.1rem;
    grid-template-columns: auto minmax(20rem, 1fr) auto;
    padding-bottom: .78rem;
    padding-top: .78rem;
}

.app-brand {
    align-items: center;
    color: var(--app-text);
    display: inline-flex;
    gap: .8rem;
    min-height: 3rem;
    text-decoration: none;
}

.app-brand:hover {
    color: var(--app-text);
}

.app-brand-logo {
    display: block;
    height: 40px;
    width: auto;
}

.app-brand-text {
    border-left: 1px solid var(--app-border);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0;
    padding-left: .85rem;
    white-space: nowrap;
}

.app-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.app-nav-link {
    border-radius: 999px;
    color: #334155;
    font-size: .94rem;
    font-weight: 650;
    padding: .48rem .8rem;
    text-decoration: none;
    transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.app-nav-link:hover,
.app-nav-link.is-active {
    background: var(--olypen-blue-soft);
    color: var(--olypen-blue-dark);
}

.app-nav-link.is-active {
    box-shadow: inset 0 0 0 1px rgba(0, 87, 168, .18);
}

.app-header-tools {
    align-items: center;
    display: flex;
    gap: .85rem;
    justify-content: flex-end;
}

.app-user {
    border-left: 1px solid var(--app-border);
    line-height: 1.2;
    padding-left: .85rem;
    text-align: right;
}

.app-user-name {
    color: var(--app-text);
    font-size: .9rem;
    font-weight: 700;
}

.app-user-name span,
.app-user-meta {
    color: var(--app-muted);
    font-weight: 500;
}

.app-user-meta {
    font-size: .75rem;
    margin-top: .18rem;
}

.app-logout {
    color: var(--olypen-blue);
    font-weight: 650;
    text-decoration: none;
}

.app-main {
    padding-bottom: 2.5rem;
    padding-top: 1.35rem;
}

.page-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.15rem;
}

.dashboard-kicker {
    color: var(--olypen-blue);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 .28rem;
    text-transform: uppercase;
}

.page-header h1 {
    font-size: clamp(1.55rem, 2.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
}

.page-subtitle {
    color: var(--app-muted);
    font-size: .98rem;
    margin-top: .35rem;
}

.queue-metrics {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .42rem;
}

.filter-control-group {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.clear-filter-action {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #31516f;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
    min-height: 1.75rem;
    padding: .35rem .7rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.clear-filter-action:hover {
    background: #edf6ff;
    border-color: rgba(0, 87, 168, .35);
    color: var(--olypen-blue-dark);
    text-decoration: none;
}

.metric-pill {
    align-items: center;
    background: #eef4fb;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    color: #40546b;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    min-height: 1.75rem;
    padding: .35rem .7rem;
}

.app-card {
    background: var(--app-panel);
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 18px;
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

.app-card-header {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    padding: 1.15rem 1.25rem;
}

.app-card-body {
    padding: 1.25rem;
}

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

.dashboard-card-header h2 {
    color: #0f172a;
    font-size: 1.16rem;
    font-weight: 800;
    margin: 0;
}

.dashboard-card-header p {
    color: #52657a;
    font-size: .92rem;
    font-weight: 500;
    margin: .25rem 0 0;
}

.step-eyebrow {
    color: #7a8ba0;
    display: block;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .08em;
    margin-bottom: .3rem;
    text-transform: uppercase;
}

.app-table {
    font-size: .95rem;
}

.app-table thead th {
    background: #f6f9fc;
    border-bottom: 1px solid var(--app-border);
    color: #243449;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
    padding: .85rem 1rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.metric-pill-warning {
    background: #fff4d6;
    border-color: rgba(180, 83, 9, .2);
    color: #7c3d00;
}

.metric-pill-danger {
    background: #ffe8e8;
    border-color: rgba(185, 28, 28, .2);
    color: #991b1b;
}

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 1.2rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    min-height: 8.25rem;
    padding: 1.05rem;
}

.action-grid {
    margin-bottom: .85rem;
}

.action-card {
    border-color: rgba(180, 83, 9, .18);
    box-shadow: 0 14px 34px rgba(180, 83, 9, .07);
}

.summary-value {
    color: #0f172a;
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    font-weight: 850;
    line-height: 1;
    margin-top: .25rem;
}

.summary-label {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: .42rem;
}

.dashboard-layout {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, .9fr);
}

.dashboard-layout-secondary {
    margin-top: 1.25rem;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-panel > .table-responsive,
.dashboard-panel > .app-card-body {
    flex: 1;
}

.uploads-panel {
    grid-row: span 2;
}

.bar-list {
    display: grid;
    gap: .72rem;
}

.bar-row {
    align-items: center;
    display: grid;
    gap: .75rem;
    grid-template-columns: 5.8rem minmax(0, 1fr) 3.2rem;
}

.bar-label,
.bar-value {
    color: #52647a;
    font-size: .82rem;
    font-weight: 750;
}

.bar-value {
    color: var(--app-text);
    text-align: right;
}

.bar-track {
    background: #eef4fb;
    border: 1px solid rgba(0, 87, 168, .1);
    border-radius: 999px;
    height: .78rem;
    overflow: hidden;
}

.bar-track span {
    background: var(--olypen-blue);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: var(--bar-width);
}

.quality-list {
    display: grid;
    gap: .65rem;
}

.quality-row {
    align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, .72);
    color: #334155;
    display: flex;
    font-size: .92rem;
    font-weight: 720;
    justify-content: space-between;
    padding-bottom: .65rem;
}

.quality-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.quick-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.2rem;
}

.quick-link-row .btn {
    min-height: 2.35rem;
}

.compact-table {
    table-layout: fixed;
    width: 100%;
}

.compact-table td,
.compact-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-uploads-card {
    margin-top: 1.25rem;
}

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

.dashboard-three-grid > .table-responsive {
    border-right: 1px solid rgba(148, 163, 184, .18);
}

.dashboard-three-grid > .table-responsive:last-child {
    border-right: 0;
}

.flag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.flag-list .metric-pill {
    font-size: .7rem;
    min-height: 1.45rem;
    padding: .24rem .48rem;
}

.empty-state {
    color: var(--app-muted);
    font-size: .9rem;
    font-weight: 650;
}

.app-table tbody td {
    border-color: #edf2f7;
    line-height: 1.3;
    padding: .72rem .78rem;
    vertical-align: middle;
}

.app-table tbody tr:hover {
    background: #f6faff;
}

.depot-table td,
.depot-table th {
    white-space: nowrap;
}

.depot-table {
    table-layout: fixed;
    width: 100%;
}

.depot-table th,
.depot-table td {
    min-width: 0;
}

.depot-col-customer {
    width: 10.25rem;
}

.depot-col-type {
    width: 7.75rem;
}

.depot-col-date {
    width: 6rem;
}

.depot-col-notes {
    width: auto;
}

.depot-col-filename {
    width: 13%;
}

.depot-col-upload {
    width: 9.25rem;
}

.depot-col-employee {
    width: 10.25rem;
}

.depot-col-actions {
    width: 11.5rem;
}

.depot-type,
.depot-filename,
.depot-employee {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.depot-table th:nth-child(6),
.depot-table td:nth-child(6) {
    padding-right: 1rem;
}

.depot-table th:nth-child(7),
.depot-table td:nth-child(7) {
    padding-left: 1rem;
}

.depot-employee {
    max-width: 10.25rem;
}

.depot-notes {
    display: -webkit-box;
    line-height: 1.35;
    max-height: 2.7em;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.depot-id {
    overflow: hidden;
    padding-right: .95rem;
    white-space: nowrap;
}

.status-link {
    align-items: center;
    background: #f1f7ff;
    border: 1px solid rgba(0, 87, 168, .16);
    border-radius: 999px;
    color: var(--olypen-blue-dark);
    display: inline-flex;
    font-size: .92rem;
    font-weight: 760;
    max-width: 100%;
    min-height: 1.85rem;
    overflow: hidden;
    padding: .3rem .72rem;
    text-decoration: none;
    text-overflow: ellipsis;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    vertical-align: middle;
    white-space: nowrap;
}

.status-link:hover {
    background: #e3f0ff;
    border-color: rgba(0, 87, 168, .35);
    box-shadow: 0 8px 18px rgba(0, 87, 168, .08);
    color: var(--olypen-blue-dark);
    text-decoration: none;
}

.status-link-missing {
    background: #fff4d6;
    border-color: rgba(180, 83, 9, .2);
    color: #7c3d00;
}

.table-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
    max-width: 100%;
}

.table-action-link {
    background: #f1f7ff;
    border: 1px solid rgba(0, 87, 168, .16);
    border-radius: 999px;
    color: var(--olypen-blue-dark);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 760;
    justify-content: center;
    line-height: 1.1;
    min-height: 1.6rem;
    padding: .24rem .48rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    white-space: nowrap;
}

.table-action-link:hover {
    background: #e3f0ff;
    border-color: rgba(0, 87, 168, .35);
    box-shadow: 0 8px 18px rgba(0, 87, 168, .08);
    color: var(--olypen-blue-dark);
    text-decoration: none;
}

.table-action-danger {
    background: #fff1f1;
    border-color: rgba(185, 28, 28, .18);
    color: #991b1b;
}

.table-action-disabled {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, .28);
    color: #94a3b8;
    cursor: not-allowed;
}

.pagination-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
}

.pagination .page-link {
    color: var(--olypen-blue-dark);
    font-weight: 700;
}

.pagination .page-item.disabled .page-link {
    color: var(--app-muted);
}

.app-form .form-label {
    color: #475569;
    font-size: .82rem;
    font-weight: 750;
    margin-bottom: .35rem;
}

.app-form .form-control,
.app-form .form-select {
    border-color: #cbd5e1;
    border-radius: 12px;
    min-height: 3rem;
}

.app-form textarea.form-control {
    min-height: auto;
    resize: vertical;
}

.app-form .form-control:focus,
.app-form .form-select:focus {
    border-color: rgba(0, 87, 168, .55);
    box-shadow: 0 0 0 .18rem rgba(0, 87, 168, .12);
}

.btn-primary {
    background: var(--olypen-blue);
    border-color: var(--olypen-blue);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 87, 168, .14);
    font-weight: 800;
    min-height: 3rem;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn-primary:hover {
    background: var(--olypen-blue-dark);
    border-color: var(--olypen-blue-dark);
    box-shadow: 0 10px 24px rgba(0, 87, 168, .2);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: #cbd5e1;
    border-radius: 12px;
    color: #31516f;
    font-weight: 750;
    min-height: 3rem;
}

.btn-outline-secondary:hover {
    background: #edf6ff;
    border-color: rgba(0, 87, 168, .35);
    color: var(--olypen-blue-dark);
}

.form-actions,
.app-dialog-actions {
    border-top: 1px solid rgba(148, 163, 184, .18);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.edit-document-card {
    max-width: 54rem;
}

.metadata-warning {
    border-color: rgba(180, 83, 9, .24);
    box-shadow: 0 14px 34px rgba(180, 83, 9, .08);
    margin-bottom: 1rem;
    max-width: 54rem;
}

.metadata-warning h2 {
    color: #7c3d00;
    font-size: 1.1rem;
    font-weight: 820;
    margin: 0;
}

.metadata-warning p {
    color: #52647a;
    font-size: .92rem;
    font-weight: 650;
    margin: .3rem 0 0;
}

.metadata-missing-field,
.metadata-missing-field:disabled {
    background-color: #fffaf0;
    border-color: rgba(180, 83, 9, .45);
}

.missing-helper {
    color: #7c3d00;
    font-size: .76rem;
    font-weight: 750;
    margin-top: .28rem;
}

.employee-manual-field {
    margin-top: .5rem;
}

.app-dialog {
    background: var(--app-panel);
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .18);
    display: none;
    left: 50%;
    max-height: min(85vh, 48rem);
    overflow: auto;
    padding: 1.25rem;
    position: fixed;
    top: 7rem;
    transform: translateX(-50%);
    width: min(calc(100vw - 2rem), 32rem);
    z-index: 1002;
}

.app-dialog-wide {
    width: min(calc(100vw - 2rem), 42rem);
}

.app-dialog-close {
    align-items: center;
    background: #eef4fb;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    color: #40546b;
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: 2rem;
}

.app-dialog-header {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    padding-right: 2.25rem;
}

.app-dialog-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.required-label,
.app-help-text {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 600;
}

.app-help-text {
    margin: .85rem 0 0;
}

.app-upload-status {
    margin-top: .8rem;
}

.login-shell {
    width: min(100%, 28rem);
}

.login-card {
    background: var(--app-panel);
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 18px;
    box-shadow: var(--app-shadow);
    padding: 1.5rem;
}

.login-brand {
    align-items: center;
    display: flex;
    gap: .85rem;
    margin-bottom: 1.35rem;
}

.login-brand img {
    display: block;
    height: 40px;
    width: auto;
}

.login-brand .dashboard-kicker {
    color: #7b8da3;
    font-size: .7rem;
    font-weight: 740;
    margin-bottom: .22rem;
}

.login-brand h1 {
    font-size: 1.9rem;
    font-weight: 860;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
}

.login-form {
    display: grid;
    gap: .85rem;
}

.login-form .form-label {
    margin-bottom: -.35rem;
}

.login-submit {
    margin-top: .25rem;
    width: 100%;
}

.login-error {
    background: #fff1f1;
    border: 1px solid rgba(185, 28, 28, .22);
    border-radius: 12px;
    color: #991b1b;
    font-size: .9rem;
    font-weight: 700;
    padding: .75rem .9rem;
}

.login-footer {
    color: #8794a6;
    margin: 1rem auto 0;
    max-width: 24rem;
    text-align: center;
}

.login-footer p {
    font-size: .75rem;
    line-height: 1.5;
    margin: 0 0 .45rem;
}

.login-footer a {
    color: inherit;
}

.app-footer {
    background: transparent;
    border-top: 1px solid rgba(148, 163, 184, .24);
    color: #8794a6;
    padding: 1.5rem 0 2rem;
}

.app-footer p {
    font-size: .78rem;
    line-height: 1.55;
    margin: 0 0 .35rem;
    max-width: 780px;
}

.app-footer a {
    color: inherit;
}

.clickable,
#uploadBtn,
#searchBtn {
    cursor: pointer;
}

.test {
    pointer-events: none;
}

@media (max-width: 1100px) {
    .app-header-inner {
        grid-template-columns: 1fr;
    }

    .app-nav,
    .app-header-tools {
        justify-content: flex-start;
    }

    .app-user {
        text-align: left;
    }

    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-three-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-three-grid > .table-responsive {
        border-bottom: 1px solid rgba(148, 163, 184, .18);
        border-right: 0;
    }

    .dashboard-three-grid > .table-responsive:last-child {
        border-bottom: 0;
    }

    .uploads-panel {
        grid-row: auto;
    }

    .app-table thead th,
    .app-table tbody td {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .depot-col-upload {
        width: 8.25rem;
    }

    .depot-col-employee {
        width: 8.75rem;
    }
}

@media (max-width: 960px) {
    .depot-col-actions {
        width: 6.6rem;
    }

    .table-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .table-action-link {
        min-height: 1.65rem;
        padding-left: .45rem;
        padding-right: .45rem;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .app-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-header {
        position: static;
    }

    .app-user {
        border-left: 0;
        border-top: 1px solid var(--app-border);
        padding-left: 0;
        padding-top: .75rem;
    }

    .app-brand-logo {
        height: 36px;
    }

    .app-brand-text {
        font-size: .95rem;
    }

    .app-nav-link {
        padding: .45rem .65rem;
    }

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

    .dashboard-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination {
        flex-wrap: wrap;
    }

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

    .quick-link-row .btn {
        width: 100%;
    }

    .bar-row {
        grid-template-columns: 1fr 3rem;
    }

    .bar-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .depot-table {
        min-width: 58rem;
    }

    .form-actions,
    .app-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions .btn,
    .app-dialog-actions .btn {
        width: 100%;
    }

    .app-dialog {
        top: 1rem;
    }
}
