/**
 * Bridge admin — overrides Metronic. No editar los bundles.
 */

:root {
    --bs-primary: #009ef7;
    --bs-success: #50cd89;
    --bs-danger: #f1416c;
    --bs-warning: #ffc700;
    --bs-info: #7239ea;
}

.app-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #f1f1f4;
    box-shadow: none;
    flex-shrink: 0;
}

.app-sidebar-menu,
.app-sidebar-wrapper {
    background-color: transparent !important;
}

@media (min-width: 992px) {
    .app-wrapper {
        flex-direction: row !important;
    }
    .app-main {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.menu-heading {
    color: #99A1B7 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.08rem;
    padding-left: 0.25rem;
}

#kt_app_sidebar_menu .menu-item > .menu-link {
    color: #4B5675;
    border-radius: 0.475rem;
    transition: background-color 150ms ease, color 150ms ease;
    padding: 0.55rem 1rem;
    margin: 1px 0;
}

body.bridge-has-test-chat .woot-widget-bubble {
    display: none !important;
}

#kt_app_sidebar_menu .menu-item > .menu-link:hover {
    background-color: rgba(27, 132, 255, 0.06);
    color: #009ef7;
}

#kt_app_sidebar_menu .menu-item > .menu-link.active {
    background-color: rgba(27, 132, 255, 0.08);
    color: #009ef7;
    font-weight: 500;
    position: relative;
}

#kt_app_sidebar_menu .menu-item > .menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    border-radius: 2px;
    background-color: #009ef7;
}

#kt_app_sidebar_menu .menu-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f6c000;
    flex-shrink: 0;
    margin-left: auto;
}

body[data-kt-app-sidebar-minimize="on"] #kt_app_sidebar_menu .menu-sync-dot {
    display: none;
}

#kt_app_sidebar_menu .symbol-label {
    border-radius: 0.475rem;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-sidebar-footer {
    border-top: none;
}

.app-sidebar-footer .separator {
    border-color: #f1f1f4;
}

body[data-kt-app-sidebar-minimize="on"] .sidebar-user-info,
body[data-kt-app-sidebar-minimize="on"] .app-sidebar-footer .separator {
    display: none;
}

.app-container {
    padding-left: 1rem;
    padding-right: 1rem;
}

.app-header {
    background-color: #ffffff !important;
    box-shadow: 0 0 28px 0 rgba(82, 63, 105, 0.13);
}

body,
.app-main,
.app-content,
#kt_app_content {
    background-color: #f5f8fa !important;
}

.card {
    box-shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    border: 0;
    background-color: #ffffff;
}

.card-header {
    border-bottom: 1px solid #eff2f5;
}

.table thead th {
    border-bottom: 1px solid #eff2f5;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #a1a5b7;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.btn {
    font-weight: 500;
    border-radius: 0.475rem;
}

.form-label {
    color: #5e6278;
    font-weight: 500;
}

.form-control,
.form-select {
    border-color: #e4e6ef;
}

.form-control:focus,
.form-select:focus {
    border-color: #009ef7;
    box-shadow: 0 0 0 0.2rem rgba(0, 158, 247, 0.25);
}

.app-toolbar {
    background-color: transparent;
}

.card-kpi-decorated {
    position: relative;
    overflow: hidden;
}

.card-kpi-decorated::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(27, 132, 255, 0.03) 50%);
    pointer-events: none;
}

.wizard-steps {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 0.15rem 1.5rem 0.25rem 0.15rem;
    margin: 0 -0.15rem;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 1.25rem), transparent 100%);
}

.wizard-steps::-webkit-scrollbar {
    display: none;
}

.wizard-step {
    flex: 0 0 auto;
    width: 7.25rem;
    min-width: 7.25rem;
    scroll-snap-align: center;
    text-decoration: none;
}

.wizard-step-title {
    line-height: 1.25;
}

.wizard-step .badge {
    display: inline-block;
    white-space: normal;
    line-height: 1.25;
    max-width: 100%;
}

.wizard-step-circle {
    width: 2.25rem;
    height: 2.25rem;
}

@media (min-width: 1200px) {
    .wizard-steps {
        overflow-x: visible;
        scroll-snap-type: none;
        mask-image: none;
        padding-right: 0.15rem;
    }

    .wizard-step {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }
}

.wizard-check-row:last-child {
    border-bottom: 0;
}

.identity-sample {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 8rem;
    overflow: auto;
    background: #f9f9f9;
    border: 1px solid #eff2f5;
    border-radius: 0.475rem;
}

