.app-login-body {
    background: #071426;
}

.app-auth-body {
    align-items: flex-start;
    background: linear-gradient(135deg, #071426 0%, #0f172a 52%, #071426 100%);
    color: #ffffff;
    display: flex;
    font-family: Inter, Arial, Helvetica, sans-serif;
    min-height: 100vh;
}

.app-auth-shell {
    align-content: start;
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
    margin: 0 auto;
    max-width: 1120px;
    min-height: 100vh;
    padding: 22px 34px 34px;
    width: 100%;
}

.app-auth-brand {
    align-self: start;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(7,20,38,.38);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 520px;
    padding: 48px;
}

.app-auth-logo {
    height: auto;
    margin-bottom: 42px;
    width: 132px;
}

.app-auth-logo-link {
    display: inline-flex;
    margin-bottom: 42px;
    width: 132px;
}

.app-auth-logo-link .app-auth-logo {
    margin-bottom: 0;
    width: 100%;
}

.app-auth-kicker {
    color: #38bdf8;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.4px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.app-auth-brand h1 {
    font-size: clamp(38px, 6vw, 68px);
    letter-spacing: -2px;
    line-height: .98;
    margin: 0 0 20px;
    max-width: 700px;
}

.app-auth-brand p {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 29px;
    margin: 0;
    max-width: 620px;
}

.app-auth-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.app-auth-pills span {
    background: rgba(56, 189, 248, .12);
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 999px;
    color: #dff7ff;
    font-size: 12px;
    font-weight: 800;
    padding: 9px 12px;
}

.app-auth-card {
    align-self: start;
    background: #ffffff;
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
    color: #0f172a;
    padding: 34px;
}

.app-auth-card form {
    margin: 0;
}

.app-auth-card-head h2 {
    color: #0f172a;
    font-size: 28px;
    letter-spacing: -1px;
    margin: 0 0 8px;
}

.app-auth-card-head p {
    color: #64748b;
    font-size: 14px;
    line-height: 22px;
    margin: 0 0 24px;
}

.app-auth-card label {
    color: #334155;
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .5px;
    margin: 16px 0 7px;
    text-transform: uppercase;
}

.app-auth-card input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    height: 48px;
    outline: none;
    padding: 0 14px;
    width: 100%;
}

.app-auth-card input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56,189,248,.16);
}

.app-auth-card button {
    background: linear-gradient(135deg, #00f2fe, #38bdf8);
    border: 0;
    border-radius: 10px;
    color: #071426;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    height: 48px;
    margin-top: 22px;
    width: 100%;
}

.app-auth-back {
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    display: flex;
    font-size: 14px;
    font-weight: 900;
    height: 46px;
    justify-content: center;
    margin-top: 12px;
    text-decoration: none;
    width: 100%;
}

.app-auth-back:hover {
    border-color: #38bdf8;
    color: #0284c7;
}

.app-auth-links {
    font-size: 13px;
    font-weight: 800;
    margin-top: 18px;
    text-align: center;
}

.app-auth-links a {
    color: #0284c7;
    text-decoration: none;
}

#menu .logo_menu {
    justify-content: center;
    min-height: 112px;
    padding: 18px 24px;
    position: relative;
}

#menu .logo_menu img {
    height: auto !important;
    max-height: 68px;
    max-width: 180px;
    object-fit: contain;
    width: auto;
}

#menu .menu_content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 0 16px;
}

#menu .menu_content.operator_mode {
    overflow-y: auto;
    justify-content: flex-start;
}

#menu .menu_content.operator_mode .menu_operator_profile,
#menu .menu_content.operator_mode .menu_operator_nav,
#menu .menu_content.operator_mode .app-menu-logout,
#menu .menu_content.operator_mode .by {
    flex-shrink: 0;
}

#menu .menu_content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#menu .menu_operator_profile {
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.10), rgba(255, 255, 255, 0.03));
    border-radius: 16px;
    margin: 0 12px 8px;
    padding: 14px 14px 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

#menu .menu_operator_nav {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    margin: 0 12px 8px;
    padding: 12px 9px 8px;
}

#menu .menu_operator_nav_title {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin: 0 8px 8px;
    text-transform: uppercase;
}

#menu .menu_operator_nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #cbd5e1;
    display: flex;
    margin: 0 0 6px;
    padding: 10px 12px;
    text-decoration: none;
}

#menu .menu_operator_nav a p {
    align-items: center;
    display: flex;
    gap: 12px;
    margin: 0;
    width: 100%;
}

#menu .menu_operator_nav a p i {
    color: #94a3b8;
    font-size: 16px;
}

#menu .menu_operator_nav a p .menu-badge {
    align-items: center;
    background: #ef4444;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    min-width: 20px;
    padding: 3px 6px;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
}

#menu .menu_operator_nav a p .menu-badge.is-hot {
    animation: appMenuHotPulse 1.2s ease-in-out infinite;
}

#menu .menu_operator_nav a:hover,
#menu .menu_operator_nav a.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.24);
    color: #ffffff;
}

#menu .menu_operator_nav a.is-hot {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.38);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), 0 0 0 6px rgba(239, 68, 68, 0.06);
    animation: appMenuHotPulse 1.2s ease-in-out infinite;
}

#menu .menu_operator_nav a:hover p i,
#menu .menu_operator_nav a.active p i {
    color: #38bdf8;
}

