.bg-blue-subtle {
  --bs-bg-opacity: 1;
  background-color: rgba(59, 130, 246, 0.15) !important;
}

.text-blue {
  color: rgb(59, 130, 246) !important;
}

.border-blue-subtle {
  border-color: rgba(59, 130, 246, 0.35) !important;
}

.bg-violet-subtle {
  --bs-bg-opacity: 1;
  background-color: rgba(147, 51, 234, 0.15) !important;
}

.text-violet {
  color: rgb(147, 51, 234) !important;
}

.border-violet-subtle {
  border-color: rgba(147, 51, 234, 0.35) !important;
}

/* Danger ghost button: transparent by default, filled on hover */
.btn-danger-ghost {
  background-color: transparent !important;
  color: var(--bs-danger) !important;
  border: 1px solid var(--bs-danger) !important;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-danger-ghost:hover,
.btn-danger-ghost:focus,
.btn-danger-ghost:active {
  background-color: var(--bs-danger) !important;
  color: #fff !important;
  border-color: var(--bs-danger) !important;
}
.btn-success-ghost,
.btn-primary-ghost,
.btn-secondary-ghost,
.btn-warning-ghost,
.btn-info-ghost,
.btn-blue-ghost,
.btn-violet-ghost {
  background-color: transparent !important;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-success-ghost { color: var(--bs-success) !important; border: 1px solid var(--bs-success) !important; }
.btn-success-ghost:hover, .btn-success-ghost:focus, .btn-success-ghost:active { background-color: var(--bs-success) !important; color: #fff !important; border-color: var(--bs-success) !important; }

.btn-primary-ghost { color: var(--bs-primary) !important; border: 1px solid var(--bs-primary) !important; }
.btn-primary-ghost:hover, .btn-primary-ghost:focus, .btn-primary-ghost:active { background-color: var(--bs-primary) !important; color: #fff !important; border-color: var(--bs-primary) !important; }

.btn-secondary-ghost { color: var(--bs-secondary) !important; border: 1px solid var(--bs-secondary) !important; }
.btn-secondary-ghost:hover, .btn-secondary-ghost:focus, .btn-secondary-ghost:active { background-color: var(--bs-secondary) !important; color: #fff !important; border-color: var(--bs-secondary) !important; }

.btn-warning-ghost { color: var(--bs-warning) !important; border: 1px solid var(--bs-warning) !important; }
.btn-warning-ghost:hover, .btn-warning-ghost:focus, .btn-warning-ghost:active { background-color: var(--bs-warning) !important; color: #fff !important; border-color: var(--bs-warning) !important; }

.btn-info-ghost { color: var(--bs-info) !important; border: 1px solid var(--bs-info) !important; }
.btn-info-ghost:hover, .btn-info-ghost:focus, .btn-info-ghost:active { background-color: var(--bs-info) !important; color: #fff !important; border-color: var(--bs-info) !important; }

.btn-blue-ghost { color: rgb(59, 130, 246) !important; border: 1px solid rgb(59, 130, 246) !important; }
.btn-blue-ghost:hover, .btn-blue-ghost:focus, .btn-blue-ghost:active { background-color: rgb(59, 130, 246) !important; color: #fff !important; border-color: rgb(59, 130, 246) !important; }

.btn-violet-ghost { color: rgb(147, 51, 234) !important; border: 1px solid rgb(147, 51, 234) !important; }
.btn-violet-ghost:hover, .btn-violet-ghost:focus, .btn-violet-ghost:active { background-color: rgb(147, 51, 234) !important; color: #fff !important; border-color: rgb(147, 51, 234) !important; }


.success-panel {
    border: 1px solid #b7e8cb;
    background: #edfdf3;
    border-radius: 12px;
}

#global-modal .modal-content {
    /*max-height: calc(100vh - 2rem);*/
    overflow: hidden;
}

#global-modal #frame_modal {
    max-height: calc(100vh - 2rem);
    min-height: 0;
}

#global-modal #frame_modal > [data-modal-size],
#global-modal #frame_modal > form,
#global-modal #frame_modal > .modal-dialog {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    min-height: 0;
}

#global-modal #frame_modal > .modal-dialog {
    margin-bottom: 0;
    margin-top: 0;
    width: 100%;
}

#global-modal #frame_modal > .modal-dialog > .modal-content {
    flex: 1 1 auto;
    min-height: 0;
}

#global-modal .modal-body {
    min-height: 0;
    overflow-y: auto;
}
.convention-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: 2.5rem;
    min-height: 620px;
}

.convention-edit-left {
    border-right: 1px solid #dce5ee;
    padding: 1rem 2.5rem 1rem .5rem;
    background-color: #f5f8fc;
}

.convention-edit-right {
    padding: 1rem .5rem 1rem 0;
}

.convention-source-card {
    align-items: center;
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 18px;
    color: #26313d;
    display: flex;
    gap: 1.3rem;
    margin-bottom: 1.5rem;
    padding: 1.8rem;
    text-align: left;
    width: 100%;
}

.convention-source-card.is-selected {
    background: #effdf3;
    border-color: #b9efc8;
}

.convention-source-radio {
    border: 2px solid #c7d0dc;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 30px;
    height: 30px;
    width: 30px;
}

.convention-source-card.is-selected .convention-source-radio {
    border: 9px solid #0b4772;
}

.convention-formula-reminder {
    align-items: center;
    background: #eef3fa;
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    min-height: 180px;
    padding: 2.2rem;
}

.convention-formula-name {
    color: #9aa7b3;
    font-size: 1.8rem;
    font-weight: 800;
}

.convention-formula-amount {
    color: #9aa7b3;
    font-size: 3.6rem;
    font-weight: 800;
    white-space: nowrap;
}

.convention-edit-switch .form-check-input {
    height: 32px;
    width: 64px;
}

.convention-schedule {
    border: 1px solid #dce5ee;
    border-radius: 18px;
    padding: 1.6rem;
}

.convention-amount-group.is-valid .form-control,
.convention-amount-group.is-valid .convention-row-state {
    border-color: #5fca7a;
}

.convention-amount-group.is-invalid .form-control,
.convention-amount-group.is-invalid .convention-row-state {
    border-color: #ff6f98;
}

.convention-row-state {
    background: #fff;
    color: #5fca7a;
    font-size: 1.4rem;
    min-width: 52px;
}

.convention-amount-group.is-invalid .convention-row-state {
    color: #ff6f98;
}

.convention-edit-footer {
    justify-content: space-between;
}

@media (max-width: 991.98px) {
    .convention-edit-grid {
        grid-template-columns: 1fr;
    }

    .convention-edit-left {
        border-right: 0;
        border-bottom: 1px solid #dce5ee;
        padding-right: .5rem;
        padding-bottom: 2rem;
    }

    .convention-formula-reminder {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .convention-formula-amount {
        font-size: 2.5rem;
    }
}

.partnership-show {
    --partnership-border: #dde7f0;
    --partnership-muted: #66788a;
    --partnership-soft: #f3f7fb;
    --partnership-primary: #0b4772;
}

.partnership-hero {
    padding: 28px 32px;
    border-radius: 18px 18px 0 0;
    background: #f3f7fb;
}

.partnership-logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.partnership-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.partnership-logo span {
    color: var(--partnership-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.partnership-title {
    margin: 0;
    font-size: 2.1rem;
    font-weight: 700;
    color: #26313d;
}

.partnership-subtitle {
    margin-top: 4px;
    color: var(--partnership-muted);
    font-size: 1rem;
}

.partnership-panel {
    background: #fff;
    padding: 0 28px 42px;
}

.partnership-tabs {
    gap: 18px;
    border-bottom: 1px solid var(--partnership-border);
}

.partnership-tabs .nav-link {
    border: 0;
    border-radius: 0;
    color: #526b80;
    padding: 18px 10px 16px;
}

.partnership-tabs .nav-link.active {
    color: var(--partnership-primary);
    border-bottom: 3px solid var(--partnership-primary);
    background: transparent;
}

.partnership-tab-content {
    padding: 32px 0 0;
}

.partnership-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 24px 28px;
    margin-bottom: 30px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(33, 55, 75, .06);
}

.partnership-kpi {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 0 20px;
    border-right: 1px solid var(--partnership-border);
}

.partnership-kpi:first-child {
    padding-left: 0;
}

.partnership-kpi:last-child {
    border-right: 0;
    padding-right: 0;
}

.partnership-kpi i {
    color: #60798f;
    font-size: 1.5rem;
}

.partnership-kpi-label {
    color: #3d4d5c;
    font-weight: 700;
}

.partnership-kpi-value {
    color: #1e2a35;
    font-weight: 700;
    font-size: 1.15rem;
}

.partnership-section,
.partnership-side-card {
    border: 1px solid var(--partnership-border);
    border-radius: 14px;
    background: #fff;
    padding: 28px;
    margin-bottom: 28px;
}

.partnership-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.partnership-section-header h2,
.partnership-side-card h2 {
    margin: 0;
    color: #2d3a45;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
}

.partnership-section-header h2 i,
.partnership-side-card h2 i {
    margin-right: 8px;
    color: #587287;
}

.partnership-inner-table {
    padding: 16px;
    border-radius: 14px;
    background: #f5f7fa;
}

.partnership-inner-table table {
    overflow: hidden;
    border: 1px solid var(--partnership-border);
    border-radius: 12px;
    background: #fff;
}

.partnership-document-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-top: 24px;
    border-radius: 14px;
    background: #f5f7fa;
}

.partnership-document-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #ffd3e1;
    color: #ff5f92;
    font-size: 1.35rem;
}

.partnership-round-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #48cf74;
    border-radius: 50%;
    color: #48cf74;
}

.partnership-round-action.is-disabled {
    opacity: .45;
}

.partnership-empty-document,
.partnership-loading {
    padding: 18px 20px;
    border-radius: 12px;
    background: #f5f7fa;
    color: #8a9baa;
}

.partnership-side-card h2 {
    margin-bottom: 22px;
}

.partnership-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.partnership-status-badge {
    min-width: 74px;
    display: inline-flex;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 800;
}

.partnership-status-success {
    background: #dcf8e7;
    color: #31bd64;
}

.partnership-status-warning {
    background: #fff3cf;
    color: #d9a700;
}

.partnership-status-info {
    background: #d9eaf2;
    color: #155173;
}

.partnership-activity-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--partnership-border);
}