.wizard-guide-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wizard-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #eff2f5;
}

.wizard-guide-step:last-child {
    border-bottom: 0;
}

.wizard-guide-index {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f1f3f7;
    color: #5e6278;
}

.wizard-guide-step.is-now .wizard-guide-index {
    background: #009ef7;
    color: #fff;
}

.wizard-guide-step.is-done .wizard-guide-index {
    background: #e8fff3;
    color: #50cd89;
}

.wizard-guide-step.is-todo {
    opacity: 0.72;
}

.mail-preview {
    display: block;
    width: 100%;
    min-height: 44rem;
    border: 0;
    border-radius: 0.75rem;
    background: #d5d9e2;
    box-shadow: inset 0 0 0 1px #e4e6ef;
}

.mail-template-editor,
#SLA_EMAIL_TEMPLATE,
#KPI_EMAIL_TEMPLATE {
    min-height: 44rem;
    font-size: 0.75rem;
    line-height: 1.45;
}

#KPI_EMAIL_TO,
#KPI_FREQUENCY,
#KPI_SEND_DATE,
#KPI_SEND_TIME,
#KPI_EMAIL_SUBJECT {
    min-height: 40px;
}

.mail-ph {
    min-height: 40px;
}

.thread-row {
    display: flex;
    margin-bottom: 1rem;
}

.thread-row.is-contact {
    justify-content: flex-start;
}

.thread-row.is-agent {
    justify-content: flex-end;
}

.thread-bubble {
    max-width: 80%;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.thread-row.is-contact .thread-bubble {
    background-color: #f1f3f7;
}

.thread-row.is-agent .thread-bubble {
    background-color: rgba(0, 158, 247, 0.08);
}

.thread-row.is-private .thread-bubble {
    background-color: #fff8dd;
    border: 1px dashed #ffc700;
}

.conv-tabs {
    border-bottom: 1px solid #eff2f5;
}

.conv-detail-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.conv-toolbar,
.conv-train {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.conv-toolbar .btn,
.conv-train .btn,
.filter-bar .btn {
    height: 40px;
    min-height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.kpi-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.65rem;
    max-width: 100%;
}

.kpi-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.kpi-filter-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-filter .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    color: #7e8299;
}

.kpi-filter-presets .btn,
.kpi-filter-apply,
.kpi-filter .form-control,
.kpi-filter .form-select {
    height: 40px;
    min-height: 40px;
}

.kpi-filter-field .form-control {
    width: 12.5rem;
    min-width: 11.5rem;
}

.flatpickr-calendar {
    z-index: 10050;
}

.flatpickr-calendar.noCalendar {
    width: auto;
}

.connector-window .form-control,
.connector-window .form-select,
.connector-window .btn {
    min-height: 40px;
}

.connector-action-hint {
    margin-left: 1.85rem;
    max-width: 40rem;
}

.kpi-filter-inbox .form-select {
    width: 12.5rem;
    max-width: 100%;
}

.kpi-filter-range {
    color: #7e8299;
    font-size: 0.8rem;
    line-height: 1.35;
    align-self: center;
    padding-bottom: 0.35rem;
}

.app-toolbar .app-container:has(.kpi-filter) {
    flex-direction: column;
    align-items: stretch;
}

.app-toolbar .app-container:has(.kpi-filter) > .d-flex.flex-wrap {
    width: 100%;
}

.conv-train {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eff2f5;
}

.conv-train .form-control {
    height: 40px;
    min-height: 40px;
    flex: 1 1 12rem;
    max-width: 28rem;
}

.help-md h3,
.help-md h4,
.help-md h5 {
    color: #252F4A;
}

.help-md pre {
    overflow-x: auto;
}

.help-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.15rem;
    padding-right: 1.5rem;
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 1.25rem), transparent 100%);
}

.help-tabs::-webkit-scrollbar {
    display: none;
}

.help-tabs .nav-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.help-tabs .nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.help-md ol {
    padding-left: 1.2rem;
}