#menu .menu_operator_nav a:hover p .menu-badge,
#menu .menu_operator_nav a.active p .menu-badge {
    background: #ffffff;
    color: #ef4444;
}

#menu .menu_operator_nav a.is-hot p .menu-badge {
    animation: appMenuHotPulse 1.2s ease-in-out infinite;
}

#menu .menu_operator_filters {
    margin: 2px 0 4px;
    padding: 0 4px 2px;
}

#menu .menu_operator_filter {
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    color: #cbd5e1;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 0 0 4px;
    padding: 8px 11px;
    text-decoration: none;
}

#menu .menu_operator_filter span:first-child {
    font-size: 13px;
    font-weight: 700;
}

#menu .menu_operator_filter .menu-badge {
    margin-left: auto;
}

#menu .menu_operator_filter:hover,
#menu .menu_operator_filter.active {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(14, 165, 233, 0.32);
    color: #ffffff;
}

#menu .menu_operator_filter:hover .menu-badge,
#menu .menu_operator_filter.active .menu-badge {
    background: #ffffff;
    color: #0f172a;
}

#menu .menu_operator_filter.is-hot {
    position: relative;
}

#menu .menu_operator_filter.is-hot::before {
    background: #ef4444;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
    content: '';
    height: 8px;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 8px;
    animation: appMenuHotPulse 1.2s ease-in-out infinite;
}

@keyframes appMenuHotPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.28); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); transform: scale(1.08); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); transform: scale(1); }
}

.app-function-row.app-new-assignment {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22), 0 0 0 8px rgba(239, 68, 68, 0.10), 0 18px 40px rgba(239, 68, 68, 0.24);
    animation: appNewAssignmentPulse 0.9s ease-in-out 0s 4;
    position: relative;
}

.app-function-row.app-new-assignment::before {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.95), rgba(239, 68, 68, 0.35));
    border-radius: 999px;
    content: '';
    left: -9px;
    position: absolute;
    top: 14px;
    width: 6px;
    bottom: 14px;
}

@keyframes appNewAssignmentPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.012); }
    100% { transform: scale(1); }
}

#menu .menu_operator_profile strong {
    color: #ffffff;
    display: block;
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 3px;
}

#menu .menu_operator_profile span {
    color: #94a3b8;
    display: block;
    font-size: 11px;
    line-height: 1.35;
}

#menu .menu_operator_group {
    margin-top: 4px;
}

#menu .menu_operator_group h4 {
    padding-top: 10px !important;
}

#menu .menu_operator_group a {
    margin: 0 10px 6px;
    border-radius: 12px;
}

#menu .menu_operator_group a p {
    width: 100%;
}

#menu .app-menu-logout {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    color: #e2e8f0;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 12px;
    margin: 2px 12px 8px;
    padding: 11px 13px;
    text-decoration: none;
}

#menu .app-menu-logout i {
    color: #38bdf8;
    font-size: 17px;
}

#menu .app-menu-logout:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #ffffff;
}

.head_container {
    display: none;
}

.app-menu-panel-toggle,
.app-menu-reopen {
    align-items: center;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    color: #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 38px;
    justify-content: center;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
    width: 38px;
}

.app-menu-panel-toggle:hover,
.app-menu-reopen:hover {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(56, 189, 248, 0.34);
    transform: translateY(-1px);
}

#menu .app-menu-panel-toggle {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 3;
}

.app-menu-reopen {
    box-shadow: 0 18px 42px rgba(2, 8, 23, 0.28);
    display: none;
    left: 18px;
    position: fixed;
    top: 18px;
    z-index: 130;
}

.app-menu-backdrop {
    background: rgba(2, 8, 23, 0.48);
    border: 0;
    display: none;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 95;
}

.app-menu-backdrop.is-visible {
    display: block;
}

body.menu-collapsed #menu {
    left: -260px;
}

body.menu-collapsed #container {
    margin-left: 0;
}

body.menu-collapsed .app-menu-reopen {
    display: inline-flex;
}

body.menu-collapsed .head_container {
    left: 0;
}

#menu .by {
    margin-top: auto;
    padding: 0 14px 10px;
}

#container {
    padding-top: 24px;
}

body.app-role-operador #container {
    padding-top: 28px;
}

body.app-role-operador #contenido {
    display: block !important;
    max-width: 980px;
    width: 100% !important;
}

body.app-role-operador.app-sec-conversaciones #contenido {
    max-width: none !important;
    width: 100% !important;
}

body.app-role-operador .title_container_module {
    display: block !important;
    max-width: 100% !important;
    padding-top: 0 !important;
}

body.app-role-operador .sep_title {
    max-width: 100% !important;
}

body.app-role-operador .app-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.15fr);
    max-width: 980px;
    width: 100%;
}

body.app-role-operador .app-card {
    min-width: 0;
}

body.app-role-operador .app-operator-chat-layout {
    align-items: start;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.2fr);
    max-width: 1100px;
    gap: 12px;
}

body.app-role-operador .app-operator-chat-layout .app-conversations-list-card {
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
}

body.app-role-operador .app-operator-chat-layout .app-conversations-list-card .app-list-header {
    margin-bottom: 4px;
}

body.app-role-operador .app-operator-chat-layout .app-toolbar-search {
    flex: 0 0 auto;
    margin-bottom: 10px !important;
}

body.app-role-operador .app-operator-chat-layout .app-conversations-list-card .app-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

