html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.dashboard-page {
    background: #f5f7fb;
    min-height: calc(100vh - 80px);
}

.dashboard-kpi {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    min-height: 100px;
}

    .dashboard-kpi .kpi-value {
        font-size: 1.5rem;
        font-weight: 800;
        color: #111827;
        word-break: break-word;
    }

    .dashboard-kpi .kpi-label {
        color: #6b7280;
        font-size: 0.85rem;
        margin-top: 4px;
    }

    .dashboard-kpi.success {
        border-left: 5px solid #198754;
    }

    .dashboard-kpi.warning {
        border-left: 5px solid #ffc107;
    }

    .dashboard-kpi.danger {
        border-left: 5px solid #dc3545;
    }

    .dashboard-kpi.info {
        border-left: 5px solid #0dcaf0;
    }

.dashboard-table thead th {
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-detail-table th {
    width: 38%;
    color: #6b7280;
    font-weight: 600;
}

.dashboard-log-pre {
    white-space: pre-wrap;
    background: #111827;
    color: #e5e7eb;
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
    max-height: 320px;
    overflow: auto;
    font-size: 0.82rem;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    border-left: 4px solid #0d6efd;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .dashboard-kpi {
        min-height: auto;
        padding: 14px;
    }

        .dashboard-kpi .kpi-value {
            font-size: 1.1rem;
        }

    .dashboard-table {
        font-size: 0.85rem;
    }
}

.required-label::after {
    content: " *";
    color: #dc3545;
    font-weight: 800;
}

.required-note {
    font-size: .875rem;
    color: #6c757d;
}