@media (max-width: 991.98px) {
    .app-header img.h-25px {
        max-width: 140px;
        object-fit: contain;
    }

    .app-navbar {
        gap: 0.15rem !important;
    }

    .mail-preview,
    #SLA_EMAIL_TEMPLATE,
    #KPI_EMAIL_TEMPLATE {
        min-height: 22rem;
    }

    .thread-bubble {
        max-width: 100%;
    }

    .card-footer .btn {
        min-height: 44px;
    }

    .filter-bar > div {
        flex: 1 1 100%;
    }

    .filter-bar .btn {
        width: 100%;
        height: 40px;
        min-height: 40px;
    }

    .kpi-filter {
        width: 100%;
    }

    .kpi-filter-presets {
        width: 100%;
    }

    .kpi-filter-presets .btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .kpi-filter-field {
        flex: 1 1 calc(50% - 0.35rem);
    }

    .kpi-filter-field .form-control,
    .kpi-filter-inbox .form-select,
    .kpi-filter-apply {
        width: 100%;
    }

    .kpi-filter-inbox,
    .kpi-filter-range {
        flex: 1 1 100%;
    }

    .kpi-filter-apply {
        flex: 1 1 100%;
    }

    .conv-toolbar,
    .conv-train {
        width: 100%;
    }

    .conv-toolbar .btn,
    .conv-train .btn {
        flex: 0 1 auto;
        width: auto;
    }

    .conv-train .form-control {
        flex: 1 1 12rem;
        max-width: none;
    }

    .help-md,
    .card-body {
        overflow-wrap: break-word;
    }

    .media-form .btn,
    .media-url-row .btn {
        width: 100%;
        min-height: 40px;
    }

    .media-url-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.login-page {
    min-height: 100vh;
    background-color: #f5f8fa;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 920px;
    overflow: hidden;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 0 50px 0 rgba(82, 63, 105, 0.12);
}

.login-card-form {
    padding: 1.75rem 1.75rem 2rem;
}

.login-aside {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    order: -1;
    min-height: 180px;
    background-color: #1e1e2d;
    background-size: cover;
    background-position: center;
}

.login-aside.has-brand-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 24, 0.45);
}

.login-aside-copy {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.25rem 1.5rem 1.5rem;
}

@media (min-width: 992px) {
    .login-card {
        flex-direction: row;
        align-items: stretch;
    }

    .login-card-form {
        flex: 1 1 50%;
        width: 50%;
        padding: 2.25rem 2.5rem 2.5rem;
    }

    .login-aside {
        flex: 1 1 50%;
        width: 50%;
        order: 0;
        min-height: 0;
        align-items: center;
    }

    .login-aside-copy {
        padding: 2rem 2.25rem;
    }
}

.login-brand-logo {
    display: block;
    max-height: 56px;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}

.brand-preview {
    width: 96px;
    height: 72px;
    border: 1px dashed #e4e6ef;
    border-radius: 0.475rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-preview.is-empty {
    background: #f1f1f4;
}

[data-kt-theme-mode-switching="true"] * {
    transition: none !important;
}

.topbar-shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.25rem;
    min-width: 40px;
    min-height: 40px;
    border-radius: 0.475rem;
    text-decoration: none;
    transition: background-color 150ms ease;
}

@media (min-width: 768px) {
    .topbar-shortcut {
        padding: 0.35rem 0.65rem;
        min-width: 0;
        min-height: 0;
        justify-content: flex-start;
    }
}

.topbar-shortcut:hover {
    background-color: #f1f1f4;
}

.topbar-shortcut-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.topbar-shortcut-label {
    display: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4B5675;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .topbar-shortcut-label {
        display: inline;
    }
}

.topbar-shortcut:hover .topbar-shortcut-label {
    color: #252F4A;
}

.password-toggle-wrap {
    position: relative;
    width: 100%;
}

.password-toggle-wrap .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.15rem;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0.475rem;
    background: transparent;
    color: #78829D;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #252F4A;
    background-color: #f1f1f4;
}

.password-toggle:focus-visible {
    outline: 2px solid #009ef7;
    outline-offset: 1px;
}

.alert.alert-warning .btn {
    min-height: 40px;
}

.topbar-alert-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e4e6ef;
    color: inherit;
    text-decoration: none;
    min-height: 40px;
}

.topbar-alert-row:last-child {
    border-bottom: none;
}

a.topbar-alert-link:hover,
a.topbar-alert-link:focus-visible {
    text-decoration: none;
    color: inherit;
}

a.topbar-alert-link:hover .text-gray-700,
a.topbar-alert-link:focus-visible .text-gray-700 {
    color: #009ef7 !important;
}

.topbar-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.475rem;
    border: none;
    background: transparent;
    color: #78829D;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.topbar-theme-toggle:hover {
    background-color: #f1f1f4;
    color: #252F4A;
}

.topbar-user-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #a1a5b7;
}

.media-source {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.media-source .form-check {
    min-height: 40px;
    align-items: center;
}

.media-form .form-control,
.media-form .btn {
    min-height: 40px;
}

.media-url-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 12rem;
}