body.app-role-operador .app-conversation-widget-head {
    padding: 10px 12px 6px;
}

body.app-role-operador .app-conversation-widget-sub {
    font-size: 10px;
    line-height: 1.15;
}

body.app-role-operador .app-conversation-widget-footer {
    padding: 4px 8px 6px;
}

body.app-role-operador .app-conversation-widget-compose {
    gap: 4px;
}

body.app-role-operador .app-conversation-widget-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

#menu .menu_section_group h4 {
    margin: 0;
}

#menu .menu_section_group a {
    text-decoration: none;
}

.app-login-links {
    font-size: 13px;
    margin: 12px 0;
    text-align: center;
}

.app-login-links a {
    color: #00a9dc;
    text-decoration: none;
}

.app-alert,
.app-panel-message {
    border-radius: 8px;
    font-size: 13px;
    line-height: 20px;
    margin: 12px 0;
    padding: 10px 12px;
}

.app-alert.ok,
.app-panel-message.ok {
    background: #ecfdf5;
    color: #047857;
}

.app-alert.error,
.app-panel-message.error {
    background: #fef2f2;
    color: #b91c1c;
}

.app-client-name {
    color: #334155;
    font-weight: 700;
    justify-content: center;
}

.app-logout {
    align-items: center;
    color: #0f172a;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    text-decoration: none;
}

#contenido {
    align-items: start !important;
    display: block;
    width: 100%;
}

.app-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
}

.app-conversations-toolbar {
    grid-column: 1 / -1;
    width: 100%;
}

.app-conversations-bottom {
    grid-column: 1 / -1;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
    margin-top: 18px;
    width: 100%;
}

.app-conversations-list-card,
.app-conversations-detail-card,
.app-conversations-widget-card {
    min-width: 0;
}

.app-conversations-list-card,
.app-conversations-detail-card,
.app-conversations-widget-card {
    max-height: calc(100vh - 280px);
    overflow: auto;
}

.app-conversations-list-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    overflow: hidden;
}

.app-conversations-list-card .app-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

body.app-role-operador.app-sec-conversaciones .app-conversations-toolbar,
body.app-role-operador.app-sec-conversaciones .app-conversations-bottom,
body.app-role-cliente.app-sec-conversaciones .app-conversations-toolbar,
body.app-role-cliente.app-sec-conversaciones .app-conversations-bottom {
    max-width: none !important;
    width: 100% !important;
}

body.app-role-operador.app-sec-conversaciones .app-conversations-list-card,
body.app-role-cliente.app-sec-conversaciones .app-conversations-list-card {
    max-height: calc(100vh - 250px);
}

body.app-role-operador.app-sec-conversaciones .app-conversations-detail-card,
body.app-role-cliente.app-sec-conversaciones .app-conversations-detail-card {
    max-height: calc(100vh - 250px);
}

body.app-role-operador.app-sec-conversaciones .app-conversations-detail-card,
body.app-role-cliente.app-sec-conversaciones .app-conversations-detail-card,
.app-conversations-detail-card {
    display: none !important;
}

.app-conversations-widget-card {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: min(408px, calc(100vw - 24px));
    height: min(900px, calc(100vh - 24px));
    max-height: min(900px, calc(100vh - 24px));
    display: none;
    overflow: hidden;
    padding: 0;
    z-index: 2200;
    box-shadow: 0 24px 70px rgba(10, 22, 45, 0.28);
}

.app-conversations-widget-card.is-open {
    display: flex;
}

.app-conversations-widget-card .app-conversation-widget {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.app-conversation-widget-head {
    align-items: flex-start;
    background: #0a6b4f;
    color: #ffffff;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px 8px;
}

.app-conversation-widget-head-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    width: 100%;
}

.app-conversation-widget-title-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.app-conversation-widget-title-row .app-status {
    background: #fff6e8;
    color: #a44e00;
    flex-shrink: 0;
}

.app-conversation-widget-title-row .app-conversation-widget-close {
    margin-left: auto;
}

.app-conversation-widget-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.app-conversation-widget-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    font-size: 11px;
    line-height: 1.35;
    opacity: 0.88;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.app-conversation-widget-sub span {
    white-space: nowrap;
}

.app-conversation-widget-emoji-menu[hidden] {
    display: none !important;
}

.app-conversation-widget-brand {
    font-size: 11px;
    opacity: 0.8;
}

.app-conversation-widget-close {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #ffffff;
    display: inline-flex;
    font-size: 22px;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    text-decoration: none;
    width: 38px;
}

.app-conversation-widget-body {
    background: #f6f8fb;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 6px 10px 4px;
}

.app-conversation-widget-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
}