.kyc-section {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.kyc-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.kyc-section-help {
    color: #6b7280;
    font-size: .875rem;
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .kyc-section {
        padding: .9rem;
        border-radius: 12px;
    }
}

/* Review cockpit */
.review-card {
    overflow: hidden;
}

.approval-stepper {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.approval-step {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    position: relative;
}

    .approval-step:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 18px;
        top: 42px;
        bottom: -14px;
        width: 2px;
        background: #e5e7eb;
    }

.approval-marker {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: #e5e7eb;
    color: #374151;
    z-index: 1;
}

.approval-content {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #fff;
}

.approval-step.approved .approval-marker {
    background: #198754;
    color: #fff;
}

.approval-step.current .approval-marker {
    background: #0d6efd;
    color: #fff;
}

.approval-step.locked .approval-content {
    background: #f9fafb;
    opacity: .82;
}

.approval-action-panel {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

/* Cleaner dashboard tables on mobile */
@media (max-width: 768px) {
    .dashboard-page {
        padding-left: .25rem;
        padding-right: .25rem;
    }

    .dashboard-detail-table th,
    .dashboard-detail-table td {
        display: block;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .dashboard-detail-table th {
        border-bottom: 0;
        padding-bottom: 2px;
        font-size: .75rem;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .dashboard-detail-table td {
        padding-top: 0;
    }

    .approval-content {
        padding: 12px;
    }
}

.kyc-mini-progress {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

    .kyc-mini-progress a {
        flex: 0 0 auto;
        text-decoration: none;
        color: #374151;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        padding: 7px 12px;
        font-size: .82rem;
        font-weight: 600;
    }

        .kyc-mini-progress a:hover {
            background: #eaf2ff;
            color: #0d6efd;
        }

.choice-card {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

    .choice-card:hover {
        border-color: #0d6efd;
        background: #f8fbff;
    }

    .choice-card .form-check-input {
        margin-right: 10px;
    }

    .choice-card:has(.form-check-input:checked) {
        border-color: #0d6efd;
        background: #eef5ff;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, .08);
    }

@media (max-width: 576px) {
    .onboarding-step {
        align-items: flex-start;
        padding: 12px 0 90px;
    }

    .onboarding-card {
        border-radius: 18px;
        padding: 16px !important;
        box-shadow: 0 6px 22px rgba(15, 23, 42, .08);
    }

    .kyc-section-title {
        font-size: 1rem;
    }

    .kyc-section-help {
        font-size: .83rem;
    }

    .btn-wstc {
        position: sticky;
        bottom: 10px;
        z-index: 20;
        box-shadow: 0 12px 24px rgba(13, 110, 253, .25);
    }
}

.kyc-optional-section {
    margin-bottom: 1rem;
}

    .kyc-optional-section > summary {
        list-style: none;
        cursor: pointer;
        border: 1px dashed #cbd5e1;
        border-radius: 14px;
        padding: 12px 14px;
        background: #f8fafc;
        font-weight: 700;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .kyc-optional-section > summary::-webkit-details-marker {
            display: none;
        }

        .kyc-optional-section > summary span {
            font-size: .75rem;
            color: #6b7280;
            font-weight: 600;
        }

.approval-focus-pulse {
    animation: approvalPulse 1.2s ease-in-out 2;
}

@keyframes approvalPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, .35);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(13, 110, 253, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.evidence-tile {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #fff;
    min-height: 105px;
}

.review-jump-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

    .review-jump-nav a {
        flex: 0 0 auto;
        text-decoration: none;
        border: 1px solid #e5e7eb;
        background: #fff;
        color: #374151;
        border-radius: 999px;
        padding: 8px 13px;
        font-size: .85rem;
        font-weight: 600;
    }

        .review-jump-nav a:hover {
            background: #eef5ff;
            color: #0d6efd;
            border-color: #0d6efd;
        }

#approval-workflow,
.approval-step,
#supporting-documents,
#customer-evidence,
#audit-history {
    scroll-margin-top: 90px;
}

.review-jump-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(245, 247, 251, .98);
    backdrop-filter: blur(10px);
    padding: 8px 0;
    border-top: 1px solid rgba(229, 231, 235, .75);
    border-bottom: 1px solid rgba(229, 231, 235, .75);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.review-jump-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

    .review-jump-nav a {
        flex: 0 0 auto;
        text-decoration: none;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        color: #374151;
        border-radius: 999px;
        padding: 8px 13px;
        font-size: .85rem;
        font-weight: 700;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
    }

        .review-jump-nav a:hover,
        .review-jump-nav a.active {
            background: #0d6efd;
            color: #ffffff;
            border-color: #0d6efd;
        }

#supporting-documents,
#customer-evidence,
#cscs-status,
#approval-workflow,
#audit-history {
    scroll-margin-top: 76px;
}

@media (max-width: 768px) {
    .review-jump-nav-wrap {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 8px;
        border-radius: 999px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
    }

    .dashboard-page {
        padding-bottom: 95px;
    }

    .review-jump-nav {
        margin: 0 !important;
    }

        .review-jump-nav a {
            padding: 8px 12px;
            font-size: .8rem;
        }

    #supporting-documents,
    #customer-evidence,
    #cscs-status,
    #approval-workflow,
    #audit-history {
        scroll-margin-top: 18px;
    }
}

.document-guidance {
    background: #f8fafc;
    font-size: .9rem;
}

    .document-guidance strong {
        color: #111827;
    }

.kyc-mini-progress {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
    scrollbar-width: thin;
}

    .kyc-mini-progress a {
        flex: 0 0 auto;
        text-decoration: none;
        padding: 9px 14px;
        border-radius: 999px;
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #1f2937;
        font-weight: 700;
        font-size: .88rem;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
    }

        .kyc-mini-progress a:hover,
        .kyc-mini-progress a.active {
            background: #0d6efd;
            color: #ffffff;
            border-color: #0d6efd;
        }

.kyc-section {
    scroll-margin-top: 76px;
}

.kyc-back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #0d6efd;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .25);
}

@media (max-width: 768px) {
    .kyc-mini-progress {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 10px;
        margin-left: 0;
        margin-right: 0;
        padding: 8px;
        border-radius: 999px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
    }

        .kyc-mini-progress a {
            padding: 8px 12px;
            font-size: .8rem;
        }

    .onboarding-step {
        padding-bottom: 95px;
    }

    .kyc-section {
        scroll-margin-top: 18px;
    }

    .kyc-back-top {
        bottom: 76px;
        right: 16px;
    }
}

.onboarding-card {
    background: #f8fafc;
}

.kyc-section {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

.kyc-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.kyc-section-help {
    color: #64748b;
    font-size: .92rem;
    margin-bottom: 18px;
}

.kyc-section .form-label {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.kyc-section .form-control,
.kyc-section .form-select {
    background-color: #ffffff;
    border: 1.7px solid #b6c2d2;
    border-radius: 12px;
    min-height: 48px;
    padding: 11px 13px;
    color: #111827;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.kyc-section textarea.form-control {
    min-height: 92px;
}

.kyc-section .form-control:focus,
.kyc-section .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .22rem rgba(13, 110, 253, .16);
}

.kyc-section .form-control::placeholder {
    color: #94a3b8;
}

.required-label::after {
    content: " *";
    color: #dc3545;
    font-weight: 800;
}

.input-validation-error,
.kyc-section .form-control.input-validation-error,
.kyc-section .form-select.input-validation-error {
    border-color: #dc3545;
    background: #fff7f7;
}

.kyc-section .text-danger {
    font-size: .85rem;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

.kyc-section label.border.rounded-3 {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1 !important;
    cursor: pointer;
    transition: all .15s ease-in-out;
}

    .kyc-section label.border.rounded-3:hover {
        background: #eef5ff;
        border-color: #0d6efd !important;
    }

.kyc-section input[type="checkbox"]:checked + span,
.kyc-section input[type="radio"]:checked + span {
    font-weight: 800;
}