.media-url-row .form-control {
    flex: 1 1 12rem;
    min-width: 0;
    min-height: 40px;
}

.media-url-row .btn {
    min-height: 40px;
    min-width: 40px;
}

.media-preview {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid #e4e6ef;
    border-radius: 0.475rem;
    overflow: hidden;
    background: #f5f8fa;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-bs-theme="dark"] .app-sidebar {
    background-color: #1e1e2d !important;
    border-right-color: #2d2d3f !important;
}

[data-bs-theme="dark"] .app-sidebar-menu,
[data-bs-theme="dark"] .app-sidebar-wrapper {
    background-color: transparent !important;
}

[data-bs-theme="dark"] #kt_app_sidebar_menu .menu-item > .menu-link {
    color: #9899ac;
}

[data-bs-theme="dark"] #kt_app_sidebar_menu .menu-item > .menu-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

[data-bs-theme="dark"] #kt_app_sidebar_menu .menu-item > .menu-link.active {
    background-color: rgba(27, 132, 255, 0.12);
    color: #ffffff;
}

[data-bs-theme="dark"] #kt_app_sidebar_menu .menu-item > .menu-link.active::before {
    background-color: #009ef7;
}

[data-bs-theme="dark"] #kt_app_sidebar_menu .menu-sync-dot {
    background-color: #f6c000;
}

[data-bs-theme="dark"] .menu-heading {
    color: #565674 !important;
}