.app-conversation-widget-line {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    max-width: 86%;
    padding: 10px 12px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.app-conversation-widget-line.user {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.app-conversation-widget-line.assistant {
    align-self: flex-end;
    background: #dff7ed;
    border-color: #c4eadb;
    border-bottom-right-radius: 4px;
}

.app-conversation-widget-line-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.app-conversation-widget-line-head strong {
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.app-conversation-widget-line-head span {
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
}

.app-conversation-widget-line-text {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.app-conversation-widget-attachment {
    margin-top: 8px;
}

.app-conversation-widget-attachment-card {
    align-items: center;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #d9e2ee;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
}

.app-conversation-widget-attachment-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
}

.app-conversation-widget-attachment-icon {
    align-items: center;
    background: #e0f2fe;
    border-radius: 12px;
    display: inline-flex;
    font-size: 20px;
    height: 42px;
    justify-content: center;
    min-width: 42px;
}

.app-conversation-widget-attachment-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-conversation-widget-attachment-copy strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-conversation-widget-attachment-copy span {
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.app-conversation-widget-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: grid;
    gap: 4px;
    padding: 6px 10px 8px;
}

.app-conversation-widget-compose {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.app-conversation-widget-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 0;
    flex-shrink: 0;
}

.app-conversation-widget-emoji-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.app-conversation-widget-attach-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 4px;
    padding: 2px;
}

.app-conversation-widget-icon {
    align-items: center;
    background: #0a6b4f;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(10, 107, 79, 0.18);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    height: 32px;
    justify-content: center;
    min-width: 32px;
    padding: 0;
    width: 36px;
}

.app-conversation-widget-attach {
    background: #0f172a;
    color: #ffffff;
    overflow: visible;
    position: relative;
}

.app-conversation-widget-attach i {
    color: #ffffff;
    display: block;
    font-size: 18px;
    line-height: 1;
}

.app-conversation-widget-attach.has-file {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18), 0 10px 20px rgba(15, 23, 42, 0.18);
}

.app-conversation-widget-attach-badge {
    align-items: center;
    background: #dc2626;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 800;
    height: 18px;
    justify-content: center;
    left: -6px;
    min-width: 17px;
    padding: 0 3px;
    position: absolute;
    top: -6px;
    z-index: 2;
}

.app-conversation-widget-attach-badge[hidden] {
    display: none !important;
}

.app-conversation-widget-attach-clear {
    align-items: center;
    background: #111827;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 18px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: -8px;
    top: -8px;
    width: 18px;
    z-index: 3;
}

.app-conversation-widget-attach-clear[hidden] {
    display: none !important;
}

.app-conversation-widget-emoji-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(217, 226, 238, 0.9);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(10, 22, 45, 0.18);
    z-index: 6;
    width: 206px;
    backdrop-filter: blur(10px);
}

.app-conversation-widget-emoji-menu button {
    border: 0;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 38px;
    padding: 0;
    cursor: pointer;
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.app-conversation-widget-file-input {
    display: none;
}

.app-conversation-widget-compose input[type="text"] {
    border: 1px solid #ccd6e3;
    border-radius: 12px;
    flex: 1 1 0;
    font-size: 14px;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
}

.app-conversation-widget-compose button {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    justify-content: center;
    min-height: 38px;
    min-width: 44px;
    padding: 0 10px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.14);
}

.app-conversation-widget-attach-wrap .app-conversation-widget-attach-clear {
    border-radius: 999px;
    box-shadow: none;
    flex: 0 0 18px;
    min-height: 18px;
    min-width: 18px;
    padding: 0;
}

.app-conversation-widget-footnote {
    color: #64748b;
    font-size: 11px;
    text-align: right;
}

.app-conversation-widget-readonly,
.app-conversation-widget-empty-state {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.app-conversation-widget-empty .app-conversation-widget-body {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 280px;
    text-align: center;
}

.app-toolbar-top,
.app-list-header,
.app-detail-title-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.app-toolbar-search {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
    flex: 1 1 420px;
}

.app-toolbar-search input[type="search"] {
    min-width: min(100%, 280px);
    flex: 1;
}

.app-toolbar-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 16px;
}

.app-toolbar-filters {
    align-items: center;
    display: flex;
    flex: 1 1 360px;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: flex-end;
}

.app-state-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.app-state-tab {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 11px;
    text-decoration: none;
}

.app-state-tab.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.app-table-wrap {
    overflow-x: auto;
}

.app-table {
    border-collapse: collapse;
    width: 100%;
}

.app-table thead th {
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 12px 10px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table tbody td {
    border-bottom: 1px solid #eef2f7;
    padding: 14px 10px;
    vertical-align: top;
}

.app-table tbody tr.is-selected {
    background: #f8fbff;
}

.app-entity-stack {
    display: grid;
    gap: 4px;
}

.app-entity-stack strong {
    color: #0f172a;
    font-size: 14px;
}

.app-entity-stack span {
    color: #475569;
    font-size: 13px;
    line-height: 18px;
}

.app-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    position: relative;
}

.app-inline-form {
    display: inline-flex;
}

.app-row-actions .app-button,
.app-row-action-cancel {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
    border-radius: 8px;
    white-space: nowrap;
}

.app-row-action-trigger {
    border: 0;
}

.app-row-action-panel {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    display: none;
    gap: 8px;
    margin-top: 0;
    min-width: 220px;
    padding: 10px;
}

.app-row-action-panel-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.app-row-action-panel-head strong {
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
}

.app-row-actions[data-mode] > :not(.app-row-action-panel) {
    display: none !important;
}

.app-row-actions[data-mode] .app-row-action-panel {
    display: grid;
}

.app-row-action-form {
    display: grid;
    gap: 8px;
}

.app-row-action-form select,
.app-row-action-form textarea {
    width: 100%;
}

.app-inline-action {
    position: relative;
    display: inline-flex;
}

.app-inline-action > summary {
    list-style: none;
}

.app-inline-action > summary::-webkit-details-marker {
    display: none;
}

.app-inline-action[open] > summary {
    margin-bottom: 10px;
}