.partnership-activity-item:last-child {
    border-bottom: 0;
}

.partnership-activity-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0d6c5;
    color: #7a3c22;
    font-size: .75rem;
    font-weight: 800;
}

.partnership-activity-dashboard {
    --activity-border: #dde7f0;
    --activity-soft: #f6f8fb;
    --activity-muted: #72829a;
    --activity-primary: #0b4772;
}

.partnership-activity-card {
    border: 1px solid var(--activity-border);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .06);
}

.partnership-activity-stat {
    min-height: 132px;
}

.partnership-activity-muted {
    color: var(--activity-muted);
}

.partnership-activity-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.partnership-activity-table th {
    background: #f8fafc;
    color: #4f5e72;
    font-weight: 800;
    padding-bottom: 1.15rem;
    padding-top: 1.15rem;
}

.partnership-activity-table td {
    padding-bottom: 1rem;
    padding-top: 1rem;
    vertical-align: middle;
}

.partnership-activity-table tbody tr:hover {
    background: #f8fafc;
}

.partnership-activity-participant {
    border: 2px solid #fff;
    margin-left: -9px;
    object-fit: cover;
}

.partnership-activity-participant:first-child {
    margin-left: 0;
}

.partnership-activity-participant-more {
    align-items: center;
    background: #e8edf4;
    color: #526277;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    justify-content: center;
}