[data-bs-theme="dark"] .app-sidebar .separator {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .app-sidebar-footer .text-gray-900 {
    color: #cdcdde !important;
}

[data-bs-theme="dark"] .app-sidebar .symbol-label.bg-light-primary {
    background-color: rgba(0, 158, 247, 0.25) !important;
}
[data-bs-theme="dark"] .app-sidebar .symbol-label.bg-light-success {
    background-color: rgba(80, 205, 137, 0.25) !important;
}
[data-bs-theme="dark"] .app-sidebar .symbol-label.bg-light-warning {
    background-color: rgba(255, 199, 0, 0.25) !important;
}
[data-bs-theme="dark"] .app-sidebar .symbol-label.bg-light-info {
    background-color: rgba(139, 92, 246, 0.35) !important;
}
[data-bs-theme="dark"] .app-sidebar .symbol-label.bg-light-danger {
    background-color: rgba(241, 65, 108, 0.25) !important;
}

[data-bs-theme="dark"] .symbol-label.bg-light-primary .ki-duotone { color: #3699ff !important; }
[data-bs-theme="dark"] .symbol-label.bg-light-success .ki-duotone { color: #6ee7a0 !important; }
[data-bs-theme="dark"] .symbol-label.bg-light-warning .ki-duotone { color: #ffd43b !important; }
[data-bs-theme="dark"] .symbol-label.bg-light-info .ki-duotone { color: #a78bfa !important; }
[data-bs-theme="dark"] .symbol-label.bg-light-danger .ki-duotone { color: #f1416c !important; }

[data-bs-theme="dark"] .app-header {
    background-color: #1c1c2e !important;
    box-shadow: 0 0 28px 0 rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .app-main,
[data-bs-theme="dark"] .app-content,
[data-bs-theme="dark"] #kt_app_content {
    background-color: #151521 !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1e1e2d;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .card-header {
    background-color: #1e1e2d;
    border-bottom-color: #2d2d3f;
}

[data-bs-theme="dark"] .table {
    color: #cdcdde;
}

[data-bs-theme="dark"] .table thead th {
    color: #565674;
    border-bottom-color: #2d2d3f;
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1b1b29 !important;
    border-color: #2d2d3f !important;
    color: #cdcdde !important;
}

[data-bs-theme="dark"] .kpi-filter .form-label,
[data-bs-theme="dark"] .kpi-filter-range {
    color: #7e8299;
}

[data-bs-theme="dark"] .flatpickr-calendar {
    background: #1e1e2d;
    border-color: #2d2d3f;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .flatpickr-months,
[data-bs-theme="dark"] .flatpickr-weekdays,
[data-bs-theme="dark"] .flatpickr-current-month,
[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-bs-theme="dark"] span.flatpickr-weekday,
[data-bs-theme="dark"] .flatpickr-day,
[data-bs-theme="dark"] .flatpickr-time input {
    color: #cdcdde;
    background: transparent;
}

[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-bs-theme="dark"] .flatpickr-day.prevMonthDay,
[data-bs-theme="dark"] .flatpickr-day.nextMonthDay {
    color: #565674;
}

[data-bs-theme="dark"] .flatpickr-day:hover,
[data-bs-theme="dark"] .flatpickr-day:focus {
    background: #2d2d3f;
    border-color: #2d2d3f;
}

[data-bs-theme="dark"] .flatpickr-day.selected,
[data-bs-theme="dark"] .flatpickr-day.selected:hover {
    background: #009ef7;
    border-color: #009ef7;
    color: #fff;
}

[data-bs-theme="dark"] .text-gray-900,
[data-bs-theme="dark"] .page-heading,
[data-bs-theme="dark"] .help-md h3,
[data-bs-theme="dark"] .help-md h4,
[data-bs-theme="dark"] .help-md h5 {
    color: #cdcdde !important;
}

[data-bs-theme="dark"] .text-gray-600 {
    color: #7e8299 !important;
}

[data-bs-theme="dark"] .text-gray-500,
[data-bs-theme="dark"] .text-gray-400 {
    color: #565674 !important;
}

[data-bs-theme="dark"] .card-kpi-decorated::after {
    background: linear-gradient(135deg, transparent 50%, rgba(27, 132, 255, 0.05) 50%);
}

[data-bs-theme="dark"] .topbar-shortcut:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .topbar-shortcut-label {
    color: #9899ac;
}

[data-bs-theme="dark"] .topbar-shortcut:hover .topbar-shortcut-label {
    color: #cdcdde;
}

[data-bs-theme="dark"] .password-toggle {
    color: #9899ac;
}

[data-bs-theme="dark"] .password-toggle:hover,
[data-bs-theme="dark"] .password-toggle:focus-visible {
    color: #cdcdde;
    background-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .topbar-alert-row {
    border-bottom-color: #2d2d3f;
}

[data-bs-theme="dark"] a.topbar-alert-link:hover .text-gray-700,
[data-bs-theme="dark"] a.topbar-alert-link:focus-visible .text-gray-700 {
    color: #009ef7 !important;
}

[data-bs-theme="dark"] .topbar-theme-toggle {
    color: #9899ac;
}

[data-bs-theme="dark"] .topbar-theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #cdcdde;
}

[data-bs-theme="dark"] .thread-row.is-contact .thread-bubble {
    background-color: #2d2d3f;
}

[data-bs-theme="dark"] .thread-row.is-agent .thread-bubble {
    background-color: rgba(0, 158, 247, 0.16);
}

[data-bs-theme="dark"] .thread-row.is-private .thread-bubble {
    background-color: rgba(255, 199, 0, 0.12);
}

[data-bs-theme="dark"] .conv-tabs,
[data-bs-theme="dark"] .conv-train {
    border-color: #2d2d3f;
}

[data-bs-theme="dark"] .wizard-check-row,
[data-bs-theme="dark"] .wizard-guide-step {
    border-bottom-color: #2d2d3f;
}

[data-bs-theme="dark"] .identity-sample {
    background: #1e1e2d;
    border-color: #2d2d3f;
    color: #cdcdde;
}

[data-bs-theme="dark"] .wizard-guide-index {
    background: #2d2d3f;
    color: #cdcdde;
}

[data-bs-theme="dark"] .wizard-guide-step.is-done .wizard-guide-index {
    background: rgba(80, 205, 137, 0.16);
    color: #50cd89;
}

[data-bs-theme="dark"] .mail-preview {
    background: #d5d9e2;
    box-shadow: inset 0 0 0 1px #2d2d3f;
}

[data-bs-theme="dark"] .login-page {
    background-color: #0f0f18;
}

[data-bs-theme="dark"] .login-card {
    background: #1b1b29;
    box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .login-aside {
    background-color: #151521;
}

[data-bs-theme="dark"] .brand-preview {
    border-color: #2d2d3f;
    background: #1b1b29;
}

[data-bs-theme="dark"] .brand-preview.is-empty {
    background: #2d2d3f;
}

[data-bs-theme="dark"] .media-preview {
    border-color: #2d2d3f;
    background: #1b1b29;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2d2d3f !important;
}

.connector-window .btn,
.connector-window .form-select,
.connector-window .form-control,
#copy-redirect {
    min-height: 40px;
}

@media (max-width: 767.98px) {
    .connector-window {
        padding-bottom: 0.75rem;
        border-bottom: 1px dashed var(--bs-gray-300);
    }
}

.lab-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.lab-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: flex-end;
}

.lab-field {
    min-width: 7.25rem;
}

.lab-field-training {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 22rem;
}

.lab-field-actions {
    flex-shrink: 0;
    padding-bottom: 1px;
}

.lab-field-actions .btn,
.lab-composer .btn,
.lab-field .form-select,
.lab-chip,
#lab-save,
#lab-input {
    min-height: 40px;
}

.lab-toolbar-types {
    min-width: 0;
}

.lab-types-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.4rem;
}

.lab-hint {
    font-size: 0.72rem;
    line-height: 1.35;
    color: #7e8299;
}

.lab-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lab-chip {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    padding: 0.35rem 0.7rem;
    border: 1px solid #e4e6ef;
    border-radius: 999px;
    background: #f5f8fa;
    color: #3f4254;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.lab-chip:hover,
.lab-chip:focus-visible {
    border-color: #009ef7;
    outline: none;
}

.lab-chip.active {
    border-color: #009ef7;
    box-shadow: 0 0 0 2px rgba(0, 158, 247, 0.18);
}

.lab-chip-skip {
    background: #f5f8fa;
    color: #5e6278;
}

.lab-chip-ok {
    background: rgba(80, 205, 137, 0.16);
    border-color: rgba(80, 205, 137, 0.45);
    color: #1aa053;
}

.lab-chip-fail {
    background: rgba(241, 65, 108, 0.12);
    border-color: rgba(241, 65, 108, 0.4);
    color: #f1416c;
}

.lab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 992px) {
    .lab-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
        align-items: stretch;
    }
}

.lab-chat-card,
.lab-inspect-card {
    min-width: 0;
}

.lab-thread {
    min-height: 280px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lab-bubble {
    max-width: 92%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.4;
}

.lab-bubble-me {
    align-self: flex-end;
    background: rgba(27, 132, 255, 0.12);
}

.lab-bubble-bot {
    align-self: flex-start;
    background: #f5f8fa;
}

.lab-composer {
    display: flex;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem 1.1rem;
    border-top: 1px solid #eff2f5;
}

.lab-composer .form-control {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
}

.lab-pre {
    margin: 0.35rem 0 0;
    padding: 0.5rem;
    background: #f5f8fa;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 8rem;
    overflow: auto;
}

.lab-seed-hint {
    font-size: 0.75rem;
    color: #7e8299;
}

@media (max-width: 575.98px) {
    .lab-toolbar-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }

    .lab-field-training,
    .lab-field-actions {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }

    .lab-field-actions .btn,
    #lab-save {
        width: 100%;
    }

    .lab-thread {
        max-height: 42vh;
        min-height: 220px;
    }

    .lab-composer {
        flex-direction: column;
    }
}

[data-bs-theme="dark"] .lab-bubble-bot,
[data-bs-theme="dark"] .lab-pre {
    background: #2d2d3f;
}

[data-bs-theme="dark"] .lab-composer {
    border-top-color: #2d2d3f;
}

[data-bs-theme="dark"] .lab-chip-skip {
    background: #2d2d3f;
    border-color: #3a3a4e;
    color: #b5b5c3;
}

[data-bs-theme="dark"] .lab-chip.active {
    box-shadow: 0 0 0 2px rgba(0, 158, 247, 0.28);
}

.stack-versions-banner {
    border-radius: 0.65rem;
    padding: 1rem 1.15rem;
    border: 1px solid #e4e6ef;
    background: #fff8dd;
    border-left: 5px solid #ffc700;
}
.stack-versions-banner--ok {
    background: #e8fff3;
    border-left-color: #50cd89;
}
.stack-versions-banner--error {
    background: #fff5f8;
    border-left-color: #f1416c;
}
.stack-version-pins {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.stack-version-card {
    border-left: 5px solid #ffc700;
}
.stack-version-card--ok {
    border-left-color: #50cd89;
}
.stack-version-card--error {
    border-left-color: #f1416c;
}
.stack-version-card .card-title {
    font-weight: 650;
}

@media (max-width: 575.98px) {
    .stack-versions-banner {
        padding: 0.9rem 1rem;
    }
    .stack-version-pins {
        font-size: 0.85rem;
        word-break: break-word;
    }
}

[data-bs-theme="dark"] .stack-versions-banner,
[data-bs-theme="dark"] .stack-versions-banner--ok,
[data-bs-theme="dark"] .stack-versions-banner--error {
    background: #1e1e2d;
    border-color: #2d2d3f;
    color: #e4e6ef;
}

.stack-compat-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}
.stack-compat-actions form {
    margin: 0;
}
.stack-compat-actions .btn,
.stack-compat-check-actions .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stack-compat-group {
    border-left: 5px solid #50cd89;
}
.stack-compat-group--warn {
    border-left-color: #ffc700;
}
.stack-compat-group--error {
    border-left-color: #f1416c;
}
.stack-compat-check {
    padding: 0.85rem 0;
    border-top: 1px solid #eff2f5;
}
.stack-compat-check:first-of-type {
    border-top: 0;
    padding-top: 0;
}
.stack-compat-check-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}
.stack-compat-check-actions form {
    margin: 0;
}
.stack-compat-pins {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid #e4e6ef;
    border-radius: 0.65rem;
    background: #fff;
}
.stack-compat-pins summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
}