.app-inline-action-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: 190px;
    padding: 10px;
}

.app-inline-action-panel select,
.app-inline-action-panel textarea {
    width: 100%;
}

.app-card input[type="text"],
.app-card input[type="search"],
.app-card input[type="email"],
.app-card input[type="tel"],
.app-card input[type="url"],
.app-card input[type="password"],
.app-card select,
.app-card textarea {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    line-height: 20px;
    padding: 11px 14px;
}

.app-card input[type="text"]:focus,
.app-card input[type="search"]:focus,
.app-card input[type="email"]:focus,
.app-card input[type="tel"]:focus,
.app-card input[type="url"]:focus,
.app-card input[type="password"]:focus,
.app-card select:focus,
.app-card textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
    outline: none;
}

.app-conversations-toolbar .app-button,
.app-conversations-list-card .app-button,
.app-conversations-detail-card .app-button,
.app-inline-action-panel .app-button {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 13px;
}

.app-conversation-table .app-row-actions .app-button,
.app-conversation-table .app-row-actions summary.app-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 30px;
    min-width: 0;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    border-radius: 8px;
    text-align: center;
    width: fit-content;
}

.app-conversation-table .app-row-actions .app-inline-action-panel {
    min-width: 190px;
    padding: 10px;
}

.app-conversation-table .app-row-actions .app-inline-action-panel .app-button {
    min-height: 30px;
    padding: 5px 8px;
    font-weight: 600;
}

.app-conversation-table .app-row-actions .app-button {
    white-space: nowrap;
}

.app-conversations-toolbar .app-button.secondary,
.app-conversations-list-card .app-button.secondary,
.app-conversations-detail-card .app-button.secondary {
    padding-inline: 14px;
}

.app-conversations-toolbar .app-status {
    align-self: flex-start;
    flex-shrink: 0;
}

.app-conversations-list-card .app-table-wrap {
    max-height: calc(100vh - 420px);
    overflow: auto;
}

.app-toolbar-search .app-button {
    min-height: 40px;
}

.app-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 18px;
}

.app-conversations-detail-card .app-chat-thread {
    max-height: 32vh;
    overflow: auto;
    padding-right: 4px;
}

.app-conversations-detail-card .app-form {
    margin-top: 14px;
}

.app-pagination-info {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.app-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.app-list-meta .app-status {
    white-space: nowrap;
}

.app-detail-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 14px 16px;
}

.app-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
}

.app-card h3 {
    color: #0f172a;
    font-size: 18px;
    margin: 0 0 14px;
}

.app-function-brief {
    align-items: flex-start;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 16px;
}

.app-function-brief-copy {
    flex: 1;
    min-width: 0;
}

.app-function-brief-copy strong {
    color: #0f172a;
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.app-function-brief-copy p {
    color: #475569;
    font-size: 13px;
    line-height: 20px;
    margin: 0;
}

.app-business-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(420px, .9fr);
    gap: 10px;
    align-items: stretch;
    margin-bottom: 8px;
}

.app-business-main-form,
.app-business-ui-form {
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin: 0;
    min-width: 0;
    padding: 10px 12px 8px;
}

.app-business-bot-name {
    min-width: 0;
}

