:root {
    --countlink-navy: #12324a;
    --countlink-blue: #1f6feb;
    --countlink-mint: #38bfa7;
    --countlink-ink: #14212b;
    --countlink-muted: #627282;
    --countlink-line: #d8e1ea;
    --countlink-surface: #ffffff;
    --countlink-soft: #f4f8fb;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--countlink-ink);
    font-family: Arial, Helvetica, sans-serif;
    background: var(--countlink-soft);
}

.auth-page {
    background:
        radial-gradient(circle at top left, rgba(56, 191, 167, 0.2), transparent 32rem),
        linear-gradient(135deg, #f7fbff 0%, #e9f1f7 100%);
}

.auth-shell {
    width: min(100% - 2rem, 30rem);
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-shell-wide {
    width: min(100% - 2rem, 48rem);
}

.auth-card {
    width: 100%;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(216, 225, 234, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1.5rem 4rem rgba(18, 50, 74, 0.12);
}

.brand-block {
    margin-bottom: 1.75rem;
}

.brand-kicker {
    margin: 0 0 0.35rem;
    color: var(--countlink-blue);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--countlink-navy);
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1.05;
}

.registration-card h1,
.temporary-home h1 {
    font-size: clamp(1.85rem, 4vw, 2.5rem);
}

.brand-copy {
    margin: 0.8rem 0 0;
    color: var(--countlink-muted);
}

.form-label {
    color: var(--countlink-navy);
    font-weight: 700;
}

.form-control,
.form-select {
    border-color: var(--countlink-line);
    border-radius: 6px;
    min-height: 2.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--countlink-blue);
    box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.16);
}

.btn-primary {
    --bs-btn-bg: var(--countlink-blue);
    --bs-btn-border-color: var(--countlink-blue);
    --bs-btn-hover-bg: #1859bd;
    --bs-btn-hover-border-color: #1859bd;
    border-radius: 6px;
    min-height: 2.85rem;
    font-weight: 700;
}

.btn-outline-primary {
    --bs-btn-color: var(--countlink-blue);
    --bs-btn-border-color: var(--countlink-blue);
    --bs-btn-hover-bg: var(--countlink-blue);
    --bs-btn-hover-border-color: var(--countlink-blue);
    border-radius: 6px;
    font-weight: 700;
}

.password-toggle {
    min-width: 3rem;
    border-color: var(--countlink-line);
}

.password-toggle-icon::before {
    content: "";
    display: inline-block;
    width: 1.05rem;
    height: 0.7rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    vertical-align: middle;
}

.password-toggle-icon::after {
    content: "";
    display: inline-block;
    width: 0.3rem;
    height: 0.3rem;
    margin-left: -0.68rem;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
}

.password-toggle.is-visible .password-toggle-icon::before {
    border-color: var(--countlink-mint);
}

.auth-secondary-action {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-secondary-action a {
    color: var(--countlink-blue);
    font-weight: 700;
    text-decoration: none;
}

.auth-secondary-action a:hover,
.auth-secondary-action a:focus {
    text-decoration: underline;
}

.app-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #dfe7ef;
}