.partnership-activity-action {
    color: #9aa8ba;
    height: 40px;
    width: 40px;
}

.partnership-activity-action:hover {
    background: #eef3f8;
    color: var(--activity-primary);
}

.partnership-activity-control {
    background-color: #f8fafc;
    border-color: var(--activity-border);
    min-height: 44px;
}

.partnership-activity-control:focus {
    border-color: var(--activity-primary);
    box-shadow: 0 0 0 .18rem rgba(11, 71, 114, .14);
}

@media (max-width: 991.98px) {
    .partnership-kpis {
        grid-template-columns: 1fr;
    }

    .partnership-kpi {
        border-right: 0;
        border-bottom: 1px solid var(--partnership-border);
        padding: 16px 0;
    }

    .partnership-kpi:last-child {
        border-bottom: 0;
    }
}

#frame_modal:has(.convention-edit-form) {
    display: flex;
    min-height: 0;
}

.convention-edit-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    max-height: calc(100vh - 3.5rem);
    min-height: 0;
}

.convention-edit-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.convention-edit-form .modal-header,
.convention-edit-form .modal-footer {
    flex: 0 0 auto;
}

.btn-pink {
    --bs-btn-color: #fff;
    --bs-btn-bg: #ff5f8e;
    --bs-btn-border-color: #ff5f8e;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #ee4d7d;
    --bs-btn-hover-border-color: #ee4d7d;
}