.app-business-topbar-item {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.app-business-topbar-item label {
    color: #334155;
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .5px;
    margin: 0;
    text-transform: uppercase;
}

.app-business-ui-form {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.app-business-color-block {
    justify-content: start;
}

.app-business-switch-block {
    align-items: center;
    column-gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.app-business-switch-copy {
    display: grid;
    gap: 4px;
}

.app-business-switch-copy span {
    color: #64748b;
    font-size: 10px;
    line-height: 14px;
}

.app-color-picker {
    width: 78px;
    height: 32px;
    padding: 2px !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.js-chat-ui-feedback {
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    grid-column: 1 / -1;
    min-height: 16px;
}


/* 1. Contenedor principal corregido */
.app-switch {
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    position: relative;
    padding-right: 70px; /* Espacio para que el texto a la derecha no se pise */
    background-color:#fff; width: 150px;
    border: 1px solid #797979;
    padding: 10px;
    border-radius: 20px;
}

/* 2. Ocultar el input sin romper los selectores */
.app-switch input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 0; /* Corregido de '100' a '0' */
    height: 0;
    margin: 0;
    pointer-events: none;
    
}

/* 3. El slider base CON FONDO INICIAL (Gris claro) y contorno */
.app-switch-slider {
    width: 52px;
    height: 28px;
    border-radius: 999px;  
    background: #e2e8f0; /* ¡Añadido! Evita que el fondo transparente oculte el borde */
    border: 1px solid #fff; /* Tu contorno gris */
    position: relative;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

/* La bola blanca del switch */
.app-switch-slider::after {
    content: "";
    position: absolute;
    top: 0px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7B7B7B;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    transition: transform .18s ease;
}

/* 4. Estilos cuando está CHECKED (Activo) */
.app-switch input:checked + .app-switch-slider {
    background: #16a34a; /* Fondo verde */
    border-color: #16a34a; /* Borde verde */
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.app-switch input:checked + .app-switch-slider::after {
    transform: translateX(24px); /* Ajustado a 24px para que encaje mejor al final */
}

/* 5. El texto del estado UNIFICADO (Sin grids residuales) */
.app-switch-state {
    position: absolute;
    top: 50%;
    left: 64px; /* Se posiciona 12px a la derecha del switch */
    transform: translateY(-50%); /* Centrado vertical perfecto */
    
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .3px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .18s ease;
}

/* Color del texto cuando cambia a activo */
.app-switch input:checked ~ .app-switch-state {
    color: #166534;
}

.app-switch-inline {
    align-items: center;
    display: inline-flex;
    min-height: 52px;
    width: 180px;
}

.app-check-chip {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    gap: 12px;
    max-width: 340px;
    padding: 12px 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-check-chip-box {
    align-items: center;
    background: #eef2f7;
    border-radius: 12px;
    color: transparent;
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 18px;
    height: 34px;
    justify-content: center;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    width: 34px;
}

.app-check-chip-text {
    display: grid;
    gap: 3px;
}

.app-check-chip-text strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.1;
}

.app-check-chip-text small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.app-check-chip:hover {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.10);
}

.app-check-chip input:checked + .app-check-chip-box,
.app-check-chip.is-checked .app-check-chip-box {
    background: #dcfce7;
    color: #15803d;
    transform: scale(1.02);
}

.app-check-chip input:checked ~ .app-check-chip-text strong,
.app-check-chip.is-checked .app-check-chip-text strong {
    color: #166534;
}


.app-operator-picker {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 10px;
    background: #f8fafc;
}

.app-operator-picker-list {
    display: grid;
    gap: 8px;
}

.app-operator-picker-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-operator-picker-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-operator-picker-option span {
    display: block;
}

.app-operator-picker-label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 20px;
    text-transform: uppercase;
}

.app-operator-picker-box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid #bfd3ea;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    position: relative;
}

.app-operator-picker-box::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 4px;
    background: transparent;
    transition: background .18s ease;
}

.app-operator-picker-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.app-operator-picker-option input:checked + .app-operator-picker-box {
    border-color: #0ea5e9;
    background: #0ea5e9;
}

.app-operator-picker-option input:checked + .app-operator-picker-box::after {
    background: #ffffff;
}

.app-operator-picker-option input:checked ~ .app-operator-picker-label {
    color: #0f172a;
}

.app-operator-picker-all {
    background: #eff6ff;
    border-color: #bfdbfe;
}

@media (max-width: 1040px) {
    .app-business-topbar {
        grid-template-columns: 1fr;
    }

    .app-business-ui-form {
        grid-template-columns: 1fr;
    }

    .app-business-switch-block {
        grid-template-columns: 1fr;
    }
}

.app-type-help {
    background: #f8fafc;
    border-left: 4px solid #38bdf8;
    border-radius: 8px;
    margin: 6px 0 14px;
    padding: 12px 12px 12px 14px;
}

.app-type-help strong {
    color: #0f172a;
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.app-type-help p {
    color: #475569;
    font-size: 13px;
    line-height: 20px;
    margin: 0;
}

.app-type-example {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    margin: 0 0 14px;
    padding: 12px 14px;
}

.app-type-example strong {
    color: #0f172a;
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.app-type-example p {
    color: #334155;
    font-size: 13px;
    line-height: 20px;
    margin: 0;
}

.app-form-note {
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
    margin: -6px 0 14px;
}

.app-icon-trigger {
    align-items: center;
    background: #0f172a !important;
    border: 0 !important;
    color: #ffffff !important;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    padding: 0 !important;
    width: 40px;
}

.app-icon-trigger:hover {
    filter: brightness(1.05);
}

.app-emoji-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 8px;
    z-index: 20;
}

.app-emoji-popover .app-emoji {
    align-items: center;
    background: #f8fafc;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    font-size: 16px;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.app-attach-visual {
    align-items: center;
    display: flex;
    gap: 10px;
    min-height: 40px;
}

.app-attach-name {
    color: #64748b;
    font-size: 12px;
    line-height: 16px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-type-panel {
    align-content: start;
}

.app-type-panel.is-hidden {
    display: none;
}

#contenido > .app-creditos-layout,
#contenido > .app-creditos-secondary {
    grid-column: span 2 !important;
    width: 100%;
}

.app-creditos-page {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
}

.app-creditos-dashboard {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 0.9fr) minmax(360px, 1.45fr);
    width: 100%;
}

.app-creditos-balance,
.app-creditos-summary,
.app-creditos-topup {
    min-height: 220px;
}

.app-creditos-summary {
    display: flex;
    flex-direction: column;
}

.app-creditos-topup .app-actions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-creditos-topup .app-button {
    justify-content: center;
    text-align: center;
}

.app-subscriptions-shell {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.55fr);
}

.app-subscriptions-sidebar {
    display: grid;
    gap: 18px;
}

.app-subscriptions-state-card {
    min-height: 398px;
}

.app-subscriptions-plans {
    align-self: stretch;
}

.app-subscriptions-plan-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.app-subscriptions-plan-card {
    display: flex;
    flex-direction: column;
    min-height: 430px;
}

.app-subscriptions-sidebar .app-muted a,
.app-creditos-invoices a {
    color: #0b5ed7;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-creditos-history #tblresp,
.app-creditos-invoices #tblresp {
    margin-bottom: 0 !important;
    max-height: 520px !important;
}

.app-creditos-history {
    clear: both;
    display: block;
    min-height: 520px;
    width: 100%;
    grid-column: 1 / -1;
    margin-top: 0 !important;
}