.top-app-bar {
    min-height: 4rem;
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) auto minmax(14rem, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 0.22rem 0.85rem 0.22rem 0;
    color: #ffffff;
    background: linear-gradient(180deg, #163c58 0%, #102f46 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 2px 8px rgba(16, 47, 70, 0.32);
}

.app-brand,
.app-user {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-brand {
    flex: 0 0 auto;
    width: fit-content;
    margin-left: 0;
    padding-left: 0;
    justify-self: start;
}

.app-brand-logo {
    display: block;
    margin-left: 0;
    width: auto;
    height: 3.65rem;
    max-width: 42vw;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

.brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    color: #0c3048;
    background: linear-gradient(180deg, #8ce5d6 0%, #42c6ad 100%);
    font-size: 0.95rem;
    font-weight: 800;
}

.app-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
}

.app-brand-tagline,
.app-user-role {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
    line-height: 1.2;
}

.app-title {
    justify-self: center;
    min-width: 16rem;
    padding: 0.45rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-user {
    justify-self: end;
}

.app-user-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.app-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    border: 0;
    color: #ffffff;
    background: transparent;
    text-align: right;
}

.app-user-trigger:focus {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 4px;
}

.app-user-name {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}

.app-user .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 4px;
    font-weight: 700;
}

.msr-workspace-container {
    width: 70%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 auto;
    padding: 0.65rem 0 3.5rem;
}

.run-workspace {
    width: 100%;
    flex: 0 0 auto;
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.65rem;
    min-height: 0;
}

.run-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #aebdcc;
    border-radius: 4px;
    background: var(--countlink-surface);
    box-shadow: 0 1px 4px rgba(18, 50, 74, 0.12);
    overflow: hidden;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.58rem 0.8rem 0.52rem;
    border-bottom: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

.panel-kicker {
    margin: 0 0 0.12rem;
    color: var(--countlink-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.panel-heading h1,
.panel-heading h2 {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.15;
}

.panel-heading h2 span {
    color: var(--countlink-blue);
}

.operational-table-wrap {
    flex: 1;
    min-height: 7.5rem;
    overflow: auto;
    background: #ffffff;
}

.operational-table {
    width: 100%;
    min-width: 58rem;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
}

.operational-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.48rem 0.65rem;
    color: #1d3d55;
    background: linear-gradient(180deg, #f2f6fa 0%, #e0e9f2 100%);
    border-right: 1px solid #cbd6e2;
    border-bottom: 1px solid #aebdcc;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.operational-table th,
.operational-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.operational-table th:nth-child(1),
.operational-table td:nth-child(1),
.operational-table th:nth-child(3),
.operational-table td:nth-child(3) {
    width: 12%;
}

.operational-table th:nth-child(2),
.operational-table td:nth-child(2) {
    width: 28%;
}

.operational-table th:nth-child(4),
.operational-table td:nth-child(4) {
    width: 10%;
}

.operational-table th:nth-child(5),
.operational-table td:nth-child(5) {
    width: 8%;
}

.operational-table th:nth-child(6),
.operational-table td:nth-child(6) {
    width: 14%;
}

.operational-table th:nth-child(7),
.operational-table td:nth-child(7) {
    width: 16%;
}

.operational-table thead th:last-child {
    border-right: 0;
}

.operational-table tbody td {
    height: 4.55rem;
    padding: 0.65rem;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
}

.chosen-event-panel .operational-table-wrap {
    flex: 0 0 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.chosen-event-panel .operational-table tbody td {
    height: 2.35rem;
    padding: 0.45rem 0.65rem;
    background: #ffffff;
}

.chosen-event-panel .blank-event-row.is-selectable {
    cursor: pointer;
}

.chosen-event-panel .blank-event-row.is-selectable:focus {
    outline: 2px solid var(--countlink-blue);
    outline-offset: -2px;
}

.chosen-event-panel .blank-event-row.is-selected td {
    color: #ffffff;
    background: var(--countlink-blue);
}

.saved-events-panel .operational-table-wrap {
    flex: 0 0 auto;
    height: calc(2.15rem + (2.35rem * 9));
    min-height: 0;
    position: relative;
}

.saved-events-panel .operational-table tbody td {
    height: 2.35rem;
    padding: 0.45rem 0.65rem;
    background: #ffffff;
}

.saved-events-panel .saved-event-row.is-selectable {
    cursor: pointer;
}

.saved-events-panel .saved-event-row.is-selectable:focus {
    outline: 2px solid var(--countlink-blue);
    outline-offset: -2px;
}

.saved-events-panel .saved-event-row.is-selected td {
    color: #ffffff;
    background: var(--countlink-blue);
}

.empty-row td {
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
    background: #ffffff;
}

.operation-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.38rem;
    padding: 0.48rem 0.55rem;
    border-top: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f7fafc 0%, #eaf1f7 100%);
}

.btn-operation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 7.15rem;
    min-height: 2rem;
    padding: 0.32rem 0.6rem;
    border: 1px solid #9fb0c1;
    border-radius: 4px;
    color: #1d3d55;
    background: linear-gradient(180deg, #ffffff 0%, #edf3f8 100%);
    font-size: 0.8rem;
    font-weight: 750;
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 1px rgba(18, 50, 74, 0.08);
    white-space: nowrap;
}

.btn-operation:hover,
.btn-operation:focus {
    border-color: #1f6feb;
    color: #0f4fa8;
    background: linear-gradient(180deg, #ffffff 0%, #e6f0ff 100%);
    box-shadow: 0 0 0 0.15rem rgba(31, 111, 235, 0.14);
}

.primary-operation {
    border-color: #1d5fbd;
    color: #ffffff;
    background: linear-gradient(180deg, #2f7bf0 0%, #1859bd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(18, 50, 74, 0.16);
}

.primary-operation:hover,
.primary-operation:focus {
    color: #ffffff;
    background: #1859bd;
}

.chosen-run-event-button:disabled {
    cursor: default;
    opacity: 1;
}

.chosen-run-event-button.is-event-ready {
    border-color: var(--countlink-blue);
    color: #ffffff;
    background: var(--countlink-blue);
}

.chosen-run-event-button.is-event-ready:hover,
.chosen-run-event-button.is-event-ready:focus {
    border-color: var(--countlink-blue);
    color: #ffffff;
    background: var(--countlink-blue);
    box-shadow: 0 0 0 0.15rem rgba(31, 111, 235, 0.18);
}

.saved-events-move-active-icon {
    display: none;
}

.saved-events-move-button.is-selection-active.is-move-up .move-up-icon,
.saved-events-move-button.is-selection-active.is-move-down .move-down-icon {
    display: inline-flex;
    color: #ffffff;
}

.danger-operation:hover,
.danger-operation:focus {
    border-color: #c9372c;
    color: #c9372c;
}

.saved-events-move-button.is-selection-active,
.saved-events-delete-button.is-selection-active {
    border-color: var(--countlink-blue);
    color: #ffffff;
    background: var(--countlink-blue);
}

.saved-events-move-button.is-selection-active:hover,
.saved-events-move-button.is-selection-active:focus,
.saved-events-delete-button.is-selection-active:hover,
.saved-events-delete-button.is-selection-active:focus {
    border-color: var(--countlink-blue);
    color: #ffffff;
    background: var(--countlink-blue);
    box-shadow: 0 0 0 0.15rem rgba(31, 111, 235, 0.18);
}

.app-status-bar {
    width: 100%;
    min-height: 2rem;
    display: flex;
    align-items: center;
    border-top: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
    color: #30495f;
    font-size: 0.8rem;
    box-shadow: inset 0 1px 0 #ffffff;
}

.status-history {
    align-self: stretch;
    display: flex;
    align-items: center;
    min-width: 9rem;
    padding: 0 0.85rem;
    border-right: 1px solid #aebdcc;
    color: var(--countlink-navy);
    font-weight: 800;
}

.status-message {
    padding: 0 1rem;
    color: var(--countlink-muted);
}

.download-event-workspace {
    width: 100%;
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: auto;
}

.download-event-panel {
    width: 100%;
    flex: 1;
    min-height: 0;
}

.download-event-heading {
    justify-content: center;
    text-align: center;
}

.download-event-body {
    display: grid;
    grid-template-rows: auto minmax(14rem, 1fr);
    gap: clamp(0.55rem, 0.8vw, 0.75rem);
    flex: 1;
    min-height: 0;
    padding: clamp(0.55rem, 0.8vw, 0.75rem);
    background: #ffffff;
}

.download-event-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 0.8fr) minmax(26rem, 1.2fr);
    gap: clamp(0.55rem, 0.8vw, 0.75rem);
    align-items: stretch;
}

.download-event-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #aebdcc;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(18, 50, 74, 0.1);
    overflow: hidden;
}

.download-event-card-heading {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

.download-event-card-heading h2 {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
}

.diagnostic-page {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.diagnostic-page .msr-workspace-container,
.diagnostic-page .download-event-workspace,
.diagnostic-page .download-event-panel,
.diagnostic-page .download-event-body {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}

.diagnostic-page .download-event-body {
    display: block;
}

.diagnostic-page .download-event-card {
    overflow: visible;
}

.diagnostic-page .table-responsive {
    overflow-x: auto;
}

.diagnostic-page td,
.diagnostic-page th {
    overflow-wrap: anywhere;
}

.download-status-card .download-event-card-heading {
    display: grid;
    gap: 0.45rem;
}

.download-event-form {
    display: grid;
    gap: clamp(0.65rem, 1vw, 0.9rem);
    align-content: start;
    padding: clamp(0.65rem, 0.9vw, 0.85rem);
}

.download-authorization-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(0.8rem, 1.4vw, 1.25rem);
    align-items: center;
}

.download-authorization-column {
    min-width: 0;
}

.download-auth-actions {
    display: grid;
    gap: 0.5rem;
    width: min(12rem, 100%);
    align-content: start;
}

.download-auth-option {
    width: 100%;
    min-height: 2rem;
    justify-content: center;
}

.download-auth-option.is-selected {
    border-color: #2364c7;
    background: #2f7bf0;
    color: #ffffff;
}

.download-auth-option.is-selected:hover,
.download-auth-option.is-selected:focus {
    border-color: #1e55a8;
    background: #2364c7;
    color: #ffffff;
}

.download-auth-row {
    display: grid;
    grid-template-columns: auto minmax(8rem, 1fr);
    align-items: center;
    gap: 0.65rem;
}

.download-auth-row .form-label {
    margin: 0;
    white-space: nowrap;
}

.download-auth-instructions {
    margin-top: 0.45rem;
    padding-left: calc(3.1rem + 0.65rem);
    color: var(--countlink-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.download-event-form .form-control {
    width: 100%;
    max-width: 16rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

#download_auth_entry {
    min-height: 0;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    line-height: 1.25;
}

.download-event-form .form-control.is-ready {
    border-color: #8fb7ff;
    background: #2f7bf0;
    color: #ffffff;
    caret-color: #ffffff;
    box-shadow: 0 0 0 0.18rem rgba(47, 123, 240, 0.22);
}

.download-event-form .form-control.is-ready:focus {
    border-color: #ffffff;
    background: #2f7bf0;
    color: #ffffff;
    box-shadow: 0 0 0 0.22rem rgba(47, 123, 240, 0.3);
}

.download-event-form .form-control.is-ready::placeholder {
    color: rgba(255, 255, 255, 0.78);
}

.download-preview-table-wrap {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: auto;
    background: #ffffff;
}

.download-preview-table {
    min-width: min(36rem, 100%);
    table-layout: fixed;
}

.download-preview-table th,
.download-preview-table td,
.download-status-line {
    overflow-wrap: anywhere;
}

.download-preview-table thead th:nth-child(1),
.download-preview-table td:nth-child(1) {
    width: 24%;
}

.download-preview-table thead th:nth-child(2),
.download-preview-table td:nth-child(2) {
    width: 36%;
}

.download-preview-table thead th:nth-child(3),
.download-preview-table td:nth-child(3) {
    width: 18%;
}

.download-preview-table thead th:nth-child(4),
.download-preview-table td:nth-child(4) {
    width: 22%;
}

.download-preview-table tbody td {
    height: clamp(1.15rem, 2.2vh, 1.45rem);
    padding-top: 0.18rem;
    padding-bottom: 0.18rem;
}

.download-preview-empty {
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
}

.download-status-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding: clamp(0.6rem, 0.9vw, 0.8rem);
}

.download-status-card {
    min-height: 0;
}

.download-status-log {
    flex: 1 1 auto;
    min-height: clamp(7rem, 18vh, 10rem);
    margin-bottom: 0;
    overflow: auto;
    color: #30495f;
    font-size: 0.9rem;
    font-weight: 700;
}

.download-status-line {
    margin-bottom: 0.22rem;
}

.download-status-line-emphasis {
    margin-top: 1.9rem;
    font-weight: 800;
    color: #183a59;
}

.download-status-line.is-success {
    color: #1f6b4f;
}

.download-status-line.is-working {
    color: #30495f;
}

.download-status-line.is-error {
    color: #b42318;
}

.download-status-track {
    height: 0.9rem;
    flex: 0 0 auto;
    display: grid;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.download-status-segments {
    display: grid;
    grid-template-columns: repeat(100, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
    height: 100%;
}

.download-status-segment {
    display: block;
    min-width: 0;
    height: 100%;
    border: 1px solid #aebdcc;
    border-radius: 1px;
    background: #f8fbfd;
    box-shadow: inset 0 1px 0 #ffffff;
}

.download-status-segment.is-filled {
    border-color: #2364c7;
    background: #2f7bf0;
}

.download-status-segments.is-preparing .download-status-segment {
    animation: download-status-preparing 1.1s linear infinite;
    animation-delay: calc(var(--segment-index) * 0.025s);
}

.download-status-segments.is-moving .download-status-segment {
    animation: download-status-moving 1.35s ease-in-out infinite alternate;
    animation-delay: calc(var(--segment-index) * 0.012s);
}

@keyframes download-status-preparing {
    0%,
    70%,
    100% {
        border-color: #aebdcc;
        background: #f8fbfd;
    }

    35% {
        border-color: #2364c7;
        background: #2f7bf0;
    }
}

@keyframes download-status-moving {
    0%,
    72%,
    100% {
        border-color: #aebdcc;
        background: #f8fbfd;
    }

    28%,
    44% {
        border-color: #2364c7;
        background: #2f7bf0;
    }
}

.download-status-retry {
    align-self: flex-start;
    margin-top: 0.65rem;
}

.download-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(14, 33, 52, 0.42);
}

.download-confirm-backdrop[hidden] {
    display: none;
}

.download-confirm-modal {
    width: min(100%, 24rem);
    border: 1px solid #8fa3b7;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1rem 2.25rem rgba(18, 50, 74, 0.28);
    overflow: hidden;
}

.download-confirm-heading {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

.download-confirm-heading h2 {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 1rem;
    font-weight: 800;
}

.download-confirm-body {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
    color: #30495f;
}

.download-confirm-detail {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: baseline;
}

.download-confirm-detail span {
    color: var(--countlink-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.download-confirm-detail strong {
    color: var(--countlink-navy);
    font-size: 0.95rem;
    font-weight: 800;
}

.download-confirm-body p {
    margin: 0.2rem 0 0;
    color: var(--countlink-navy);
    font-weight: 800;
}

.download-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid #d4dee8;
    background: #f8fbfd;
}

.download-confirm-actions .btn.is-selected {
    outline: 2px solid #2f7bf0;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.18rem rgba(47, 123, 240, 0.22);
}

@media (max-width: 1100px) {
    .download-event-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .download-authorization-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 800px) {
    .download-event-body {
        gap: 0.5rem;
        grid-template-rows: auto minmax(10rem, 1fr);
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .download-event-card-heading {
        padding-top: 0.42rem;
        padding-bottom: 0.42rem;
    }

    .download-event-form,
    .download-status-body {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .download-status-log {
        min-height: 6.5rem;
    }

}

.dashboard-shell {
    width: min(100% - 1.25rem, 88rem);
    flex: 1;
    display: grid;
    grid-template-columns: clamp(12.5rem, 14vw, 14rem) minmax(0, 1fr);
    gap: clamp(0.55rem, 0.8vw, 0.75rem);
    min-height: 0;
    margin: 0 auto;
    padding: clamp(0.5rem, 0.8vw, 0.75rem) 0 2rem;
    overflow: hidden;
}

.dashboard-sidebar,
.dashboard-main,
.dashboard-panel,
.dashboard-summary-card {
    border: 1px solid #aebdcc;
    border-radius: 4px;
    background: var(--countlink-surface);
    box-shadow: 0 1px 4px rgba(18, 50, 74, 0.12);
}

.dashboard-sidebar {
    min-height: 0;
    overflow: hidden;
}

.dashboard-nav {
    display: grid;
    gap: 0.2rem;
    padding: 0.45rem;
}

.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #24445b;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.dashboard-nav-item:hover,
.dashboard-nav-item:focus,
.dashboard-nav-item.is-active {
    border-color: #cbd6e2;
    color: var(--countlink-blue);
    background: #f2f6fa;
}

.dashboard-main {
    min-width: 0;
    min-height: 0;
    padding: clamp(0.55rem, 0.8vw, 0.75rem);
    overflow: auto;
}

.dashboard-heading {
    margin-bottom: 0.75rem;
}

.dashboard-heading h1 {
    font-size: 1.45rem;
}

.dashboard-subtitle {
    margin: 0.35rem 0 0;
    color: var(--countlink-muted);
    font-size: 0.92rem;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: clamp(0.45rem, 0.7vw, 0.6rem);
    margin-bottom: 0.75rem;
}

.dashboard-summary-card {
    padding: 0.75rem;
}

.summary-card-label {
    color: var(--countlink-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-card-value {
    margin-top: 0.35rem;
    color: var(--countlink-navy);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(14rem, 0.7fr);
    gap: clamp(0.55rem, 0.8vw, 0.75rem);
}

.dashboard-panel {
    min-height: 12rem;
    overflow: hidden;
}

.dashboard-panel-heading {
    padding: 0.58rem 0.8rem 0.52rem;
    border-bottom: 1px solid #aebdcc;
    background: linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

.dashboard-panel-heading h2 {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 1rem;
    font-weight: 800;
}

.dashboard-empty-state {
    min-height: 8rem;
    display: grid;
    place-items: center;
    color: var(--countlink-muted);
    font-style: italic;
}

.quick-action-list {
    display: grid;
    gap: 0.45rem;
    padding: 0.65rem;
}

.admin-users-list {
    display: grid;
    gap: 0.75rem;
}

.admin-users-controls-panel {
    min-height: 0;
}

.admin-users-company-select {
    padding: 0.75rem;
}

.admin-users-company-select form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 28rem;
}

.admin-users-company-select label {
    flex: 0 0 auto;
    margin: 0;
    color: var(--countlink-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-users-company-select .form-select {
    min-width: 12rem;
}

.admin-users-panel {
    min-height: 0;
}

.admin-users-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.admin-users-add-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    font-weight: 800;
}

.admin-users-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.55rem 0.65rem 0;
    overflow-x: auto;
    background: #f8fbfd;
    border-bottom: 1px solid #cbd6e2;
}

.admin-users-tab {
    flex: 0 0 auto;
    padding: 0.42rem 0.7rem;
    color: #31566f;
    border: 1px solid #cbd6e2;
    border-bottom: 0;
    border-radius: 0.35rem 0.35rem 0 0;
    background: #eef4f8;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.admin-users-tab:hover,
.admin-users-tab:focus {
    color: var(--countlink-navy);
    background: #ffffff;
}

.admin-users-tab.is-active {
    color: var(--countlink-navy);
    background: #ffffff;
}

.admin-users-table-wrap {
    overflow: auto;
}

.admin-reports-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.admin-reports-demo-badge {
    flex: 0 0 auto;
    padding: 0.28rem 0.55rem;
    border: 1px solid #b9c8d6;
    border-radius: 4px;
    color: #31566f;
    background: #edf3f8;
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-reports-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.admin-reports-filters-panel,
.admin-reports-table-panel {
    min-height: 0;
    margin-bottom: 0.75rem;
}

.admin-reports-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0.75rem;
}

.admin-reports-filters .form-label {
    margin-bottom: 0.25rem;
    color: var(--countlink-navy);
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-reports-table-wrap {
    overflow: auto;
}

.admin-reports-table {
    min-width: 48rem;
    font-size: 0.82rem;
}

.admin-reports-table th {
    color: var(--countlink-navy);
    background: #f8fbfd;
    white-space: nowrap;
}

.admin-reports-table td {
    white-space: nowrap;
}

.admin-reports-detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.55fr);
}

.admin-reports-status-grid {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
}

.admin-reports-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.48rem 0.6rem;
    border: 1px solid #d4dee8;
    border-radius: 4px;
    background: #f8fbfd;
    color: #31566f;
    font-size: 0.84rem;
    font-weight: 800;
}

.admin-reports-status-item strong {
    color: var(--countlink-navy);
    font-size: 1rem;
}

.admin-users-table {
    min-width: 48rem;
    table-layout: fixed;
    font-size: 0.86rem;
}

.admin-users-table thead th {
    padding: 0.5rem 0.65rem;
    color: #1d3d55;
    background: linear-gradient(180deg, #f2f6fa 0%, #e0e9f2 100%);
    border-right: 1px solid #cbd6e2;
    border-bottom: 1px solid #aebdcc;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-users-table tbody td {
    padding: 0.5rem 0.65rem;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-users-table tbody td:last-child {
    white-space: nowrap;
}

.admin-users-empty-row {
    height: 5rem;
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
}

.admin-user-action-button {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.admin-companies-panel {
    min-height: 0;
}

.admin-companies-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.admin-companies-add-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    font-weight: 800;
}

.admin-company-action-button {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.dashboard-alert {
    margin-bottom: 0.75rem;
}

.admin-companies-table-wrap {
    overflow: auto;
}

.admin-companies-table {
    min-width: 52rem;
    table-layout: fixed;
    font-size: 0.86rem;
}

.admin-companies-table thead th {
    padding: 0.5rem 0.65rem;
    color: #1d3d55;
    background: linear-gradient(180deg, #f2f6fa 0%, #e0e9f2 100%);
    border-right: 1px solid #cbd6e2;
    border-bottom: 1px solid #aebdcc;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-companies-table tbody td {
    padding: 0.5rem 0.65rem;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-companies-empty-row {
    height: 5rem;
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
}

.admin-clients-panel,
.admin-clients-controls-panel {
    min-height: 0;
}

.admin-clients-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.admin-clients-add-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    font-weight: 800;
}

.admin-clients-company-select {
    padding: 0.75rem;
}

.admin-clients-company-select form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 28rem;
}

.admin-clients-company-select label {
    flex: 0 0 auto;
    margin: 0;
    color: var(--countlink-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-clients-company-select .form-select {
    min-width: 12rem;
}

.admin-client-action-button {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.admin-clients-table-wrap {
    overflow: auto;
}

.admin-clients-table {
    min-width: 58rem;
    table-layout: fixed;
    font-size: 0.86rem;
}

.admin-clients-table thead th {
    padding: 0.5rem 0.65rem;
    color: #1d3d55;
    background: linear-gradient(180deg, #f2f6fa 0%, #e0e9f2 100%);
    border-right: 1px solid #cbd6e2;
    border-bottom: 1px solid #aebdcc;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-clients-table tbody td {
    padding: 0.5rem 0.65rem;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-clients-empty-row {
    height: 5rem;
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
}

.admin-stores-panel,
.admin-stores-controls-panel,
.admin-events-panel,
.admin-events-controls-panel {
    min-height: 0;
}

.admin-stores-heading,
.admin-events-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.admin-stores-add-button,
.admin-events-add-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    font-weight: 800;
}

.admin-stores-filters,
.admin-events-filters {
    padding: 0.75rem;
}

.admin-stores-filters form,
.admin-events-filters form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-stores-filters label,
.admin-events-filters label {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-stores-filters .form-select,
.admin-events-filters .form-select {
    width: auto;
    min-width: 12rem;
}

.admin-store-action-button,
.admin-event-action-button {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.admin-stores-table-wrap,
.admin-events-table-wrap {
    overflow: auto;
}

.admin-stores-table,
.admin-events-table {
    min-width: 48rem;
    table-layout: fixed;
    font-size: 0.86rem;
}

.admin-stores-table thead th,
.admin-events-table thead th {
    padding: 0.5rem 0.65rem;
    color: #1d3d55;
    background: linear-gradient(180deg, #f2f6fa 0%, #e0e9f2 100%);
    border-right: 1px solid #cbd6e2;
    border-bottom: 1px solid #aebdcc;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-stores-table tbody td,
.admin-events-table tbody td {
    padding: 0.5rem 0.65rem;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-stores-table tbody td:last-child,
.admin-events-table tbody td:last-child {
    white-space: nowrap;
}

.admin-stores-empty-row,
.admin-events-empty-row {
    height: 5rem;
    color: var(--countlink-muted);
    font-style: italic;
    text-align: center;
}

.admin-store-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin: 0;
}

.admin-store-details-grid > div {
    min-width: 0;
    padding: 0.6rem 0.7rem;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    background: #f8fafc;
}

.admin-store-details-grid dt {
    margin-bottom: 0.2rem;
    color: var(--countlink-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-store-details-grid dd {
    margin: 0;
    color: var(--countlink-navy);
    font-size: 0.92rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.admin-store-modal-section-title {
    margin: 1rem 0 0.6rem;
    color: var(--countlink-navy);
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-store-modal-fieldset {
    min-width: 0;
    margin: 0.25rem 0 0;
    padding: 0.8rem;
    border: 1px solid #dbe4ee;
    border-radius: 6px;
}

.admin-store-modal-fieldset legend {
    float: none;
    width: auto;
    margin: 0 0 0.65rem;
    padding: 0 0.25rem;
    color: var(--countlink-navy);
    font-size: 0.85rem;
    font-weight: 800;
}

@media (min-width: 1601px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(5, minmax(8.5rem, 1fr));
    }
}

@media (max-width: 1700px) {
    .msr-workspace-container {
        width: 76%;
    }

    .dashboard-shell {
        width: min(100% - 1rem, 82rem);
    }
}

@media (max-width: 1536px) {
    .msr-workspace-container {
        width: 82%;
    }

    .dashboard-shell {
        width: calc(100% - 1rem);
        grid-template-columns: 12.5rem minmax(0, 1fr);
    }

    .dashboard-summary-card {
        padding: 0.65rem;
    }
}

@media (max-width: 1440px) {
    .msr-workspace-container {
        width: 88%;
    }

    .dashboard-shell {
        grid-template-columns: 11.75rem minmax(0, 1fr);
    }

    .dashboard-nav-item {
        gap: 0.4rem;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .dashboard-content-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(13rem, 0.85fr);
    }

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

@media (max-width: 1366px) {
    .msr-workspace-container {
        width: 92%;
        padding-bottom: 2.5rem;
    }

    .top-app-bar {
        gap: 0.65rem;
        padding-left: 0;
        padding-right: 0.7rem;
    }

    .app-title {
        min-width: 13rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-brand-logo {
        max-width: 35vw;
    }

    .operation-toolbar {
        gap: 0.32rem;
    }

    .btn-operation {
        min-width: 6.75rem;
    }

    .dashboard-shell {
        width: calc(100% - 1rem);
        grid-template-columns: 11rem minmax(0, 1fr);
        padding-top: 0.5rem;
        padding-bottom: 1.5rem;
    }

    .dashboard-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(7.75rem, 1fr));
        margin-bottom: 0.55rem;
    }

    .dashboard-heading {
        margin-bottom: 0.55rem;
    }

    .dashboard-heading h1 {
        font-size: 1.3rem;
    }

    .summary-card-value {
        font-size: 1.45rem;
    }

    .dashboard-panel {
        min-height: 10rem;
    }

    .dashboard-empty-state {
        min-height: 6.75rem;
    }

    .quick-action-list {
        padding: 0.5rem;
    }

    .admin-reports-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    }

    .admin-reports-table {
        font-size: 0.78rem;
    }
}

@media (max-width: 900px) {
    .top-app-bar {
        grid-template-columns: 1fr;
    }

    .app-title,
    .app-user {
        justify-self: stretch;
    }

    .app-title {
        text-align: center;
    }

    .app-user {
        justify-content: space-between;
    }

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

    .run-workspace {
        grid-template-rows: auto auto;
    }

    .msr-workspace-container {
        width: calc(100% - 1rem);
    }

    .dashboard-shell,
    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }

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

    .admin-reports-filters,
    .admin-reports-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .operation-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .btn-operation {
        justify-content: center;
    }
}