@media (max-width: 575.98px) {
    .stack-compat-actions,
    .stack-compat-check-actions {
        flex-direction: column;
    }
    .stack-compat-actions .btn,
    .stack-compat-check-actions .btn,
    .stack-compat-actions form,
    .stack-compat-check-actions form {
        width: 100%;
    }
}

[data-bs-theme="dark"] .stack-compat-check {
    border-top-color: #2d2d3f;
}
[data-bs-theme="dark"] .stack-compat-pins {
    background: #1e1e2d;
    border-color: #2d2d3f;
}

.chatflow-shipped-preview {
    max-height: 50vh;
    overflow: auto;
    padding: 0.85rem 1rem;
    border: 1px solid #e4e6ef;
    border-radius: 0.5rem;
    background: #f9f9f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-word;
}
[data-bs-target="#kt_chatflow_shipped_modal"],
#kt_chatflow_shipped_modal .btn,
#kt_chatflow_shipped_modal .form-check-label {
    min-height: 40px;
}
#kt_chatflow_shipped_modal .form-check-label {
    display: inline-flex;
    align-items: center;
}
#kt_chatflow_shipped_modal .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.45rem;
}

@media (max-width: 575.98px) {
    #kt_chatflow_shipped_modal .btn {
        width: 100%;
    }
}