.app-creditos-history #table_resultados th,
.app-creditos-history #table_resultados td {
    white-space: nowrap;
}

.app-creditos-history #table_resultados td:last-child,
.app-creditos-history #table_resultados th:last-child {
    white-space: normal;
}

.app-conversations-toolbar-compact {
    padding: 16px 18px 12px;
}

.app-conversations-toolbar-compact .app-toolbar-top {
    margin-bottom: 6px;
}

.app-conversations-toolbar-compact .app-toolbar-controls {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
    align-items: center;
}

.app-conversations-toolbar-compact .app-toolbar-search {
    margin: 0 !important;
}

.app-conversations-toolbar-compact .app-toolbar-search input[type="search"] {
    height: 42px;
    margin-bottom: 0;
    padding: 9px 14px;
}

.app-conversations-toolbar-compact .app-toolbar-search .app-button {
    min-height: 42px;
    padding: 9px 14px;
}

.app-conversations-toolbar-compact .app-toolbar-filters {
    align-items: center;
    display: flex;
    gap: 8px 12px;
    justify-content: space-between;
    min-width: 0;
}

.app-conversations-toolbar-compact .app-state-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.app-conversations-list-card-tall {
    height: calc(100vh - 205px);
    max-height: calc(100vh - 205px);
}

.app-conversations-list-card-tall .app-table-wrap {
    max-height: none;
}

.app-conversations-toolbar-compact .app-state-tab {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    min-height: 36px;
    padding: 7px 12px;
}

body.app-role-cliente #menu .menu_section_group h4 {
    border: 0 !important;
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.app-form label {
    color: #475569;
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.app-form input,
.app-form textarea,
.app-form select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    margin: 0 0 14px;
    padding: 11px 12px;
    width: 100%;
}

.app-form textarea {
    min-height: 140px;
    resize: vertical;
}

.app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.app-button {
    background: #00a9dc;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    min-height: 40px;
    padding: 11px 16px;
    text-decoration: none;
}

.app-button.secondary {
    background: #0f172a;
}

.app-chat-filters .app-button.secondary.active {
    background: #0ea5e9;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
    color: #ffffff;
}

.app-button.danger {
    background: #dc2626;
}

.app-kpi {
    color: #0f172a;
    font-size: 30px;
    font-weight: 800;
}

.app-muted {
    color: #64748b;
    font-size: 13px;
}

.app-chat-line {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0; color: #555555;
    word-break: break-word; /* Para navegadores antiguos */
    overflow-wrap: break-word; /* Estándar moderno */
}

.app-chat-line.user strong {
    color: #0f766e;
}

.app-chat-line.assistant strong {
    color: #2563eb;
}

