/* ─────────────────────────────────────────────────────────────────────────
   Business Credit Application
   Customer + admin styling. Built on the existing Bootstrap 5 utilities and
   the shared account-content-card shell.
   ───────────────────────────────────────────────────────────────────────── */

.ca-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}

.ca-badge--draft { background: #f1f1f1; color: #555; border-color: #ddd; }
.ca-badge--submitted { background: #e7f1ff; color: #0b5ed7; border-color: #cfe2ff; }
.ca-badge--review { background: #fff4e5; color: #a15c00; border-color: #ffe0b2; }
.ca-badge--info { background: #fff8e1; color: #8a6d00; border-color: #ffe9a8; }
.ca-badge--approved { background: #e8f5e9; color: #1b5e20; border-color: #c8e6c9; }
.ca-badge--declined { background: #fdecea; color: #b3261e; border-color: #f7c9c5; }
.ca-badge--withdrawn { background: #eeeeee; color: #666; border-color: #ddd; }

.ca-nav-badge {
    margin-left: 8px;
    font-size: 10px;
    padding: 1px 7px;
    vertical-align: middle;
}

/* Sections ------------------------------------------------------------- */

.ca-section {
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    margin-bottom: 22px;
    background: #fff;
}

.ca-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    border-radius: 6px 6px 0 0;
}

.ca-section__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 26px;
}

.ca-section__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ca-section__hint {
    margin: 4px 0 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #454545;
}

.ca-section__body { padding: 16px; }

.ca-subgroup {
    border: 1px dashed #e0e0e0;
    border-radius: 4px;
    padding: 14px;
    margin-bottom: 14px;
}

.ca-subgroup__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #3d3d3d;
    margin-bottom: 10px;
}

/* Fields ---------------------------------------------------------------- */

.ca-field { margin-bottom: 12px; }

.ca-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.ca-field .ca-required { color: #b3261e; margin-left: 2px; }

.ca-field .form-control,
.ca-field .form-select,
.ca-field select {
    border-radius: 3px;
    font-size: 14px;
}

.ca-field .form-control:focus,
.ca-field .form-select:focus,
.ca-field select:focus {
    border-color: #222;
    box-shadow: 0 0 0 .18rem rgba(0,0,0,.12);
}

.ca-help {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: #484848;
    margin-top: 4px;
}

.ca-onfile {
    display: inline-block;
    font-size: 11px;
    color: #444;
    background: #f4f4f4;
    border: 1px solid #e2e2e2;
    border-radius: 3px;
    padding: 1px 7px;
    margin-left: 6px;
    font-family: Consolas, "Courier New", monospace;
}

/* Read-only summary ----------------------------------------------------- */

.ca-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
}

.ca-summary-item .ca-summary-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #555;
}

.ca-summary-item .ca-summary-value {
    display: block;
    font-size: 14px;
    color: #222;
    word-break: break-word;
}

.ca-legacy-note {
    font-size: 13px;
    line-height: 1.5;
    color: #454545;
    background: #f7f7f7;
    border-left: 3px solid #bbb;
    padding: 10px 12px;
    margin-bottom: 12px;
    word-break: break-word;
}

.ca-message {
    border-left: 3px solid #a15c00;
    background: #fff8ef;
    padding: 10px 14px;
    font-size: 13px;
    color: #4a3400;
    white-space: pre-wrap;
    margin-bottom: 18px;
    border-radius: 0 4px 4px 0;
}

.ca-agreement {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    background: #fcfcfc;
}

.ca-signature-pad {
    width: 100%;
    max-width: 720px;
    height: 182px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.ca-signature-pad canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
}

.ca-row-removed { display: none; }

.ca-timeline { list-style: none; padding: 0; margin: 0; }

.ca-timeline li {
    border-left: 2px solid #e4e4e4;
    padding: 0 0 14px 14px;
    position: relative;
}

.ca-timeline li:before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #222;
}

.ca-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.ca-timeline__meta { font-size: 12px; color: #666; }

.ca-timeline__comment { font-size: 13px; color: #333; white-space: pre-wrap; margin-top: 3px; }

.ca-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 6px;
}

.ca-intro {
    margin-bottom: 18px;
    color: #454545;
    font-size: 14px;
    line-height: 1.55;
}

.ca-text-secondary {
    color: #454545;
    font-size: 13px;
    line-height: 1.5;
}

.ca-empty-note {
    color: #555;
    font-size: 13px;
    line-height: 1.45;
}

.ca-section--error {
    border-color: #d99b97;
}

.ca-section--error > .ca-section__header {
    background: #fff8f7;
    border-bottom-color: #efd2cf;
}

.ca-subgroup--error {
    border-style: solid;
    border-color: #d99b97;
    background: #fffafa;
}

.ca-field .is-invalid,
.ca-signature-pad .is-invalid {
    border-color: #b3261e;
}

.ca-field-error {
    display: block;
    margin-top: 5px;
    color: #9f231c;
    font-size: 12px;
    line-height: 1.4;
}

.ca-field-error:empty { display: none; }

.ca-address-card {
    border: 1px solid #dedede;
    border-radius: 5px;
    background: #fcfcfc;
    padding: 15px;
}

.ca-address-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.ca-address-card__title {
    margin: 0;
    color: #222;
    font-size: 14px;
    font-weight: 700;
}

.ca-address-card > .ca-address-card__title {
    margin: 0 0 12px;
}

.ca-address-card__edit {
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.ca-readiness-panel {
    border: 1px solid #ead39c;
    border-left: 4px solid #b27a00;
    border-radius: 4px;
    background: #fff9e9;
    color: #493500;
    padding: 13px 15px;
    font-size: 13px;
    line-height: 1.5;
}

.ca-currency-input {
    display: flex;
    align-items: stretch;
}

.ca-currency-input > span {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 3px 0 0 3px;
    background: #f3f3f3;
    color: #333;
    font-weight: 600;
}

.ca-currency-input .form-control {
    border-radius: 0 3px 3px 0;
}

@media (max-width: 575.98px) {
    .ca-actions { justify-content: stretch; }
    .ca-actions .btn { flex: 1 1 100%; }
    .ca-section__body { padding: 12px; }
    .ca-address-card { padding: 12px; }
    .ca-summary-grid { grid-template-columns: 1fr; gap: 9px; }
}

/* Admin review ---------------------------------------------------------- */

.ca-admin-page {
    color: #111;
}

.ca-admin-page .btn,
.ca-admin-page .btn-sm,
.ca-admin-page a.btn,
.ca-admin-page button.btn {
    padding: 4px 10px !important;
    min-height: 0;
    height: auto;
    font-size: 12px !important;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.3;
    text-transform: none;
    border-radius: 3px;
}

.ca-admin-page .card {
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}

.ca-admin-page .card-header {
    border-bottom: 1px solid #cfcfcf;
    background: #f7f7f7;
}

.ca-admin-page .card-footer {
    border-top: 1px solid #cfcfcf;
}

.ca-admin-simple-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ca-admin-simple-search .form-control {
    flex: 1 1 220px;
    min-width: 0;
}

.ca-admin-simple-search .btn {
    flex: 0 0 auto;
}

.ca-admin-advanced {
    display: none !important;
    margin-top: 14px;
}

.ca-admin-advanced.is-open {
    display: flex !important;
    flex-wrap: wrap;
}

.ca-admin-page .ca-admin-filters .form-label {
    display: block;
    margin-bottom: 4px;
    color: #222;
    font-size: 12px;
    font-weight: 700;
}

.ca-admin-page .ca-admin-filters .form-control,
.ca-admin-page .ca-admin-filters select.form-control {
    height: 34px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    color: #111;
    font-size: 13px;
}

.ca-admin-page .table thead th {
    color: #222;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f3f3f3;
}

.ca-admin-page .table tbody td {
    color: #111;
    font-size: 14px;
    vertical-align: middle;
}

.ca-admin-actions-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.ca-admin-actions-bar__meta {
    min-width: 0;
}

.ca-admin-actions-bar__title {
    margin: 0;
    color: #111;
    font-size: 18px;
    font-weight: 700;
}

.ca-admin-actions-bar__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ca-admin-panel {
    margin-bottom: 18px;
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.ca-admin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #cfcfcf;
    background: #f7f7f7;
}

.ca-admin-panel__header h5 {
    margin: 0;
    color: #111;
    font-size: 15px;
    font-weight: 700;
}

.ca-admin-panel__body {
    padding: 16px;
}

.ca-admin-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ca-admin-compare__col {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #c8c8c8;
    border-radius: 5px;
    background: #fff;
}

.ca-admin-compare__title {
    margin: 0 0 10px;
    color: #111;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ca-admin-kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.ca-admin-kv {
    padding: 9px 0;
    border-bottom: 1px solid #ececec;
}

.ca-admin-kv:last-child {
    border-bottom: 0;
}

.ca-admin-kv__label {
    display: block;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ca-admin-kv__value {
    display: block;
    margin-top: 3px;
    color: #111;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.ca-admin-kv__empty {
    display: inline-block;
    color: #888;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    vertical-align: middle;
}

.ca-admin-notes {
    margin: 0;
    color: #111;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    font-family: inherit;
}

.ca-admin-help {
    margin: 12px 0 0;
    color: #333;
    font-size: 13px;
    line-height: 1.45;
}

.ca-admin-empty {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.ca-admin-page .ca-timeline__meta {
    color: #444;
}

.ca-admin-page .ca-timeline__comment {
    color: #111;
}

.ca-admin-modal .form-label {
    color: #222;
    font-size: 13px;
    font-weight: 700;
}

.ca-admin-modal .form-control,
.ca-admin-modal select.form-control,
.ca-admin-modal textarea.form-control {
    color: #111;
    font-size: 14px;
}

@media (max-width: 767.98px) {
    .ca-admin-compare,
    .ca-admin-kv-grid {
        grid-template-columns: 1fr;
    }
    .ca-admin-actions-bar__buttons .btn {
        flex: 1 1 calc(50% - 8px);
    }
    .ca-admin-simple-search .btn {
        flex: 1 1 auto;
    }
}