[data-bs-theme="dark"] .chatflow-shipped-preview {
    background: #1e1e2d;
    border-color: #2d2d3f;
    color: #e4e6ef;
}

.flow-trace {
    list-style: none;
    margin: 0;
    padding: 0;
}

.flow-trace-step {
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.flow-trace-rail {
    position: relative;
    flex: 0 0 1.25rem;
    display: flex;
    justify-content: center;
}

.flow-trace-rail::before {
    content: "";
    position: absolute;
    top: 1.35rem;
    bottom: -0.15rem;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: var(--bs-gray-300, #e4e6ef);
}

.flow-trace-step:last-child .flow-trace-rail::before {
    display: none;
}

.flow-trace-dot {
    position: relative;
    z-index: 1;
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.45rem;
    border-radius: 50%;
    border: 2px solid var(--bs-gray-400, #b5b5c3);
    background: #fff;
}

.flow-trace-step.is-taken .flow-trace-dot {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
}

.flow-trace-step.is-stopped .flow-trace-dot {
    border-color: var(--bs-warning);
    background: var(--bs-warning);
}

.flow-trace-step.is-error .flow-trace-dot {
    border-color: var(--bs-danger);
    background: var(--bs-danger);
}

.flow-trace-step.is-skipped .flow-trace-dot,
.flow-trace-step.is-idle .flow-trace-dot {
    border-color: var(--bs-gray-400, #b5b5c3);
    background: var(--bs-gray-200, #eff2f5);
}

.flow-trace-card {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--bs-gray-300, #e4e6ef);
    border-radius: 0.65rem;
    background: var(--bs-body-bg, #fff);
}

.flow-trace-step.is-idle .flow-trace-card,
.flow-trace-step.is-skipped .flow-trace-card {
    opacity: 0.62;
}

.flow-trace-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.7rem;
}

.flow-trace-title {
    font-weight: 600;
    color: var(--bs-gray-900, #181c32);
}

.flow-trace-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bs-gray-200, #eff2f5);
    color: var(--bs-gray-700, #5e6278);
}

.flow-trace-step.is-taken .flow-trace-badge {
    background: rgba(0, 158, 247, 0.12);
    color: var(--bs-primary);
}

.flow-trace-step.is-stopped .flow-trace-badge {
    background: rgba(255, 199, 0, 0.16);
    color: #c59a00;
}

.flow-trace-step.is-error .flow-trace-badge {
    background: rgba(241, 65, 108, 0.12);
    color: var(--bs-danger);
}

.flow-trace-detail {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    word-break: break-word;
    color: var(--bs-gray-600, #7e8299);
}

.flow-mermaid {
    min-width: 0;
    width: 100%;
}

.flow-mermaid svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--bs-gray-600, #7e8299);
}

.flow-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
}

.flow-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    flex: 0 0 0.85rem;
}

.flow-legend-swatch.is-taken {
    background: var(--bs-primary);
}

.flow-legend-swatch.is-idle {
    background: #eff2f5;
    border-color: #e4e6ef;
}

.flow-legend-swatch.is-stopped {
    background: #fff4cc;
    border-color: var(--bs-warning);
}

.flow-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flow-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--bs-gray-300, #e4e6ef);
    font-size: 0.8rem;
}

.flow-chip.is-on {
    border-color: rgba(80, 205, 137, 0.45);
    background: rgba(80, 205, 137, 0.12);
}

.flow-chip.is-off {
    color: var(--bs-gray-600, #7e8299);
}

.flow-page,
.flow-map,
.flow-map-node,
.flow-map-split,
.flow-mermaid,
.flow-trace,
.flow-trace-step,
.flow-trace-card,
.flow-grid,
.flow-form-actions,
.flow-chips {
    box-sizing: border-box;
}

.flow-map {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.55rem 0.4rem;
    min-width: 0;
}

.flow-map-node {
    flex: 1 1 6.5rem;
    min-width: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--bs-gray-300, #e4e6ef);
    border-radius: 0.65rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-gray-600, #7e8299);
    background: var(--bs-gray-100, #f5f8fa);
}

.flow-map-node.is-taken {
    border-color: var(--bs-primary);
    background: rgba(0, 158, 247, 0.12);
    color: var(--bs-gray-900, #181c32);
}

.flow-map-node.is-stopped {
    border-color: var(--bs-warning);
    background: rgba(255, 199, 0, 0.16);
    color: var(--bs-gray-900, #181c32);
}

.flow-map-node.is-skipped,
.flow-map-node.is-idle {
    opacity: 0.45;
}

.flow-map-node.is-error {
    border-color: var(--bs-danger);
    background: rgba(241, 65, 108, 0.12);
}

.flow-map-split {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 0;
}

.flow-map-split .flow-map-node {
    flex: 1 1 8rem;
}

.flow-map-arrow {
    flex: 0 0 1.1rem;
    position: relative;
    min-height: 12px;
}

.flow-map-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 2px solid var(--bs-gray-300, #e4e6ef);
}

.flow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.flow-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flow-field {
    flex: 1 1 10rem;
    min-width: 0;
}

.flow-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.flow-form-actions .btn,
.flow-field .form-select,
#flow-text,
#flow-run {
    min-height: 40px;
}

@media (min-width: 992px) {
    .flow-grid {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.9fr);
        align-items: start;
    }
}

@media (max-width: 767.98px) {
    .flow-map {
        flex-direction: column;
        align-items: stretch;
    }
    .flow-map-node {
        flex: 0 0 auto;
        width: auto;
        align-self: stretch;
    }
    .flow-map-split {
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }
    .flow-map-split .flow-map-node {
        flex: 1 1 0;
        min-height: 40px;
    }
    .flow-map-arrow {
        flex: 0 0 0.85rem;
        width: 100%;
    }
    .flow-map-arrow::after {
        top: 0;
        bottom: 0;
        left: 50%;
        right: auto;
        border-top: 0;
        border-left: 2px solid var(--bs-gray-300, #e4e6ef);
        transform: translateX(-1px);
    }
    .flow-form-actions .btn {
        width: 100%;
    }
}

[data-bs-theme="dark"] .flow-legend-swatch.is-idle {
    background: #2d2d3f;
    border-color: #3f4254;
}

[data-bs-theme="dark"] .flow-legend-swatch.is-stopped {
    background: #3d3410;
}

[data-bs-theme="dark"] .flow-trace-card,
[data-bs-theme="dark"] .flow-map-node,
[data-bs-theme="dark"] .flow-chip {
    border-color: #2d2d3f;
}

[data-bs-theme="dark"] .flow-trace-dot,
[data-bs-theme="dark"] .flow-map-node {
    background: #1e1e2d;
}

[data-bs-theme="dark"] .flow-trace-step.is-taken .flow-trace-dot,
[data-bs-theme="dark"] .flow-trace-step.is-stopped .flow-trace-dot,
[data-bs-theme="dark"] .flow-trace-step.is-error .flow-trace-dot {
    background: currentColor;
}

[data-bs-theme="dark"] .flow-map-arrow::after,
[data-bs-theme="dark"] .flow-trace-rail::before {
    border-color: #2d2d3f;
    background: #2d2d3f;
}