.app-chat-line a,
.app-conversation-widget-line a {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.app-chat-line.assistant a,
.app-conversation-widget-line.assistant a {
    color: #0b5ed7;
}

.app-operator-chat-layout {
    display: block;
}

body.app-role-operador #contenido,
body.app-role-operador .app-operator-chat-layout {
    max-width: 1280px;
}

.app-operator-list-card {
    margin-bottom: 18px;
}

.app-operator-thread {
    background: #eef3f8;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: min(58vh, 620px);
    min-height: 360px;
    overflow: auto;
    padding: 14px;
}

.app-operator-thread .app-chat-line {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom: 0;
    border-radius: 14px;
    color: #0f172a;
    max-width: 82%;
    padding: 10px 12px;
}

.app-operator-thread .app-chat-line.user {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.app-operator-thread .app-chat-line.assistant {
    align-self: flex-end;
    background: #dff7ed;
    border-color: #c4eadb;
    border-bottom-right-radius: 4px;
}

.app-operator-reply-form {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
    margin-top: 12px;
}

.app-operator-reply-form textarea {
    margin: 0;
    min-height: 48px;
    max-height: 120px;
    resize: vertical;
}

.app-operator-reply-form .app-button {
    min-height: 48px;
}

.app-operator-reply-form .app-operator-reply-feedback {
    grid-column: 1 / -1;
    margin: 0;
}

.app-operator-chat-layout .app-attachment-form {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr auto;
    margin-top: 10px;
}

.app-operator-chat-layout .app-attachment-form label {
    display: none;
}

.app-operator-chat-layout .app-attachment-form input {
    margin: 0;
}

.app-operator-chat-layout .app-attachment-form .app-button {
    min-height: 40px;
}

.app-operator-chat-layout .app-attachment-form .app-form-note {
    grid-column: 1 / -1;
    margin: 0;
}

.app-operator-reply-form .app-actions {
    overflow: visible;
    position: relative;
    justify-content: space-between !important;
}

.app-operator-reply-form .js-emoji-trigger {
    position: relative;
}

.app-operator-reply-form .js-emoji-popover {
    left: auto;
    right: 0;
    z-index: 40;
}

.app-operator-chat-layout .js-file-trigger {
    color: transparent !important;
    position: relative;
}

.app-operator-chat-layout .js-file-trigger::before {
    background: center/18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-8.49 8.49a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.5 3.5 0 1 1 4.95 4.95l-8.49 8.49a1.5 1.5 0 0 1-2.12-2.12l7.78-7.78'/%3E%3C/svg%3E");
    content: '';
    display: block;
    height: 18px;
    inset: 0;
    margin: auto;
    position: absolute;
    width: 18px;
}

.app-operator-reply-form .js-emoji-trigger {
    color: transparent !important;
    position: relative;
}

.app-operator-reply-form .js-emoji-trigger::before {
    background: center/18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='9' cy='10' r='1' fill='%23ffffff' stroke='none'/%3E%3Ccircle cx='15' cy='10' r='1' fill='%23ffffff' stroke='none'/%3E%3Cpath d='M8.5 14.5c1 .9 2.3 1.4 3.5 1.4s2.5-.5 3.5-1.4'/%3E%3C/svg%3E");
    content: '';
    display: block;
    height: 18px;
    inset: 0;
    margin: auto;
    position: absolute;
    width: 18px;
}

.app-wizard-step {
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    gap: 14px;
    grid-template-columns: 34px 1fr;
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.app-step-number {
    align-items: center;
    background: #0f172a;
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.app-function-row {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 0;
}

.app-function-row:last-child {
    border-bottom: 0;
}

.app-conversation-closed {
    background: #f8fafc;
    border-color: #dbe4ee;
    opacity: 0.95;
}

.app-function-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.app-function-head strong { color: #555555;}
.app-function-row p { color: #555555;}

.app-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
    text-transform: uppercase;
}

.app-status.pendiente {
    background: #fffbeb;
    color: #92400e;
}

.app-status.sin-asignar {
    background: #eef2ff;
    color: #4338ca;
}

.app-status.aprobada {
    background: #ecfdf5;
    color: #047857;
}

.app-status.denegada,
.app-status.inactiva {
    background: #fef2f2;
    color: #b91c1c;
}

.app-module-panel .app-form {
    margin-top: 0;
}

.app-motivo-inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.app-motivo-inline-form input[type="text"] {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1024px) {
    .app-auth-shell {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .app-auth-brand {
        min-height: auto;
        padding: 30px;
    }

    .app-auth-logo {
        margin-bottom: 28px;
        width: 112px;
    }

    .app-auth-logo-link {
        margin-bottom: 28px;
        width: 112px;
    }

    .app-auth-card {
        padding: 26px;
    }

    .head_container {
        background: transparent;
        border-bottom: 0;
        display: flex;
        height: 58px;
        justify-content: flex-start;
        pointer-events: none;
    }

    .head_container .container_head_center,
    .head_container .container_head_right,
    .head_container .container_head_left .title {
        display: none;
    }

    .head_container .container_head_left,
    .head_container .menu-toggle {
        pointer-events: auto;
    }

    .app-menu-reopen {
        display: none !important;
    }

    #container {
        padding-top: 74px;
    }

    body.app-role-operador #container {
        padding-top: 28px;
    }

    body.app-role-operador #contenido {
        max-width: none;
    }

    body.app-role-operador .app-grid {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
        max-width: none;
    }

    body.app-role-operador .app-operator-chat-layout {
        grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.15fr);
    }

    .app-client-name {
        display: none;
    }

    .app-creditos-dashboard,
    .app-subscriptions-shell {
        grid-template-columns: 1fr;
    }

    .app-creditos-topup .app-actions,
    .app-conversations-toolbar-compact .app-toolbar-controls {
        grid-template-columns: 1fr;
    }

    .app-conversations-toolbar-compact .app-toolbar-filters {
        justify-content: flex-start;
    }

    .app-function-brief {
        flex-direction: column;
    }

    #menu {
        width: 300px;
        left: -300px;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.42);
        z-index: 120;
    }

    #menu.active {
        left: 0;
    }

    #container.menu-open {
        transform: none;
    }

    .head_container.menu-open {
        transform: none;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    .app-auth-body {
        display: block;
    }

    .app-auth-shell {
        gap: 14px;
        padding: 14px;
    }

    .app-auth-brand {
        border-radius: 14px;
        padding: 22px;
    }

    .app-auth-brand h1 {
        font-size: 34px;
        letter-spacing: -1px;
    }

    .app-auth-brand p {
        font-size: 15px;
        line-height: 24px;
    }

    .app-function-brief {
        padding: 14px;
    }

    .app-auth-card {
        border-radius: 14px;
        padding: 22px;
    }

    #menu {
        width: 86vw;
        max-width: 300px;
        left: -86vw;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.42);
    }

    body.app-role-operador #container {
        padding-top: 72px;
    }

    body.app-role-operador .app-grid {
        grid-template-columns: 1fr;
    }

    body.app-role-operador .app-operator-chat-layout {
        grid-template-columns: 1fr;
    }

    #menu.active {
        left: 0;
    }

    #container.menu-open,
    .head_container.menu-open {
        transform: none;
    }

    #menu .logo_menu {
        min-height: 80px;
        padding: 12px 16px;
    }

    #menu .logo_menu img {
        max-height: 46px;
        max-width: 132px;
    }

    #menu .menu_operator_profile,
    #menu .menu_section_group {
        margin-left: 10px;
        margin-right: 10px;
    }

    #menu .menu_content.operator_mode {
        overflow-y: auto;
    }

    #menu .menu_operator_profile {
        margin-bottom: 8px;
        padding: 12px 12px 10px;
    }

    #menu .menu_operator_nav,
    #menu .app-menu-logout {
        margin-left: 10px;
        margin-right: 10px;
    }

    #menu .menu_section_group h4 {
        padding: 10px 14px !important;
    }

    #menu .menu_section_group a {
        padding: 9px 16px;
    }
}