.signature-modal {
    max-height: calc(100vh - 2rem);
}

.signature-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    border: 0;
    border-radius: 14px;
}

.signature-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    min-height: 0;
}

.signature-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.signature-modal .modal-header,
.signature-modal .modal-footer {
    flex: 0 0 auto;
}

.signature-tabs .nav-link {
    color: #263743;
    font-weight: 600;
}

.signature-tabs .nav-link.active {
    background: #06466d;
    color: #fff;
}

.signature-mode-panel {
    max-width: 680px;
    margin: 0 auto;
}

.signature-canvas-box {
    position: relative;
    width: min(100%, 480px);
    height: 190px;
    border: 2px solid #294b57;
    border-radius: 16px;
    background: #fff;
}

.signature-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.signature-powered {
    position: absolute;
    right: 24px;
    bottom: -12px;
    padding: 0 10px;
    background: #fff;
    color: #163d51;
    font-size: .8rem;
    font-style: italic;
}

.signature-script-name {
    --signature-name-progress: 0%;
    min-height: 58px;
    margin-top: 26px;
    color: transparent;
    background: linear-gradient(
        90deg,
        #111 0 var(--signature-name-progress),
        #cfd3d8 var(--signature-name-progress) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 2.5rem;
    line-height: 1;
}

.signature-upload-preview img {
    max-width: 360px;
    max-height: 120px;
    object-fit: contain;
}

.signature-slider {
    width: min(100%, 430px);
}

.signature-slider-track {
    position: relative;
    height: 46px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e5e5;
    user-select: none;
}

.signature-slider-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, #6ee7cb, #58d8bd);
}

.signature-slider-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5ad;
    font-weight: 600;
    pointer-events: none;
}

.signature-slider-handle {
    position: absolute;
    top: 2px;
    left: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    transform: translateX(-1px);
    border: 2px solid #d2d7dc;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .18);
}

.signature-slider.is-valid .signature-slider-label {
    color: #5e787d;
}

.signature-preview-box {
    display: flex;
    min-height: 130px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e3ea;
    border-radius: 10px;
    background: #fff;
}

.signature-preview-box img {
    max-width: 360px;
    max-height: 110px;
    object-fit: contain;
}

@media (max-width: 767.98px) {
    .signature-script-name {
        font-size: 2rem;
    }

    .signature-canvas-box {
        height: 160px;
    }
}
