@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

:root {
    --color-bg: #07111f;
    --color-panel: rgba(10, 20, 35, 0.9);
    --color-panel-strong: #0d1b30;
    --color-border: rgba(148, 163, 184, 0.14);
    --color-text: #e2e8f0;
    --color-muted: #8aa0ba;
    --color-primary: #0ea5e9;
    --color-secondary: #14b8a6;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-success: #10b981;
    --shadow-soft: 0 20px 50px rgba(2, 6, 23, 0.35);
    --radius-xl: 24px;
    --radius-lg: 18px;
}

html[data-theme="light"] {
    --color-bg: #f0f4f8;
    --color-panel: #ffffff;
    --color-panel-strong: #ffffff;
    --color-border: rgba(15, 23, 42, 0.12);
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-primary: #0284c7;
    --color-secondary: #0d9488;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-success: #059669;
    --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.09);
}

html[data-theme="light"] .shell {
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.06), transparent 24%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.05), transparent 28%),
        var(--color-bg);
}

html[data-theme="light"] .shell__sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right-color: rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] .shell__status {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .global-message-notice {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.22);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .panel-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .panel-card__tag {
    background: rgba(2, 132, 199, 0.10);
    color: #0284c7;
}

html[data-theme="light"] .menu__link {
    color: #334155;
}

html[data-theme="light"] .menu__link:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

html[data-theme="light"] .menu__link.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(13, 148, 136, 0.10));
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.20);
}

html[data-theme="light"] .sidebar-toggle {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.14);
    color: #475569;
}

html[data-theme="light"] .sidebar-toggle:hover {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
    border-color: rgba(2, 132, 199, 0.25);
}

html[data-theme="light"] .filters-summary {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] .filters-summary__text {
    color: #334155;
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .btn--ghost {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .btn--ghost:hover {
    background: rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] .data-table th,
html[data-theme="light"] .data-table td {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .ia-query-box__input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

html[data-theme="light"] .ia-query-box__input:focus {
    outline: 2px solid rgba(2, 132, 199, 0.3);
    border-color: rgba(2, 132, 199, 0.5);
}

html[data-theme="light"] .ia-launcher-options {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .ia-inline-message--info {
    background: rgba(2, 132, 199, 0.08);
    color: #0369a1;
    border-color: rgba(2, 132, 199, 0.2);
}

html[data-theme="light"] .ia-inline-message--safe {
    background: rgba(13, 148, 136, 0.08);
    color: #0f766e;
    border-color: rgba(13, 148, 136, 0.2);
}

html[data-theme="light"] .ia-inline-message--error,
html[data-theme="light"] .ia-report--error .ia-inline-message {
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.2);
}

html[data-theme="light"] .help-search {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .help-search__input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

html[data-theme="light"] .help-search__input::placeholder {
    color: #94a3b8;
}

html[data-theme="light"] .help-search__input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
    background: #ffffff;
}

html[data-theme="light"] .kpi-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
}

html[data-theme="light"] .kpi-card--highlight {
    background: linear-gradient(135deg, #f0fdfa, #ffffff);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.1);
}

html[data-theme="light"] .kpi-card__icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(20, 184, 166, 0.15));
    color: #0284c7;
}

html[data-theme="light"] .kpi-card__icon--highlight {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(56, 189, 248, 0.18));
    color: #0d9488;
}

html[data-theme="light"] .kpi-card--highlight .kpi-card__label {
    color: #0d9488;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Manrope', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .58) rgba(15, 23, 42, .36);
    transition: background-color 0.3s ease, color 0.2s ease;
}

* {
    box-sizing: border-box;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .58) rgba(15, 23, 42, .36);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 23, 42, .36);
}

::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid rgba(15, 23, 42, .36);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(34, 211, 238, .88), rgba(14, 165, 233, .72));
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(103, 232, 249, .95), rgba(14, 165, 233, .88));
}

html[data-theme="light"],
html[data-theme="light"] * {
    scrollbar-color: rgba(2, 132, 199, .62) rgba(226, 232, 240, .78);
}

html[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, .78);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
    border-color: rgba(226, 232, 240, .78);
    background: linear-gradient(180deg, rgba(14, 165, 233, .86), rgba(2, 132, 199, .76));
}

a,
.btn-link {
    color: inherit;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

button,
input,
select {
    font: inherit;
}

.page-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-intro__title {
    margin: 0;
    font-size: clamp(1.3rem, 1.7vw, 1.75rem);
    font-weight: 800;
}

.page-intro__text {
    margin: 0.45rem 0 0;
    max-width: 62ch;
    color: var(--color-muted);
    font-size: 0.98rem;
    line-height: 1.45;
}

.page-grid {
    display: grid;
    gap: 1.25rem;
}

.kpi-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chart-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1.6fr 1fr 1fr;
}

.panel-card {
    background: linear-gradient(180deg, rgba(13, 27, 48, 0.96), rgba(9, 19, 33, 0.95));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
}

.panel-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-card__title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
}

.panel-card__subtitle {
    margin: 0.3rem 0 0;
    color: var(--color-muted);
    font-size: 0.84rem;
}

.panel-card__tag {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #bfe9fb;
    font-size: 0.8rem;
    font-weight: 600;
}

.filters-card {
    display: grid;
    gap: 1rem;
}

.filters-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Calendario */
.calendario-page {
    --calendar-border: rgba(148, 163, 184, .16);
    --calendar-panel: rgba(15, 23, 42, .44);
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: .7rem;
    min-height: calc(100vh - 2.2rem);
    padding: .8rem 1rem 1rem;
    overflow: hidden;
}

.calendario-topbar,
.calendario-toolbar,
.calendario-shell,
.calendario-feedback {
    animation: support-slide-up-in .18s ease-out both;
}

.calendario-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--calendar-border);
}

.calendario-eyebrow {
    margin: 0 0 .15rem;
    color: #22d3ee;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.calendario-topbar h2 {
    margin: 0;
    font-size: 1.32rem;
    line-height: 1.1;
}

.calendario-actions,
.calendario-nav,
.calendario-active-guard,
.calendario-filters,
.calendario-toolbar {
    display: flex;
    align-items: end;
    gap: .5rem;
}

.calendario-page .btn {
    min-height: 32px;
    padding: .38rem .72rem;
    border-radius: 7px;
    font-size: .82rem;
}

.calendario-page .btn--icon {
    width: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
}

.calendario-feedback {
    display: grid;
    gap: .16rem;
    padding: .62rem .8rem;
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: 8px;
    background: rgba(5, 150, 105, .16);
    color: #22c55e;
    font-size: .82rem;
}

.calendario-feedback--error {
    border-color: rgba(248, 113, 113, .42);
    background: rgba(127, 29, 29, .22);
    color: #fca5a5;
}

.calendario-toolbar {
    display: grid;
    grid-template-columns: auto minmax(210px, .55fr) minmax(420px, 1fr);
    align-items: end;
    justify-content: space-between;
    padding: .55rem .65rem;
    border: 1px solid var(--calendar-border);
    border-radius: 8px;
    background: var(--calendar-panel);
}

.calendario-active-guard {
    align-self: stretch;
    align-items: center;
    min-width: 0;
    padding: .42rem .62rem;
    border: 1px solid color-mix(in srgb, var(--event-color) 55%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--event-color) 18%, transparent);
    color: var(--color-text);
    text-align: left;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.calendario-active-guard:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--event-color) 76%, transparent);
    background: color-mix(in srgb, var(--event-color) 26%, transparent);
}

.calendario-active-guard.is-empty {
    cursor: default;
}

.calendario-active-guard::before {
    content: "";
    flex: 0 0 auto;
    width: .72rem;
    height: .72rem;
    border-radius: 999px;
    background: var(--event-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--event-color) 14%, transparent);
}

.calendario-active-guard span,
.calendario-active-guard strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendario-active-guard span {
    color: #bfdbfe;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.calendario-active-guard strong {
    color: color-mix(in srgb, var(--event-color) 34%, #ffffff);
    font-size: .9rem;
}

.calendario-nav strong {
    min-width: 9rem;
    color: var(--color-text);
    font-size: .96rem;
    text-transform: capitalize;
}

.calendario-filters {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.calendario-filters .field {
    min-width: 150px;
}

.calendario-filters .field:first-child {
    min-width: min(33vw, 390px);
}

.calendario-page .field {
    display: grid;
    gap: .24rem;
}

.calendario-page .field label {
    color: #93c5fd;
    font-size: .68rem;
    font-weight: 700;
}

.calendario-page input,
.calendario-page select,
.calendario-page textarea {
    width: 100%;
    min-height: 34px;
    padding: .42rem .58rem;
    border: 1px solid var(--calendar-border);
    border-radius: 7px;
    background: rgba(2, 6, 23, .42);
    color: var(--color-text);
    font-size: .84rem;
}

.calendario-page textarea {
    min-height: 92px;
    resize: vertical;
}

.calendario-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 28px repeat(6, minmax(92px, 1fr));
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--calendar-border);
    border-radius: 8px;
    background: rgba(2, 6, 23, .28);
}

.calendario-weekday {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--calendar-border);
    border-bottom: 1px solid var(--calendar-border);
    color: #bfdbfe;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.calendario-weekday:nth-child(7) {
    border-right: 0;
}

.calendario-day {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .3rem;
    min-width: 0;
    min-height: 0;
    padding: .48rem;
    border: 0;
    border-right: 1px solid var(--calendar-border);
    border-bottom: 1px solid var(--calendar-border);
    background: rgba(15, 23, 42, .18);
    color: var(--color-text);
    text-align: left;
    transition: background .16s ease, transform .16s ease;
}

.calendario-day:hover {
    background: rgba(14, 165, 233, .08);
}

.calendario-day.is-muted {
    background: rgba(15, 23, 42, .08);
    color: #64748b;
}

.calendario-day.is-today .calendario-day-number {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #22d3ee;
    color: #082f49;
    font-weight: 900;
}

.calendario-day-events {
    display: grid;
    align-content: start;
    gap: .22rem;
    min-width: 0;
    overflow: hidden;
}

.calendario-event-chip {
    display: grid;
    gap: .08rem;
    min-width: 0;
    padding: .22rem .35rem;
    border-left: 3px solid var(--event-color);
    border-radius: 5px;
    background: rgba(14, 165, 233, .12);
    color: #e0f2fe;
    font-size: .74rem;
    line-height: 1.15;
    cursor: pointer;
    transition: transform .14s ease, background .14s ease;
}

.calendario-event-chip:hover {
    transform: translateX(2px);
    background: rgba(14, 165, 233, .2);
}

.calendario-event-chip span,
.calendario-event-chip small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendario-event-chip small {
    color: #bae6fd;
    font-size: .66rem;
}

.calendario-more {
    color: #7dd3fc;
    font-size: .72rem;
}

.calendario-side {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 42;
    display: grid;
    align-content: start;
    gap: .7rem;
    width: min(310px, 88vw);
    min-height: 0;
    padding: .8rem;
    overflow: auto;
    border-left: 1px solid rgba(56, 189, 248, .2);
    background: #0b1628;
    box-shadow: -24px 0 48px rgba(0, 0, 0, .34);
    transform: translateX(104%);
    opacity: 0;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}

.calendario-side.is-open {
    transform: translateX(0);
    opacity: 1;
}

.calendario-panel-backdrop {
    position: absolute;
    inset: 0;
    z-index: 41;
    border: 0;
    background: rgba(2, 6, 23, .28);
    animation: support-modal-backdrop-in .16s ease-out both;
}

.calendario-side-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--calendar-border);
}

.calendario-side-title div {
    display: grid;
    gap: .08rem;
}

.calendario-side-title span {
    color: #22d3ee;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.calendario-side-title strong {
    font-size: 1rem;
}

.calendario-mini,
.calendario-side-section {
    border: 1px solid var(--calendar-border);
    border-radius: 8px;
    background: var(--calendar-panel);
}

.calendario-mini {
    display: grid;
    gap: .18rem;
    padding: .8rem;
}

.calendario-mini strong {
    text-transform: capitalize;
}

.calendario-mini span,
.calendario-empty {
    color: var(--color-muted);
    font-size: .8rem;
}

.calendario-side-section {
    display: grid;
    gap: .45rem;
    padding: .65rem;
}

.calendario-side-head,
.calendario-side-event,
.calendario-technicians button,
.calendario-reminder-state {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.calendario-side-head {
    justify-content: space-between;
    color: #e2e8f0;
    font-size: .84rem;
    font-weight: 800;
}

.calendario-side-head small {
    color: #7dd3fc;
}

.calendario-side-event,
.calendario-technicians button {
    width: 100%;
    padding: .42rem .48rem;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--color-text);
    text-align: left;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.calendario-side-event:hover,
.calendario-technicians button:hover,
.calendario-technicians button.is-active {
    border-color: rgba(34, 211, 238, .24);
    background: rgba(14, 165, 233, .1);
    transform: translateX(2px);
}

.calendario-side-event span:last-child {
    display: grid;
    gap: .06rem;
    min-width: 0;
}

.calendario-side-event strong,
.calendario-side-event small,
.calendario-technicians span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendario-side-event small {
    color: var(--color-muted);
    font-size: .72rem;
}

.calendario-dot {
    flex: 0 0 auto;
    width: .56rem;
    height: .56rem;
    border-radius: 50%;
}

.calendario-technicians {
    display: grid;
    gap: .22rem;
}

.calendario-loading {
    position: absolute;
    left: 50%;
    top: 1rem;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    border: 1px solid rgba(34, 211, 238, .2);
    border-radius: 999px;
    background: rgba(15, 23, 42, .9);
    color: #bae6fd;
    transform: translateX(-50%);
}

.calendario-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(2, 6, 23, .58);
    backdrop-filter: blur(4px);
    animation: support-modal-backdrop-in .18s ease-out both;
}

.calendario-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 71;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(760px, calc(100vw - 2rem));
    max-height: min(760px, calc(100vh - 2rem));
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 12px;
    background: #0f172a;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .42);
    transform: translate(-50%, -50%);
    animation: calendario-modal-in .18s cubic-bezier(.2, .8, .2, 1) both;
}

.calendario-modal > header,
.calendario-modal > footer {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--calendar-border);
}

.calendario-modal > header {
    justify-content: space-between;
}

.calendario-modal > header div {
    display: grid;
    gap: .08rem;
}

.calendario-modal > header span {
    color: #67e8f9;
    font-size: .72rem;
    font-weight: 800;
}

.calendario-modal > header strong {
    font-size: 1rem;
}

.calendario-modal > footer {
    grid-template-columns: auto 1fr auto auto;
    border-top: 1px solid var(--calendar-border);
    border-bottom: 0;
}

.calendario-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    min-height: 0;
    overflow: auto;
    padding: .85rem .9rem;
}

.calendario-form .field--wide,
.calendario-reminder {
    grid-column: 1 / -1;
}

.calendario-checkbox {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 34px;
    margin: 0;
    color: var(--color-text);
    font-size: .84rem;
    font-weight: 700;
}

.calendario-checkbox input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    accent-color: #14b8a6;
}

.calendario-reminder {
    display: grid;
    grid-template-columns: auto minmax(120px, .45fr) minmax(200px, 1fr);
    align-items: end;
    gap: .75rem;
    padding: .65rem;
    border: 1px solid rgba(34, 211, 238, .16);
    border-radius: 8px;
    background: rgba(14, 165, 233, .06);
}

.calendario-reminder-state {
    grid-column: 1 / -1;
    justify-content: space-between;
    color: var(--color-muted);
    font-size: .8rem;
}

@media (max-width: 1100px) {
    .calendario-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 760px) {
    .calendario-page {
        padding: .65rem;
        overflow: auto;
    }

    .calendario-topbar,
    .calendario-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .calendario-filters .field,
    .calendario-filters .field:first-child {
        min-width: 0;
    }

    .calendario-grid {
        min-width: 760px;
    }

    .calendario-shell {
        overflow-x: auto;
    }

    .calendario-side,
    .calendario-form,
    .calendario-reminder {
        grid-template-columns: 1fr;
    }
}

.shell__main--calendario .calendario-page {
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: .75rem;
    height: 100dvh;
    min-height: 0;
    padding: 1rem 1.25rem 1.15rem;
    overflow: hidden;
}

.shell__main--calendario .calendario-topbar {
    align-items: center;
    gap: 1.25rem;
    padding-bottom: .45rem;
}

.shell__main--calendario .calendario-toolbar {
    grid-template-columns: minmax(245px, auto) minmax(280px, .45fr) minmax(560px, 1fr);
    align-items: end;
    gap: .85rem;
    padding: .45rem 0 .65rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.shell__main--calendario .calendario-nav {
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    min-width: 0;
}

.shell__main--calendario .calendario-nav strong {
    min-width: 9.75rem;
}

.shell__main--calendario .calendario-active-guard {
    min-height: 48px;
    padding: .55rem .75rem;
}

.shell__main--calendario .calendario-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(150px, .42fr) minmax(150px, .42fr);
    align-items: end;
    gap: .65rem;
    min-width: 0;
}

.shell__main--calendario .calendario-filters .field,
.shell__main--calendario .calendario-filters .field:first-child {
    min-width: 0;
}

.shell__main--calendario .calendario-page .field {
    gap: .34rem;
}

.shell__main--calendario .calendario-page .field label {
    line-height: 1.1;
}

.shell__main--calendario .calendario-page input,
.shell__main--calendario .calendario-page select,
.shell__main--calendario .calendario-page textarea {
    min-height: 38px;
    padding: .52rem .68rem;
}

.shell__main--calendario .calendario-shell {
    min-height: 0;
    overflow: auto;
}

.shell__main--calendario .calendario-grid {
    grid-template-rows: 30px repeat(6, minmax(88px, 1fr));
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    border-radius: 0;
}

.shell__main--calendario .calendario-weekday {
    min-width: 0;
    padding: 0 .5rem;
}

.shell__main--calendario .calendario-day {
    gap: .45rem;
    padding: .65rem;
}

.shell__main--calendario .calendario-day-number {
    line-height: 1.6rem;
}

.shell__main--calendario .calendario-day-events {
    gap: .28rem;
}

.shell__main--calendario .calendario-event-chip {
    padding: .28rem .42rem;
}

.shell__main--calendario .calendario-side {
    position: fixed;
    top: max(.6rem, env(safe-area-inset-top));
    right: max(.6rem, env(safe-area-inset-right));
    bottom: max(.6rem, env(safe-area-inset-bottom));
    width: min(340px, calc(100vw - 1.2rem));
    max-height: calc(100dvh - 1.2rem);
    padding: .95rem;
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.shell__main--calendario .calendario-panel-backdrop {
    position: fixed;
    inset: 0;
}

@media (max-width: 1280px) {
    .shell__main--calendario .calendario-toolbar {
        grid-template-columns: minmax(230px, auto) minmax(260px, 1fr);
    }

    .shell__main--calendario .calendario-filters {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .shell__main--calendario .calendario-page {
        padding: .8rem;
        overflow: auto;
    }

    .shell__main--calendario .calendario-topbar,
    .shell__main--calendario .calendario-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .shell__main--calendario .calendario-toolbar,
    .shell__main--calendario .calendario-filters {
        grid-template-columns: 1fr;
    }

    .shell__main--calendario .calendario-active-guard {
        min-width: 0;
    }
}

.smart-search-card {
    position: relative;
    z-index: 80;
    overflow: visible;
}

.smart-search {
    position: relative;
    width: 100%;
}

.smart-search__bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: 2.45rem;
    border: 1px solid rgba(125, 161, 207, .28);
    border-radius: 8px;
    background: rgba(4, 12, 24, .78);
    color: var(--color-text);
    overflow: hidden;
}

.smart-search__bar > i {
    padding-left: .8rem;
    color: var(--color-text-muted);
}

.smart-search__bar input {
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    padding: .65rem .75rem;
    outline: none;
}

.smart-search__bar input::placeholder {
    color: rgba(178, 204, 238, .58);
}

.smart-search__bar:focus-within {
    border-color: rgba(8, 197, 218, .85);
    box-shadow: 0 0 0 1px rgba(8, 197, 218, .22);
}

.smart-search__toggle {
    align-self: stretch;
    width: 2.6rem;
    border: 0;
    border-left: 1px solid rgba(125, 161, 207, .2);
    background: rgba(8, 197, 218, .14);
    color: var(--color-text);
    cursor: pointer;
}

.smart-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-height: 1.8rem;
    padding-top: .55rem;
}

.smart-search__hint {
    color: var(--color-text-muted);
    font-size: .82rem;
}

.smart-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid rgba(8, 197, 218, .25);
    border-radius: 999px;
    background: rgba(8, 197, 218, .1);
    color: var(--color-text);
    padding: .28rem .55rem;
    font-size: .78rem;
    cursor: pointer;
}

.smart-chip:hover {
    border-color: rgba(8, 197, 218, .58);
}

.smart-search__panel {
    position: absolute;
    z-index: 90;
    top: calc(100% + .55rem);
    left: 0;
    width: min(860px, calc(100vw - 3rem));
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 0;
    border: 1px solid rgba(125, 161, 207, .3);
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .38);
    overflow: hidden;
    transform-origin: top left;
    animation: support-dropdown-in .18s cubic-bezier(.2, .8, .2, 1) both;
}

.smart-search__column,
.smart-search__custom {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .95rem;
}

.smart-search__column + .smart-search__column {
    border-left: 1px solid rgba(125, 161, 207, .2);
}

.smart-search__custom {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(150px, 2fr) auto;
    align-items: end;
    border-top: 1px solid rgba(125, 161, 207, .2);
    background: rgba(4, 12, 24, .36);
}

.smart-search h4 {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .35rem;
    color: var(--color-text);
    font-size: .9rem;
}

.smart-search h4 i {
    color: var(--color-primary);
}

.smart-search__column button,
.smart-option {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    text-align: left;
    padding: .48rem .55rem;
    cursor: pointer;
}

.smart-search__column button:hover,
.smart-option:hover,
.smart-option.is-active {
    background: rgba(8, 197, 218, .16);
}

.smart-option.is-active {
    color: #7ce9f2;
}

.smart-search__inline {
    display: grid;
    gap: .3rem;
    margin-top: .35rem;
}

.smart-search__inline label {
    color: var(--color-text-muted);
    font-size: .72rem;
}

.smart-search select,
.smart-search input[type="text"] {
    min-width: 0;
    border: 1px solid rgba(125, 161, 207, .28);
    border-radius: 6px;
    background: rgba(4, 12, 24, .78);
    color: var(--color-text);
    padding: .58rem .65rem;
}

.tickets-smart-search {
    flex: 1 1 620px;
    min-width: min(100%, 480px);
}

@keyframes support-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes support-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes support-modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes support-modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes support-slide-up-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes calendario-modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 10px)) scale(.985);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .contactos-page .panel-card,
    .tickets-page--odoo .panel-card,
    .tickets-commandbar,
    .smart-search__panel,
    .conversations-panel-backdrop,
    .conversations-window-banner,
    .conversations-contact-suggest,
    .conversations-tools-panel,
    .conversations-modal-backdrop,
    .conversations-modal,
    .modal-overlay.conversations-template-modal,
    .modal-overlay.conversations-new-thread-modal,
    .conversations-template-modal__card,
    .conversations-new-thread-modal__card,
    .attachment-preview-overlay,
    .attachment-preview-modal,
    .ticket-link-popover,
    .ticket-editor-emoji-picker,
    .tickets-slash-menu {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}

.filters-grid--dates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.filters-grid--wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.filters-toggle-wrap {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

.filters-toggle {
    min-width: 180px;
}

.filters-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
}

.filters-summary__label {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filters-summary__text {
    color: rgba(226, 232, 240, 0.92);
    font-size: 0.88rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field label {
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.82);
    color: var(--color-text);
    font-size: 0.95rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(14, 165, 233, 0.24);
    border-color: rgba(14, 165, 233, 0.4);
}

.field.field--xs {
    max-width: 7rem;
}

.field.field--sm {
    max-width: 12rem;
}

.field.field--md {
    max-width: 18rem;
}

.field.field--full,
.field.field--wide {
    max-width: none;
}

@media (max-width: 900px) {
    .field.field--xs,
    .field.field--sm,
    .field.field--md {
        max-width: none;
    }
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-range {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 0.78rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn--xs {
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.btn--ghost {
    background: rgba(15, 23, 42, 0.8);
    color: var(--color-text);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    vertical-align: middle;
}

.data-table th {
    color: var(--color-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    white-space: nowrap;
}

.data-table td strong {
    display: block;
    font-size: 0.9rem;
}

.badge-state {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-state::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
}

.badge-state--ok {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.badge-state--warn {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.badge-state--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state__eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.table-wrap {
    overflow-x: auto;
}

.quick-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-filter-btn {
    min-width: 132px;
}

.quick-filter-btn--up.btn--primary  { background: rgba(34,197,94,.25); border-color: #22c55e; color: #4ade80; }
.quick-filter-btn--up.btn--ghost    { border-color: rgba(34,197,94,.4); color: #4ade80; }
.quick-filter-btn--down.btn--primary{ background: rgba(239,68,68,.22);  border-color: #ef4444; color: #fca5a5; }
.quick-filter-btn--down.btn--ghost  { border-color: rgba(239,68,68,.4); color: #fca5a5; }
.quick-filter-btn--new.btn--primary { background: rgba(139,92,246,.22); border-color: #8b5cf6; color: #c4b5fd; }
.quick-filter-btn--new.btn--ghost   { border-color: rgba(139,92,246,.4); color: #c4b5fd; }

.table-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-alert__dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: currentColor;
    flex-shrink: 0;
}

.table-alert--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.table-alert--warn {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.table-alert--info {
    background: rgba(14, 165, 233, 0.14);
    color: #7dd3fc;
}

.table-alert--neutral {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.loading {
    color: var(--color-muted);
    padding: 2rem 0;
}

.detail-list {
    display: grid;
    gap: 0.85rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-row__label {
    color: var(--color-muted);
    font-size: 0.88rem;
}

.metrics-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.action-link {
    color: #7dd3fc;
    text-decoration: none;
    font-weight: 700;
}

.action-link:hover {
    text-decoration: underline;
}

.split-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1.2fr 0.8fr;
}

.three-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .kpi-grid,
    .chart-grid,
    .filters-grid,
    .filters-grid--wide,
    .split-grid,
    .three-grid,
    .metrics-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-grid > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .page-intro,
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-grid,
    .chart-grid,
    .filters-grid,
    .filters-grid--wide,
    .split-grid,
    .three-grid,
    .metrics-inline {
        grid-template-columns: 1fr;
    }
}

.costos-perfiles__list,
.costos-perfiles__editor {
    min-height: 100%;
}

.costos-perfiles__form {
    display: grid;
    gap: 1rem;
}

.costos-perfiles__field {
    min-width: 0;
}

.costos-perfiles__field--full {
    grid-column: 1 / -1;
}

.costos-perfiles__field--code {
    position: relative;
}

.costos-perfiles__input-lg {
    min-height: 52px;
    font-size: 1rem;
}

.costos-perfiles__lookup {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.85rem;
    max-height: 220px;
    overflow: auto;
    padding-right: 0.15rem;
}

.costos-perfiles__lookup-item {
    display: grid;
    gap: 0.2rem;
    text-align: left;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(15, 23, 42, 0.55);
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.costos-perfiles__lookup-item:hover {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(14, 116, 144, 0.18);
    transform: translateY(-1px);
}

.costos-perfiles__lookup-code {
    font-size: 0.92rem;
    font-weight: 700;
    color: #e2e8f0;
}

.costos-perfiles__lookup-name {
    font-size: 0.84rem;
    color: var(--color-muted);
}

.costos-perfiles__provider-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.42);
}

.costos-perfiles__provider-label {
    margin: 0 0 0.2rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.costos-perfiles__toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1rem;
}

.costos-perfiles__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.32);
}

.costos-perfiles__toggle input[type=checkbox] {
    accent-color: var(--color-primary);
}

.costos-perfiles__notes {
    min-height: 150px;
}

.costos-perfiles__actions {
    margin-top: 1.1rem;
    flex-wrap: wrap;
}

.costos-nueva__search-input {
    margin-bottom: 0.65rem;
}

.costos-nueva__selected-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 14px;
    background: rgba(14, 116, 144, 0.12);
}

.costos-nueva__selected-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.costos-nueva__selected-code {
    margin-left: 0.45rem;
    color: var(--color-muted);
}

.costos-nueva__profile-results {
    display: grid;
    gap: 0.55rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.costos-nueva__profile-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.4);
    color: inherit;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.costos-nueva__profile-option:hover {
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(14, 116, 144, 0.16);
    transform: translateY(-1px);
}

.costos-nueva__profile-option.is-selected {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(21, 128, 61, 0.14);
}

.costos-nueva__profile-name {
    font-weight: 600;
}

.costos-nueva__profile-code {
    flex-shrink: 0;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.costos-nueva__empty {
    padding: 0.85rem 0.95rem;
    border: 1px dashed var(--color-border);
    border-radius: 14px;
    color: var(--color-muted);
    background: rgba(15, 23, 42, 0.25);
}

.costos-lote__filters {
    margin-bottom: 1rem;
}

.costos-lote__grid-shell {
    position: relative;
}

.costos-lote__table-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: 68vh;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    scrollbar-gutter: stable both-edges;
}

.costos-lote__table th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--color-panel);
}

.costos-lote__table td {
    font-size: 0.92rem;
}

.costos-lote__table {
    min-width: 1380px;
}

.costos-lote__check-cell {
    width: 52px;
    text-align: center;
}

.costos-lote__sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.costos-lote__sort-btn.is-active {
    color: var(--color-primary);
}

.costos-lote__text {
    max-width: 320px;
    white-space: normal;
    line-height: 1.45;
}

.costos-lote__state,
.costos-lote__score,
.costos-lote__variation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.costos-lote__state.is-confirmed {
    background: rgba(125, 211, 252, 0.18);
    color: #7dd3fc;
}

.costos-lote__state.is-matched {
    background: rgba(110, 231, 183, 0.18);
    color: #86efac;
}

.costos-lote__state.is-missing,
.costos-lote__state.is-error {
    background: rgba(252, 165, 165, 0.18);
    color: #fca5a5;
}

.costos-lote__state.is-discarded {
    background: rgba(203, 213, 225, 0.18);
    color: #cbd5e1;
}

.costos-lote__state.is-applied {
    background: rgba(147, 197, 253, 0.18);
    color: #93c5fd;
}

.costos-lote__score.is-exact {
    background: rgba(147, 197, 253, 0.22);
    color: #93c5fd;
}

.costos-lote__score.is-good {
    background: rgba(134, 239, 172, 0.2);
    color: #86efac;
}

.costos-lote__score.is-mid {
    background: rgba(253, 230, 138, 0.22);
    color: #fde68a;
}

.costos-lote__score.is-low {
    background: rgba(252, 165, 165, 0.2);
    color: #fca5a5;
}

.costos-lote__variation.is-up,
.costos-lote__variation.is-up-strong {
    background: rgba(187, 247, 208, 0.2);
    color: #86efac;
}

.costos-lote__variation.is-down,
.costos-lote__variation.is-down-strong {
    background: rgba(254, 205, 211, 0.2);
    color: #fda4af;
}

.costos-lote__variation.is-flat {
    background: rgba(203, 213, 225, 0.18);
    color: #cbd5e1;
}

.costos-lote__summary {
    display: grid;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.24);
}

.costos-lote__summary-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.costos-lote__candidate-tools {
    margin-bottom: 1rem;
}

.costos-lote__fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.22);
}

.costos-lote__table .is-confirmed td,
.costos-lote__table .is-applied td {
    background: rgba(15, 23, 42, 0.08);
}

.costos-lote__table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.costos-lote__table tbody tr:hover td {
    background: rgba(125, 211, 252, 0.12);
}

.costos-lote__table tbody tr.table-row-selected td,
.costos-lote__table tbody tr.table-row-selected:hover td {
    background: rgba(56, 189, 248, 0.16);
}

.costos-lote__modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    z-index: 40;
}

.costos-lote__modal {
    position: fixed;
    inset: 2rem;
    z-index: 41;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.costos-lote__modal-card {
    width: min(1400px, 100%);
    max-height: 100%;
    overflow: auto;
    padding: 1rem;
}

.costos-lote__modal-table-wrap {
    max-height: 44vh;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
}

html[data-theme="light"] .costos-lote__summary,
html[data-theme="light"] .costos-lote__fallback,
html[data-theme="light"] .costos-lote__table .is-confirmed td,
html[data-theme="light"] .costos-lote__table .is-applied td {
    background: rgba(248, 250, 252, 0.82);
}

html[data-theme="light"] .costos-lote__table tbody tr:hover td {
    background: rgba(14, 165, 233, 0.08);
}

html[data-theme="light"] .costos-lote__table tbody tr.table-row-selected td,
html[data-theme="light"] .costos-lote__table tbody tr.table-row-selected:hover td {
    background: rgba(56, 189, 248, 0.14);
}

html[data-theme="light"] .costos-lote__table th {
    background: #f8fafc;
}

@media (max-width: 1200px) {
    .costos-perfiles__provider-preview {
        flex-direction: column;
        align-items: stretch;
    }

    .costos-nueva__selected-profile,
    .costos-nueva__profile-option {
        flex-direction: column;
        align-items: flex-start;
    }

    .costos-lote__modal {
        inset: 0.75rem;
    }
}

/* ── Shell / Layout ─────────────────────────────────────────── */
.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    transition: grid-template-columns 0.22s ease;
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 28%),
        var(--color-bg);
}

.shell--collapsed {
    grid-template-columns: 92px 1fr;
}

.shell__sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(8, 15, 28, 0.8);
    backdrop-filter: blur(14px);
    overflow-x: hidden;
}

.shell__main {
    min-width: 0;
    padding: 2rem;
}

.shell__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.shell__actions {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.shell__eyebrow {
    margin: 0;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
}

.shell__title {
    margin: 0.35rem 0 0;
    font-size: clamp(1.65rem, 2.1vw, 2.25rem);
    font-weight: 800;
}

.shell__module {
    margin: .28rem 0 0;
    color: var(--color-text);
    font-size: .95rem;
    font-weight: 600;
}

.shell__status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.68);
    color: var(--color-muted);
}

.shell__print {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    white-space: nowrap;
}

.shell__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--color-success);
    box-shadow: 0 0 0 0.35rem rgba(16, 185, 129, 0.18);
}

.shell__date {
    color: var(--color-text);
    font-weight: 600;
}

.shell__content {
    min-width: 0;
}

.pos-layout-host {
    min-height: 100dvh;
    background: #e4e8ef;
}

.shell__main--calendario {
    padding: 0;
    overflow: hidden;
}

.shell__main--calendario .shell__content {
    min-height: 100dvh;
}

.global-message-notice {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 1250;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    width: min(380px, calc(100vw - 2rem));
    padding: .78rem .9rem;
    border: 1px solid rgba(14, 165, 233, .32);
    border-radius: 14px;
    background: rgba(8, 19, 34, .96);
    color: var(--color-text);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .34);
    text-align: left;
    cursor: pointer;
}

.global-message-notice:hover {
    border-color: rgba(20, 184, 166, .55);
    transform: translateY(-1px);
}

.global-message-notice__icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .16);
    color: #22c55e;
    font-size: 1.05rem;
}

.global-message-notice__body {
    display: grid;
    min-width: 0;
    gap: .16rem;
}

.global-message-notice__body strong,
.global-message-notice__body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-message-notice__body strong {
    font-size: .86rem;
}

.global-message-notice__body span {
    color: var(--color-muted);
    font-size: .78rem;
}

.global-message-notice__count {
    display: grid;
    place-items: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
}

.print-only {
    display: none;
}

.print-banner {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.14);
}

.print-banner__eyebrow {
    margin: 0 0 .2rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .72rem;
    font-weight: 700;
}

.print-banner__title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-text);
}

.print-banner__meta {
    margin: .45rem 0 0;
    color: var(--color-muted);
    font-size: .85rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 1.5rem 1.25rem;
}

.brand__content {
    min-width: 0;
}

.brand__logo-link {
    display: inline-flex;
    flex-shrink: 0;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.brand__logo-link--static {
    cursor: default;
}

.brand__logo-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, .65);
    outline-offset: 3px;
}

.brand__logo {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    flex-shrink: 0;
}

.brand__eyebrow {
    margin: 0 0 0.2rem;
    color: var(--color-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.brand__title {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-toggle {
    margin-left: auto;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.45);
    color: var(--color-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sidebar-toggle:hover {
    background: rgba(30, 41, 59, 0.9);
    color: white;
    border-color: rgba(125, 211, 252, 0.2);
}

.menu {
    padding: 0 1rem 1.5rem;
}

.menu__section {
    margin: 1.25rem 0 0.75rem;
    padding: 0 0.5rem;
    color: var(--color-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.menu__nav {
    display: grid;
    gap: 0.45rem;
}

.menu__link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: #dbeafe;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.menu__link:hover {
    background: rgba(30, 41, 59, 0.9);
    color: white;
    transform: translateX(4px);
}

.menu__link.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(45, 212, 191, 0.18));
    color: white;
    border: 1px solid rgba(125, 211, 252, 0.15);
}

.menu__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    background: rgba(148, 163, 184, 0.1);
    font-size: 1rem;
    flex-shrink: 0;
}

.shell--collapsed .brand {
    display: grid;
    justify-items: center;
    padding-inline: 0.9rem;
    gap: .65rem;
}

.shell--collapsed .brand__content,
.shell--collapsed .menu__section,
.shell--collapsed .menu__link span:not(.menu__icon) {
    display: none;
}

.shell--collapsed .sidebar-toggle {
    position: static;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    margin-left: 0;
}

.shell--collapsed .menu {
    padding-inline: 0.6rem;
}

.shell--collapsed .menu__nav {
    align-items: center;
}

.shell--collapsed .menu__link {
    justify-content: center;
    padding: 0.8rem 0.55rem;
}

.shell--collapsed .menu__link:hover {
    transform: none;
}

.shell--collapsed .menu__icon {
    width: 2.35rem;
    height: 2.35rem;
}

@media (max-width: 640px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .shell--collapsed {
        grid-template-columns: 1fr;
    }

    .shell__sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    }

    .shell--collapsed .brand {
        justify-content: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .shell--collapsed .brand__content,
    .shell--collapsed .menu__section,
    .shell--collapsed .menu__link span:not(.menu__icon) {
        display: initial;
    }

    .shell--collapsed .sidebar-toggle {
        position: static;
        width: 2.4rem;
        height: 2.4rem;
        border-radius: 0.85rem;
    }

    .shell--collapsed .menu {
        padding: 0 1rem 1rem;
    }

    .shell--collapsed .menu__link {
        justify-content: flex-start;
        padding: 0.85rem 0.9rem;
    }

    .brand {
        padding: 1rem;
        gap: .85rem;
    }

    .brand__logo {
        width: 2.6rem;
        height: 2.6rem;
    }

    .brand__eyebrow {
        font-size: .68rem;
        letter-spacing: .12em;
    }

    .brand__title {
        font-size: .95rem;
    }

    .menu {
        padding: 0 1rem 1rem;
    }

    .menu__section {
        margin: .9rem 0 .55rem;
        padding: 0 .2rem;
        font-size: .68rem;
    }

    .menu__nav {
        gap: .35rem;
    }

    .menu__link,
    .menu__back {
        padding: .8rem .9rem;
        border-radius: .95rem;
        font-size: .88rem;
    }

    .menu__icon {
        width: 1.9rem;
        height: 1.9rem;
        border-radius: .7rem;
    }

    .menu__footer {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .shell__main {
        padding: 1rem;
    }

    .shell__header {
        flex-direction: column;
    }

    .shell__status {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        padding: .8rem .9rem;
    }

    .shell__actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: .65rem;
        justify-content: stretch;
    }

    .shell__actions > * {
        width: 100%;
    }

    .shell__actions .btn,
    .session-chip {
        justify-content: center;
    }

    .session-chip {
        max-width: none;
        min-height: 42px;
        padding: .55rem .8rem;
        border-radius: 16px;
    }

    .session-chip__text {
        min-width: 0;
        flex: 1 1 auto;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .shell__main {
        padding: .85rem;
    }

    .shell__header {
        margin-bottom: 1rem;
    }

    .shell__module {
        font-size: .9rem;
    }

    .shell__status {
        gap: .5rem;
        border-radius: 16px;
    }

    .shell__date {
        width: 100%;
    }

    .help-btn {
        margin-left: auto;
    }
}

/* ── KpiCard ─────────────────────────────────────────────────── */
.kpi-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem;
    min-width: 0;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(9, 18, 31, 0.92));
    box-shadow: var(--shadow-soft);
}

.kpi-card--highlight {
    border-color: rgba(45, 212, 191, 0.34);
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(7, 18, 31, 0.96));
    box-shadow: 0 22px 50px rgba(20, 184, 166, 0.12);
}

.kpi-card__body {
    min-width: 0;
    flex: 1 1 auto;
}

.kpi-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(20, 184, 166, 0.2));
    color: #e0f2fe;
    font-weight: 800;
}

.kpi-card__icon--highlight {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(56, 189, 248, 0.24));
    color: #ecfeff;
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.08) inset;
}

.kpi-card__label {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.kpi-card__value {
    margin: 0.5rem 0 0.25rem;
    font-size: clamp(1.15rem, 1.55vw, 1.75rem);
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kpi-card__description {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kpi-card--highlight .kpi-card__label {
    color: #99f6e4;
}

.kpi-card--highlight .kpi-card__description {
    color: #cbd5e1;
}

.kpi-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card--iva-pagar {
    border-color: rgba(245, 158, 11, 0.4);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 40%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(9, 18, 31, 0.92));
}

.kpi-card--iva-pagar .kpi-card__icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.2));
    color: #fde68a;
}

.kpi-card--iva-favor {
    border-color: rgba(16, 185, 129, 0.4);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 40%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(9, 18, 31, 0.92));
}

.kpi-card--iva-favor .kpi-card__icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(52, 211, 153, 0.2));
    color: #a7f3d0;
}

.text-danger { color: #f87171; }

/* ── Resumen TC table ────────────────────────────────────────── */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.resumen-tc-table {
    min-width: 900px;
    font-size: 0.83rem;
}

.resumen-tc-table .col-num {
    text-align: right;
    white-space: nowrap;
}

.resumen-tc-table .col-total {
    background: rgba(14, 165, 233, 0.06);
    font-weight: 600;
}

.resumen-tc-table tfoot .row-totals td {
    border-top: 2px solid rgba(148, 163, 184, 0.25);
    padding-top: 0.8rem;
}

html[data-theme="light"] .resumen-tc-table .col-total {
    background: rgba(14, 165, 233, 0.05);
}

/* ── Resumen por alícuota IVA ────────────────────────────────── */
.resumen-alicuota-table {
    min-width: 680px;
    font-size: 0.83rem;
}

.resumen-alicuota-table .col-num {
    text-align: right;
    white-space: nowrap;
}

.resumen-alicuota-table .col-total {
    background: rgba(14, 165, 233, 0.06);
    font-weight: 600;
}

.resumen-alicuota-table .cell-cond {
    font-weight: 600;
}

.resumen-alicuota-table tr.row-subtotal td {
    background: rgba(148, 163, 184, 0.07);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    font-style: italic;
}

.resumen-alicuota-table tfoot .row-totals td {
    border-top: 2px solid rgba(148, 163, 184, 0.25);
    padding-top: 0.8rem;
}

html[data-theme="light"] .resumen-alicuota-table .col-total {
    background: rgba(14, 165, 233, 0.05);
}

html[data-theme="light"] .resumen-alicuota-table tr.row-subtotal td {
    background: rgba(148, 163, 184, 0.08);
}

/* ── LineChart ───────────────────────────────────────────────── */
.line-chart {
    width: 100%;
}

.line-chart__svg {
    width: 100%;
    height: auto;
    display: block;
}

.line-chart__grid {
    stroke: rgba(148, 163, 184, 0.12);
    stroke-width: 1;
}

.line-chart__path {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: none;
    animation: none;
}

.line-chart__point {
    fill: #ecfeff;
    stroke: #14b8a6;
    stroke-width: 2.5;
    transition: none;
    animation: none;
}

.line-chart__bar {
    fill: #38bdf8;
    opacity: .82;
    transition: none;
    animation: none;
}

.dual-bar__ventas {
    fill: #38bdf8;
    opacity: .85;
    transition: none;
    animation: none;
}

.dual-bar__compras {
    fill: #fb923c;
    opacity: .85;
    transition: none;
    animation: none;
}

.dual-bar__svg {
    overflow: visible;
}

.line-chart__svg * {
    transition: none !important;
    animation: none !important;
}

/* Chart-type selector */
.chart-type-switch {
    display: inline-flex;
    gap: .15rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    padding: .18rem;
}

.chart-type-switch__btn {
    padding: .28rem .6rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--color-muted);
    font-size: .82rem;
    cursor: pointer;
    line-height: 1;
    transition: background .12s, color .12s;
}

.chart-type-switch__btn--active {
    background: rgba(14,165,233,.2);
    color: #7dd3fc;
}

html[data-theme="light"] .chart-type-switch {
    background: rgba(0,0,0,.04);
    border-color: rgba(0,0,0,.12);
}

html[data-theme="light"] .chart-type-switch__btn--active {
    background: rgba(14,165,233,.15);
    color: #0284c7;
}

.line-chart__label-svg {
    fill: var(--color-muted);
    font-size: 10px;
    font-family: inherit;
}

.line-chart__axis-svg {
    fill: var(--color-muted);
    font-size: 11px;
    font-family: inherit;
}

.chart-empty {
    color: var(--color-muted);
    margin: 1rem 0 0;
}

/* ── Launcher ────────────────────────────────────────────────── */
.launcher {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.launcher__header {
    margin-bottom: 2.5rem;
}

.launcher__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.launcher__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
}

.launcher__subtitle {
    margin: 0;
    color: var(--color-muted);
}

.launcher__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: var(--color-panel);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.app-card--button {
    width: 100%;
    text-align: left;
    font: inherit;
    background: var(--color-panel);
}

.app-card__favorite {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.45);
    color: rgba(226, 232, 240, 0.7);
    font-size: 1rem;
    line-height: 1;
    opacity: 0.78;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
    z-index: 2;
}

.app-card:hover .app-card__favorite,
.app-card__favorite:focus-visible,
.app-card__favorite:hover,
.app-card__favorite.is-active {
    opacity: 1;
}

.app-card__favorite:hover,
.app-card__favorite:focus-visible {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.4);
    color: #f8fafc;
    transform: scale(1.04);
}

.app-card__favorite.is-active {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.48);
    color: #fbbf24;
}

.app-card--disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.app-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.app-card__icon--compras  { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.app-card__icon--ventas   { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.app-card__icon--stock    { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.app-card__icon--caja     { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.app-card__icon--contabilidad { background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; }
.app-card__icon--consultas { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }
.app-card__icon--usuarios  { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.app-card__icon--contactos { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.app-card__icon--calendario { background: linear-gradient(135deg, #14b8a6, #0ea5e9); color: #fff; }

.app-card__name {
    font-size: 1rem;
    font-weight: 700;
}

.app-card__desc {
    font-size: 0.82rem;
    color: var(--color-muted);
    line-height: 1.4;
}

/* ── Sidebar back button ─────────────────────────────────────── */
.menu__back {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 1rem;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.menu__back:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-text);
    border-color: var(--color-border);
}

.shell--collapsed .menu__back span {
    display: none;
}

.shell--direct .menu__back {
    display: none;
}

html[data-theme="light"] .app-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .app-card:hover {
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: 0 8px 28px rgba(2, 132, 199, 0.12);
}

html[data-theme="light"] .app-card__favorite {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(15, 23, 42, 0.12);
    color: rgba(71, 85, 105, 0.8);
}

html[data-theme="light"] .app-card__favorite:hover,
html[data-theme="light"] .app-card__favorite:focus-visible {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.32);
    color: #0f172a;
}

html[data-theme="light"] .app-card__favorite.is-active {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.42);
    color: #d97706;
}

/* ── HorizontalBarChart ──────────────────────────────────────── */
.bar-chart {
    display: grid;
    gap: 1rem;
}

.bar-chart__row {
    display: grid;
    gap: 0.45rem;
}

.bar-chart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bar-chart__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
    font-size: 0.92rem;
}

.bar-chart__track {
    position: relative;
    height: 0.8rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.14);
}

.bar-chart__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.22);
}

.bar-chart__fill--muted {
    background: rgba(148, 163, 184, 0.3) !important;
    box-shadow: none !important;
}

/* ── Proveedores ─────────────────────────────────────────────── */

.kpi-grid--6 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-grid--6 .kpi-card__value {
    font-size: clamp(1.05rem, 1.25vw, 1.5rem);
}

.kpi-grid--6 .kpi-card__description {
    font-size: 0.78rem;
}

@media (max-width: 1400px) {
    .kpi-grid--6 {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
}

@media (max-width: 900px) {
    .kpi-grid--6 {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }
}

.btn--sm {
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
}

.var-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.var-badge--up   { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.var-badge--flat { background: rgba(148, 163, 184, 0.1);  color: #94a3b8; }
.var-badge--down { background: rgba(239, 68, 68, 0.15);   color: #fca5a5; }
.var-badge--new  { background: rgba(14, 165, 233, 0.15);  color: #7dd3fc; }

.alert-band {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(8, 15, 28, 0.6);
}

.alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.alert-chip--warn    { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.alert-chip--danger  { background: rgba(239, 68, 68, 0.15);  color: #fca5a5; }
.alert-chip--info    { background: rgba(14, 165, 233, 0.12); color: #7dd3fc; }
.alert-chip--success { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }

.pct-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.pct-bar {
    width: 56px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.pct-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.rank-cell {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding-right: 0.25rem;
}

.text-muted {
    display: block;
    font-size: 0.78rem;
    color: var(--color-muted);
    font-weight: 400;
}

tr.row--selected td {
    background: rgba(14, 165, 233, 0.07);
}

tr.row--warning td {
    background: rgba(245, 158, 11, 0.06);
}

tr.row--critical td {
    background: rgba(239, 68, 68, 0.07);
}

/* ── Ayuda ─────────────────────────────────────────────────────────────── */

/* Link contextual "Ver ayuda" en page-intro */
.help-link {
    font-size: .75rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: .6;
    transition: opacity .15s, color .15s;
    white-space: nowrap;
}
.help-link:hover { opacity: 1; color: var(--accent); }

/* Botón ? en el header */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.1rem;
    text-decoration: none;
    transition: color .15s, background .15s;
}
.help-btn:hover { color: var(--accent); background: rgba(99,102,241,.12); }

/* Link de ayuda al pie del sidebar */
.menu__footer {
    margin-top: auto;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid var(--border);
}
.menu__link--help { opacity: .7; }
.menu__link--help:hover { opacity: 1; }

.menu__link--disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.menu__link--module {
    border: 1px solid rgba(125, 211, 252, 0.1);
}

.menu__soon {
    margin-left: auto;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
    background: rgba(148, 163, 184, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.shell--collapsed .menu__soon {
    display: none;
}

.menu__search {
    margin-top: 1rem;
    display: grid;
    gap: .5rem;
}

.menu__search-label {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--shell-muted);
}

.menu__search-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: 0 .85rem;
    border-radius: 16px;
    border: 1px solid rgba(92, 201, 255, .18);
    background: rgba(6, 17, 33, .78);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.menu__search-box:focus-within {
    border-color: rgba(68, 203, 255, .55);
    box-shadow: 0 0 0 1px rgba(68, 203, 255, .18);
}

.menu__search-icon {
    color: var(--shell-muted);
    font-size: .95rem;
}

.menu__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--shell-text);
    font-size: .94rem;
}

.menu__search-input::placeholder {
    color: var(--shell-muted);
}

.menu__search-clear {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--shell-muted);
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}

.menu__search-clear:hover {
    color: var(--shell-text);
    background: rgba(255, 255, 255, .06);
}

.menu__search-state {
    margin: 0;
    font-size: .84rem;
    color: var(--shell-muted);
}

.menu__search-state--error {
    color: #ff8f8f;
}

.menu__search-results {
    display: grid;
    gap: .45rem;
    max-height: 18rem;
    overflow-y: auto;
    padding-right: .15rem;
}

.menu__search-result {
    border: 1px solid rgba(92, 201, 255, .12);
    background: rgba(7, 20, 39, .78);
    color: var(--shell-text);
    border-radius: 16px;
    padding: .8rem .85rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .75rem;
    align-items: center;
    text-align: left;
    width: 100%;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.menu__search-result:hover {
    transform: translateY(-1px);
    border-color: rgba(68, 203, 255, .34);
    background: rgba(9, 29, 55, .88);
}

.menu__search-result-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(68, 203, 255, .12);
    color: #54d7ff;
}

.menu__search-result-body {
    min-width: 0;
    display: grid;
    gap: .14rem;
}

.menu__search-result-title {
    font-size: .92rem;
    font-weight: 600;
    color: var(--shell-text);
}

.menu__search-result-meta {
    font-size: .78rem;
    color: var(--shell-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu__search-result-kind {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #67d9ff;
}

.shell--collapsed .menu__search {
    display: none;
}

html[data-theme="light"] .menu__search-box {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(19, 103, 170, .14);
}

html[data-theme="light"] .menu__search-result {
    background: rgba(255, 255, 255, .95);
    border-color: rgba(19, 103, 170, .1);
}

html[data-theme="light"] .menu__search-result:hover {
    background: rgba(245, 250, 255, .98);
    border-color: rgba(19, 103, 170, .25);
}

/* Conversaciones */
.conversations-page {
    gap: .55rem;
}

.conversations-page .page-intro {
    align-items: end;
    margin-bottom: 0;
}

.conversations-page .page-intro__title {
    font-size: clamp(1rem, 1.1vw, 1.18rem);
}

.conversations-page .page-intro__text {
    display: none;
}

.conversations-page .page-intro .actions {
    gap: .5rem;
}

.conversations-page .page-intro .btn {
    padding: .42rem .7rem;
    min-height: 32px;
    font-size: .84rem;
}

.conversations-filters {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .45rem .75rem;
    padding: .55rem .75rem;
    border-radius: var(--radius-lg);
}

.conversations-filters__modes {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.conversations-filters__modes--compact {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    max-width: 100%;
    gap: 0;
}

.conversations-filters__modes--compact .conversations-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    white-space: nowrap;
    overflow: hidden;
    max-width: 11rem;
    opacity: 1;
    transform: translateX(0);
    transition: max-width .22s ease, opacity .18s ease, transform .22s ease, margin-left .22s ease, padding .22s ease, color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.conversations-filters__modes--compact .conversations-filter-pill:not(.is-active) {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
    pointer-events: none;
    transform: translateX(-.25rem);
}

.conversations-filters__modes--compact:hover .conversations-filter-pill,
.conversations-filters__modes--compact:focus-within .conversations-filter-pill {
    max-width: 11rem;
    opacity: 1;
    padding-left: .62rem;
    padding-right: .62rem;
    border-color: var(--color-border);
    pointer-events: auto;
    transform: translateX(0);
}

.conversations-filters__modes--compact:hover .conversations-filter-pill:not(.is-active),
.conversations-filters__modes--compact:focus-within .conversations-filter-pill:not(.is-active) {
    margin-left: .45rem;
}

.conversations-filters__modes--compact .conversations-filter-pill.is-active {
    order: -1;
}

.conversations-mode-caret {
    display: none;
    font-size: .68rem;
    opacity: .78;
    transition: transform .22s ease, opacity .18s ease;
}

.conversations-filters__modes--compact .conversations-filter-pill.is-active .conversations-mode-caret {
    display: inline-flex;
}

.conversations-filters__modes--compact:hover .conversations-filter-pill.is-active .conversations-mode-caret,
.conversations-filters__modes--compact:focus-within .conversations-filter-pill.is-active .conversations-mode-caret {
    transform: rotate(180deg);
    opacity: 1;
}

.conversations-filter-pill {
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-muted);
    border-radius: 999px;
    padding: .34rem .62rem;
    font-size: .8rem;
    font-weight: 700;
    transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    min-width: 0;
}

.conversations-filter-pill:hover {
    transform: translateY(-1px);
}

.conversations-filter-pill:hover,
.conversations-filter-pill.is-active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(20, 184, 166, 0.12));
    color: var(--color-text);
    border-color: rgba(14, 165, 233, 0.28);
    box-shadow: 0 8px 18px rgba(2, 132, 199, .08);
}

.conversations-filters__fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) repeat(2, minmax(180px, 1fr)) auto;
    gap: .5rem;
    align-items: end;
}

.conversations-filters__fields .field {
    gap: .25rem;
}

.conversations-filters__fields label {
    font-size: .72rem;
}

.conversations-filters__fields input,
.conversations-filters__fields select {
    min-height: 32px;
    padding-top: .32rem;
    padding-bottom: .32rem;
}

.conversations-filters__fields .btn {
    min-height: 32px;
    padding: .38rem .7rem;
}

.conversations-layout {
    display: grid;
    grid-template-columns: minmax(260px, 330px) minmax(0, 1.35fr) minmax(240px, 300px);
    gap: 1rem;
    align-items: stretch;
    height: calc(100vh - 180px);
    min-height: 680px;
}

.conversations-list,
.conversations-chat,
.conversations-context {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.conversations-list__header,
.conversations-chat__header,
.conversations-context__section {
    margin-bottom: .65rem;
}

.conversations-list__items,
.conversations-thread {
    display: flex;
    flex-direction: column;
    gap: .62rem;
    overflow: auto;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.46) rgba(15, 23, 42, 0.18);
}

.conversations-list__items::-webkit-scrollbar,
.conversations-thread::-webkit-scrollbar,
.conversations-context::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.conversations-list__items::-webkit-scrollbar-track,
.conversations-thread::-webkit-scrollbar-track,
.conversations-context::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
}

.conversations-list__items::-webkit-scrollbar-thumb,
.conversations-thread::-webkit-scrollbar-thumb,
.conversations-context::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.68), rgba(20, 184, 166, 0.58));
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

.conversations-list__items::-webkit-scrollbar-thumb:hover,
.conversations-thread::-webkit-scrollbar-thumb:hover,
.conversations-context::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.9), rgba(20, 184, 166, 0.78));
    border: 2px solid transparent;
    background-clip: content-box;
}

.conversations-list__items {
    flex: 1 1 auto;
}

.conversation-row {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    text-align: left;
    padding: 1rem;
    display: grid;
    gap: .45rem;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, background-color .18s ease;
}

.conversation-row__avatar {
    display: none;
}

.conversation-row__content {
    display: contents;
    min-width: 0;
}

.conversation-row:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.conversation-row.is-selected {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(20, 184, 166, 0.08));
    border-color: rgba(14, 165, 233, 0.28);
}

.conversation-row.is-pinned {
    border-color: rgba(245, 158, 11, .34);
    background: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(14, 165, 233, .05));
}

.conversation-row__top,
.message-card__meta,
.message-card__footer,
.conversations-chat__chips,
.conversations-context__actions,
.conversations-composer__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-width: 0;
}

.conversation-row__name {
    font-weight: 800;
    color: var(--color-text);
}

.conversation-row__side {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
}

.conversation-row__new-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
}

.conversation-pin {
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(15, 23, 42, .44);
    color: var(--color-muted);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.conversation-pin:hover {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .45);
    background: rgba(245, 158, 11, .12);
    transform: translateY(-1px);
}

.conversation-pin.is-pinned {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .55);
    background: rgba(245, 158, 11, .18);
}

.conversation-row__date,
.conversation-row__meta,
.conversation-row__summary,
.context-card__muted,
.message-card__meta {
    color: var(--color-muted);
    font-size: .92rem;
}

.context-card__action {
    width: fit-content;
    margin-top: .35rem;
}

.conversation-row__meta,
.conversation-row__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.conversation-row__summary,
.message-card__text {
    margin: 0;
    line-height: 1.42;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;
}

.conversation-row__summary {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.message-card__link {
    color: #7dd3fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message-card__link:hover,
.message-card__link:focus-visible {
    color: #bae6fd;
}

.conversation-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    border-radius: 999px;
    padding: .28rem .7rem;
    font-size: .8rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-text);
    white-space: nowrap;
}

.conversation-badge--state {
    background: rgba(14, 165, 233, 0.16);
    color: #7dd3fc;
}

.conversations-chat__identity {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.conversation-header-state {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .34rem;
    min-width: 176px;
}

.conversation-header-state__row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(14, 165, 233, 0.24);
    background: rgba(15, 23, 42, 0.52);
    padding: .18rem .22rem .18rem .62rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.conversation-header-state__row.is-open {
    border-color: rgba(14, 165, 233, 0.52);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
}

.conversation-header-state__caption {
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 650;
}

.conversation-header-state__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-width: 112px;
    min-height: 26px;
    padding: .08rem .38rem .08rem .18rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.conversation-header-state__trigger:hover {
    color: #e0f2fe;
}

.conversation-header-state__trigger:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.conversation-header-state__trigger i {
    color: #7dd3fc;
    font-size: .78rem;
}

.conversation-header-state__trigger:focus {
    outline: 0;
    box-shadow: none;
}

.conversation-header-state__menu {
    position: absolute;
    top: calc(100% + .32rem);
    right: 0;
    z-index: 30;
    min-width: 178px;
    padding: .28rem;
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.34);
}

.conversation-header-state__option {
    width: 100%;
    min-height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-muted);
    text-align: left;
    padding: .42rem .55rem;
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
}

.conversation-header-state__option:hover,
.conversation-header-state__option.is-active {
    background: rgba(14, 165, 233, 0.14);
    color: var(--color-text);
}

.conversation-header-state__option.is-active {
    font-weight: 850;
}

.conversation-header-state__close {
    min-height: 28px;
    padding: .2rem .56rem;
    border-radius: 999px;
    font-size: .71rem;
    font-weight: 750;
    color: var(--color-muted);
}

.conversation-header-state__closed {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 800;
}

.conversations-thread-shell {
    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.conversations-thread {
    flex: 1 1 auto;
    justify-content: flex-start;
    align-content: flex-start;
    padding-right: .25rem;
}

.message-card {
    display: grid;
    gap: .25rem;
    padding: .55rem .72rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    min-width: min(18rem, 100%);
    max-width: min(92%, 720px);
    overflow-wrap: break-word;
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.10);
}

.message-card--incoming {
    background: rgba(255, 255, 255, 0.04);
    align-self: flex-start;
}

.message-card--outgoing {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(20, 184, 166, 0.12));
    align-self: flex-end;
}

.message-card--internal {
    background: rgba(245, 158, 11, 0.12);
    border-style: dashed;
    align-self: center;
}

.message-card__footer {
    color: var(--color-muted);
    font-size: .68rem;
    line-height: 1;
    opacity: .78;
}

.message-card__quote {
    appearance: none;
    border: 0;
    display: grid;
    gap: .12rem;
    width: 100%;
    min-width: 0;
    margin-bottom: .15rem;
    padding: .38rem .5rem;
    border-left: 3px solid rgba(14, 165, 233, .72);
    border-radius: 6px;
    background: rgba(2, 6, 23, .22);
    color: var(--color-muted);
    font-family: inherit;
    font-size: .72rem;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.message-card__quote:hover,
.message-card__quote:focus-visible {
    border-left-color: rgba(34, 211, 238, .95);
    background: rgba(8, 47, 73, .38);
}

.message-card__quote:focus-visible {
    outline: 2px solid rgba(56, 189, 248, .7);
    outline-offset: 2px;
}

.message-card__quote span,
.message-card__quote strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__quote strong {
    color: var(--color-text);
    font-size: .78rem;
    font-weight: 800;
}

.message-row--jump-target .message-card {
    animation: message-jump-highlight 2.4s ease;
}

@keyframes message-jump-highlight {
    0%,
    100% {
        box-shadow: 0 4px 14px rgba(2, 6, 23, 0.10);
    }

    18%,
    70% {
        box-shadow: 0 0 0 2px rgba(34, 211, 238, .85), 0 12px 30px rgba(14, 165, 233, .25);
    }
}

.message-card__footer span:nth-child(2) {
    display: none;
}

.message-card:has(.message-attachments) .message-card__footer { display: none; }

.message-card__delivery {
    display: flex;
    justify-content: flex-end;
    margin-top: .25rem;
}

.message-delivery {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--color-muted);
    font-size: .68rem;
    line-height: 1;
}

.message-delivery span {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-delivery.is-sent,
.message-delivery.is-read {
    color: #7dd3fc;
}

.message-delivery.is-pending {
    color: #fbbf24;
}

.message-delivery.is-error {
    color: #f87171;
}

.message-new-divider {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--color-danger);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.message-new-divider::before,
.message-new-divider::after {
    content: "";
    height: 1px;
    background: rgba(239, 68, 68, 0.65);
    flex: 1 1 auto;
}

.message-new-divider span {
    border: 1px solid rgba(239, 68, 68, 0.65);
    border-radius: 999px;
    padding: .08rem .45rem;
    background: var(--color-panel);
}

.conversation-event-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    max-width: min(680px, 92%);
    margin: .25rem auto;
    padding: .38rem .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(15, 23, 42, .62);
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 8px 22px rgba(2, 6, 23, .16);
}

.conversation-event-divider__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.conversation-event-divider__link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(125, 211, 252, .55);
    text-underline-offset: 3px;
}

.conversation-event-divider__link:hover,
.conversation-event-divider__link:focus-visible {
    color: #e0f2fe;
    text-decoration-color: currentColor;
}

.conversation-event-divider__time {
    flex: 0 0 auto;
    color: #7dd3fc;
    font-size: .72rem;
    font-weight: 900;
}

.conversations-page--odoo .conversation-date-divider {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: .85rem 0 .9rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(.97);
    transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}

.conversations-page--odoo .conversation-date-divider.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.conversations-page--odoo .conversation-date-divider span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: .32rem .86rem;
    border-radius: 999px;
    background: rgba(24, 34, 41, .92);
    color: rgba(233, 237, 239, .88);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .24);
    backdrop-filter: blur(8px);
}

.conversation-audit-results {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    padding: 1rem;
}

.conversation-audit-results__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}

.conversation-audit-results__list {
    display: grid;
    gap: .55rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: .35rem;
}

.conversation-audit-result {
    width: 100%;
    padding: .72rem .8rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(15, 23, 42, .42);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

.conversation-audit-result:hover {
    border-color: rgba(56, 189, 248, .34);
    background: rgba(14, 165, 233, .12);
}

.conversation-audit-result__top,
.conversation-audit-result__meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.conversation-audit-result__top {
    justify-content: space-between;
    margin-bottom: .32rem;
}

.conversation-audit-result__top strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-audit-result__top span,
.conversation-audit-result__meta {
    color: var(--color-muted);
    font-size: .76rem;
}

.conversation-audit-result__meta {
    flex-wrap: wrap;
    margin-bottom: .38rem;
}

.conversation-audit-result__meta span {
    padding: .12rem .38rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, .1);
}

.conversation-audit-result p {
    margin: 0;
    color: #cfe8ff;
    font-size: .9rem;
    line-height: 1.35;
}

.conversations-latest-button {
    position: absolute;
    right: 1.1rem;
    bottom: 1rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: 999px;
    padding: .48rem .8rem;
    background: var(--color-panel-strong);
    color: var(--color-text);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.20);
    font-size: .82rem;
    font-weight: 800;
}

.conversations-latest-button strong {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: white;
    font-size: .72rem;
}

.conversations-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .5rem .65rem;
    border-top: 1px solid var(--color-border);
    margin-top: .42rem;
    padding-top: .42rem;
    flex: 0 0 auto;
}

.conversations-composer--support {
    position: relative;
    max-height: min(34vh, 300px);
    overflow: auto;
    padding-right: .2rem;
    scrollbar-width: thin;
}

.conversations-drop-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.conversations-composer--support.is-file-dragging {
    outline: 2px dashed rgba(14, 165, 233, .85);
    outline-offset: -7px;
    background: rgba(14, 165, 233, .12);
}

.conversations-composer--support.is-file-dragging::after {
    content: "Soltá el archivo para adjuntarlo";
    position: absolute;
    inset: .45rem;
    z-index: 5;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(2, 6, 23, .68);
    color: #dbeafe;
    font-size: .92rem;
    font-weight: 800;
    pointer-events: none;
}

.conversations-composer--support > .conversations-inline,
.conversations-composer--support > .context-card {
    grid-column: 1 / -1;
}

.conversations-composer--support > .context-card {
    border-radius: 12px;
    padding: .72rem .85rem;
}

.conversations-composer--support > .context-card .context-card__muted {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-height: 4.2rem;
    overflow: auto;
}

.conversation-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: .2rem 0 .38rem;
    color: #74d7ff;
    font-size: .78rem;
    font-weight: 700;
}

.conversation-typing-indicator__dots {
    display: inline-flex;
    align-items: center;
    gap: .16rem;
}

.conversation-typing-indicator__dots i {
    width: .28rem;
    height: .28rem;
    border-radius: 999px;
    background: currentColor;
    opacity: .55;
    animation: typing-dot 1.05s infinite ease-in-out;
}

.conversation-typing-indicator__dots i:nth-child(2) {
    animation-delay: .14s;
}

.conversation-typing-indicator__dots i:nth-child(3) {
    animation-delay: .28s;
}

@keyframes typing-dot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .45;
    }

    40% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

.conversations-composer--support > .conversations-composer__actions {
    grid-column: 2;
    align-self: end;
    grid-row: auto;
}

.conversations-composer--support > .conversations-composer__reply {
    grid-column: 1;
    grid-row: 1;
}

.conversations-composer--support > .conversations-composer__note {
    grid-column: 1;
    grid-row: 3;
}

.conversations-pending-list {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    max-width: 100%;
}

.conversations-pending-list--reply {
    grid-column: 1;
    grid-row: 2;
}

.conversations-pending-attachment {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    max-width: min(300px, 100%);
    padding: .38rem .45rem;
    border: 1px solid rgba(14, 165, 233, .26);
    border-radius: 7px;
    background: rgba(14, 165, 233, .08);
    color: var(--color-text);
}

.conversations-pending-attachment.has-error {
    border-color: rgba(239, 68, 68, .45);
    background: rgba(239, 68, 68, .08);
}

.conversations-pending-attachment.is-loading {
    border-color: rgba(14, 165, 233, .42);
    background: rgba(14, 165, 233, .1);
}

.conversations-pending-attachment > .bi {
    color: var(--color-primary);
}

.conversations-pending-attachment.is-loading > .bi {
    animation: pending-attachment-icon-pulse 1.05s ease-in-out infinite;
}

.conversations-pending-attachment.has-error > .bi {
    color: #f87171;
}

.conversations-pending-attachment > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8rem;
    font-weight: 700;
}

.conversations-pending-attachment__error {
    max-width: min(360px, 48vw);
    color: #fecaca;
    font-size: .72rem;
    font-weight: 700;
}

.conversations-pending-attachment__loading {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    padding-inline: .25rem;
}

.conversations-pending-attachment__loading i {
    width: .28rem;
    height: .28rem;
    border-radius: 999px;
    background: #67e8f9;
    opacity: .45;
    animation: pending-attachment-dot 1s ease-in-out infinite;
}

.conversations-pending-attachment__loading i:nth-child(2) {
    animation-delay: .14s;
}

.conversations-pending-attachment__loading i:nth-child(3) {
    animation-delay: .28s;
}

.conversations-pending-attachment .btn {
    display: inline-grid !important;
    place-items: center;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 50%;
    line-height: 1;
    flex: 0 0 28px;
}

.conversations-pending-attachment .btn .bi,
.conversations-pending-attachment > .bi {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    line-height: 1;
}

.conversations-pending-attachment .btn .bi::before,
.conversations-pending-attachment > .bi::before {
    display: block;
    margin: 0;
    line-height: 1;
    vertical-align: 0;
}

@keyframes pending-attachment-dot {
    0%,
    80%,
    100% {
        opacity: .35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@keyframes pending-attachment-icon-pulse {
    0%,
    100% {
        opacity: .65;
    }

    50% {
        opacity: 1;
    }
}

.message-contact-list {
    display: grid;
    gap: .45rem;
    margin-top: .35rem;
}

.message-contact-card {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-width: min(280px, 100%);
    padding: .62rem;
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 8px;
    background: rgba(15, 23, 42, .32);
}

.message-contact-card__icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(14, 165, 233, .14);
    color: var(--color-primary);
}

.message-contact-card__body {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.message-contact-card__body strong,
.message-contact-card__body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-contact-card__body span {
    color: var(--color-muted);
    font-size: .82rem;
}

.message-contact-card .btn {
    white-space: nowrap;
}

.conversations-composer.conversations-composer--support > .conversations-composer__actions {
    grid-column: 2;
    align-self: end;
}

.conversations-composer.conversations-composer--support > .conversations-composer__actions--reply {
    grid-row: 1;
}

.conversations-composer.conversations-composer--support > .conversations-composer__actions--note {
    grid-row: 3;
}

.conversations-composer--support .conversations-inline--error {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .58rem .75rem;
    line-height: 1.25;
}

.conversations-composer--support > .field textarea {
    min-height: 38px;
    max-height: 180px;
    resize: vertical;
    overflow: auto;
}

.conversations-composer--support > .field label {
    font-size: .76rem;
}

.conversations-composer--support .btn {
    min-height: 38px;
}

.conversations-composer textarea {
    min-height: 42px;
    max-height: 180px;
    resize: vertical;
    overflow: auto;
}

.conversations-composer .field {
    gap: .35rem;
}

.conversations-composer .field {
    grid-column: 1;
}

.conversations-composer__actions {
    justify-content: flex-start;
}

.templates-page .page-intro__text {
    max-width: 760px;
}

.templates-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1.1fr) minmax(280px, 360px);
}

.templates-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: .7rem;
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.templates-form .field {
    grid-column: auto;
}

.templates-form .field:has(textarea),
.templates-form label.field,
.templates-form .conversations-composer__actions,
.templates-form .conversations-inline {
    grid-column: 1 / -1;
}

.templates-form textarea {
    max-height: none;
}

.templates-form .conversations-composer__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: .15rem;
}

.templates-preview {
    gap: .85rem;
}

.templates-preview .message-card {
    align-self: stretch;
    max-width: 100%;
}

.templates-preview .message-card__text,
.templates-preview .context-card__muted {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.conversations-context {
    gap: 1rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.46) rgba(15, 23, 42, 0.18);
}

.context-card {
    display: grid;
    gap: .35rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
}

.context-card__label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .76rem;
    color: var(--color-muted);
    font-weight: 800;
}

.conversations-context__hint {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .72rem .85rem;
    border: 1px solid rgba(14, 165, 233, .22);
    border-radius: 8px;
    background: rgba(14, 165, 233, .08);
    color: var(--color-text-muted);
    font-size: .78rem;
    line-height: 1.35;
}

.conversations-context__hint .bi {
    color: var(--color-primary);
    margin-top: .1rem;
}

.conversations-inline {
    border-radius: 16px;
    padding: .9rem 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.conversations-inline--ok {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.24);
}

.conversations-inline--error,
.conversations-error {
    background: rgba(239, 68, 68, 0.10);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: 16px;
    padding: .9rem 1rem;
    overflow-wrap: anywhere;
}

.conversations-empty {
    color: var(--color-muted);
    padding: 1rem 0;
}

.conversations-empty--center {
    display: grid;
    place-items: center;
    min-height: 240px;
    text-align: center;
}

html[data-theme="light"] .conversation-row {
    background: #fff;
}

html[data-theme="light"] .conversation-row:hover {
    background: #f8fbfd;
}

html[data-theme="light"] .message-card--incoming,
html[data-theme="light"] .context-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .message-card--internal {
    background: rgba(245, 158, 11, 0.10);
}

html[data-theme="light"] .message-attachment--image .btn {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(0, 0, 0, 0.18);
    color: #1e293b;
}

html[data-theme="light"] .message-attachment--image .btn:hover {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(14, 165, 233, 0.55);
}

html[data-theme="light"] .message-reactions {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .message-action-button {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .conversation-badge--state {
    color: #0369a1;
}

html[data-theme="light"] .conversations-list__items,
html[data-theme="light"] .conversations-thread,
html[data-theme="light"] .conversations-context {
    scrollbar-color: rgba(2, 132, 199, 0.55) rgba(226, 232, 240, 0.75);
}

html[data-theme="light"] .conversations-list__items::-webkit-scrollbar-track,
html[data-theme="light"] .conversations-thread::-webkit-scrollbar-track,
html[data-theme="light"] .conversations-context::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.75);
}

html[data-theme="light"] .conversations-list__items::-webkit-scrollbar-thumb,
html[data-theme="light"] .conversations-thread::-webkit-scrollbar-thumb,
html[data-theme="light"] .conversations-context::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.62), rgba(13, 148, 136, 0.52));
    border: 2px solid transparent;
    background-clip: content-box;
}

.conversations-page--odoo,
.templates-page--odoo {
    --conv-font-scale: .86;
    --conv-control-h: 30px;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding: 0;
    min-height: calc(100vh - 5rem);
    height: calc(100vh - 5rem);
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    border: 0;
    border-radius: 0;
    font-size: calc(1rem * var(--conv-font-scale));
}

.templates-page--odoo {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.shell:not(.shell--collapsed) .templates-page--odoo {
    position: fixed;
    inset: 0 0 0 300px;
    z-index: 25;
    min-height: 100vh;
    height: 100vh;
}

.shell.shell--collapsed .templates-page--odoo {
    position: fixed;
    inset: 0 0 0 92px;
    z-index: 25;
    min-height: 100vh;
    height: 100vh;
}

.templates-page--odoo .conversations-topbar {
    min-height: 68px;
    margin: 0;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.templates-page--odoo .conversations-topbar .page-intro__title {
    font-size: 1.15rem;
    line-height: 1.15;
}

.templates-page--odoo .conversations-topbar .page-intro__text {
    display: block;
    margin-top: .25rem;
    max-width: 680px;
    font-size: .86rem;
}

.shell:not(.shell--collapsed) .conversations-page--odoo {
    position: fixed;
    inset: 0 0 0 300px;
    z-index: 25;
    min-height: 100vh;
    height: 100vh;
}

.shell.shell--collapsed .conversations-page--odoo {
    position: fixed;
    inset: 0 0 0 92px;
    z-index: 25;
    min-height: 100vh;
    height: 100vh;
}

.conversations-page--odoo .conversations-filters,
.templates-page--odoo > .panel-card {
    border-radius: 0;
    border-width: 0 0 1px 0;
    background: var(--color-bg);
}

.templates-page--odoo .templates-filters {
    padding: .55rem .85rem;
}

.templates-page--odoo .conversations-filters__fields {
    grid-template-columns: minmax(260px, 1.35fr) minmax(180px, .7fr) auto auto;
    align-items: end;
}

.templates-toggle {
    min-height: 38px;
    padding: .42rem .72rem;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-panel-strong);
    color: var(--color-text);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

.templates-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #14b8a6;
}

.conversations-page--odoo .conversations-filters {
    grid-template-columns: auto 1fr auto;
    padding: .28rem .5rem;
    gap: .28rem .45rem;
}

.conversations-page--odoo .conversations-filters__modes,
.conversations-page--odoo .conversations-canal,
.conversations-page--odoo .conversations-filters__fields {
    gap: .35rem;
}

.conversations-page--odoo .conversations-filter-pill,
.conversations-page--odoo .btn {
    min-height: 28px;
    padding: .24rem .56rem;
    font-size: .78rem;
}

.conversations-page--odoo .conversations-filters__fields .field:first-child {
    position: relative;
}

.conversations-page--odoo .conversations-filters__fields input,
.conversations-page--odoo .conversations-filters__fields select {
    min-height: 32px;
    padding: .36rem .56rem;
    font-size: .82rem;
}

.conversations-contact-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + .45rem);
    z-index: 52;
    display: grid;
    gap: .35rem;
    max-height: min(420px, 70vh);
    overflow: auto;
    padding: .45rem;
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 8px;
    background: #0f172a;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
    transform-origin: top left;
    animation: support-dropdown-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

.conversations-contact-suggest::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.conversations-contact-suggest::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 23, 42, .35);
}

.conversations-contact-suggest::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid rgba(15, 23, 42, .35);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(34, 211, 238, .88), rgba(14, 165, 233, .72));
}

.conversations-contact-suggest::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(103, 232, 249, .95), rgba(14, 165, 233, .88));
}

.conversations-contact-suggest__header,
.conversations-contact-suggest__state,
.conversations-contact-suggest__item,
.conversations-contact-suggest__actions,
.conversations-contact-suggest__preview {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.conversations-contact-suggest__header {
    justify-content: space-between;
    padding: .15rem .2rem .35rem;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.conversations-contact-suggest__state {
    padding: .7rem;
    color: var(--color-muted);
    font-size: .86rem;
}

.conversations-contact-suggest__item {
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: .58rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background: rgba(15, 23, 42, .72);
}

.conversations-contact-suggest__main {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.conversations-contact-suggest__main strong,
.conversations-contact-suggest__main span,
.conversations-contact-suggest__main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-contact-suggest__main span,
.conversations-contact-suggest__main small,
.conversations-contact-suggest__preview {
    color: var(--color-muted);
    font-size: .78rem;
}

.conversations-contact-suggest__actions {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.conversations-contact-suggest__preview {
    flex-basis: 100%;
    flex-wrap: wrap;
    padding-top: .35rem;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.conversations-module-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .28rem;
}

.conversations-module-actions .btn {
    width: var(--conv-control-h);
    min-width: var(--conv-control-h);
    height: var(--conv-control-h);
    padding: 0;
    justify-content: center;
}

.conversations-module-actions .conversations-context-button {
    width: auto;
    min-width: 104px;
    padding: 0 .65rem;
    gap: .42rem;
    border-color: rgba(14, 165, 233, .36);
    background: rgba(14, 165, 233, .12);
    color: var(--color-text);
    font-weight: 800;
}

.conversations-module-actions .conversations-context-button:hover {
    background: rgba(14, 165, 233, .18);
    border-color: rgba(14, 165, 233, .52);
}

.conversations-module-actions .conversations-ticket-button {
    width: auto;
    min-width: 112px;
    padding: 0 .7rem;
    gap: .42rem;
    white-space: nowrap;
    font-weight: 800;
}

.conversations-page--odoo .conversations-layout {
    grid-template-columns: minmax(235px, 300px) minmax(0, 1fr);
    gap: 0;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.conversations-page--odoo .conversations-list,
.templates-page--odoo .conversations-list {
    border-radius: 0;
    border-width: 0 1px 0 0;
    background: rgba(15, 23, 42, 0.28);
    padding: .45rem .55rem;
}

.conversations-panel-backdrop {
    position: absolute;
    inset: 0;
    z-index: 30;
    border: 0;
    background: rgba(0, 0, 0, .18);
    animation: support-modal-backdrop-in .18s ease-out both;
}

.conversations-page--odoo .conversations-list__header,
.templates-page--odoo .conversations-list__header {
    margin-bottom: .35rem;
}

.conversations-page--odoo .conversation-row,
.templates-page--odoo .conversation-row {
    border: 0;
    border-radius: 5px;
    background: transparent;
    padding: .42rem .5rem;
    gap: .22rem;
}

.conversations-page--odoo .conversation-row:hover,
.templates-page--odoo .conversation-row:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.04);
}

.conversations-page--odoo .conversation-row.is-selected,
.templates-page--odoo .conversation-row.is-selected {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(20, 184, 166, 0.08));
    border-color: rgba(14, 165, 233, 0.28);
}

.conversations-page--odoo .conversation-badge,
.templates-page--odoo .conversation-badge {
    border-radius: 5px;
    padding: .12rem .34rem;
    font-size: .68rem;
}

.conversations-page--odoo .conversations-chat,
.templates-page--odoo .conversations-chat {
    position: relative;
    border: 0;
    border-radius: 0;
    background: var(--color-panel);
    padding: 0;
}

.conversations-page--odoo .conversations-chat__header,
.templates-page--odoo .conversations-chat__header {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .2rem .75rem;
    min-height: 48px;
    margin: 0;
    padding: .38rem .75rem .32rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-panel);
    flex: 0 0 auto;
}

.conversations-page--odoo .conversations-chat__header > div:first-child,
.templates-page--odoo .conversations-chat__header > div:first-child {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.conversations-page--odoo .conversations-chat__chips {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .24rem;
    margin-top: .06rem;
}

.conversations-page--odoo .conversations-chat__header .panel-card__title,
.conversations-page--odoo .conversations-chat__header .panel-card__subtitle {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-window-banner {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 30px;
    padding: .28rem .75rem;
    background: #241e12;
    border-bottom: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 1px 0 rgba(245, 158, 11, .12);
    color: #fde68a;
    font-size: .78rem;
    font-weight: 800;
    flex: 0 0 auto;
    animation: support-slide-up-in .18s ease-out both;
}

.conversations-page--odoo .conversations-chat__header .panel-card__title {
    font-size: .95rem;
}

.conversation-title-editor {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.conversation-title-editor .panel-card__title {
    flex: 0 1 auto;
}

.conversation-title-editor__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    min-height: 1.85rem;
    padding: 0;
    white-space: nowrap;
}

.conversation-title-editor__input {
    width: min(36rem, 100%);
    min-height: 2.15rem;
    padding: .45rem .7rem;
    border: 1px solid rgba(34, 211, 238, .45);
    border-radius: 10px;
    background: rgba(2, 6, 23, .72);
    color: #f8fafc;
    font: inherit;
    font-size: .95rem;
    font-weight: 800;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.conversation-title-editor__input:disabled {
    opacity: .7;
}

.conversations-page--odoo .conversations-chat__header .panel-card__subtitle {
    font-size: .76rem;
}

.conversations-window-banner span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.conversations-window-banner .btn {
    position: static;
    justify-self: end;
    white-space: nowrap;
    min-width: max-content;
    z-index: 3;
}

.conversations-ticket-selection {
    background: rgba(20, 184, 166, .12);
    border-bottom-color: rgba(45, 212, 191, .28);
    color: #99f6e4;
}

.message-ticket-selector {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(45, 212, 191, .28);
    background: rgba(15, 23, 42, .62);
    cursor: pointer;
}

.message-ticket-selector input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-secondary);
}

.message-card--ticket-selected {
    border-color: rgba(45, 212, 191, .68) !important;
    box-shadow: 0 0 0 2px rgba(45, 212, 191, .12);
}

.conversations-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(2, 6, 23, .48);
    backdrop-filter: blur(3px);
    animation: support-modal-backdrop-in .18s ease-out both;
}

.conversations-modal {
    position: fixed;
    z-index: 901;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 2rem));
    max-height: min(760px, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: auto;
    transform-origin: center;
    animation: conversations-centered-modal-in .2s cubic-bezier(.2, .8, .2, 1) both;
}

.conversations-ticket-dialog {
    width: min(560px, calc(100vw - 2rem));
    padding: clamp(1rem, 2.4vh, 1.35rem);
    gap: clamp(.65rem, 1.6vh, 1rem);
    overscroll-behavior: contain;
}

.conversations-ticket-dialog .panel-card__header {
    flex: 0 0 auto;
}

.conversations-ticket-dialog .tickets-from-conversation-form {
    flex: 0 0 auto;
}

.conversations-ticket-dialog > .actions {
    position: sticky;
    bottom: calc(-1 * clamp(1rem, 2.4vh, 1.35rem));
    z-index: 2;
    margin: 0 calc(-1 * clamp(1rem, 2.4vh, 1.35rem)) calc(-1 * clamp(1rem, 2.4vh, 1.35rem));
    padding: .85rem clamp(1rem, 2.4vh, 1.35rem) clamp(1rem, 2.4vh, 1.35rem);
    border-top: 1px solid rgba(148, 163, 184, .14);
    background: linear-gradient(180deg, rgba(15, 23, 42, .86), rgba(15, 23, 42, .98));
    backdrop-filter: blur(10px);
}

.conversations-ticket-dialog textarea {
    min-height: clamp(5rem, 15vh, 7rem);
    resize: vertical;
}

.conversations-link-client-dialog {
    width: min(620px, calc(100vw - 2rem));
    padding: clamp(1rem, 2.4vh, 1.35rem);
    gap: 1rem;
}

.conversations-link-client-search {
    align-items: end;
    display: grid;
    gap: .85rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.conversations-link-client-dialog input {
    background: rgba(8, 20, 36, .92);
    border: 1px solid rgba(83, 124, 172, .42);
    border-radius: .45rem;
    color: var(--text-main, #e7f1ff);
    min-height: 2.45rem;
    padding: .52rem .7rem;
}

.conversations-link-client-dialog input:focus {
    border-color: rgba(34, 211, 238, .82);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .16);
    outline: 0;
}

.conversations-link-client-results {
    display: grid;
    gap: .75rem;
}

.conversations-link-client-result {
    align-items: stretch;
    background: rgba(11, 27, 46, .72);
    border: 1px solid rgba(83, 124, 172, .34);
    border-radius: .42rem;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 0;
    grid-template-columns: 4.25rem minmax(0, 1fr) 2.5rem;
    min-height: 4.7rem;
    overflow: hidden;
    padding: 0;
    text-align: left;
}

.conversations-link-client-result:hover,
.conversations-link-client-result:focus-visible {
    background: rgba(13, 33, 56, .9);
    border-color: rgba(34, 211, 238, .62);
    outline: 0;
}

.conversations-link-client-result__avatar {
    align-items: center;
    background: #2f95c7;
    color: #fff;
    display: flex;
    font-size: 1.85rem;
    font-weight: 800;
    justify-content: center;
}

.conversations-link-client-result__body {
    display: grid;
    gap: .18rem;
    min-width: 0;
    padding: .72rem .85rem;
}

.conversations-link-client-result__body strong,
.conversations-link-client-result__body span,
.conversations-link-client-result__body small {
    overflow-wrap: anywhere;
}

.conversations-link-client-result__body small,
.conversations-link-client-result__body span {
    color: var(--text-muted, #8da2bf);
}

.conversations-link-client-result > i {
    align-self: center;
    color: var(--accent, #22d3ee);
    justify-self: center;
}

.conversations-ticket-dialog::-webkit-scrollbar,
.conversations-ticket-duplicates__list::-webkit-scrollbar {
    width: 8px;
}

.conversations-ticket-dialog::-webkit-scrollbar-track,
.conversations-ticket-duplicates__list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .35);
}

.conversations-ticket-dialog::-webkit-scrollbar-thumb,
.conversations-ticket-duplicates__list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(56, 189, 248, .55);
}

@keyframes conversations-centered-modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 10px)) scale(.985);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tickets-from-conversation-form {
    display: grid;
    gap: .8rem;
}

.ticket-creator-assignment {
    display: grid;
    gap: .2rem;
    min-height: 2.55rem;
    padding: .65rem .75rem;
    border: 1px solid rgba(34, 211, 238, .24);
    border-radius: 10px;
    background: rgba(34, 211, 238, .08);
    color: #e5f6ff;
}

.ticket-creator-assignment span {
    font-weight: 700;
}

.ticket-creator-assignment small {
    color: #8fb4ca;
}

.conversations-ticket-duplicates {
    display: grid;
    gap: .75rem;
    margin-bottom: .9rem;
    padding: .85rem;
    border: 1px solid rgba(245, 158, 11, .32);
    border-radius: 10px;
    background: rgba(245, 158, 11, .08);
    animation: support-panel-in .18s ease-out both;
}

.conversations-ticket-duplicates--loading {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    color: #fde68a;
}

.conversations-ticket-duplicates__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
    color: #fde68a;
}

.conversations-ticket-duplicates__head > i {
    margin-top: .1rem;
}

.conversations-ticket-duplicates__head div {
    display: grid;
    gap: .15rem;
}

.conversations-ticket-duplicates__head span,
.conversations-ticket-duplicate span,
.conversations-ticket-duplicate small {
    color: var(--color-muted);
}

.conversations-ticket-duplicates__terms {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.conversations-ticket-duplicates__terms span {
    border: 1px solid rgba(245, 158, 11, .28);
    border-radius: 999px;
    background: rgba(245, 158, 11, .12);
    color: #fde68a;
    font-size: .75rem;
    font-weight: 800;
    padding: .22rem .5rem;
}

.conversations-ticket-duplicates__list {
    display: grid;
    gap: .5rem;
    max-height: min(210px, 22vh);
    overflow: auto;
    padding-right: .2rem;
}

.conversations-ticket-duplicate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .62rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(2, 6, 23, .32);
}

.conversations-ticket-duplicate > div {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.conversations-context-tickets {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
    animation: support-panel-in .18s ease-out both;
}

.conversations-context-ticket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
    padding: .62rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(2, 6, 23, .28);
}

.conversations-context-ticket > div {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.conversations-context-ticket span,
.conversations-context-ticket small {
    color: var(--color-muted);
}

.conversations-page--odoo .conversations-thread-shell {
    position: relative;
    z-index: 1;
    min-height: 0;
}

.conversations-page--odoo .conversations-thread {
    padding: .7rem .75rem .9rem;
    background: var(--color-panel);
    overflow-x: hidden;
}

.conversations-page--odoo .message-row {
    gap: .32rem;
    padding-bottom: .58rem;
}

.conversations-page--odoo .message-row:has(.message-reactions) {
    padding-bottom: 1.18rem;
}

.conversations-page--odoo .message-bubble-shell {
    max-width: min(72%, 620px);
}

.conversations-page--odoo .message-row:has(.message-actions) .message-bubble-shell {
    max-width: min(72%, calc(100% - 2rem));
}

.message-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: .85rem;
    animation: message-enter .18s ease both;
}

/* cuando hay reaccion necesita más espacio abajo */
.message-row:has(.message-reactions) {
    padding-bottom: 1.55rem;
}

.message-row--incoming {
    justify-content: flex-start;
}

.message-row--outgoing {
    justify-content: flex-end;
}

.message-row--outgoing .message-actions {
    order: -1;
}

.message-bubble-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 1 auto;
    max-width: min(76%, 720px);
    min-width: 0;
}

.message-row--outgoing .message-bubble-shell {
    align-items: flex-end;
}

.message-row:has(.message-actions) .message-bubble-shell {
    max-width: min(76%, calc(100% - 2.35rem));
}

.conversations-page--odoo .message-card {
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    min-width: min(13rem, 100%);
    max-width: 100%;
    width: fit-content;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.conversations-page--odoo .message-card__text,
.conversations-page--odoo .message-card__meta,
.conversations-page--odoo .message-card__footer,
.conversations-page--odoo .attachment-name,
.conversations-page--odoo .attachment-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.conversations-page--odoo .message-card__text {
    font-size: .86rem;
}

.conversations-page--odoo .message-card__meta,
.conversations-page--odoo .message-card__footer {
    font-size: .72rem;
}

.conversations-page--odoo .message-card__quote {
    max-width: 100%;
    background: rgba(15, 23, 42, .36);
}

.conversations-page--odoo .message-card--outgoing .message-card__quote {
    border-left-color: rgba(167, 139, 250, .9);
    background: rgba(2, 6, 23, .24);
}

.conversations-page--odoo .message-attachments {
    gap: .35rem;
    margin-top: .28rem;
}

.conversations-page--odoo .message-attachment--image img {
    max-width: min(170px, 100%);
    max-height: 118px;
}

.conversations-page--odoo .message-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(2, 6, 23, .22);
}

.conversations-page--odoo .message-card--incoming {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.conversations-page--odoo .message-card--outgoing {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(20, 184, 166, 0.14));
    border: 1px solid rgba(14, 165, 233, 0.18);
}

.conversations-page--odoo .message-card--internal {
    background: rgba(168, 85, 247, 0.16);
    border: 1px dashed rgba(168, 85, 247, 0.35);
}

.message-actions {
    position: relative;
    z-index: 40;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    align-self: center;
    gap: .34rem;
    opacity: 0;
    transition: opacity .15s ease;
}

.message-row:hover .message-actions,
.message-actions:focus-within {
    opacity: 1;
}

.message-action-button {
    display: inline-grid;
    place-items: center;
    min-width: 1.65rem;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    line-height: 1;
    transform-origin: center;
    transition: background .14s ease, border-color .14s ease, transform .12s ease;
}

.conversations-page--odoo .message-action-button.btn.btn--sm {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 !important;
}

.message-action-button .bi,
.quoted-reply__clear .bi,
.conversations-latest-button .bi {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    line-height: 1;
    font-size: .8rem;
}

.message-action-button .bi::before,
.quoted-reply__clear .bi::before,
.conversations-latest-button .bi::before {
    display: block;
    margin: 0;
    line-height: 1;
    vertical-align: 0;
}

.message-action-button:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(14, 165, 233, 0.45);
    transform: scale(1.1);
}

.message-reactions {
    position: absolute;
    left: .55rem;
    bottom: -.75rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: .15rem;
    min-height: 1.45rem;
    padding: .12rem .4rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    font-size: .95rem;
    line-height: 1;
}

/* reacciones en mensajes salientes: pegadas a la derecha */
.message-row--outgoing .message-reactions {
    left: auto;
    right: .55rem;
}

.message-reaction-picker {
    position: absolute;
    /* Se abre hacia arriba para no taparse con el compositor. */
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    bottom: calc(100% + .45rem);
    z-index: 220;
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .5rem;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 999px;
    background: #111827;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
    animation: reaction-picker-slide .16s ease both;
    white-space: nowrap;
}

/* En mensajes salientes se alinea desde el lado opuesto del botón. */
.message-row--outgoing .message-reaction-picker {
    right: 50%;
    left: auto;
    top: auto;
    bottom: calc(100% + .45rem);
    transform: translateX(50%);
}

.message-reaction-picker__emoji {
    min-width: 2.15rem;
    padding-inline: .35rem;
    font-size: 1.1rem;
}

.message-bubble-shell > .message-reaction-picker {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    width: max-content;
    max-width: min(100%, calc(100vw - 7rem));
    margin-bottom: .35rem;
    align-self: flex-start;
    order: -1;
    overflow-x: auto;
}

.message-row--outgoing .message-bubble-shell > .message-reaction-picker {
    align-self: flex-end;
    transform: none;
}

.conversations-latest-button {
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.conversations-latest-button:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, .48);
    box-shadow: 0 16px 34px rgba(2, 132, 199, .14);
}

.quoted-reply {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    margin-bottom: .35rem;
    padding-left: .15rem;
    color: #dbeafe;
    font-size: .78rem;
}

.quoted-reply > span:first-child {
    flex: 0 0 auto;
    white-space: nowrap;
}

.quoted-reply__preview {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #93c5fd;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quoted-reply__clear {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 1.65rem;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0 !important;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    line-height: 1;
}

.quoted-reply__clear .bi,
.quoted-reply__clear .bi::before {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
}

.conversations-page--odoo .conversations-composer {
    margin: 0;
    padding: .42rem .75rem;
    border-top: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.32);
}

.conversations-page--odoo .conversations-composer__actions {
    gap: .3rem;
}

.conversations-page--odoo .conversations-composer__actions .btn {
    width: 34px;
    min-width: 34px;
    height: 32px;
    padding: 0;
    justify-content: center;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.conversations-page--odoo .btn:hover:not(:disabled),
.conversations-page--odoo .conversations-composer__actions .btn:hover:not(:disabled),
.conversations-page--odoo .conversations-drawer-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(2, 132, 199, .12);
}

.conversations-page--odoo .btn:active:not(:disabled),
.conversations-page--odoo .conversations-composer__actions .btn:active:not(:disabled) {
    transform: translateY(0) scale(.98);
}

.conversations-page--odoo .conversations-composer textarea,
.conversations-page--odoo .conversations-composer input,
.conversations-page--odoo .conversations-composer select {
    min-height: 34px;
    padding: .42rem .58rem;
    border-radius: 7px;
    background: var(--color-panel-strong);
    font-size: .82rem;
}

.conversations-page--odoo .conversations-context-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 36;
    width: min(350px, 90vw);
    max-height: none;
    transform: translateX(104%);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
    opacity: 0;
    border-radius: 0;
    border-width: 0 0 0 1px;
    background: var(--color-panel);
    box-shadow: -22px 0 44px rgba(0, 0, 0, .32);
}

.conversations-page--odoo .conversations-context-drawer.is-open {
    transform: translateX(0);
    opacity: 1;
}

.conversations-tools-panel {
    position: absolute;
    right: 1rem;
    bottom: 7.5rem;
    z-index: 45;
    width: min(600px, calc(100vw - 2rem));
    max-height: min(460px, calc(100vh - 12rem));
    overflow: auto;
    padding: 1.15rem;
    border: 1px solid rgba(148, 163, 184, .28);
    background: #111827;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
    transform-origin: top left;
    animation: support-dropdown-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

.conversations-tools-panel--composer {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    z-index: 260;
    width: min(600px, calc(100vw - 2rem));
    max-height: min(430px, calc(100dvh - 7.5rem));
    transform-origin: bottom right;
}

.message-bubble-shell > .conversations-tools-panel--reaction {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: 90;
    width: min(360px, calc(100vw - 7rem));
    max-width: 100%;
    max-height: min(260px, calc(100vh - 14rem));
    margin-bottom: .45rem;
    padding: .75rem;
    align-self: flex-start;
    order: -1;
    transform-origin: bottom left;
}

.message-row--outgoing .message-bubble-shell > .conversations-tools-panel--reaction {
    align-self: flex-end;
    transform-origin: bottom right;
}

.conversations-tools-panel--reaction .conversations-tools-panel__search {
    width: 100%;
    margin-bottom: .7rem;
}

.conversations-tools-panel--reaction .conversations-tools-panel__group {
    margin-bottom: .7rem;
}

.conversations-tools-panel--reaction .conversations-tools-panel__grid {
    gap: .35rem;
}

.conversations-tools-panel__tabs {
    justify-content: flex-start;
    gap: .55rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.conversations-tools-panel__search {
    width: min(240px, 100%);
    margin-bottom: 1rem;
}

.conversations-tools-panel__group {
    margin-bottom: 1rem;
}

.conversations-tools-panel__grid,
.conversations-tools-panel__actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .45rem;
}

.conversations-tools-panel__emoji {
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-size: 1rem;
}

.conversations-tools-panel__tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .38rem;
    min-width: 5.75rem;
    min-height: 2.45rem;
    padding-inline: .75rem;
    cursor: pointer;
    white-space: nowrap;
}

.conversations-tools-panel__sticker {
    display: inline-grid;
    place-items: center;
    width: 3.75rem;
    min-width: 3.75rem;
    height: 3.75rem;
    padding: .35rem;
}

.conversations-tools-panel__sticker img {
    width: 2.65rem;
    height: 2.65rem;
    object-fit: contain;
}

@media (max-width: 520px) {
    .conversations-tools-panel {
        right: .65rem;
        width: min(420px, calc(100vw - 1.3rem));
        padding: .9rem;
    }

    .conversations-tools-panel__tool {
        min-width: 2.65rem;
        width: 2.65rem;
        padding-inline: 0;
    }

    .conversations-tools-panel__tool span {
        display: none;
    }
}

@keyframes message-enter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tools-pop {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* animación para el picker de reacciones — incluye el translateY(-50%) del centrado */
@keyframes reaction-picker-slide {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 920px) {
    .message-bubble-shell,
    .message-row:has(.message-actions) .message-bubble-shell {
        max-width: calc(100% - 2.35rem);
    }

    .quoted-reply {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .quoted-reply__preview {
        flex-basis: 100%;
    }
}

.conversations-drawer-close {
    align-self: flex-end;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
}

.conversations-page--odoo textarea,
.conversations-page--odoo select,
.conversations-page--odoo input,
.templates-page--odoo textarea,
.templates-page--odoo select,
.templates-page--odoo input {
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.conversations-page--odoo textarea,
.templates-page--odoo textarea {
    resize: none;
}

.conversations-page--odoo .conversations-composer textarea {
    resize: vertical;
    overflow: auto;
}

.templates-variable-guide {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, .36);
}

.templates-variable-guide .context-card__label {
    flex-basis: 100%;
}

.templates-variable-chip {
    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: 999px;
    background: rgba(8, 145, 178, .16);
    color: var(--color-text);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    padding: .48rem .7rem;
}

.templates-variable-chip:hover {
    border-color: rgba(56, 189, 248, .7);
    background: rgba(8, 145, 178, .28);
}

.templates-body-limit {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .35rem .75rem;
    color: var(--color-muted);
    font-size: .76rem;
    margin-top: .4rem;
}

.templates-body-limit.is-danger {
    color: #fca5a5;
}

.conversations-page--odoo textarea::-webkit-scrollbar,
.templates-page--odoo textarea::-webkit-scrollbar,
.conversations-page--odoo select::-webkit-scrollbar,
.templates-page--odoo select::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.conversations-page--odoo textarea::-webkit-scrollbar-track,
.templates-page--odoo textarea::-webkit-scrollbar-track,
.conversations-page--odoo select::-webkit-scrollbar-track,
.templates-page--odoo select::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.conversations-page--odoo textarea::-webkit-scrollbar-thumb,
.templates-page--odoo textarea::-webkit-scrollbar-thumb,
.conversations-page--odoo select::-webkit-scrollbar-thumb,
.templates-page--odoo select::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, .62);
    border: 2px solid rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.modal-overlay.conversations-template-modal {
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(2, 6, 23, .78);
    backdrop-filter: blur(3px);
    animation: support-modal-backdrop-in .18s ease-out both;
}

.modal-overlay.conversations-new-thread-modal {
    animation: support-modal-backdrop-in .18s ease-out both;
}

.conversations-new-thread-modal__card {
    transform-origin: center;
    animation: support-modal-in .2s cubic-bezier(.2, .8, .2, 1) both;
}

.conversations-template-modal__card {
    width: min(980px, 90vw);
    max-width: 980px;
    max-height: min(760px, 90vh);
    overflow: auto;
    background: var(--color-panel-strong);
    border: 1px solid rgba(148, 163, 184, .24);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
    transform-origin: center;
    animation: support-modal-in .2s cubic-bezier(.2, .8, .2, 1) both;
}

.conversations-template-modal__header,
.conversations-template-modal__body {
    display: grid;
    gap: 1rem;
}

.conversations-template-modal__header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.conversations-template-modal__header p {
    margin: .2rem 0 0;
    color: var(--color-muted);
}

.conversations-template-modal__body {
    grid-template-columns: minmax(280px, .8fr) minmax(320px, 1fr);
    align-items: stretch;
}

.conversations-template-modal__form {
    display: grid;
    gap: .8rem;
}

.conversations-template-phone-preview {
    display: grid;
    align-content: center;
    gap: .6rem;
    padding: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(rgba(15, 23, 42, .96), rgba(15, 23, 42, .96)),
        repeating-linear-gradient(45deg, rgba(148, 163, 184, .08) 0 8px, transparent 8px 16px);
}

.conversations-template-phone-preview .message-card {
    max-width: 100%;
    justify-self: center;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__card {
    box-sizing: border-box;
    width: min(920px, calc(100vw - 3rem));
    max-width: none;
    overflow-x: hidden;
    padding: 1.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .62) rgba(15, 23, 42, .35);
}

.modal-overlay.conversations-template-modal .conversations-template-modal__body {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
    min-width: 0;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__header,
.modal-overlay.conversations-template-modal .conversations-template-modal__form,
.modal-overlay.conversations-template-modal .conversations-template-phone-preview,
.modal-overlay.conversations-template-modal .field,
.modal-overlay.conversations-template-modal .context-card {
    min-width: 0;
}

.modal-overlay.conversations-template-modal select,
.modal-overlay.conversations-template-modal textarea,
.modal-overlay.conversations-template-modal input {
    width: 100%;
    max-width: 100%;
}

.modal-overlay.conversations-template-modal .message-card {
    min-width: 0;
    max-width: 100%;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__card::-webkit-scrollbar,
.modal-overlay.conversations-template-modal .conversations-template-phone-preview::-webkit-scrollbar,
.modal-overlay.conversations-template-modal textarea::-webkit-scrollbar,
.modal-overlay.conversations-template-modal select::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__card::-webkit-scrollbar-track,
.modal-overlay.conversations-template-modal .conversations-template-phone-preview::-webkit-scrollbar-track,
.modal-overlay.conversations-template-modal textarea::-webkit-scrollbar-track,
.modal-overlay.conversations-template-modal select::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__card::-webkit-scrollbar-thumb,
.modal-overlay.conversations-template-modal .conversations-template-phone-preview::-webkit-scrollbar-thumb,
.modal-overlay.conversations-template-modal textarea::-webkit-scrollbar-thumb,
.modal-overlay.conversations-template-modal select::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, .62);
    border: 2px solid rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.modal-overlay.conversations-template-modal .conversations-template-modal__card::-webkit-scrollbar-thumb:hover,
.modal-overlay.conversations-template-modal .conversations-template-phone-preview::-webkit-scrollbar-thumb:hover,
.modal-overlay.conversations-template-modal textarea::-webkit-scrollbar-thumb:hover,
.modal-overlay.conversations-template-modal select::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, .86);
}

@media (max-width: 760px) {
    .modal-overlay.conversations-template-modal {
        padding: 1rem;
    }

    .modal-overlay.conversations-template-modal .conversations-template-modal__card {
        width: min(100%, calc(100vw - 2rem));
        max-height: calc(100vh - 2rem);
    }

    .modal-overlay.conversations-template-modal .conversations-template-modal__body {
        grid-template-columns: 1fr;
    }
}

.templates-page--odoo .templates-layout {
    grid-template-columns: minmax(280px, 320px) minmax(520px, 1fr) minmax(300px, 360px);
    gap: 0;
    height: 100%;
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.templates-page--odoo .templates-editor,
.templates-page--odoo .templates-preview {
    border-radius: 0;
    min-width: 0;
    min-height: max-content;
}

.templates-page--odoo .templates-form {
    height: auto;
    min-height: max-content;
    overflow: visible;
    padding: 1rem 1.1rem;
    background: var(--color-panel);
    padding-bottom: 1.35rem;
}

.templates-page--odoo .templates-form .conversations-composer__actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: .35rem -1.1rem -1.35rem;
    padding: .75rem 1.1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, .86), var(--color-panel));
    border-top: 1px solid var(--color-border);
}

.templates-page--odoo .templates-preview {
    border-width: 0 0 0 1px;
    background: rgba(15, 23, 42, 0.28);
    padding: 1rem 1.1rem;
    overflow: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.templates-page--odoo .templates-layout::-webkit-scrollbar,
.templates-page--odoo .templates-form::-webkit-scrollbar,
.templates-page--odoo .templates-preview::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.templates-page--odoo .templates-layout::-webkit-scrollbar-track,
.templates-page--odoo .templates-form::-webkit-scrollbar-track,
.templates-page--odoo .templates-preview::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.templates-page--odoo .templates-layout::-webkit-scrollbar-thumb,
.templates-page--odoo .templates-form::-webkit-scrollbar-thumb,
.templates-page--odoo .templates-preview::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, .62);
    border: 2px solid rgba(15, 23, 42, .35);
    border-radius: 999px;
}

.conv-config-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.conv-stats-page {
    gap: .85rem;
    display: flex;
    flex-direction: column;
    align-content: stretch;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.conv-stats-hero {
    align-items: center;
}

.conv-stats-filters {
    padding: .75rem .9rem;
    position: relative;
    z-index: 1;
}

.conv-stats-board {
    display: grid;
    gap: 1rem;
    margin: 0 1rem 1rem;
    padding: 1rem;
    min-height: auto;
    overflow: visible;
    border-radius: 8px;
    position: relative;
    z-index: 0;
}

.conv-stats-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, .9fr) auto;
    align-items: end;
    gap: .7rem;
}

.conv-stats-range-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .65rem;
}

.conv-stats-range-tab {
    min-height: 30px;
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 999px;
    padding: .35rem .85rem;
    background: rgba(15, 23, 42, .34);
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
}

.conv-stats-range-tab:hover,
.conv-stats-range-tab.is-active {
    border-color: rgba(45, 212, 191, .55);
    background: rgba(8, 145, 178, .22);
    color: var(--color-text);
}

.conv-stats-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(112px, auto);
    align-items: stretch;
    gap: .75rem;
    min-height: 0;
    padding: 0;
}

.conv-stats-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: .85rem;
    align-items: start;
}

.conv-stats-column {
    display: grid;
    gap: .85rem;
    align-content: start;
    min-width: 0;
}

.conv-stat-card {
    display: grid;
    align-content: start;
    gap: .35rem;
    height: 100%;
    min-height: 112px;
    padding: .95rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .74), rgba(15, 23, 42, .5)),
        var(--color-panel);
}

.conv-stat-card--primary {
    border-color: rgba(45, 212, 191, .36);
    background:
        linear-gradient(135deg, rgba(14, 165, 233, .22), rgba(20, 184, 166, .12)),
        var(--color-panel);
}

.conv-stat-card span,
.conv-stat-card small {
    display: block;
    color: var(--color-muted);
    font-size: .78rem;
    line-height: 1.25;
}

.conv-stat-card strong {
    display: block;
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1;
}

.conv-stats-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: .75rem;
    padding: 0;
    align-items: start;
}

.conv-stats-grid--wide {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}

.conv-stats-panel {
    min-width: 0;
    position: static;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(15, 23, 42, .32);
}

.conv-stats-link,
.conv-stats-row-link {
    color: inherit;
    text-decoration: none;
}

.conv-stats-row-link {
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.conv-stats-row-link:hover {
    border-color: rgba(56, 189, 248, .32);
    background: rgba(14, 165, 233, .12);
    transform: translateY(-1px);
}

.conv-stats-inline-link,
.conv-stats-inline-link a {
    display: inline;
}

.conv-stats-inline-link a {
    color: #7dd3fc;
    font-weight: 800;
    text-decoration: none;
}

.conv-stats-inline-link a:hover {
    color: #bae6fd;
}

.conv-stats-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

.conv-stats-state-list,
.conv-stats-days,
.conv-stats-table,
.conv-stats-activity-list {
    display: grid;
    gap: .62rem;
}

.conv-stats-chip-grid,
.conv-stats-top-list,
.conv-stats-topic-list,
.conv-stats-phrase-list {
    display: grid;
    gap: .55rem;
}

.conv-stats-chip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.conv-stats-bar-row__label,
.conv-stats-activity-item,
.conv-stats-table__head,
.conv-stats-table__row,
.conv-stats-day {
    display: grid;
    align-items: center;
    gap: .75rem;
}

.conv-stats-bar-row__label {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: .28rem;
    color: var(--color-muted);
    font-size: .82rem;
}

.conv-stats-bar-row__label strong,
.conv-stats-activity-item strong,
.conv-stats-table__row strong {
    color: var(--color-text);
}

.conv-stats-bar {
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .12);
}

.conv-stats-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(14, 165, 233, .9), rgba(45, 212, 191, .8));
}

.conv-stats-flow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: .85rem;
}

.conv-stats-flow a,
.conv-stats-activity-item {
    min-width: 0;
    padding: .7rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(15, 23, 42, .34);
    color: inherit;
    text-decoration: none;
}

.conv-stats-flow span {
    display: block;
    color: var(--color-muted);
    font-size: .76rem;
}

.conv-stats-flow strong {
    color: var(--color-text);
    font-size: 1.25rem;
}

.conv-stats-activity-item {
    grid-template-columns: minmax(0, 1fr) auto;
    font-size: .84rem;
}

.conv-stats-metric-chip {
    min-width: 0;
    padding: .72rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(15, 23, 42, .28);
}

.conv-stats-metric-chip span,
.conv-stats-top-item span {
    display: block;
    color: var(--color-muted);
    font-size: .76rem;
}

.conv-stats-metric-chip strong {
    display: block;
    margin-top: .25rem;
    color: var(--color-text);
    font-size: 1.28rem;
}

.conv-stats-top-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .68rem .75rem;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(15, 23, 42, .24);
}

.conv-stats-top-item > div {
    min-width: 0;
}

.conv-stats-top-item strong {
    color: var(--color-text);
}

.conv-stats-top-item__numbers {
    text-align: right;
}

.conv-stats-top-item__numbers strong {
    display: block;
    font-size: 1.1rem;
}

.conv-stats-topic-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.conv-stats-topic,
.conv-stats-phrase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    padding: .66rem .72rem;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(15, 23, 42, .24);
}

.conv-stats-topic span,
.conv-stats-phrase span {
    min-width: 0;
    overflow: hidden;
    color: var(--color-muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-stats-topic strong,
.conv-stats-phrase strong {
    color: var(--color-text);
}

.conv-stats-table__head,
.conv-stats-table__row {
    grid-template-columns: minmax(130px, 1.4fr) repeat(4, minmax(70px, .7fr));
    padding: .62rem .7rem;
    border-radius: 8px;
}

.conv-stats-table__head {
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(15, 23, 42, .35);
}

.conv-stats-table__row {
    border: 1px solid rgba(148, 163, 184, .13);
    color: var(--color-text);
    font-size: .84rem;
    background: rgba(15, 23, 42, .24);
}

.conv-stats-day {
    grid-template-columns: 64px minmax(0, 1fr) 92px;
    padding: .55rem .6rem;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(15, 23, 42, .24);
}

.conv-stats-day__date strong,
.conv-stats-day__date span {
    display: block;
}

.conv-stats-day__date span {
    color: var(--color-muted);
    font-size: .72rem;
    text-transform: capitalize;
}

.conv-stats-day__bars {
    display: grid;
    gap: 4px;
}

.conv-stats-day__bars span {
    display: block;
    min-width: 4px;
    height: 6px;
    border-radius: 999px;
}

.conv-stats-day__bars .is-in {
    background: #38bdf8;
}

.conv-stats-day__bars .is-out {
    background: #2dd4bf;
}

.conv-stats-day__bars .is-close {
    background: #a78bfa;
}

.conv-stats-day__values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .25rem;
    color: var(--color-muted);
    font-size: .78rem;
    text-align: right;
}

@media (max-width: 1180px) {
    .conv-stats-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conv-stats-columns,
    .conv-stats-grid,
    .conv-stats-grid--wide {
        grid-template-columns: 1fr;
    }

    .conv-stats-filter-grid,
    .conv-stats-chip-grid,
    .conv-stats-topic-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .conv-stats-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conv-stats-table {
        overflow-x: auto;
    }

    .conv-stats-table__head,
    .conv-stats-table__row {
        min-width: 620px;
    }

    .conv-stats-filter-grid,
    .conv-stats-chip-grid,
    .conv-stats-topic-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .conv-stats-summary,
    .conv-stats-flow {
        grid-template-columns: 1fr;
    }
}

.conv-status-card {
    gap: .75rem;
}

.conv-config-status {
    font-size: 1.05rem;
    font-weight: 800;
}

.conv-config-status--ok {
    color: #6ee7b7;
}

.conv-config-status--pending {
    color: #fbbf24;
}

.conv-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .9fr);
    gap: 1rem;
    align-items: start;
}

.conv-config-form,
.conv-config-help {
    display: grid;
    gap: 1rem;
}

.conv-config-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.conv-config-fields__full {
    grid-column: 1 / -1;
}

.conv-config-steps {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: .65rem;
    color: var(--color-text);
}

html[data-theme="light"] .conv-config-status--ok {
    color: #047857;
}

html[data-theme="light"] .conv-config-status--pending {
    color: #b45309;
}

/* Toggle de índice */
.help-toc-toggle { display: flex; align-items: center; }

.help-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.help-main {
    display: grid;
    gap: 1.25rem;
}

.help-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1.5rem;
    padding: 1.6rem 1.75rem;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(15, 23, 42, 0));
}

.help-hero__eyebrow {
    display: inline-flex;
    margin-bottom: .55rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #8bd6e8;
}

.help-hero__title {
    margin: 0 0 .55rem;
    font-size: 1.55rem;
    line-height: 1.15;
    color: var(--text-primary);
}

.help-hero__text {
    max-width: 62ch;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.help-search {
    align-self: stretch;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(125, 211, 252, 0.16);
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.88), rgba(9, 16, 30, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.help-search__label {
    display: block;
    margin-bottom: .55rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.help-search__row {
    display: flex;
    gap: .65rem;
    align-items: center;
}

.help-search__input {
    width: 100%;
    min-height: 2.85rem;
    padding: .75rem .95rem;
    border-radius: .85rem;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.help-search__input::placeholder {
    color: rgba(148, 163, 184, 0.8);
}

.help-search__input:focus {
    border-color: rgba(45, 212, 191, 0.65);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
    background: rgba(15, 23, 42, 1);
}

.help-search__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    margin-top: .75rem;
    font-size: .82rem;
    color: var(--text-muted);
}

.help-sidebar {
    position: sticky;
    top: 1rem;
    padding: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(14, 23, 40, 0.98), rgba(10, 18, 31, 0.98)),
        radial-gradient(circle at top, rgba(45, 212, 191, 0.06), transparent 42%);
}

.help-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.help-sidebar__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    color: #d7fbff;
    background: rgba(20, 184, 166, 0.16);
    border: 1px solid rgba(45, 212, 191, 0.18);
}

.help-sidebar__empty {
    margin: 0;
    font-size: .88rem;
    color: var(--text-muted);
}

/* Tabla de contenidos */
.help-toc {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
}
.help-toc__title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin: 0 0 .6rem;
}
.help-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
}
.help-toc__list--stacked {
    display: grid;
    gap: .2rem;
}
.help-toc__item {
    list-style: none;
}
.help-toc__item--sub { padding-left: 1rem; }
.help-toc__link {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    font-size: .82rem;
    color: #c9d7ea;
    text-decoration: none;
    padding: .5rem .65rem;
    border-radius: .7rem;
    transition: color .15s, background .15s, border-color .15s, transform .15s;
    border: 1px solid transparent;
}
.help-toc__link:hover {
    color: #f8fbff;
    background: rgba(45, 212, 191, 0.08);
    border-color: rgba(45, 212, 191, 0.14);
    transform: translateX(2px);
}

.help-toc__bullet {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #2dd4bf, #22d3ee);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.help-results {
    padding: 1.1rem 1.2rem;
}

.help-results--empty {
    display: flex;
    align-items: center;
    min-height: 7rem;
}

.help-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .9rem;
}

.help-result-card {
    width: 100%;
    text-align: left;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(125, 211, 252, 0.12);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(13, 22, 38, 1));
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.help-result-card:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.24);
    box-shadow: 0 18px 30px rgba(2, 8, 23, 0.24);
}

.help-result-card__tag {
    display: inline-flex;
    margin-bottom: .55rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.help-result-card__title {
    display: block;
    margin-bottom: .45rem;
    color: var(--text-primary);
}

.help-result-card__snippet {
    display: block;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: .88rem;
}

/* Contenido del manual */
.help-content {
    padding: 2rem 2.5rem;
    max-width: 920px;
    line-height: 1.7;
    background:
        linear-gradient(180deg, rgba(13, 23, 40, 0.98), rgba(9, 16, 30, 0.98)),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.06), transparent 28%);
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.22);
}

.help-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 .25rem;
}
.help-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.2rem 0 .6rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 1.5rem;
}
.help-content h3 {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1.4rem 0 .4rem;
    scroll-margin-top: 1.5rem;
}
.help-content p  { margin: .5rem 0; color: var(--text-secondary); }
.help-content ul,
.help-content ol { padding-left: 1.4rem; margin: .5rem 0; color: var(--text-secondary); }
.help-content li { margin: .2rem 0; }
.help-content strong { color: var(--text-primary); }
.help-content hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.help-content em  { color: var(--text-muted); font-style: italic; }

/* Tablas del manual */
.help-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    margin: .75rem 0 1.25rem;
}
.help-content th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: .45rem .75rem;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
}
.help-content td {
    padding: .4rem .75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}
.help-content tr:last-child td { border-bottom: none; }
.help-content tr:hover td { background: var(--surface-2); }

/* Bloques de código */
.help-content code {
    font-family: ui-monospace, monospace;
    font-size: .82em;
    background: var(--surface-2);
    padding: .1em .35em;
    border-radius: .25rem;
    color: var(--accent);
}
.help-content pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: .5rem;
    padding: .9rem 1.1rem;
    overflow-x: auto;
    margin: .75rem 0;
}
.help-content pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: .82rem;
}

/* ── Informes IA ─────────────────────────────────────────────────────── */

.ia-page {
    gap: 1.35rem;
}

.ia-query-card,
.ia-report {
    overflow: hidden;
}

.ia-query-box {
    display: grid;
    gap: 1rem;
}

.ia-launcher-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1rem;
    padding: .9rem 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.ia-check {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--color-text);
    font-weight: 600;
}

.ia-check input {
    width: 1rem;
    height: 1rem;
}

.ia-launcher-hint {
    color: var(--color-muted);
    font-size: .84rem;
}

.ia-query-box__input {
    width: 100%;
    min-height: 132px;
    resize: vertical;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.88);
    color: var(--color-text);
    line-height: 1.6;
}

.ia-query-box__input:focus {
    outline: 2px solid rgba(14, 165, 233, 0.24);
    border-color: rgba(14, 165, 233, 0.4);
}

.ia-query-box__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
}

.ia-sources {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

.ia-sources__label {
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    align-self: center;
}

.ia-sources__item {
    padding: .42rem .72rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.18);
    color: #bfe9fb;
    font-size: .8rem;
}

.ia-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1.1fr .9fr;
}

.ia-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.ia-chip {
    min-width: 220px;
    padding: .95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.55);
    color: inherit;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ia-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(20, 31, 54, 0.92);
}

.ia-chip--secondary {
    min-width: 0;
    padding: .8rem .9rem;
}

.ia-chip__title {
    display: block;
    font-weight: 700;
    color: var(--color-text);
}

.ia-chip__meta {
    display: block;
    margin-top: .35rem;
    color: var(--color-muted);
    font-size: .8rem;
}

.ia-history-list {
    display: grid;
    gap: .75rem;
}

.ia-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    padding: .9rem 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.ia-history-item__content strong {
    display: block;
    margin-bottom: .2rem;
}

.ia-history-item__content span {
    color: var(--color-muted);
    font-size: .82rem;
}

.ia-history-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.btn--sm {
    padding: .55rem .8rem;
    font-size: .82rem;
}

.ia-report__toolbar {
    display: flex;
    gap: .75rem;
}

.ia-report-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.ia-report-meta__label,
.ia-summary__label {
    display: block;
    margin-bottom: .25rem;
    color: var(--color-muted);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ia-inline-message {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-radius: 16px;
    font-size: .92rem;
}

.ia-inline-message--info {
    background: rgba(14, 165, 233, 0.12);
    color: #c7eefc;
    border: 1px solid rgba(14, 165, 233, 0.18);
}

.ia-inline-message--safe {
    background: rgba(20, 184, 166, 0.12);
    color: #b8fff5;
    border: 1px solid rgba(20, 184, 166, 0.18);
}

.ia-inline-message--error,
.ia-report--error .ia-inline-message {
    background: rgba(239, 68, 68, 0.12);
    color: #ffd0d0;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.ia-summary {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(20, 184, 166, 0.08));
    border: 1px solid rgba(45, 212, 191, 0.14);
}

.ia-summary p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
}

.ia-chart {
    margin-bottom: 1rem;
}

.ia-related {
    margin-top: 1rem;
}

@media (max-width: 1080px) {
    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-sidebar {
        position: static;
        max-height: none;
    }

    .help-hero {
        grid-template-columns: 1fr;
    }

    .ia-grid {
        grid-template-columns: 1fr;
    }

    .ia-report-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .help-content {
        padding: 1.35rem;
    }

    .help-search__row {
        flex-direction: column;
        align-items: stretch;
    }

    .ia-history-item,
    .ia-query-box__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media print {
    :root {
        --color-bg: #ffffff;
        --color-panel: #ffffff;
        --color-panel-strong: #ffffff;
        --color-border: rgba(15, 23, 42, 0.14);
        --color-text: #0f172a;
        --color-muted: #475569;
        --shadow-soft: none;
    }

    html,
    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    .shell {
        display: block !important;
    }

    .shell__sidebar,
    .shell__header,
    .no-print,
    .filters-toggle-wrap,
    .quick-range,
    .actions,
    .help-toc-toggle,
    .help-sidebar,
    .help-results,
    .ia-suggestions,
    .ia-history,
    .help-link,
    .sidebar-toggle {
        display: none !important;
    }

    .shell__main,
    .shell__content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-only {
        display: block !important;
    }

    .page-grid,
    .chart-grid,
    .three-grid,
    .split-grid,
    .help-layout,
    .help-main,
    .help-hero,
    .kpi-grid,
    .kpi-grid--6 {
        display: block !important;
    }

    .panel-card,
    .help-content,
    .help-hero,
    .help-search {
        background: #ffffff !important;
        color: #0f172a !important;
        border: 1px solid rgba(15, 23, 42, 0.12) !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .panel-card + .panel-card,
    .panel-card + .data-table,
    .panel-card + section,
    .page-grid > * + * {
        margin-top: 1rem !important;
    }

    .page-intro__text,
    .panel-card__subtitle,
    .filters-summary__label,
    .filters-summary__text,
    .text-muted,
    .help-content p,
    .help-content li,
    .help-content td,
    .help-search__meta,
    .help-result-card__snippet {
        color: #475569 !important;
    }

    .brand__logo,
    .menu__icon,
    .help-toc__bullet,
    .shell__dot {
        box-shadow: none !important;
    }

    .table-wrap {
        overflow: visible !important;
    }

    .data-table {
        font-size: 10pt;
    }

    .data-table th,
    .data-table td {
        border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
        color: #0f172a !important;
    }

    a,
    a:visited {
        color: inherit !important;
        text-decoration: none !important;
    }

    .btn,
    button {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MÓDULO: DISEÑADOR DE CONSULTAS
   ═══════════════════════════════════════════════════════════════ */

/* ── Lista de consultas ───────────────────────────────────────── */
.consultas-loading,
.consultas-empty {
    color: var(--color-muted);
    padding: 2rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consultas-error {
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 14px;
    color: var(--color-danger);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consultas-search {
    margin-bottom: 1.25rem;
}

.consultas-search__input {
    width: 100%;
    max-width: 480px;
    padding: 0.6rem 1rem;
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: border-color 0.15s;
}

.consultas-search__input::placeholder { color: var(--color-muted); }
.consultas-search__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.consultas-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.consultas-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.consultas-sidebar__group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-muted);
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.consultas-sidebar__group:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--color-text);
}

.consultas-sidebar__group--active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    background: rgba(14, 165, 233, 0.07);
    font-weight: 600;
}

.consultas-sidebar__group-count {
    font-size: 0.72rem;
    opacity: 0.55;
    background: rgba(148, 163, 184, 0.12);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.consultas-content {
    flex: 1;
    min-width: 0;
}

.consultas-content--full {
    width: 100%;
}

.consultas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.consulta-card {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.consulta-card:hover {
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.1);
}

.consulta-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.consulta-card__clave {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-muted);
    background: rgba(148, 163, 184, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.consulta-card__nombre {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1.35;
}

.consulta-card__desc {
    font-size: 0.8rem;
    color: var(--color-muted);
    line-height: 1.45;
    flex: 1;
    margin: 0;
}

.consulta-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
    gap: 0.5rem;
}

.consulta-card__badge {
    font-size: 0.72rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.9;
}

.consulta-card__badge--auto {
    color: var(--color-muted);
    opacity: 0.6;
}

/* ── Detalle y ejecución ──────────────────────────────────────── */
.consulta-detalle {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.consulta-detalle__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-muted);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.consulta-detalle__back:hover { color: var(--color-primary); }

.consulta-detalle__meta {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
}

.consulta-detalle__clave {
    margin: 0 0 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.consulta-detalle__titulo {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-text);
}

.consulta-detalle__comentarios {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.5;
}

.consulta-params {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
}

.consulta-params__title {
    margin: 0 0 1rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.consulta-params__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1.25rem;
}

.consulta-params__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.consulta-params__label {
    font-size: 0.8rem;
    color: var(--color-muted);
    font-weight: 500;
}

.consulta-params__input {
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

.consulta-params__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.consulta-params__date-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.quick-range--sm {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.consulta-stale-warn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #fbbf24;
    font-size: 0.85rem;
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}
.btn--pulse { animation: btn-pulse 1.5s ease-in-out infinite; }

.consulta-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Resultado ────────────────────────────────────────────────── */
.consulta-result {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow: hidden;
}

.consulta-result__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.consulta-result__stats {
    font-size: 0.82rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.consulta-result__stats strong {
    color: var(--color-text);
}

.consulta-result__ts {
    opacity: 0.6;
}

.consulta-result__warn {
    font-size: 0.8rem;
    color: var(--color-warning);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.consulta-result__table-wrap {
    overflow-x: auto;
    max-height: 560px;
    overflow-y: auto;
}

.consulta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.consulta-table th {
    padding: 0.6rem 0.9rem;
    text-align: left;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(15, 23, 42, 0.25);
    position: sticky;
    top: 0;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
    z-index: 1;
}

.consulta-table td {
    padding: 0.5rem 0.9rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.consulta-table tr:hover td {
    background: rgba(148, 163, 184, 0.06);
}

.consulta-table tr:last-child td {
    border-bottom: none;
}

.consulta-result__empty {
    padding: 3rem;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.consulta-result__empty i {
    font-size: 2rem;
    opacity: 0.35;
}

.consulta-result__error {
    padding: 1.25rem 1.5rem;
    color: var(--color-danger);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Light mode ───────────────────────────────────────────────── */
html[data-theme="light"] .consultas-sidebar {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .consultas-sidebar__group--active {
    background: rgba(2, 132, 199, 0.07);
    color: #0284c7;
    border-left-color: #0284c7;
}

html[data-theme="light"] .consultas-search__input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

html[data-theme="light"] .consulta-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .consulta-card:hover {
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.09);
}

html[data-theme="light"] .consulta-detalle__meta,
html[data-theme="light"] .consulta-params,
html[data-theme="light"] .consulta-result {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .consulta-params__input {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

html[data-theme="light"] .consulta-table th {
    background: #f1f5f9;
    color: #475569;
    border-bottom-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .consulta-table td {
    color: #0f172a;
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .consulta-table tr:hover td {
    background: rgba(15, 23, 42, 0.03);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .consultas-layout {
        flex-direction: column;
    }

    .consultas-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
    }

    .consultas-sidebar__group {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .consultas-sidebar__group--active {
        border-bottom-color: var(--color-primary);
        border-left-color: transparent;
    }
}

/* ============================================================
   EDITOR DE CONSULTAS (nueva / editar)
   ============================================================ */

.editor {
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.editor__top {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.editor__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

/* ── Sección genérica ── */
.editor-section {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.editor-section__title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
}

.editor-section__hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0 0 .75rem;
}

.editor-section__hint code {
    background: var(--color-hover);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--color-primary);
}

/* summary del <details> constructor */
.editor-section--builder > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    user-select: none;
}

.editor-section--builder > summary::-webkit-details-marker { display: none; }

.editor-section--builder > summary::before {
    content: '\F285'; /* bi-chevron-right */
    font-family: 'bootstrap-icons';
    transition: transform .2s;
    color: var(--color-text-muted);
}

.editor-section--builder[open] > summary::before {
    transform: rotate(90deg);
}

.editor-section__summary-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    opacity: .7;
}

/* ── Campos básicos ── */
.editor-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
}

.editor-field { display: flex; flex-direction: column; gap: .3rem; }
.editor-field--full { grid-column: 1 / -1; }

.editor-field__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.editor-field__input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    color: var(--color-text);
    padding: .45rem .75rem;
    font-size: 0.88rem;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
}

.editor-field__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.editor-field__input--sm {
    padding: .35rem .6rem;
    font-size: 0.82rem;
    width: auto;
}

/* ── SQL textarea ── */
.editor-sql {
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    color: var(--color-text);
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.84rem;
    line-height: 1.6;
    padding: .75rem 1rem;
    resize: vertical;
    transition: border-color .15s;
}

.editor-sql:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ── Parámetros detectados ── */
.editor-params {
    margin-top: 1rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.editor-params__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 .75rem;
}

.editor-params__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .6rem;
}

.editor-params__field { display: flex; flex-direction: column; gap: .25rem; }

.editor-params__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.editor-params__input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: .35rem .6rem;
    font-size: 0.84rem;
}

.editor-params__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ── Mensajes de resultado ── */
.editor-msg {
    padding: .7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.editor-msg--animated {
    animation: editor-msg-fade-in .18s ease-out both;
    transition: opacity .18s ease, transform .18s ease;
}

.editor-msg--animated.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}

.conversations-notice {
    animation: editor-msg-fade-in .18s ease-out both;
    transition: opacity .18s ease, transform .18s ease;
}

.conversations-notice.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}

@keyframes editor-msg-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-msg--error {
    background: color-mix(in srgb, #ef4444 12%, transparent);
    color: #ef4444;
    border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
}

.editor-msg--ok {
    background: color-mix(in srgb, #22c55e 12%, transparent);
    color: #22c55e;
    border: 1px solid color-mix(in srgb, #22c55e 30%, transparent);
}

/* ── Acciones ── */
.editor-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding-bottom: 2rem;
}

.editor-actions__confirm {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ── Constructor visual ── */
.editor-builder {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.editor-builder__empty {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.editor-builder__empty code {
    background: var(--color-hover);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.editor-builder__loading {
    font-size: 0.84rem;
    color: var(--color-text-muted);
}

.editor-builder__source { display: flex; flex-direction: column; gap: .4rem; }

.editor-builder__subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 .6rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.editor-builder__col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .3rem .75rem;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    padding: .6rem .75rem;
}

.editor-builder__col-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--color-text);
}

.editor-builder__col-item input[type=checkbox] { accent-color: var(--color-primary); }

.editor-builder__col-name { flex: 1; }

.editor-builder__col-type {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    opacity: .7;
}

.editor-builder__filter-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .4rem;
}

.editor-builder__param-toggle {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.editor-builder__param-toggle input[type=checkbox] { accent-color: var(--color-primary); }

/* ── Botones utilitarios ── */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-primary);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    text-decoration: none;
}

.btn-link:hover { text-decoration: underline; }

.btn-link--danger { color: #ef4444; }

.btn--secondary {
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: .45rem .9rem;
    border-radius: 8px;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: background .15s;
}

.btn--secondary:hover { background: var(--color-border); }

.btn--danger {
    background: #ef4444;
    border: 1px solid #dc2626;
    color: #fff;
    padding: .45rem .9rem;
    border-radius: 8px;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: background .15s;
}

.btn--danger:hover { background: #dc2626; }

.btn--ghost.btn--danger {
    background: transparent;
    border-color: #ef4444;
    color: #ef4444;
}

.btn--ghost.btn--danger:hover {
    background: color-mix(in srgb, #ef4444 12%, transparent);
}

/* ── Topbar en detalle ── */
.consulta-detalle__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ── Light mode overrides ── */
html[data-theme="light"] .editor-sql {
    background: #fff;
    border-color: #d1d5db;
    color: #111827;
}

html[data-theme="light"] .editor-field__input {
    background: #fff;
    border-color: #d1d5db;
    color: #111827;
}

html[data-theme="light"] .editor-params__input {
    background: #fff;
    border-color: #d1d5db;
    color: #111827;
}

html[data-theme="light"] .editor-builder__col-grid {
    background: #fff;
    border-color: #d1d5db;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .editor-fields { grid-template-columns: 1fr; }
    .editor-field--full { grid-column: 1; }
    .editor-builder__filter-row { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   CHIP DE SESIÓN + DRAWER DE SESIONES
   ============================================================ */

/* ── Chip en el header ── */
.session-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: .3rem .75rem;
    font-size: 0.78rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
}

.session-chip:hover {
    background: var(--color-border);
    border-color: var(--color-primary);
}

.session-chip__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.session-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-chip .bi-chevron-down {
    font-size: 0.65rem;
    opacity: .6;
    flex-shrink: 0;
}

/* ── Overlay ── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 200;
    animation: fadeIn .15s ease;
}

/* ── Drawer panel ── */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 95vw;
    background: var(--color-panel);
    border-left: 1px solid var(--color-border);
    z-index: 201;
    display: flex;
    flex-direction: column;
    animation: slideIn .2s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.drawer__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--color-text);
}

.drawer__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: .25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.drawer__close:hover { color: var(--color-text); background: var(--color-hover); }

.drawer__body {
    overflow-y: auto;
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drawer__note {
    font-size: 0.74rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: auto;
    padding-top: .5rem;
}

.drawer__note code {
    background: var(--color-hover);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.72rem;
}

/* ── Lista de sesiones ── */
.drawer-sessions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.drawer-session {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
}

.drawer-session--active {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg));
}

.drawer-session__info {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    min-width: 0;
    flex: 1;
}

.drawer-session__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    margin-top: 5px;
    flex-shrink: 0;
}

.drawer-session__dot--ok { background: #22c55e; }

.drawer-session__nombre {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-session__detalle {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin: .1rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-session__usuario {
    font-size: 0.73rem;
    color: var(--color-text-muted);
    margin: 0;
    opacity: .7;
}

.drawer-session__actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.drawer-session__badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-primary);
    padding: .2rem .5rem;
    border: 1px solid var(--color-primary);
    border-radius: 10px;
}

/* ── Formulario nueva sesión ── */
.drawer-new > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 0;
    user-select: none;
}

.drawer-new > summary::-webkit-details-marker { display: none; }

.drawer-new__form {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding-top: .75rem;
}

.drawer-new__field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.drawer-new__field label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.drawer-new__field input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: .4rem .65rem;
    font-size: 0.84rem;
    width: 100%;
    box-sizing: border-box;
}

.drawer-new__field input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.drawer-new__password {
    display: flex;
    gap: .4rem;
}

.drawer-new__password input { flex: 1; }

.drawer-new__eye {
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-muted);
    padding: .4rem .6rem;
    cursor: pointer;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
}

.drawer-new__eye:hover { color: var(--color-text); }

.drawer-new__error {
    font-size: 0.8rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Light mode overrides ── */
html[data-theme="light"] .drawer {
    background: #fff;
    border-color: #d1d5db;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
}

html[data-theme="light"] .drawer-session { background: #f9fafb; }
html[data-theme="light"] .drawer-new__field input { background: #fff; border-color: #d1d5db; color: #111827; }

/* Módulo Tareas */
.tareas-page {
    gap: .9rem;
}

.tareas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.tareas-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.tareas-header span,
.tareas-muted {
    color: var(--color-muted);
}

.tareas-feedback {
    width: calc(100% - 2rem);
    margin: 0 1rem;
    padding: 0.85rem 1rem;
    align-items: center;
    border-radius: 8px;
    line-height: 1.35;
    animation: editor-msg-fade-in .18s ease-out both;
    transition: opacity .18s ease, transform .18s ease;
}

.tareas-feedback.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}

.tareas-feedback.editor-msg--warning {
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.48);
    color: #fde68a;
}

.tareas-feedback > .bi {
    flex: 0 0 auto;
    color: #fbbf24;
    font-size: 1rem;
}

.tareas-feedback__content {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: .65rem;
    flex-wrap: wrap;
}

.tareas-feedback strong,
.tareas-feedback p,
.tareas-feedback small {
    margin: 0;
}

.tareas-feedback p {
    color: inherit;
}

.tareas-feedback__close {
    width: 28px;
    height: 28px;
    margin-left: auto;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}

.tareas-feedback__close:hover,
.tareas-feedback__close:focus-visible {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.6);
    color: #ffffff;
    outline: none;
}

.tareas-shell {
    display: grid;
    grid-template-columns: 260px minmax(420px, 1fr) 300px;
    gap: .9rem;
    padding: 0 1rem 1rem;
    align-items: start;
}

.tareas-lists,
.tareas-main,
.tareas-quick {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(15, 23, 42, .38);
}

.tareas-lists,
.tareas-quick {
    padding: .75rem;
}

.tareas-main {
    display: grid;
    gap: .75rem;
    padding: .75rem;
}

.tareas-list-button {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: .55rem .65rem;
    background: transparent;
    color: var(--color-text);
    text-align: left;
}

.tareas-list-button .bi-share {
    color: #67e8f9;
    font-size: .95rem;
    opacity: 1;
}

.tareas-list-button:hover,
.tareas-list-button.is-active {
    border-color: rgba(45, 212, 191, .3);
    background: rgba(14, 165, 233, .16);
}

.tareas-list-button.is-drop-target {
    border-color: rgba(251, 191, 36, .62);
    background: rgba(251, 191, 36, .14);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .28);
}

.tareas-list-button span {
    display: flex;
    align-items: center;
    gap: .32rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tareas-list-button strong {
    color: #7dd3fc;
    font-size: .82rem;
}

.tareas-lists__head,
.tareas-quick__head,
.tareas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tareas-lists__head {
    margin: .75rem 0 .45rem;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tareas-lists__head button,
.tareas-note button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(15, 23, 42, .45);
    color: var(--color-muted);
}

.tareas-list-stack,
.tareas-list,
.tareas-completed__list,
.tareas-notes {
    display: grid;
    gap: .45rem;
}

.tareas-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .35rem;
    align-items: center;
}

.tareas-list-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .4rem;
}

.tareas-compose {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-height: 52px;
    padding: .45rem .7rem;
    border: 1px solid rgba(56, 189, 248, .26);
    border-radius: 8px;
    background: rgba(8, 47, 73, .28);
}

.tareas-compose i {
    color: #38bdf8;
    font-size: 1.15rem;
}

.tareas-compose input,
.tareas-quick-input,
.tareas-title-input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--color-text);
    outline: 0;
}

.tareas-toolbar {
    color: var(--color-muted);
    padding: .5rem .7rem;
}

.tareas-assignee-filter {
    position: relative;
    min-width: 220px;
}

.tareas-assignee-filter__button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .65rem .45rem .75rem;
    border: 1px solid rgba(56, 189, 248, .28);
    border-radius: 8px;
    background: rgba(8, 47, 73, .24);
    color: var(--color-text);
    font: inherit;
    font-weight: 650;
}

.tareas-assignee-filter__button > span,
.tareas-assignee-filter__option span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tareas-assignee-filter__button .bi-chevron-down {
    color: #7dd3fc;
    font-size: .82rem;
}

.tareas-assignee-filter__button:hover,
.tareas-assignee-filter__button:focus-visible {
    border-color: rgba(56, 189, 248, .48);
    background: rgba(14, 165, 233, .16);
    outline: none;
}

.tareas-assignee-filter__menu {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 25;
    width: min(280px, 70vw);
    max-height: 310px;
    overflow: auto;
    padding: .35rem;
    border: 1px solid rgba(80, 118, 180, .28);
    border-radius: 8px;
    background: #0d1a2d;
    box-shadow: 0 18px 46px rgba(2, 8, 23, .44);
}

.tareas-assignee-filter__option {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 18px;
    align-items: center;
    gap: .65rem;
    padding: .45rem .55rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #dbeafe;
    text-align: left;
    font: inherit;
}

.tareas-assignee-filter__option > .bi:first-child,
.tareas-assignee-filter__option > .bi:last-child {
    display: inline-grid;
    place-items: center;
    min-width: 0;
}

.tareas-assignee-filter__option:hover,
.tareas-assignee-filter__option:focus-visible {
    background: rgba(14, 165, 233, .16);
    color: #ffffff;
    outline: none;
}

.tareas-assignee-filter__option.is-active {
    background: rgba(34, 211, 238, .15);
    color: #e0faff;
}

.tareas-assignee-filter__option > .bi:last-child {
    color: #22d3ee;
}

.tareas-toolbar strong,
.tareas-quick__head strong {
    display: block;
    color: var(--color-text);
}

.tareas-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(135px, auto) auto;
    gap: .6rem;
    align-items: center;
    min-height: 58px;
    padding: .55rem .65rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(15, 23, 42, .34);
}

.tareas-row[draggable="true"] {
    cursor: grab;
}

.tareas-row.is-dragging {
    opacity: 1;
    border-color: rgba(251, 191, 36, .42);
    background: rgba(15, 23, 42, .54);
    cursor: grabbing;
}

.tareas-row--drag-preview {
    opacity: 1 !important;
    border-color: rgba(56, 189, 248, .42) !important;
    background: #0d1a2d !important;
    box-shadow: 0 18px 48px rgba(2, 8, 23, .52), 0 0 0 1px rgba(56, 189, 248, .18) !important;
    transform: rotate(-1deg);
}

.tareas-row--completed {
    opacity: .78;
}

.tareas-check {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #93c5fd;
    font-size: 1.1rem;
}

.tareas-check:hover,
.tareas-check.is-done {
    color: #2dd4bf;
    background: rgba(45, 212, 191, .12);
}

.tareas-row__body {
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.tareas-row__body strong,
.tareas-row__body span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tareas-row__body span {
    margin-top: .18rem;
    color: var(--color-muted);
    font-size: .82rem;
}

.tareas-menu {
    position: relative;
}

.tareas-menu summary {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--color-muted);
    cursor: pointer;
}

.tareas-menu summary::-webkit-details-marker {
    display: none;
}

.tareas-menu[open] summary {
    color: var(--color-text);
    background: rgba(14, 165, 233, .14);
}

.tareas-menu > div {
    position: absolute;
    right: 0;
    top: 38px;
    z-index: 20;
    min-width: 150px;
    padding: .35rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-panel);
    box-shadow: var(--shadow-soft);
}

.tareas-row .tareas-menu[open] {
    z-index: 35;
}

.tareas-row .tareas-menu > div {
    top: auto;
    bottom: 38px;
    z-index: 40;
}

.tareas-menu button {
    width: 100%;
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    text-align: left;
}

.tareas-menu button:hover {
    background: rgba(14, 165, 233, .12);
}

.tareas-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--color-muted);
    text-align: center;
}

.tareas-empty i {
    color: #2dd4bf;
    font-size: 2rem;
}

.tareas-empty strong {
    color: var(--color-text);
}

.tareas-completed {
    border-top: 1px solid rgba(148, 163, 184, .14);
    padding-top: .45rem;
}

.tareas-completed summary {
    cursor: pointer;
    color: var(--color-muted);
    font-weight: 800;
}

.tareas-quick__head span {
    display: block;
    color: #38bdf8;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tareas-quick-input {
    min-height: 42px;
    margin: .7rem 0;
    padding: 0 .75rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 8px;
    background: rgba(15, 23, 42, .45);
}

.tareas-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .7rem;
    padding: .7rem .75rem;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(15, 23, 42, .26);
}

.tareas-note span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tareas-note small {
    display: block;
    margin-top: .25rem;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.tareas-note .bi-share {
    margin-left: .25rem;
    color: #67e8f9;
    font-size: .78rem;
    opacity: .82;
}

.tareas-row__body .bi-share {
    margin-left: .3rem;
    color: #67e8f9;
    font-size: .78rem;
    opacity: .82;
}

.tareas-note.is-done span {
    color: var(--color-muted);
    text-decoration: line-through;
}

.tareas-modal {
    position: fixed;
    inset: 5vh auto auto 50%;
    z-index: 1120;
    width: min(760px, calc(100vw - 2rem));
    max-height: 90vh;
    overflow-y: auto;
    transform: translateX(-50%);
    border-radius: 8px;
    padding: 1.55rem;
}

.tareas-modal__head,
.tareas-modal__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
}

.tareas-title-input {
    min-height: 50px;
    border-bottom: 2px solid rgba(147, 197, 253, .65);
    font-size: 1.12rem;
}

.tareas-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 1rem;
    margin: 1.25rem 0 1.35rem;
}

.tareas-form-grid label,
.tareas-description {
    display: grid;
    gap: .55rem;
    color: var(--color-muted);
    font-size: .8rem;
    font-weight: 800;
}

.tareas-form-grid input,
.tareas-form-grid select {
    min-height: 38px;
    padding: 0 .75rem;
}

.tareas-description textarea {
    min-height: 150px;
    margin-top: .25rem;
    resize: vertical;
}

.tareas-attachments {
    display: grid;
    gap: .75rem;
    border: 1px dashed rgba(56, 189, 248, .28);
    border-radius: 8px;
    padding: .85rem;
    background: rgba(15, 23, 42, .26);
    outline: none;
}

.tareas-attachments:focus-visible,
.tareas-attachments.is-file-dragging {
    border-color: rgba(45, 212, 191, .72);
    background: rgba(8, 145, 178, .16);
}

.tareas-attachments__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tareas-attachments__head div:first-child {
    display: grid;
    gap: .18rem;
}

.tareas-attachments__head strong {
    color: var(--color-text);
    font-size: .9rem;
}

.tareas-attachments__head span,
.tareas-attachments__empty {
    color: var(--color-muted);
    font-size: .8rem;
}

.tareas-attachments__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 142px));
    gap: .65rem;
}

.tareas-attachment-card {
    position: relative;
    display: grid;
    grid-template-rows: 86px auto;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .28);
}

.tareas-attachment-card.is-pending {
    border-color: rgba(45, 212, 191, .34);
}

.tareas-attachment-card img,
.tareas-attachment-card video {
    width: 100%;
    height: 86px;
    object-fit: cover;
    background: rgba(2, 6, 23, .5);
}

.tareas-attachment-card__image {
    width: 100%;
    height: 86px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.tareas-attachment-card audio {
    align-self: center;
    width: calc(100% - 1rem);
    margin: 0 .5rem;
}

.tareas-attachment-card__fallback {
    display: grid;
    place-items: center;
    min-height: 86px;
    color: var(--color-accent);
    font-size: 1.8rem;
}

.tareas-attachment-card__body {
    display: grid;
    gap: .15rem;
    min-width: 0;
    padding: .55rem .65rem;
}

.tareas-attachment-card__body strong,
.tareas-attachment-card__body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tareas-attachment-card__body strong {
    color: var(--color-text);
    font-size: .82rem;
}

.tareas-attachment-card__body span {
    color: var(--color-muted);
    font-size: .75rem;
}

.tareas-attachment-card__remove {
    position: absolute;
    top: .35rem;
    right: .35rem;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 999px;
    background: rgba(15, 23, 42, .82);
    color: var(--color-text);
}

.tareas-attachment-card__remove:hover {
    border-color: rgba(248, 113, 113, .5);
    color: #fecaca;
}

.tareas-image-preview {
    position: fixed;
    inset: 4vh 4vw;
    z-index: 2200;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .75rem;
    padding: .85rem;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    background: rgba(2, 6, 23, .96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

.tareas-image-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-width: 0;
}

.tareas-image-preview__head strong {
    overflow: hidden;
    color: var(--color-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tareas-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(15, 23, 42, .72);
}

.tareas-modal__actions {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    margin-top: 1rem;
}

.tareas-share-modal h3 {
    margin: .1rem 0 0;
    font-size: 1rem;
}

.tareas-modal-kicker {
    color: var(--color-muted);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tareas-share-all,
.tareas-share-users label {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--color-text);
    font-size: .9rem;
    font-weight: 700;
}

.tareas-share-all {
    margin: 1rem 0;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(15, 23, 42, .28);
}

.tareas-task-share {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: .2rem 0 1rem;
}

.tareas-task-share > span {
    color: var(--color-muted);
    font-size: .82rem;
    font-weight: 700;
}

.tareas-task-share-panel {
    display: grid;
    gap: .65rem;
    margin: -0.2rem 0 1.1rem;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(15, 23, 42, .24);
}

.tareas-share-users {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem .75rem;
    max-height: 260px;
    overflow: auto;
    padding: .25rem;
}

.tareas-share-modal input[type="checkbox"],
.tareas-task-share-panel input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

html[data-theme="light"] .tareas-lists,
html[data-theme="light"] .tareas-main,
html[data-theme="light"] .tareas-quick,
html[data-theme="light"] .tareas-row,
html[data-theme="light"] .tareas-note {
    background: #fff;
}

@media (max-width: 1180px) {
    .tareas-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .tareas-quick {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .tareas-header,
    .tareas-shell {
        grid-template-columns: 1fr;
    }

    .tareas-header {
        display: grid;
    }

    .tareas-shell {
        padding: 0 .75rem .75rem;
    }

    .tareas-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .tareas-row select {
        grid-column: 2 / -1;
    }

    .tareas-form-grid,
    .tareas-modal__actions {
        grid-template-columns: 1fr;
    }
}
html[data-theme="light"] .session-chip { background: #f3f4f6; border-color: #d1d5db; color: #111827; }
html[data-theme="light"] .session-chip:hover { background: #e5e7eb; }

/* ============================================================
   ÁRBOL DE CONSULTAS
   ============================================================ */

.ctree-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 220px);
    min-height: 400px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

/* ── Panel izquierdo ── */
.ctree-panel {
    width: 300px;
    min-width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    background: var(--color-panel);
    overflow: hidden;
}

/* ── Buscador ── */
.ctree-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.ctree-search__icon {
    color: var(--color-text-muted);
    font-size: .85rem;
    flex-shrink: 0;
}

.ctree-search__input {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.83rem;
    width: 100%;
    outline: none;
}

.ctree-search__input::placeholder { color: var(--color-text-muted); opacity: .7; }

/* ── Árbol ── */
.ctree {
    flex: 1;
    overflow-y: auto;
    padding: .4rem 0;
}

.ctree__group { }

.ctree__group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
}

.ctree__group-header:hover { background: var(--color-hover); }

.ctree__chevron {
    font-size: .7rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform .15s;
}

.ctree__group-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
}

.ctree__group-count {
    font-size: 0.68rem;
    background: var(--color-hover);
    color: var(--color-text-muted);
    border-radius: 10px;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* ── Items bajo cada grupo ── */
.ctree__items {
    border-left: 2px solid var(--color-border);
    margin-left: 1.3rem;
    margin-bottom: .2rem;
}

.ctree__item {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .35rem .75rem;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.82rem;
    transition: background .1s;
    line-height: 1.3;
}

.ctree__item:hover {
    background: var(--color-hover);
    color: var(--color-primary);
}

.ctree__item-clave {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: monospace;
}

.ctree__item-name {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ctree__item-badge {
    font-size: .7rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    opacity: .6;
}

/* ── Panel derecho ── */
.ctree-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.ctree-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
}

.ctree-welcome__icon {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    opacity: .3;
}

.ctree-welcome__text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Árbol jerárquico: nodos y hojas ── */
.ctree__node {
    display: flex;
    align-items: stretch;
}

.ctree__indent {
    flex-shrink: 0;
}

.ctree__toggle {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 1;
    padding: .38rem .5rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    border-radius: .375rem;
    color: inherit;
    font-size: .85rem;
    min-width: 0;
}

.ctree__toggle:hover { background: var(--color-border); }

.ctree__leaf {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 1;
    padding: .38rem .5rem;
    text-decoration: none;
    color: inherit;
    border-radius: .375rem;
    font-size: .85rem;
    min-width: 0;
}

.ctree__leaf:hover { background: var(--color-border); }

.ctree__node-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Etiqueta de nombre en el campo "Descripción / Ayuda" del editor */
.editor-field__optional {
    font-size: .78rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Descripción de la consulta en la página de detalle */
.consulta-detalle__desc {
    font-size: .88rem;
    color: var(--color-text-muted);
    margin: .25rem 0 0;
}

/* ── Light mode ── */
html[data-theme="light"] .ctree-panel { background: #f9fafb; }
html[data-theme="light"] .ctree__group-header:hover { background: #f3f4f6; }
html[data-theme="light"] .ctree__item:hover { background: #f3f4f6; }
html[data-theme="light"] .ctree__toggle:hover { background: #f3f4f6; }
html[data-theme="light"] .ctree__leaf:hover { background: #f3f4f6; }
html[data-theme="light"] .ctree-content { background: #fff; }

/* ── Panel de gráfico en resultado ── */
.result-chart-panel {
    border: 1px solid var(--color-border);
    border-radius: .625rem;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--color-surface);
}

.result-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.result-chart-control { display: flex; flex-direction: column; gap: .35rem; }

.result-chart-control__label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
}

.result-chart-type { display: flex; gap: .25rem; }

.result-chart-type__btn {
    padding: .3rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: .375rem;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: .83rem;
    transition: background .15s, border-color .15s;
}

.result-chart-type__btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.result-chart-type__btn:not(.active):hover { background: var(--color-border); }

.result-chart-ycols {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    max-width: 420px;
}

.result-chart-ycol {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .83rem;
    cursor: pointer;
}

/* ── ResultChart component ── */
.result-chart { }

.result-chart__warn {
    font-size: .8rem;
    color: var(--color-text-muted);
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.result-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: .5rem;
    font-size: .82rem;
}

.result-chart__legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.result-chart__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.result-chart__svg {
    width: 100%;
    height: auto;
    display: block;
}

.result-chart__zero-line {
    stroke: var(--color-text-muted);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: .6;
}

/* btn--active para el botón Ver gráfico */
.btn--active {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
}

/* ── Buscador dentro del resultado ── */
.result-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    padding: .4rem .6rem;
    border: 1px solid var(--color-border);
    border-radius: .5rem;
    background: var(--color-bg);
}

.result-search__icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
    font-size: .9rem;
}

.result-search__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: .88rem;
    outline: none;
    min-width: 0;
}

.result-search__input::placeholder { color: var(--color-text-muted); }

.result-search__count {
    font-size: .8rem;
    color: var(--color-primary);
    font-weight: 600;
    white-space: nowrap;
}

.result-search__clear {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    padding: .1rem .2rem;
    border-radius: .25rem;
    font-size: .8rem;
    flex-shrink: 0;
}

.result-search__clear:hover { color: var(--color-text); background: var(--color-border); }

/* ── Buscador de columnas en el constructor visual ── */
.editor-builder__cols-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.editor-builder__col-search {
    padding: .3rem .6rem;
    font-size: .82rem;
    border: 1px solid var(--color-border);
    border-radius: .375rem;
    background: var(--color-bg);
    color: var(--color-text);
    width: 180px;
}

.col-item--match {
    outline: 2px solid var(--color-primary);
    border-radius: .375rem;
}

.col-item--dim {
    opacity: .25;
}

/* ── Encabezados de tabla ordenables ── */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover { background: var(--color-border); }

/* PWA, mobile shell and responsive safety */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.menu__button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.modal-backdrop.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15, 23, 42, .48);
    border: 0;
}

.app-modal {
    position: fixed;
    z-index: 1081;
    right: 1rem;
    bottom: 1rem;
    width: min(420px, calc(100vw - 2rem));
    max-height: min(720px, calc(100vh - 2rem));
    overflow: auto;
}

.app-modal--wide {
    width: min(560px, calc(100vw - 2rem));
}

.app-settings-grid {
    display: grid;
    gap: .9rem;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 44px;
    color: var(--color-text);
}

.toggle-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.toggle-row--compact {
    min-height: 36px;
}

.app-modal__hint {
    margin: .85rem 0 0;
    color: var(--color-muted);
    font-size: .9rem;
}

.pwa-mobile-actions {
    display: none;
}

.pwa-mobile-actions__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: .55rem .8rem;
    border: 1px solid rgba(34, 197, 94, .22);
    border-radius: 10px;
    background: rgba(34, 197, 94, .1);
    color: var(--color-text);
    font-size: .86rem;
    font-weight: 800;
}

.data-table,
.consulta-table,
.comparativo-table,
.result-group-table,
.detail-table,
.balance-saldos-table,
.costos-lote__table,
.conv-stats-table {
    min-width: max-content;
}

.table-wrap,
.table-scroll,
.consulta-result__table-wrap,
.usuarios-table-wrap,
.costos-lote__table-wrap,
.result-group-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

button,
.btn,
.menu__link,
input,
select,
textarea {
    touch-action: manipulation;
}

@media (max-width: 900px) {
    .shell {
        display: block;
        min-height: 100dvh;
    }

    .shell__sidebar {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        min-height: 0;
        max-height: 58dvh;
        overflow: auto;
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .shell.shell--collapsed .shell__sidebar {
        width: 100%;
    }

    .shell--collapsed .menu {
        display: none;
    }

    .brand {
        min-height: 64px;
    }

    .brand__content {
        min-width: 0;
    }

    .brand__title,
    .brand__eyebrow {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .shell__main {
        min-width: 0;
        width: 100%;
    }

    .shell__content {
        width: 100%;
        padding: .9rem;
    }

    .page-grid,
    .dashboard-grid,
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .panel-card {
        min-width: 0;
    }

    .panel-card__header,
    .actions,
    .table-toolbar,
    .filters-grid,
    .form-grid {
        flex-wrap: wrap;
    }

    .btn {
        min-height: 42px;
    }

    input,
    select,
    textarea {
        min-height: 42px;
    }
}

@media (max-width: 720px) {
    .conversations-page--odoo {
        height: auto;
        min-height: calc(100dvh - 80px);
    }

    .conversations-page--odoo .conversations-layout,
    .conversations-layout {
        display: grid;
        grid-template-columns: 1fr !important;
        height: auto;
        min-height: 0;
        gap: .8rem;
    }

    .conversations-page--odoo .conversations-list,
    .conversations-page--odoo .conversations-chat,
    .conversations-list,
    .conversations-chat {
        width: 100%;
        min-width: 0;
        min-height: 0;
        max-height: none;
    }

    .conversations-list__items {
        max-height: 42dvh;
    }

    .conversations-thread {
        min-height: 48dvh;
        max-height: 62dvh;
    }

    .conversations-context,
    .conversations-page--odoo .conversations-context-drawer {
        width: min(92vw, 420px);
    }

    .conversations-filters__fields,
    .conversations-page--odoo .conversations-filters__fields {
        grid-template-columns: 1fr !important;
    }

    .conversations-canal,
    .conversations-filters__modes,
    .conversations-module-actions,
    .conversations-composer__actions {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .conversations-filter-pill,
    .conversations-module-actions .btn,
    .conversations-composer__actions .btn {
        flex: 0 0 auto;
        min-height: 42px;
    }

    .message-card {
        max-width: min(86vw, 560px);
    }

    .app-modal {
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        width: auto;
        max-height: calc(100dvh - 1.5rem);
    }
}

@media (max-width: 520px) {
    .shell__content {
        padding: .65rem;
    }

    .panel-card {
        border-radius: 8px;
        padding: .85rem;
    }

    .btn,
    .conversations-filter-pill {
        width: auto;
        max-width: 100%;
        white-space: nowrap;
    }

    .actions .btn,
    .table-toolbar .btn {
        flex: 1 1 150px;
    }

    .conversation-row__top,
    .conversation-row__meta,
    .conversation-row__badges {
        min-width: 0;
    }
}

.sort-icon {
    font-size: .7rem;
    margin-left: .25rem;
    opacity: .4;
    vertical-align: middle;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon { opacity: 1; color: var(--color-primary); }

/* ── Paginación del resultado ── */
.result-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 0 .25rem;
    font-size: .83rem;
}

.result-pagination__info {
    color: var(--color-text-muted);
}

.result-pagination__controls {
    display: flex;
    gap: .25rem;
    align-items: center;
}

.result-pagination__btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0 .4rem;
    border: 1px solid var(--color-border);
    border-radius: .375rem;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: .82rem;
    transition: background .15s;
}

.result-pagination__btn:hover:not(:disabled) { background: var(--color-border); }
.result-pagination__btn:disabled { opacity: .35; cursor: default; }

.result-pagination__btn--active {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary);
}

.result-pagination__size {
    padding: .25rem .5rem;
    border: 1px solid var(--color-border);
    border-radius: .375rem;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: .82rem;
    cursor: pointer;
}

/* ── View switch (Ventas / Comparativo) ── */
.view-switch {
    display: inline-flex;
    gap: .2rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .2rem;
}

.view-switch__btn {
    padding: .3rem 1rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.view-switch__btn--active {
    background: rgba(14, 165, 233, .18);
    color: #7dd3fc;
    font-weight: 600;
}

html[data-theme="light"] .view-switch {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .12);
}

html[data-theme="light"] .view-switch__btn--active {
    background: rgba(14, 165, 233, .15);
    color: #0284c7;
}

.comparativo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.comparativo-table th,
.comparativo-table td {
    padding: .45rem .75rem;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
}

.comparativo-table th:first-child,
.comparativo-table td:first-child {
    text-align: left;
}

.comparativo-table th {
    color: var(--color-muted);
    font-weight: 600;
    font-size: .82rem;
}

.comparativo-table tbody tr:hover td {
    background: rgba(125, 211, 252, .06);
}

.comparativo-table .balance-pos { color: #4ade80; }
.comparativo-table .balance-neg { color: #f87171; }

html[data-theme="light"] .comparativo-table .balance-pos { color: #16a34a; }
html[data-theme="light"] .comparativo-table .balance-neg { color: #dc2626; }

.kpi-card--compras {
    border-color: rgba(251, 146, 60, .35);
    background: linear-gradient(135deg,
        rgba(251, 146, 60, .08),
        rgba(13, 27, 48, .96) 60%
    );
}

.kpi-card--balance-pos {
    border-color: rgba(74, 222, 128, .35);
    background: linear-gradient(135deg,
        rgba(74, 222, 128, .08),
        rgba(13, 27, 48, .96) 60%
    );
}

.kpi-card--balance-neg {
    border-color: rgba(248, 113, 113, .35);
    background: linear-gradient(135deg,
        rgba(248, 113, 113, .08),
        rgba(13, 27, 48, .96) 60%
    );
}

html[data-theme="light"] .kpi-card--compras {
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border-color: rgba(234, 88, 12, .25);
}

html[data-theme="light"] .kpi-card--balance-pos {
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    border-color: rgba(22, 163, 74, .25);
}

html[data-theme="light"] .kpi-card--balance-neg {
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    border-color: rgba(220, 38, 38, .25);
}

/* ── Breadcrumb de consulta ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    font-size: .82rem;
    color: var(--color-text-muted);
    margin: .25rem 0 .5rem;
}

.breadcrumb__sep {
    opacity: .5;
    user-select: none;
}

.breadcrumb__item {
    color: var(--color-text-muted);
}

/* ── Fila de búsqueda del constructor visual ── */
.editor-builder__search-row {
    display: flex;
    gap: .5rem;
    align-items: stretch;
}

.editor-builder__search-row .editor-field__input {
    flex: 1;
}

/* ── Agrupador dinámico ─────────────────────────────────────────── */
.result-group-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
    margin-bottom: 1rem;
}

.result-group-config {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.result-group-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.result-group-by {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.result-group-by__label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 6.5rem;
}

.result-group-cols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .35rem .75rem;
    padding-top: .5rem;
    border-top: 1px solid var(--color-border);
}

.result-group-col {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.result-group-col__name {
    font-size: .8rem;
    color: var(--color-text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-group-col__op {
    font-size: .78rem;
    padding: .18rem .3rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    width: 7.5rem;
    flex-shrink: 0;
    cursor: pointer;
}

.result-group-table-wrap {
    overflow-x: auto;
    padding: 0 1rem .75rem;
}

.result-group-blocks {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    padding: .9rem 1rem .25rem;
}

.result-group-block {
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 4px);
    background: color-mix(in srgb, var(--color-surface) 78%, var(--color-bg));
    overflow: hidden;
}

.result-group-block__header {
    width: 100%;
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 70%, var(--color-primary-soft));
    text-align: left;
    cursor: pointer;
}

.result-group-block__header:hover {
    background: color-mix(in srgb, var(--color-surface) 55%, var(--color-primary-soft));
}

.result-group-block__eyebrow {
    margin: 0 0 .2rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.result-group-block__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.result-group-block__totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .55rem;
}

.result-group-block__total {
    min-width: 8rem;
    padding: .45rem .65rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
}

.result-group-block__total-label {
    display: block;
    font-size: .72rem;
    color: var(--color-text-muted);
    margin-bottom: .15rem;
}

.result-group-block__total-value {
    display: block;
    font-size: .88rem;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.result-group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.result-group-table th,
.result-group-table td {
    padding: .38rem .65rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.result-group-table th {
    font-weight: 600;
    font-size: .79rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    white-space: nowrap;
}

.result-group-table__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.result-group-table tfoot .result-group-total td {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
    border-bottom: none;
    background: var(--color-bg);
    color: var(--color-text);
}

.result-group-info {
    font-size: .78rem;
    color: var(--color-text-muted);
    padding: 0 1rem .65rem;
    margin: 0;
}

.result-group-global {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 0 1rem .75rem;
}

.result-group-global__label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-text);
}

/* ── Responsive: en mobile el panel izquierdo ocupa todo el ancho ── */
@media (max-width: 640px) {
    .ctree-layout { flex-direction: column; height: auto; }
    .ctree-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); }
    .ctree-content { display: none; }
}

.two-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auditoria__block {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.18);
    line-height: 1.6;
    white-space: pre-wrap;
}

.auditoria__pre {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.2);
    overflow: auto;
    max-height: 60vh;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.9rem;
}

.auditoria__textarea {
    width: 100%;
    min-height: 360px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.2);
    color: inherit;
    resize: vertical;
    line-height: 1.5;
    font-size: 0.9rem;
    font-family: Consolas, "Courier New", monospace;
    box-sizing: border-box;
}

html[data-theme="light"] .auditoria__block,
html[data-theme="light"] .auditoria__pre,
html[data-theme="light"] .auditoria__textarea {
    background: rgba(248, 250, 252, 0.86);
}

@media (max-width: 960px) {
    .two-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .interfaces-bulkbar {
        align-items: stretch;
    }

    .interfaces-bulkbar__field,
    .interfaces-bulkbar__field select,
    .interfaces-bulkbar__apply {
        width: 100%;
        min-width: 0;
    }

    .interfaces-table__actions {
        min-width: 110px;
    }
}

/* ── Comprobantes expandibles ─────────────────────────────── */
.row--clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.row--clickable:hover {
    background: rgba(148, 163, 184, 0.06);
}

.row--active {
    background: rgba(99, 102, 241, 0.08) !important;
}

.row--detail td {
    padding: 0.75rem 1rem 1rem;
    background: rgba(8, 15, 28, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.detail-table th {
    text-align: left;
    padding: 0.35rem 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.detail-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    color: var(--text-primary);
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.badge-tc {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.loading-inline {
    padding: 0.6rem 0;
    color: var(--text-muted);
    font-size: 0.87rem;
}

.alert-band--warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
    font-size: 0.87rem;
    align-items: center;
}

html[data-theme="light"] .row--detail td {
    background: rgba(248, 250, 252, 0.7);
}

html[data-theme="light"] .badge-tc {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

html[data-theme="light"] .alert-band--warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

/* ── Balance General de Saldos ──────────────────────────────── */
.kpi-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card--warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.kpi-card--warning .kpi-card__icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.balance-nivel-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-nivel-selector__label {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.balance-nivel-selector__select {
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    background: var(--card-bg, #1e2433);
    color: var(--text-primary);
    min-width: 160px;
}

.balance-saldos-table {
    min-width: 480px;
    font-size: 0.84rem;
}

.balance-saldos-table .col-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.balance-row--capitulo td {
    font-weight: 700;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 0.65rem;
}

.balance-row--capitulo:first-child td {
    border-top: none;
}

.balance-row--detalle td {
    color: var(--text-secondary, #94a3b8);
}

.balance-col-codigo {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 60px;
}

.balance-col-empty {
    color: transparent;
    user-select: none;
}

html[data-theme="light"] .balance-nivel-selector__select {
    background: #fff;
    border-color: #d1d5db;
    color: #1e293b;
}

html[data-theme="light"] .balance-row--detalle td {
    color: #475569;
}

@media (max-width: 1280px) {
    .conversations-layout {
        grid-template-columns: minmax(250px, 310px) minmax(0, 1fr) minmax(220px, 280px);
        height: calc(100vh - 170px);
        min-height: 640px;
    }

    .message-card {
        max-width: min(96%, 620px);
    }
}

@media (max-width: 1100px) {
    .conversations-layout {
        grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
        height: auto;
        align-items: start;
    }

    .conversations-list {
        height: min(820px, calc(100vh - 190px));
    }

    .conversations-chat {
        height: min(900px, calc(100vh - 190px));
    }

    .conversations-context {
        grid-column: 1 / -1;
        max-height: 360px;
    }
}

@media (max-width: 900px) {
    .kpi-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conv-config-status-grid,
    .conv-config-layout,
    .conv-config-fields {
        grid-template-columns: 1fr;
    }

    .conversations-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .conversations-filters__fields {
        grid-template-columns: 1fr;
    }

    .conversations-list,
    .conversations-chat,
    .conversations-context {
        height: auto;
        max-height: none;
    }

    .conversations-list__items {
        max-height: 360px;
    }

    .conversations-thread {
        min-height: 360px;
        max-height: min(620px, 62vh);
    }

    .conversations-chat__header,
    .conversations-context__actions,
    .conversations-composer__actions {
        flex-wrap: wrap;
    }

    .conversation-header-state {
        justify-items: start;
        align-items: flex-start;
        min-width: min(100%, 230px);
    }

    .conversations-window-banner {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .conversations-window-banner .btn {
        justify-self: start;
    }

    .message-card {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .conversations-filters,
    .conversations-list,
    .conversations-chat,
    .conversations-context {
        padding: 1rem;
    }

    .conversations-canal,
    .conversations-filters__modes,
    .conversations-composer__actions,
    .conversations-context__actions {
        align-items: stretch;
    }

    .conversations-filter-pill,
    .conversations-filters__fields .btn,
    .conversations-composer__actions .btn,
    .conversations-context__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .conversation-row {
        border-radius: 16px;
        padding: .85rem;
    }

    .conversation-row__top,
    .message-card__meta,
    .message-card__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: .25rem;
    }

    .conversation-header-state,
    .conversation-header-state__row,
    .conversation-header-state__trigger,
    .conversation-header-state__close {
        width: 100%;
        max-width: none;
    }

    .conversation-header-state__menu {
        left: 0;
        right: auto;
        width: 100%;
    }

    .message-card {
        border-radius: 18px;
        padding: .9rem;
    }

    .message-attachment--audio,
    .wa-audio-player,
    .attachment-link {
        max-width: 100%;
        width: 100%;
    }
}

/* Canal switcher */
.conversations-canal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.btn--sm {
    padding: .4rem .85rem;
    font-size: .85rem;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    display: grid;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.modal-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-card__actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.attachment-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(2, 6, 23, 0.78);
    animation: support-modal-backdrop-in .18s ease-out both;
}

.attachment-preview-modal {
    width: min(1100px, 96vw);
    max-height: 92vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: .75rem;
    border: 1px solid rgba(56, 189, 248, .14);
    border-radius: 18px;
    background: rgba(9, 24, 43, .96);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .42), 0 0 0 1px rgba(56, 189, 248, .14);
    padding: 1rem;
    transform-origin: center;
    animation: support-modal-in .2s cubic-bezier(.2, .8, .2, 1) both;
}

.attachment-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--color-text);
    font-weight: 800;
    min-width: 0;
    padding-inline: .15rem;
}

.attachment-preview-header span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-preview-actions {
    display: flex;
    align-items: center;
    gap: .18rem;
    flex: 0 0 auto;
}

.attachment-preview-action {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    color: rgba(226, 232, 240, .9);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.attachment-preview-action:hover,
.attachment-preview-action:focus-visible {
    background: rgba(255, 255, 255, .09);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.attachment-preview-zoom-button {
    width: auto;
    min-width: 3.15rem;
    padding-inline: .55rem;
    font-size: .85rem;
    font-weight: 800;
}

.attachment-preview-body {
    display: grid;
    grid-template-columns: 2.55rem minmax(0, 1fr) 2.55rem;
    align-items: center;
    min-height: 0;
    gap: .75rem;
}

.attachment-preview-nav {
    display: grid;
    place-items: center;
    align-self: center;
    justify-self: center;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .26);
    color: rgba(226, 232, 240, .9);
    font-size: 1.15rem;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.attachment-preview-nav:disabled {
    opacity: .35;
    cursor: default;
}

.attachment-preview-nav:not(:disabled):hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    transform: scale(1.04);
}

.attachment-preview-canvas {
    display: grid;
    place-items: center;
    min-height: min(64vh, 620px);
    max-height: calc(92vh - 6rem);
    overflow: auto;
    border-radius: var(--radius-md);
    background: rgba(2, 6, 23, .12);
    overscroll-behavior: contain;
    cursor: grab;
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

.attachment-preview-canvas::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.attachment-preview-canvas.is-dragging {
    cursor: grabbing;
}

.attachment-preview-canvas img {
    max-width: 100%;
    max-height: calc(92vh - 10rem);
    width: auto;
    min-height: 0;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    transform-origin: center center;
    transform: scale(var(--preview-zoom, 1)) rotate(var(--preview-rotation, 0deg));
    transition: transform .18s ease;
    animation: attachment-preview-media-enter .18s ease both;
    user-select: none;
    -webkit-user-drag: none;
}

.attachment-preview-canvas video {
    align-self: center;
    justify-self: center;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-md);
    background: rgba(2, 6, 23, .72);
    animation: attachment-preview-media-enter .18s ease both;
}

.attachment-preview-strip {
    display: flex;
    align-items: center;
    gap: .55rem;
    max-width: 100%;
    overflow-x: auto;
    padding: .75rem .2rem .35rem;
    border-top: 1px solid rgba(148, 163, 184, .16);
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.attachment-preview-thumb {
    position: relative;
    flex: 0 0 76px;
    width: 76px;
    height: 58px;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    padding: 0;
    background: rgba(15, 23, 42, .58);
    opacity: .76;
    transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

.attachment-preview-thumb:hover,
.attachment-preview-thumb:focus-visible {
    opacity: 1;
    outline: none;
    transform: translateY(-1px);
}

.attachment-preview-thumb.is-active {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .26), 0 0 18px rgba(34, 197, 94, .22);
    opacity: 1;
}

.attachment-preview-thumb img,
.attachment-preview-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-preview-thumb span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    background: rgba(2, 6, 23, .28);
}

@keyframes attachment-preview-media-enter {
    from {
        opacity: 0;
        transform: scale(calc(var(--preview-zoom, 1) * .985)) rotate(var(--preview-rotation, 0deg));
    }

    to {
        opacity: 1;
        transform: scale(var(--preview-zoom, 1)) rotate(var(--preview-rotation, 0deg));
    }
}

/* Adjuntos en mensajes */
.message-attachments {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .4rem;
}

/* Contenedor de imagen/sticker: contexto de posicionamiento para el overlay */
.message-attachment--image {
    position: relative;
    display: inline-block;
    line-height: 0;
    align-self: flex-start;
}

/* Botón de guardar sticker — overlay esquina inferior-izquierda */
.message-attachment--image .btn {
    position: absolute;
    bottom: .4rem;
    left: .4rem;
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    line-height: 1;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: #e2e8f0;
    opacity: 0;
    transition: opacity .18s ease, background .15s ease, transform .12s ease;
    z-index: 2;
}

.message-attachment--image:hover .btn,
.message-attachment--image .btn:focus-visible {
    opacity: 1;
}

.message-attachment--image .btn:hover {
    background: rgba(14, 165, 233, 0.58);
    border-color: rgba(14, 165, 233, 0.55);
    transform: scale(1.08);
}

.message-attachment--image .btn .bi {
    display: block;
    line-height: 1;
    font-size: .78rem;
}

.attachment-preview-button {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    max-width: 100%;
    line-height: 0;
}

.message-attachment--image img {
    max-width: min(220px, 100%);
    max-height: 150px;
    border-radius: var(--radius-md);
    display: block;
    object-fit: contain;
    border: 1px solid rgba(148, 163, 184, 0.15);
    transition: opacity .14s ease;
}

.attachment-preview-button:hover img {
    opacity: .88;
}

.attachment-name {
    display: block;
    font-size: .75rem;
    color: var(--color-muted);
    margin-top: .2rem;
}

.message-attachment--audio {
    position: relative;
    display: block;
    width: min(370px, calc(100vw - 7rem));
    max-width: 100%;
}

.message-row:has(.message-reaction-picker) {
    z-index: 60;
}

.wa-audio-player__media {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: .001;
    pointer-events: none;
}

.wa-audio-player {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr) 2.25rem 2rem;
    align-items: center;
    gap: .55rem;
    width: 100%;
    min-width: 0;
    min-height: 3.1rem;
    padding: .52rem .58rem .45rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(31, 41, 55, .94), rgba(17, 24, 39, .94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.message-row--outgoing .wa-audio-player {
    background: linear-gradient(180deg, rgba(7, 89, 133, .9), rgba(8, 76, 112, .92));
    border-color: rgba(56, 189, 248, .18);
}

.wa-audio-player__play {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #f8fafc;
    cursor: pointer;
}

.wa-audio-player__play .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.wa-audio-player__body {
    position: relative;
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.wa-audio-player__seek {
    --audio-progress: 0%;
    width: 100%;
    height: 1.35rem;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background:
        radial-gradient(circle at var(--audio-progress) 50%, #38bdf8 0 .3rem, transparent .32rem),
        linear-gradient(90deg, rgba(56, 189, 248, .95) 0 var(--audio-progress), rgba(148, 163, 184, .62) var(--audio-progress) 100%);
    mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 6px);
    -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 6px);
}

.wa-audio-player__seek::-webkit-slider-runnable-track {
    height: 1.45rem;
    background: transparent;
}

.wa-audio-player__seek::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: .01rem;
    height: 1.45rem;
    background: transparent;
}

.wa-audio-player__seek::-moz-range-track {
    height: 1.45rem;
    background: transparent;
}

.wa-audio-player__seek::-moz-range-thumb {
    width: .01rem;
    height: 1.45rem;
    border: 0;
    background: transparent;
}

.wa-audio-player__meta {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: rgba(203, 213, 225, .72);
    font-size: .7rem;
    line-height: 1;
}

.wa-audio-player__speed {
    justify-self: end;
    min-width: 2.1rem;
    height: 1.25rem;
    padding: 0 .4rem;
    border: 0;
    border-radius: 999px;
    background: rgba(2, 6, 23, .66);
    color: #f8fafc;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.wa-audio-player__speed:hover,
.wa-audio-player__speed:focus-visible {
    background: rgba(2, 6, 23, .9);
}

.wa-audio-player.has-audio-error {
    border-color: rgba(248, 113, 113, .55);
}

.message-attachment--video {
    display: grid;
    gap: .35rem;
    max-width: min(340px, 100%);
}

.message-video-preview {
    position: relative;
    width: min(320px, 100%);
    max-width: 100%;
}

.message-attachment--video video {
    display: block;
    width: 100%;
    max-height: 220px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    background: rgba(2, 6, 23, 0.62);
}

.message-video-preview__open {
    position: absolute;
    inset: 0 0 42px 0;
    display: grid;
    place-items: start end;
    border: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: .45rem;
    background: linear-gradient(135deg, rgba(2, 6, 23, .08), rgba(2, 6, 23, .34));
    color: #e2e8f0;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity .16s ease, background-color .16s ease;
}

.message-video-preview__open i {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(2, 6, 23, .68);
    box-shadow: 0 8px 18px rgba(2, 6, 23, .22);
}

.message-video-preview:hover .message-video-preview__open,
.message-video-preview__open:focus-visible {
    opacity: 1;
}

.attachment-video-meta {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
    color: var(--color-muted);
    font-size: .74rem;
}

.attachment-video-meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-video-meta span:last-child {
    flex: 0 0 auto;
    color: #7dd3fc;
}

.attachment-menu-button {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--color-muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.attachment-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .25rem);
    z-index: 5;
    min-width: 150px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-panel-strong);
    box-shadow: var(--shadow-soft);
    padding: .35rem;
}

.attachment-menu a {
    display: block;
    border-radius: 8px;
    padding: .45rem .6rem;
    color: var(--color-text);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.attachment-menu a:hover {
    background: rgba(14, 165, 233, 0.12);
}

.attachment-download {
    display: inline-flex;
    width: fit-content;
    margin-top: .35rem;
    color: var(--color-primary);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.attachment-download:hover {
    text-decoration: underline;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .4rem .75rem;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    font-size: .85rem;
    transition: background .15s ease;
}

.attachment-link:hover {
    background: rgba(14, 165, 233, 0.16);
}

.attachment-link__size {
    color: var(--color-muted);
    font-size: .75rem;
}

/* Botón grabando */
.btn.is-recording {
    color: #ef4444;
    border-color: #ef4444;
    animation: pulse-record 1.2s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

.interfaces-page {
    --interfaces-surface: rgba(8, 18, 34, 0.72);
    --interfaces-surface-2: rgba(11, 24, 43, 0.78);
    --interfaces-surface-3: rgba(255, 255, 255, 0.04);
    --interfaces-surface-4: rgba(8, 19, 35, 0.92);
    --interfaces-stroke: rgba(139, 164, 196, 0.16);
    --interfaces-stroke-strong: rgba(71, 156, 255, 0.26);
    --interfaces-accent-soft: rgba(27, 169, 255, 0.16);
    --interfaces-accent-glow: rgba(29, 183, 255, 0.18);
    --interfaces-success-soft: rgba(16, 185, 129, 0.14);
    --interfaces-warning-soft: rgba(245, 158, 11, 0.16);
    --interfaces-danger-soft: rgba(239, 68, 68, 0.16);
    --interfaces-shadow: 0 18px 44px rgba(2, 8, 23, 0.28);
}

html[data-theme="light"] .interfaces-page {
    --interfaces-surface: rgba(255, 255, 255, 0.78);
    --interfaces-surface-2: rgba(249, 251, 253, 0.92);
    --interfaces-surface-3: rgba(15, 23, 42, 0.03);
    --interfaces-surface-4: rgba(255, 255, 255, 0.96);
    --interfaces-stroke: rgba(15, 23, 42, 0.08);
    --interfaces-stroke-strong: rgba(2, 132, 199, 0.18);
    --interfaces-accent-soft: rgba(2, 132, 199, 0.1);
    --interfaces-accent-glow: rgba(2, 132, 199, 0.12);
    --interfaces-success-soft: rgba(5, 150, 105, 0.1);
    --interfaces-warning-soft: rgba(217, 119, 6, 0.12);
    --interfaces-danger-soft: rgba(220, 38, 38, 0.1);
    --interfaces-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.interfaces-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(9, 25, 46, 0.96), rgba(8, 18, 34, 0.64)),
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 34%);
    border: 1px solid var(--interfaces-stroke);
    box-shadow: var(--interfaces-shadow);
}

.interfaces-hero::after {
    content: "";
    position: absolute;
    inset: auto -12% -65% auto;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 68%);
    pointer-events: none;
}

html[data-theme="light"] .interfaces-hero {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 252, 0.92)),
        radial-gradient(circle at top left, rgba(2, 132, 199, 0.08), transparent 34%);
}

.interfaces-filters-panel,
.interfaces-inbox-panel,
.interfaces-editor-panel {
    background: var(--interfaces-surface);
    border-color: var(--interfaces-stroke);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--interfaces-shadow);
}

.interfaces-filters-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        var(--interfaces-surface);
}

.interfaces-filters-summary,
.interfaces-editor-ribbon,
.interfaces-editor-header-actions,
.interfaces-upload-actions,
.interfaces-inbox-item__quick,
.interfaces-inbox-item__meta,
.interfaces-inbox-item__footer,
.interfaces-history-modern__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.interfaces-summary-chip,
.interfaces-status-pill,
.interfaces-priority-chip {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-height: 30px;
    padding: .32rem .72rem;
    border-radius: 999px;
    font-size: .79rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.interfaces-summary-chip {
    color: var(--color-muted);
    background: var(--interfaces-surface-3);
    border-color: var(--interfaces-stroke);
}

.interfaces-status-pill--info {
    color: var(--color-primary);
    background: var(--interfaces-accent-soft);
    border-color: rgba(14, 165, 233, 0.22);
}

.interfaces-status-pill--success {
    color: var(--color-success);
    background: var(--interfaces-success-soft);
    border-color: rgba(16, 185, 129, 0.22);
}

.interfaces-status-pill--warning {
    color: var(--color-warning);
    background: var(--interfaces-warning-soft);
    border-color: rgba(245, 158, 11, 0.24);
}

.interfaces-status-pill--danger {
    color: var(--color-danger);
    background: var(--interfaces-danger-soft);
    border-color: rgba(239, 68, 68, 0.24);
}

.interfaces-bulkbar {
    display: flex;
    align-items: end;
    gap: .85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 16px;
    background: color-mix(in srgb, var(--interfaces-surface-2) 76%, transparent);
}

.interfaces-bulkbar__field {
    min-width: min(280px, 100%);
    margin-bottom: 0;
}

.interfaces-bulkbar__field select {
    min-width: 240px;
}

.interfaces-bulkbar__apply {
    min-width: 120px;
}

.interfaces-table__selector {
    width: 44px;
    text-align: center;
}

.interfaces-table__checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.interfaces-table__actions {
    width: 120px;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .interfaces-sticky-filters,
    .interfaces-docs-panel .panel-card__header,
    .interfaces-docs-panel .interfaces-bulkbar {
        position: static;
    }

    .interfaces-filters-panel-grid {
        grid-template-columns: 1fr 1fr;
    }

    .interfaces-docs-table-wrap {
        height: calc(100vh - 280px);
        min-height: 300px;
    }

    .interfaces-detail-modal {
        width: min(96vw, 760px);
        max-width: min(96vw, 760px);
        height: 92vh;
    }
}

.interfaces-docs-panel .panel-card__header {
    position: sticky;
    top: 8px;
    z-index: 7;
    background: var(--interfaces-surface-4, var(--color-panel));
    padding-block: .45rem;
    border-bottom: 1px solid var(--interfaces-stroke, var(--color-border));
}

.interfaces-sticky-filters {
    position: sticky;
    top: 8px;
    z-index: 8;
}

.interfaces-docs-table-wrap {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 0;
    scrollbar-gutter: auto;
    overscroll-behavior: auto;
    border-radius: 12px;
}

.interfaces-docs-table-wrap .usuarios-table__row td.interfaces-table__actions {
    position: sticky;
    right: 0;
    z-index: 5;
    background: var(--interfaces-surface-4, var(--color-surface));
    box-shadow: -8px 0 12px rgba(2, 6, 23, 0.08);
}

.interfaces-docs-table-wrap .interfaces-table__actions .btn {
    opacity: 1;
    visibility: visible;
}

.interfaces-table__actions--menu {
    position: relative;
    min-width: 170px;
}

.interfaces-row-actions-menu {
    position: static;
    min-width: 150px;
    display: grid;
    gap: .35rem;
    margin-top: .45rem;
    padding: .45rem;
    border: 1px solid var(--interfaces-stroke, var(--color-border));
    border-radius: 10px;
    background: var(--interfaces-surface-4, var(--color-panel));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.interfaces-row-actions-menu .btn {
    width: 100%;
    justify-content: flex-start;
}

.interfaces-detail-modal-overlay {
    z-index: 2200;
    background: rgba(2, 8, 23, 0.78);
    backdrop-filter: blur(2px);
}

.interfaces-detail-modal {
    width: min(980px, 96vw);
    max-width: min(980px, 96vw);
    height: min(92vh, 1320px);
    max-height: 92vh;
    overflow: auto;
    background: #0b1729;
    border: 1px solid rgba(80, 118, 180, 0.28);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .interfaces-detail-modal {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
}

.interfaces-docs-panel .interfaces-bulkbar {
    position: static;
    background: var(--interfaces-surface-2, var(--color-surface));
}

.interfaces-filters-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: .75rem;
    margin-top: .55rem;
}

.interfaces-sticky-filters .smart-search__panel {
    position: static;
    z-index: auto;
    top: auto;
    left: auto;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform-origin: initial;
    animation: none;
    padding: 0;
}

.interfaces-sticky-filters .smart-search select,
.interfaces-sticky-filters .smart-search input[type="text"],
.interfaces-sticky-filters .smart-search input[type="date"] {
    min-width: 0;
    border: 1px solid rgba(125, 161, 207, 0.28);
    border-radius: 10px;
    background: rgba(4, 12, 24, 0.78);
    color: var(--color-text);
    padding: .58rem .65rem;
}

.interfaces-docs-table-wrap {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.interfaces-docs-table-wrap::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.interfaces-docs-table-wrap {
    scrollbar-width: none;
}

.interfaces-docs-table-wrap::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.22);
}

.interfaces-docs-table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(34, 211, 238, .88), rgba(14, 165, 233, .72));
    border-radius: 999px;
}

.interfaces-invoice {
    display: grid;
    gap: 1rem;
}

.interfaces-invoice__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.interfaces-invoice__header h4 {
    margin: 0;
    font-size: 1.18rem;
}

.interfaces-invoice__header p {
    margin: .3rem 0 0;
    color: var(--color-text-muted);
}

.interfaces-invoice__total {
    text-align: right;
}

.interfaces-invoice__total span {
    font-size: .78rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.interfaces-invoice__total strong {
    display: block;
    font-size: 1.4rem;
}

.interfaces-invoice__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}

.interfaces-invoice__totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem .8rem;
}

.interfaces-invoice__totals > div {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem .65rem;
    border: 1px solid var(--interfaces-stroke, var(--color-border));
    border-radius: 12px;
}

.interfaces-invoice__totals > div span {
    color: var(--color-text-muted);
}

.interfaces-table__edit {
    gap: .4rem;
}

.interfaces-table__edit span {
    display: inline;
}

.interfaces-queue-progress {
    min-width: 180px;
    display: grid;
    gap: .32rem;
}

.interfaces-queue-progress__track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--interfaces-surface-3) 78%, transparent);
    border: 1px solid color-mix(in srgb, var(--interfaces-stroke) 75%, transparent);
}

.interfaces-queue-progress__fill {
    height: 100%;
    border-radius: 999px;
    transition: width .35s ease;
}

.interfaces-queue-progress__fill--pending {
    background: linear-gradient(90deg, #94a3b8, #64748b);
}

.interfaces-queue-progress__fill--active {
    background: linear-gradient(90deg, #0ea5e9, #22d3ee, #0ea5e9);
    background-size: 220% 100%;
    animation: interfaces-progress-stripe 1.3s linear infinite;
}

.interfaces-queue-progress__fill--success {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.interfaces-queue-progress__fill--info {
    background: linear-gradient(90deg, #06b6d4, #0ea5e9);
}

.interfaces-queue-progress__fill--danger {
    background: linear-gradient(90deg, #f43f5e, #ef4444);
}

.interfaces-queue-progress__fill--muted {
    background: linear-gradient(90deg, #64748b, #475569);
}

.interfaces-queue-progress__label {
    font-size: .74rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

@keyframes interfaces-progress-stripe {
    from {
        background-position: 0% 0%;
    }
    to {
        background-position: 220% 0%;
    }
}

.interfaces-mobile-toolbar,
.interfaces-mobile-list {
    display: none;
}

.interfaces-mobile-group {
    margin: .25rem 0 .55rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.interfaces-mobile-card {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 18px;
    background: color-mix(in srgb, var(--interfaces-surface-2) 78%, transparent);
    box-shadow: var(--interfaces-shadow);
}

.interfaces-mobile-card + .interfaces-mobile-card {
    margin-top: .75rem;
}

.interfaces-mobile-card.is-selected {
    border-color: var(--interfaces-stroke-strong);
    background: color-mix(in srgb, var(--interfaces-accent-soft) 36%, var(--interfaces-surface-2));
}

.interfaces-mobile-card__head,
.interfaces-mobile-card__meta,
.interfaces-mobile-card__actions {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    justify-content: space-between;
}

.interfaces-mobile-card__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .12rem;
}

.interfaces-mobile-card__identity {
    display: grid;
    gap: .18rem;
    flex: 1 1 auto;
    min-width: 0;
}

.interfaces-mobile-card__identity strong {
    font-size: 1rem;
}

.interfaces-mobile-card__identity span,
.interfaces-mobile-card__meta span {
    color: var(--color-text-muted);
    font-size: .84rem;
}

.interfaces-mobile-card__summary {
    margin: 0;
    font-size: .92rem;
    line-height: 1.5;
}

.interfaces-mobile-card__meta {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.interfaces-mobile-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.interfaces-mobile-card__actions .btn {
    width: 100%;
    justify-content: center;
}

.interfaces-priority-chip--normal {
    color: var(--color-muted);
    background: var(--interfaces-surface-3);
    border-color: var(--interfaces-stroke);
}

.interfaces-priority-chip--high {
    color: var(--color-warning);
    background: var(--interfaces-warning-soft);
    border-color: rgba(245, 158, 11, 0.24);
}

.interfaces-priority-chip--urgent {
    color: var(--color-danger);
    background: var(--interfaces-danger-soft);
    border-color: rgba(239, 68, 68, 0.24);
}

.interfaces-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 35%) minmax(0, 65%);
    gap: 1.35rem;
    align-items: start;
}

.interfaces-inbox-panel,
.interfaces-editor-panel {
    min-height: 780px;
}

.interfaces-inbox-panel {
    background:
        linear-gradient(180deg, rgba(6, 16, 30, 0.96), rgba(9, 21, 38, 0.92)),
        var(--interfaces-surface-4);
}

html[data-theme="light"] .interfaces-inbox-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 253, 0.95)),
        var(--interfaces-surface-4);
}

.interfaces-inbox-list {
    display: grid;
    gap: .9rem;
    max-height: 900px;
    overflow: auto;
    padding-right: .35rem;
}

.interfaces-inbox-item {
    position: relative;
    display: grid;
    gap: .72rem;
    padding: 1rem 1rem .95rem 1rem;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(18, 33, 54, 0.98), rgba(10, 20, 36, 0.96)),
        #0b1729;
    transition: border-color .18s ease, transform .18s ease, background-color .18s ease, box-shadow .18s ease;
    overflow: hidden;
}

html[data-theme="light"] .interfaces-inbox-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.94)),
        #ffffff;
}

.interfaces-inbox-item:hover {
    border-color: var(--interfaces-stroke-strong);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.2);
}

.interfaces-inbox-item.is-selected {
    border-color: rgba(28, 178, 255, 0.34);
    background:
        linear-gradient(180deg, rgba(18, 144, 255, 0.12), rgba(18, 144, 255, 0.03)),
        var(--interfaces-surface-4);
    box-shadow:
        inset 0 0 0 1px rgba(28, 178, 255, 0.08),
        0 0 0 1px rgba(28, 178, 255, 0.05),
        0 18px 40px rgba(14, 165, 233, 0.12);
}

html[data-theme="light"] .interfaces-inbox-item.is-selected {
    background:
        linear-gradient(180deg, rgba(2, 132, 199, 0.1), rgba(2, 132, 199, 0.02)),
        var(--interfaces-surface-4);
}

.interfaces-inbox-item__active-bar {
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 999px;
    background: transparent;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.interfaces-inbox-item.is-selected .interfaces-inbox-item__active-bar {
    background: linear-gradient(180deg, #38bdf8, #0ea5e9);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.interfaces-inbox-item__main {
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0;
    text-align: left;
    display: grid;
    gap: .6rem;
}

.interfaces-inbox-item__top,
.interfaces-section__head,
.interfaces-history-modern__top,
.interfaces-inline-state,
.interfaces-attachment-row,
.interfaces-inbox-item__actions {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: start;
}

.interfaces-inbox-item__identity {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
}

.interfaces-inbox-item__top strong {
    font-size: 1.02rem;
    letter-spacing: -.02em;
}

.interfaces-inbox-item__meta,
.interfaces-inbox-item__footer,
.interfaces-history-modern__meta {
    color: var(--color-muted);
    font-size: .82rem;
}

.interfaces-inbox-item__summary,
.interfaces-history-modern__item p,
.interfaces-editor-empty p,
.interfaces-section__head p {
    margin: 0;
}

.interfaces-inline-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: start;
    margin: 0 0 1rem;
    padding: .95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: linear-gradient(180deg, rgba(18, 48, 70, 0.78), rgba(11, 29, 47, 0.88));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.interfaces-inline-note i {
    font-size: 1rem;
    color: #7dd3fc;
    margin-top: .12rem;
}

.interfaces-inline-note strong,
.interfaces-inline-note span {
    display: block;
}

.interfaces-inline-note strong {
    color: var(--color-text);
    font-size: .88rem;
}

.interfaces-inline-note span {
    margin-top: .2rem;
    color: var(--color-muted);
    font-size: .83rem;
    line-height: 1.45;
}

html[data-theme="light"] .interfaces-inline-note {
    border-color: rgba(14, 165, 233, 0.18);
    background: linear-gradient(180deg, rgba(232, 244, 251, 0.96), rgba(240, 247, 252, 0.98));
}

.updates-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.updates-stat .panel-card__title {
    margin-bottom: .35rem;
}

.updates-config-grid {
    align-items: end;
}

.updates-config-actions {
    justify-content: flex-start;
}

.updates-grid {
    align-items: start;
}

.updates-script-list,
.updates-history-list {
    display: grid;
    gap: .9rem;
}

.updates-script-item,
.updates-history-item {
    padding: 1rem 1.05rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(12, 24, 43, 0.9), rgba(9, 18, 32, 0.94));
}

html[data-theme="light"] .updates-script-item,
html[data-theme="light"] .updates-history-item {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,252,0.98));
}

.updates-script-item__top,
.updates-history-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .45rem;
}

.updates-script-item p,
.updates-history-item p {
    margin: 0 0 .35rem;
    color: var(--color-text);
}

.updates-script-item span,
.updates-history-item span {
    color: var(--color-muted);
    font-size: .85rem;
}

.updates-history-item details {
    margin-top: .7rem;
}

.updates-history-item summary {
    cursor: pointer;
    color: var(--color-accent);
    font-size: .84rem;
}

.updates-history-item pre {
    margin: .7rem 0 0;
    padding: .85rem;
    border-radius: 16px;
    background: rgba(3, 10, 20, 0.42);
    color: var(--color-muted);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .78rem;
}

@media (max-width: 980px) {
    .updates-overview {
        grid-template-columns: 1fr;
    }
}

.interfaces-inbox-item__summary {
    font-size: .91rem;
    line-height: 1.4;
    color: var(--color-text);
}

.interfaces-inbox-item__quick {
    gap: .45rem;
}

.interfaces-icon-action {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 12px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
}

.interfaces-icon-action i {
    font-size: 1rem;
}

.interfaces-icon-action span {
    display: none;
}

.interfaces-inline-state {
    flex-wrap: wrap;
    align-items: center;
}

.interfaces-inline-state select {
    min-width: 150px;
}

.interfaces-editor-panel {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
        var(--interfaces-surface);
}

.interfaces-editor-shell {
    display: grid;
    gap: 1.05rem;
}

.interfaces-editor-ribbon {
    padding: .95rem 1rem;
    border-radius: 22px;
    border: 1px solid var(--interfaces-stroke);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
        var(--interfaces-surface-2);
}

.interfaces-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 1rem;
    align-items: start;
}

.interfaces-editor-column {
    display: grid;
    gap: 1rem;
}

.interfaces-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.interfaces-form-grid .field,
.interfaces-section,
.interfaces-editor-empty {
    border: 1px solid var(--interfaces-stroke);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        var(--interfaces-surface-2);
}

.interfaces-form-grid .field {
    min-width: 0;
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.interfaces-form-grid .field--full {
    grid-column: 1 / -1;
}

.interfaces-field-shell {
    padding: .95rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
        rgba(10, 22, 39, 0.7);
}

html[data-theme="light"] .interfaces-field-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.94)),
        #ffffff;
}

.interfaces-field-shell textarea {
    min-height: 160px;
}

.interfaces-prompt-editor {
    min-height: 220px;
    max-height: 52dvh;
    overflow: auto;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.interfaces-field-shell--subtle {
    background: var(--interfaces-surface-3);
}

.interfaces-editor-actions {
    gap: .8rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.interfaces-section {
    padding: 1rem 1rem 1.05rem;
    display: grid;
    gap: .9rem;
}

.interfaces-section--feature {
    background:
        linear-gradient(180deg, rgba(14, 165, 233, 0.06), rgba(14, 165, 233, 0.02)),
        var(--interfaces-surface-2);
}

.interfaces-section--soft {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        var(--interfaces-surface-2);
}

.interfaces-section--timeline {
    position: relative;
}

.interfaces-section__head h4,
.interfaces-editor-empty h4 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -.01em;
}

.interfaces-section__head p {
    color: var(--color-muted);
    font-size: .88rem;
}

.interfaces-empty-upload,
.interfaces-empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.24);
    border-radius: 20px;
    padding: 1rem;
    color: var(--color-muted);
    background: var(--interfaces-surface-3);
}

.interfaces-upload-dropzone {
    outline: none;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.interfaces-upload-dropzone[data-upload-paste-ready="1"]:focus-visible,
.interfaces-upload-dropzone.is-file-dragging {
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.08);
}

.interfaces-upload-hint {
    margin: 0;
    color: var(--color-muted);
    font-size: .84rem;
}

.interfaces-file-trigger {
    min-height: 46px;
}

.interfaces-file-trigger.is-disabled {
    opacity: .5;
    pointer-events: none;
}

.interfaces-upload-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

.interfaces-file-trigger--mobile {
    display: none;
}

.interfaces-attachments-modern,
.interfaces-history-modern {
    display: grid;
    gap: .75rem;
}

.interfaces-attachment-row,
.interfaces-history-modern__item {
    padding: .95rem 1rem;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.interfaces-attachment-row__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--interfaces-accent-soft);
    color: var(--color-primary);
    flex: 0 0 auto;
    font-size: 1.1rem;
}

.interfaces-attachment-row__content {
    display: grid;
    gap: .2rem;
    min-width: 0;
    flex: 1 1 auto;
}

.interfaces-pending-file {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .8rem;
}

.interfaces-pending-file__thumb {
    width: 58px;
    height: 58px;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    background: rgba(2, 6, 23, .45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.interfaces-pending-file__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.interfaces-pending-preview {
    width: min(1080px, 96vw);
    max-height: 94vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .9rem;
    overflow: hidden;
}

.interfaces-pending-preview__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.interfaces-pending-preview__meta {
    display: grid;
    gap: .15rem;
    min-width: 0;
    flex: 1 1 18rem;
}

.interfaces-pending-preview__meta strong {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interfaces-pending-preview__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    flex: 0 1 auto;
}

.interfaces-pending-preview__header span {
    color: var(--color-muted);
    font-size: .82rem;
}

.interfaces-pending-preview__canvas {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--interfaces-stroke);
    border-radius: 14px;
    background: rgba(2, 6, 23, .55);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.interfaces-pending-preview__canvas img {
    transform-origin: center center;
    max-width: 100%;
    max-height: 72vh;
    transition: transform .12s ease;
}

.interfaces-attachment-row__content strong {
    overflow-wrap: anywhere;
}

.interfaces-attachment-row__content span {
    color: var(--color-muted);
    font-size: .82rem;
}

.interfaces-attachment-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
    justify-content: flex-end;
}

.interfaces-attachment-row--pending .interfaces-attachment-row__icon {
    background: var(--interfaces-warning-soft);
    color: var(--color-warning);
}

.interfaces-history-modern__item {
    display: grid;
    gap: .5rem;
    position: relative;
    padding-left: 1.1rem;
}

.interfaces-history-modern__item::before {
    content: "";
    position: absolute;
    left: .55rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.5), transparent);
}

.interfaces-editor-empty {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
    gap: .85rem;
    background:
        radial-gradient(circle at top, rgba(14, 165, 233, 0.1), transparent 32%),
        var(--interfaces-surface-2);
}

.interfaces-editor-empty__icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-primary);
    background: var(--interfaces-accent-soft);
    border: 1px solid rgba(14, 165, 233, 0.22);
}

.interfaces-filters-grid .field input,
.interfaces-filters-grid .field select,
.interfaces-filters-grid .field textarea,
.interfaces-form-grid .field input,
.interfaces-form-grid .field select,
.interfaces-form-grid .field textarea,
.interfaces-field-shell textarea,
.interfaces-inline-state select {
    background: rgba(7, 17, 31, 0.72);
    border: 1px solid rgba(132, 157, 192, 0.16);
    border-radius: 16px;
    color: var(--color-text);
    min-height: 46px;
    box-shadow: none;
}

html[data-theme="light"] .interfaces-filters-grid .field input,
html[data-theme="light"] .interfaces-filters-grid .field select,
html[data-theme="light"] .interfaces-filters-grid .field textarea,
html[data-theme="light"] .interfaces-form-grid .field input,
html[data-theme="light"] .interfaces-form-grid .field select,
html[data-theme="light"] .interfaces-form-grid .field textarea,
html[data-theme="light"] .interfaces-field-shell textarea,
html[data-theme="light"] .interfaces-inline-state select {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(15, 23, 42, 0.08);
}

.interfaces-form-grid .field input[readonly] {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -.01em;
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .interfaces-form-grid .field input[readonly] {
    background: rgba(248, 250, 252, 0.92);
}

.interfaces-filters-grid .field input:focus,
.interfaces-filters-grid .field select:focus,
.interfaces-form-grid .field input:focus,
.interfaces-form-grid .field select:focus,
.interfaces-form-grid .field textarea:focus,
.interfaces-field-shell textarea:focus,
.interfaces-inline-state select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.38);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
}

@media (max-width: 1280px) {
    .interfaces-workspace {
        grid-template-columns: minmax(300px, 40%) minmax(0, 60%);
    }

    .interfaces-editor-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .interfaces-page {
        gap: 1rem;
    }

    .interfaces-workspace {
        grid-template-columns: 1fr;
    }

    .interfaces-inbox-panel,
    .interfaces-editor-panel {
        min-height: auto;
    }

    .interfaces-inbox-list {
        max-height: 46vh;
    }

    .interfaces-editor-panel .panel-card__header,
    .interfaces-inbox-panel .panel-card__header,
    .interfaces-filters-panel .panel-card__header {
        gap: .85rem;
        flex-direction: column;
        align-items: stretch;
    }

    .interfaces-editor-header-actions,
    .interfaces-filters-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .interfaces-page {
        gap: .9rem;
    }

    .interfaces-mobile-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .7rem;
    }

    .interfaces-mobile-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .interfaces-hero,
    .page-intro {
        align-items: start;
        flex-direction: column;
        padding: 1rem;
    }

    .interfaces-hero .page-intro__title {
        font-size: 1.65rem;
        line-height: 1.05;
    }

    .interfaces-hero .page-intro__text {
        font-size: .94rem;
    }

    .interfaces-hero .actions,
    .page-intro .actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .interfaces-hero .actions .btn,
    .page-intro .actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .interfaces-list-page .usuarios-table-wrap {
        display: none;
    }

    .interfaces-mobile-list {
        display: block;
    }

    .interfaces-mobile-section,
    .interfaces-bulkbar {
        display: none;
    }

    .interfaces-mobile-section.is-open,
    .interfaces-bulkbar.is-mobile-open {
        display: block;
    }

    .interfaces-bulkbar.is-mobile-open {
        padding: .85rem;
    }

    .interfaces-filters-summary,
    .interfaces-editor-ribbon,
    .interfaces-section__head,
    .interfaces-inbox-item__top,
    .interfaces-inbox-item__actions,
    .interfaces-attachment-row,
    .interfaces-editor-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .interfaces-filters-panel,
    .interfaces-inbox-panel,
    .interfaces-editor-panel {
        padding: 1rem;
        border-radius: 22px;
    }

    .interfaces-filters-grid {
        grid-template-columns: 1fr;
        gap: .8rem;
    }

    .interfaces-filters-grid .field--wide,
    .interfaces-filters-actions {
        grid-column: auto;
    }

    .interfaces-form-grid {
        grid-template-columns: 1fr;
        gap: .85rem;
    }

    .interfaces-editor-page .contactos-form__grid {
        grid-template-columns: 1fr;
    }

    .interfaces-editor-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: .9rem;
    }

    .interfaces-file-trigger--desktop {
        display: none;
    }

    .interfaces-file-trigger--mobile {
        display: inline-flex;
        justify-content: center;
    }

    .interfaces-inline-state,
    .interfaces-attachment-row__actions,
    .interfaces-inbox-item__quick {
        width: 100%;
    }

    .interfaces-inbox-list {
        max-height: none;
        padding-right: 0;
    }

    .interfaces-inbox-item {
        padding: .9rem .9rem .85rem;
        border-radius: 20px;
    }

    .interfaces-inbox-item__meta,
    .interfaces-inbox-item__footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .interfaces-inline-state {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .55rem;
    }

    .interfaces-icon-action {
        width: 100%;
        height: 40px;
        padding-inline: .8rem;
        border-radius: 14px;
        justify-content: flex-start;
        gap: .55rem;
    }

    .interfaces-icon-action span {
        display: inline;
        font-size: .85rem;
        font-weight: 600;
    }

    .interfaces-editor-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .interfaces-editor-ribbon,
    .interfaces-section,
    .interfaces-form-grid .field,
    .interfaces-field-shell,
    .interfaces-editor-empty {
        border-radius: 20px;
    }

    .interfaces-section {
        padding: .9rem;
    }

    .interfaces-field-shell textarea {
        min-height: 132px;
    }

    .interfaces-editor-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: .6rem;
    }

    .interfaces-editor-page .usuarios-editor__actions,
    .interfaces-editor-page .contactos-tabs {
        display: grid;
        grid-template-columns: 1fr;
        gap: .6rem;
    }

    .interfaces-editor-page .contactos-tabs .btn {
        width: 100%;
        justify-content: center;
    }

    .interfaces-inline-state select,
    .interfaces-inline-state .btn,
    .interfaces-attachment-row__actions .btn,
    .interfaces-inbox-item__quick .btn,
    .interfaces-editor-actions .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .interfaces-page {
        gap: .8rem;
    }

    .interfaces-mobile-card {
        padding: .9rem;
        border-radius: 16px;
    }

    .interfaces-hero {
        border-radius: 20px;
    }

    .interfaces-hero .actions,
    .page-intro .actions {
        grid-template-columns: 1fr;
    }

    .interfaces-summary-chip,
    .interfaces-status-pill,
    .interfaces-priority-chip {
        font-size: .74rem;
        min-height: 28px;
        padding: .28rem .62rem;
    }

    .interfaces-inbox-item__top strong {
        font-size: .96rem;
    }

    .interfaces-inbox-item__summary {
        font-size: .88rem;
    }

    .interfaces-mobile-card__head {
        align-items: flex-start;
    }

    .interfaces-mobile-card__head .interfaces-status-pill {
        max-width: 48%;
        justify-content: center;
        text-align: center;
    }

    .interfaces-mobile-card__meta {
        display: grid;
        gap: .4rem;
    }

    .interfaces-inline-state {
        grid-template-columns: 1fr;
    }

    .interfaces-attachment-row {
        padding: .85rem;
    }

    .interfaces-attachment-row__icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .interfaces-invoice__grid,
    .interfaces-invoice__totals {
        grid-template-columns: 1fr;
    }
}

.usuarios-table-wrap {
    overflow-x: auto;
}

.usuarios-table__row {
    cursor: pointer;
    transition: background-color .2s ease;
}

.usuarios-table__row:hover td {
    background: rgba(37, 99, 235, 0.06);
}

.usuarios-table__row.is-selected td {
    background: rgba(37, 99, 235, 0.1);
}

.usuarios-table__row td.interfaces-table__selector,
.usuarios-table__row td.interfaces-table__actions {
    background: transparent;
}

.data-grid__row {
    transition: background-color .2s ease;
}

.data-grid__row:hover td {
    background: rgba(37, 99, 235, 0.06);
}

.usuarios-table__name {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.usuarios-table__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-muted);
    flex: 0 0 auto;
}

.usuarios-table__avatar--filled {
    color: #60a5fa;
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(37, 99, 235, 0.08);
}

.usuarios-empty {
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 1rem;
    color: var(--color-muted);
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .interfaces-bulkbar {
    background: rgba(255, 255, 255, 0.9);
}

.usuarios-editor {
    display: grid;
    gap: 1rem;
}

.usuarios-photo-card,
.usuarios-password-card {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.usuarios-photo-preview {
    width: min(220px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.35);
    margin-bottom: 1rem;
}

.usuarios-photo-preview__img,
.usuarios-photo-preview__empty {
    width: 100%;
    height: 100%;
}

.usuarios-photo-preview__img {
    object-fit: cover;
    display: block;
}

.usuarios-photo-preview__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.25rem;
    color: rgba(148, 163, 184, 0.7);
}

.usuarios-photo-actions,
.usuarios-toggle-row,
.usuarios-password-card__head,
.usuarios-editor__meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.usuarios-photo-hint {
    margin: .85rem 0 0;
    color: var(--color-muted);
    font-size: .85rem;
}

.usuarios-editor__form,
.usuarios-password-card {
    display: grid;
    gap: 1rem;
}

.usuarios-editor__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.usuarios-editor__actions {
    margin-top: .25rem;
}

.usuarios-editor__meta {
    color: var(--color-muted);
    font-size: .85rem;
}

.usuarios-input--invalid {
    border-color: rgba(239, 68, 68, 0.75) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.usuarios-field-error {
    display: block;
    margin-top: .45rem;
    color: #fca5a5;
    font-size: .82rem;
}

.usuarios-view-settings {
    display: grid;
    gap: 1rem;
}

.usuarios-view-settings__list {
    display: grid;
    gap: .75rem;
}

.usuarios-view-settings__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .95rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.usuarios-group-row td {
    padding: .8rem 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-accent);
    font-weight: 700;
    background: rgba(14, 165, 233, 0.06);
}

.usuarios-btn-danger {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.usuarios-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
}

.contactos-page {
    gap: .95rem;
}

.contactos-page .page-intro {
    align-items: center;
    margin-bottom: .35rem;
    padding: .35rem 0 .2rem;
}

.contactos-page .page-intro__title {
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
}

.contactos-page .panel-card {
    border-radius: 16px;
    padding: 1rem 1.05rem;
    animation: support-panel-in .18s ease-out both;
}

.contactos-page .filters-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(180px, .45fr) auto;
    align-items: end;
    gap: .75rem;
}

.contactos-page .filters-grid .field--wide {
    grid-column: auto;
}

.contactos-page .field input,
.contactos-page .field select,
.contactos-page .field textarea {
    min-height: 38px;
    border-radius: 8px;
}

.contactos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .75rem;
}

.contactos-tabs .btn {
    min-height: 34px;
}

.contactos-form {
    display: grid;
    gap: .85rem;
}

.contactos-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .72rem .85rem;
}

.contactos-form__grid .field {
    min-width: 0;
}

.contactos-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: .65rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 10px;
    background: rgba(15, 23, 42, .28);
}

.contactos-flags .checkbox {
    min-height: 30px;
    padding: .25rem .35rem;
}

.contactos-observaciones {
    min-height: 140px;
    resize: vertical;
}

.contactos-table__actions-head,
.contactos-table__actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.wa-audio-player__download {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contactos-page .contactos-table {
    table-layout: auto;
    min-width: max-content;
    width: max-content;
}

.contactos-page .contactos-table th,
.contactos-page .contactos-table td {
    white-space: nowrap;
}

.contactos-page .contactos-table__col {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contactos-page .contactos-table__col--nombre {
    min-width: 13rem;
    max-width: 22rem;
}

.contactos-page .contactos-table__col--email {
    max-width: 18rem;
}

.contactos-page .contactos-table__col--localidad,
.contactos-page .contactos-table__col--provincia,
.contactos-page .contactos-table__col--telefono,
.contactos-page .contactos-table__col--celular,
.contactos-page .contactos-table__col--cargo {
    max-width: 12rem;
}

.contactos-page .contactos-table .interfaces-table__selector,
.contactos-page .contactos-table .interfaces-table__actions,
.contactos-page .contactos-table .contactos-table__actions-head,
.contactos-page .contactos-table .contactos-table__actions {
    width: 1%;
}

.contactos-conversation-btn {
    min-height: 32px;
    gap: .38rem;
}

.contactos-page .usuarios-table-wrap {
    max-height: 58vh;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 12px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, .55) rgba(15, 23, 42, .35);
}

.contactos-page .usuarios-table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.contactos-page .usuarios-table-wrap::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 23, 42, .35);
}

.contactos-page .usuarios-table-wrap::-webkit-scrollbar-thumb {
    border: 2px solid rgba(15, 23, 42, .35);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(34, 211, 238, .88), rgba(14, 165, 233, .72));
}

.app-card__icon--tickets {
    background: linear-gradient(135deg, #06b6d4, #10b981);
}

.tickets-page {
    gap: .95rem;
}

.tickets-page--odoo {
    gap: .75rem;
}

.tickets-odoo-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-height: 54px;
    padding: .15rem 0 .45rem;
    border-bottom: 1px solid rgba(148, 163, 184, .08);
}

.tickets-odoo-header__eyebrow {
    margin: 0 0 .2rem;
    color: var(--color-secondary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tickets-odoo-header__title {
    margin: 0;
    font-size: clamp(1.25rem, 1.55vw, 1.65rem);
    font-weight: 850;
    line-height: 1.05;
}

.tickets-odoo-header__subtitle {
    margin: .35rem 0 0;
    max-width: 62ch;
    color: var(--color-muted);
    font-size: .88rem;
}

.tickets-hero {
    align-items: center;
    margin-bottom: .25rem;
}

.tickets-page--odoo .panel-card {
    border-radius: 16px;
    padding: 1rem 1.05rem;
    animation: support-panel-in .18s ease-out both;
}

.tickets-commandbar {
    position: relative;
    z-index: 120;
    display: grid;
    gap: .9rem;
    padding: .8rem;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 10px;
    background: rgba(13, 27, 48, .62);
    box-shadow: none;
    overflow: visible;
    animation: support-panel-in .16s ease-out both;
}

.tickets-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.tickets-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(140px, .45fr)) auto auto;
    gap: .65rem;
    align-items: end;
}

.tickets-page--odoo .field {
    gap: .32rem;
}

.tickets-page--odoo .field label {
    font-size: .72rem;
}

.tickets-page--odoo .field input,
.tickets-page--odoo .field select,
.tickets-page--odoo .field textarea {
    min-height: 38px;
    padding: .58rem .75rem;
    border-radius: 8px;
    background: rgba(7, 17, 31, .72);
}

.tickets-page--odoo .btn {
    min-height: 38px;
    border-radius: 8px;
    padding: .55rem .8rem;
    font-size: .86rem;
}

.tickets-closed-filter {
    align-self: center;
    min-height: 42px;
}

.tickets-kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: .65rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.tickets-kanban-column {
    min-width: 220px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, .22);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.tickets-kanban-column--drag-target {
    border-color: rgba(34, 211, 238, .72);
    background: rgba(14, 165, 233, .10);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .24);
}

.tickets-kanban-column--drag-current {
    border-color: rgba(148, 163, 184, .32);
    background: rgba(148, 163, 184, .08);
}

.tickets-kanban-column__head {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .65rem;
    border-bottom: 1px solid var(--color-border);
    font-size: .86rem;
}

.tickets-kanban-column__head small {
    margin-left: auto;
    color: var(--color-muted);
    font-weight: 700;
}

.tickets-state-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.tickets-kanban-column__body {
    display: grid;
    gap: .45rem;
    padding: .55rem;
    min-height: 88px;
}

.tickets-card {
    display: grid;
    gap: .45rem;
    padding: .65rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 6px;
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
    user-select: none;
}

.tickets-card:hover {
    transform: translateY(-1px);
    border-color: rgba(45, 212, 191, .35);
    background: rgba(20, 184, 166, .07);
}

.tickets-card--dragging {
    opacity: .58;
    border-color: rgba(34, 211, 238, .55);
}

.tickets-card__head,
.tickets-card__footer,
.tickets-message__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.tickets-card__head strong {
    font-size: .86rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.tickets-card__head span {
    color: #facc15;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.tickets-card__meta {
    display: grid;
    gap: .22rem;
    color: var(--color-muted);
    font-size: .76rem;
}

.tickets-tags,
.tickets-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tickets-tags span {
    padding: .2rem .5rem;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
}

.tickets-card__footer {
    color: var(--color-muted);
    font-size: .72rem;
}

.tickets-editor-grid,
.tickets-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .35fr);
    gap: .9rem;
    align-items: start;
}

.tickets-editor-main,
.tickets-editor-side,
.tickets-message-list,
.tickets-activity {
    display: grid;
    gap: .65rem;
}

.tickets-editor-side {
    align-self: start;
    height: max-content;
    position: sticky;
    top: .75rem;
}

.tickets-lookup {
    position: relative;
}

.tickets-lookup__selected {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    width: fit-content;
    max-width: 100%;
    margin-top: .35rem;
    padding: .22rem .45rem;
    border: 1px solid rgba(34, 211, 238, .28);
    border-radius: 999px;
    background: rgba(8, 145, 178, .16);
    color: #bae6fd;
    font-size: .78rem;
    font-weight: 800;
}

.tickets-lookup__selected button {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.tickets-lookup__results {
    position: absolute;
    z-index: 80;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    display: grid;
    gap: .25rem;
    max-height: 16rem;
    overflow: auto;
    padding: .35rem;
    border: 1px solid rgba(56, 189, 248, .26);
    border-radius: 10px;
    background: rgba(8, 18, 33, .98);
    box-shadow: 0 18px 38px rgba(2, 6, 23, .36);
}

.tickets-lookup__results button {
    display: grid;
    gap: .12rem;
    width: 100%;
    padding: .55rem .65rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #e5edf8;
    text-align: left;
    cursor: pointer;
}

.tickets-lookup__results button:hover,
.tickets-lookup__results button:focus-visible {
    background: rgba(14, 165, 233, .15);
}

.tickets-lookup__results small {
    color: #8fb3d9;
}

.tickets-rich-editor {
    position: relative;
    display: grid;
    gap: .45rem;
}

.tickets-rich-editor__surface {
    min-height: 190px;
    width: 100%;
    padding: .75rem .85rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(7, 17, 31, .72);
    color: var(--color-text);
    font-family: inherit;
    font-size: .95rem;
    line-height: 1.5;
    overflow: auto;
}

.tickets-rich-editor__surface:empty::before {
    content: attr(data-placeholder);
    color: rgba(148, 163, 184, .7);
}

.tickets-rich-editor__surface:focus {
    outline: 2px solid rgba(14, 165, 233, 0.24);
    border-color: rgba(14, 165, 233, 0.4);
}

.tickets-rich-editor__surface h1,
.tickets-rich-editor__surface h2,
.tickets-rich-editor__surface h3,
.tickets-rich-editor__surface p,
.tickets-rich-editor__surface ul,
.tickets-rich-editor__surface ol,
.tickets-rich-editor__surface blockquote,
.tickets-rich-editor__surface pre,
.tickets-rich-editor__surface details,
.tickets-rich-editor__surface .ticket-editor-banner,
.tickets-rich-editor__surface .ticket-editor-file,
.tickets-rich-editor__surface .ticket-editor-media,
.tickets-rich-editor__surface .ticket-editor-index {
    margin: .45rem 0;
}

.tickets-rich-editor__surface h1 {
    font-size: 1.35rem;
    font-weight: 850;
}

.tickets-rich-editor__surface h2 {
    font-size: 1.12rem;
    font-weight: 800;
}

.tickets-rich-editor__surface h3 {
    font-size: .98rem;
    font-weight: 800;
}

.tickets-rich-editor__surface hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, .32);
    margin: .8rem 0;
}

.tickets-rich-editor__surface ul,
.tickets-rich-editor__surface ol {
    padding-left: 1.25rem;
}

.tickets-rich-editor__surface .ticket-editor-todo {
    list-style: none;
    padding-left: .1rem;
    display: grid;
    gap: .35rem;
}

.tickets-rich-editor__surface .ticket-editor-todo li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
    min-height: 1.5rem;
    line-height: 1.45;
}

.tickets-rich-editor__surface .ticket-editor-todo input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: .16rem 0 0;
    padding: 0;
    accent-color: var(--color-primary);
    border-radius: 4px;
}

.tickets-rich-editor__surface blockquote {
    padding: .65rem .8rem;
    border-left: 3px solid rgba(14, 165, 233, .65);
    background: rgba(14, 165, 233, .08);
    border-radius: 0 8px 8px 0;
}

.tickets-rich-editor__surface pre {
    padding: .7rem .8rem;
    border-radius: 8px;
    background: rgba(2, 6, 23, .78);
    color: #c4f1ff;
    white-space: pre-wrap;
}

.tickets-rich-editor__surface details {
    padding: .65rem .8rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.tickets-rich-editor__surface summary {
    cursor: pointer;
    font-weight: 800;
}

.ticket-editor-banner,
.ticket-editor-file,
.ticket-editor-media,
.ticket-editor-index {
    padding: .7rem .8rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.ticket-editor-file--document,
.ticket-editor-file--media,
.ticket-editor-file--upload {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
}

.ticket-editor-file--media {
    align-items: start;
}

.ticket-editor-file--media.ticket-editor-file--has-preview {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    border-color: transparent;
    background: transparent;
    vertical-align: top;
}

.ticket-editor-file--has-preview > .ticket-editor-file__button,
.ticket-editor-file--has-preview .ticket-editor-file__content > strong,
.ticket-editor-file--has-preview .ticket-editor-file__status,
.ticket-editor-file--has-preview .ticket-editor-file__files,
.ticket-editor-file--has-preview .ticket-editor-file__replace-hint {
    display: none;
}

.ticket-editor-file--selected {
    border-color: rgba(34, 211, 238, .65);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, .18);
}

.ticket-editor-file__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 36px;
    padding: .45rem .7rem;
    border: 1px solid rgba(14, 165, 233, .34);
    border-radius: 7px;
    background: rgba(14, 165, 233, .16);
    color: var(--color-text);
    font-weight: 800;
    cursor: pointer;
}

.ticket-editor-file__button:hover,
.ticket-editor-file__button:focus {
    border-color: rgba(34, 211, 238, .58);
    background: rgba(14, 165, 233, .24);
    outline: 0;
}

.ticket-editor-file__icon {
    color: #7dd3fc;
}

.ticket-editor-file__content {
    min-width: 0;
    display: grid;
    gap: .2rem;
}

.ticket-editor-file__content strong {
    font-size: .86rem;
}

.ticket-editor-file__status,
.ticket-editor-file__files small {
    color: var(--color-muted);
    font-size: .78rem;
}

.ticket-editor-file__files {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ticket-editor-file__files span {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    max-width: 100%;
    padding: .22rem .45rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(2, 6, 23, .36);
    overflow-wrap: anywhere;
}

.ticket-editor-file__files .bi {
    color: #6ee7b7;
}

.ticket-editor-file__preview {
    position: relative;
    display: grid;
    gap: .45rem;
    margin-top: .35rem;
}

.ticket-editor-file--has-preview .ticket-editor-file__preview {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    margin-top: 0;
    vertical-align: top;
}

.ticket-editor-file__preview:empty {
    display: none;
}

.ticket-editor-file__preview img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .62);
    cursor: pointer;
}

.ticket-editor-file--has-preview .ticket-editor-file__preview img {
    width: auto;
    max-width: 100%;
    max-height: none;
}

.ticket-editor-file__resize {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 16px;
    height: 16px;
    border-right: 2px solid rgba(226, 232, 240, .92);
    border-bottom: 2px solid rgba(226, 232, 240, .92);
    border-radius: 2px;
    background: linear-gradient(135deg, transparent 45%, rgba(2, 6, 23, .7) 45%);
    cursor: nwse-resize;
    opacity: 0;
}

.ticket-editor-file--has-preview:hover .ticket-editor-file__resize,
.ticket-editor-file--selected .ticket-editor-file__resize {
    opacity: 1;
}

.ticket-editor-file__replace-hint {
    display: none;
    margin-top: .3rem;
    color: var(--color-muted);
    font-size: .76rem;
}

.ticket-editor-file--media:hover .ticket-editor-file__replace-hint,
.ticket-editor-file--selected .ticket-editor-file__replace-hint {
    display: inline-flex;
}

.ticket-editor-banner {
    position: relative;
    display: block;
    min-height: 42px;
    padding-left: 2.65rem;
}

.ticket-editor-banner__icon {
    position: absolute;
    left: .8rem;
    top: .72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: .95rem;
    pointer-events: none;
    user-select: none;
}

.ticket-editor-banner__body {
    min-width: 0;
}

.ticket-editor-banner p,
.ticket-editor-banner__body p {
    margin: 0;
    overflow-wrap: anywhere;
}

.ticket-editor-banner--info {
    border-color: rgba(14, 165, 233, .35);
    background: rgba(14, 165, 233, .10);
}

.ticket-editor-banner--info .ticket-editor-banner__icon {
    color: #7dd3fc;
}

.ticket-editor-banner--success {
    border-color: rgba(16, 185, 129, .38);
    background: rgba(16, 185, 129, .10);
}

.ticket-editor-banner--success .ticket-editor-banner__icon {
    color: #6ee7b7;
}

.ticket-editor-banner--warning {
    border-color: rgba(245, 158, 11, .42);
    background: rgba(245, 158, 11, .11);
}

.ticket-editor-banner--warning .ticket-editor-banner__icon {
    color: #fbbf24;
}

.ticket-editor-banner--danger {
    border-color: rgba(239, 68, 68, .42);
    background: rgba(239, 68, 68, .11);
}

.ticket-editor-banner--danger .ticket-editor-banner__icon {
    color: #fca5a5;
}

.ticket-editor-button {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: .38rem .7rem;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.ticket-editor-stars {
    color: #facc15;
    letter-spacing: .06em;
}

.tickets-rich-editor__bar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    padding: .42rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(7, 17, 31, .62);
}

.tickets-rich-editor__tool {
    width: 34px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
}

.tickets-rich-editor__tool:hover,
.tickets-rich-editor__tool:focus {
    color: var(--color-text);
    background: rgba(148, 163, 184, .12);
    outline: none;
}

.tickets-rich-editor__tool:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.ticket-link-popover,
.ticket-editor-emoji-picker {
    position: absolute;
    left: .55rem;
    bottom: 3.05rem;
    z-index: 30;
    width: min(360px, calc(100% - 1.1rem));
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
    background: #111827;
    box-shadow: 0 18px 48px rgba(2, 6, 23, .52);
    transform-origin: bottom left;
    animation: ticket-popover-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

.ticket-link-popover {
    display: grid;
    gap: .7rem;
}

.ticket-link-popover > strong,
.ticket-editor-emoji-picker > strong {
    font-size: .9rem;
}

.ticket-link-popover__fields {
    display: grid;
    gap: .55rem;
}

.ticket-link-popover__fields label {
    display: grid;
    gap: .25rem;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
}

.ticket-link-popover__fields input {
    width: 100%;
    min-height: 34px;
    padding: .45rem .55rem;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 7px;
    background: rgba(2, 6, 23, .72);
    color: var(--color-text);
}

.ticket-link-popover__fields input:focus {
    outline: 2px solid rgba(14, 165, 233, .24);
    border-color: rgba(14, 165, 233, .44);
}

.ticket-link-popover__actions {
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
}

.ticket-editor-emoji-picker {
    display: grid;
    gap: .65rem;
    width: min(420px, calc(100% - 1.1rem));
}

@keyframes ticket-popover-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ticket-editor-emoji-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: .25rem;
    max-height: 240px;
    overflow: auto;
}

.ticket-editor-emoji-picker__grid button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: rgba(2, 6, 23, .58);
    font-size: 1.1rem;
    cursor: pointer;
}

.ticket-editor-emoji-picker__grid button:hover,
.ticket-editor-emoji-picker__grid button:focus {
    background: rgba(14, 165, 233, .2);
    outline: none;
}

.tickets-slash-menu {
    position: absolute;
    left: .55rem;
    bottom: 3.05rem;
    z-index: 20;
    width: min(360px, calc(100% - 1.1rem));
    max-height: 360px;
    overflow: auto;
    padding: .55rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    background: #111827;
    box-shadow: 0 18px 48px rgba(2, 6, 23, .52);
    transform-origin: bottom left;
    animation: ticket-popover-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

.tickets-slash-menu__group {
    display: grid;
    gap: .25rem;
    padding: .25rem 0;
}

.tickets-slash-menu__group > span {
    padding: .25rem .45rem;
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tickets-slash-menu button {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: .65rem;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: .45rem .55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

.tickets-slash-menu button:hover,
.tickets-slash-menu button:focus {
    background: rgba(14, 165, 233, .18);
    outline: none;
}

.tickets-slash-menu button i {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(2, 6, 23, .7);
    color: #e2e8f0;
    font-size: 1rem;
}

.tickets-slash-menu button span {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.tickets-slash-menu button strong {
    font-size: .86rem;
}

.tickets-slash-menu button small {
    color: var(--color-muted);
    font-size: .78rem;
    line-height: 1.3;
}

.tickets-message,
.tickets-activity__item {
    padding: .7rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.tickets-message p,
.tickets-activity__item p {
    margin: .45rem 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tickets-message__meta span,
.tickets-activity__item span {
    color: var(--color-muted);
    font-size: .78rem;
}

.tickets-attachment {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 100%;
    padding: .4rem .55rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    text-decoration: none;
}

.tickets-attachment--image {
    display: grid;
    width: min(220px, 100%);
}

.tickets-attachment--image img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.tickets-table td {
    cursor: pointer;
}

html[data-theme="light"] .tickets-kanban-column,
html[data-theme="light"] .tickets-card,
html[data-theme="light"] .tickets-message,
html[data-theme="light"] .tickets-activity__item {
    background: rgba(248, 250, 252, .9);
}

@media (max-width: 1100px) {
    .tickets-filters,
    .tickets-editor-grid,
    .tickets-detail-layout {
        grid-template-columns: 1fr;
    }

    .tickets-editor-side {
        position: static;
    }
}

@media (max-width: 768px) {
    .tickets-page .page-intro,
    .tickets-card__head,
    .tickets-card__footer,
    .tickets-message__meta {
        display: grid;
        align-items: stretch;
    }

    .tickets-page .actions,
    .tickets-page .btn {
        width: 100%;
        justify-content: center;
    }
}

.contactos-page .usuarios-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .8rem;
}

.app-login-overlay {
    backdrop-filter: blur(4px);
}

.app-login-modal {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(460px, calc(100vw - 2rem));
    z-index: 1200;
    border-radius: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-panel);
    box-shadow: 0 24px 80px rgba(2, 8, 23, 0.55);
}

.app-login-modal__header,
.app-login-modal__body {
    padding: 1.15rem 1.25rem;
}

.app-login-modal__header {
    border-bottom: 1px solid var(--color-border);
}

.app-login-modal__title {
    margin: .15rem 0 0;
    font-size: 1.4rem;
}

.app-login-modal__body {
    display: grid;
    gap: 1rem;
}

.app-login-modal__actions {
    justify-content: stretch;
}

@media (max-width: 768px) {
    .app-login-modal {
        width: min(460px, calc(100vw - 1rem));
    }

    .app-login-modal__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .contactos-page .filters-grid,
    .contactos-form__grid {
        grid-template-columns: 1fr;
    }

    .contactos-page .panel-card__header,
    .contactos-page .page-intro,
    .contactos-page .panel-card__header .actions {
        display: grid;
        align-items: stretch;
    }

    .contactos-page .btn,
    .contactos-page .actions .btn {
        width: 100%;
        justify-content: center;
    }

    .contactos-table__actions-head,
    .contactos-table__actions {
        text-align: left;
    }

    .usuarios-editor__grid {
        grid-template-columns: 1fr;
    }

    .usuarios-view-settings__item {
        display: grid;
    }

    .usuarios-photo-preview {
        width: 100%;
        max-width: 220px;
    }

    .usuarios-view-settings__item .actions .btn,
    .usuarios-photo-actions .btn,
    .usuarios-editor__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .usuarios-toggle-row {
        display: grid;
    }
}

/* Responsive mobile-first: shell, tablas y conversaciones */
.desktop-only {
    display: block;
}

.conversations-filters.desktop-only {
    display: grid;
}

.mobile-only {
    display: none !important;
}

.shell__mobile-toggle,
.shell__overlay,
.conversations-mobile-back,
.conversations-mobile-actions,
.conversations-mobile-quick-filters,
.conversations-mobile-states,
.conversations-mobile-header,
.conversations-mobile-inbox-count,
.conversations-mobile-sheet-backdrop,
.conversations-mobile-filter-sheet {
    display: none;
}

.shell__main,
.shell__content,
.page-grid,
.panel-card,
.field,
.actions,
.btn,
input,
select,
textarea {
    max-width: 100%;
}

.table-wrap,
.table-scroll,
.consulta-result__table-wrap,
.usuarios-table-wrap,
.costos-lote__table-wrap,
.result-group-table-wrap,
.data-table-wrap,
.table-responsive,
.panel-card:has(> table),
.panel-card:has(.data-table),
.panel-card:has(.consulta-table),
.panel-card:has(.result-group-table),
.panel-card:has(.detail-table),
.panel-card:has(.balance-saldos-table),
.panel-card:has(.conv-stats-table):not(.conv-stats-board) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table,
.consulta-table,
.comparativo-table,
.result-group-table,
.detail-table,
.balance-saldos-table,
.costos-lote__table,
.conv-stats-table {
    width: 100%;
}

#alfacore-sticky-x-scroll {
    position: fixed;
    left: 0;
    bottom: 4px;
    z-index: 1085;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    transform: translateY(10px);
}

#alfacore-sticky-x-scroll.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.alfacore-sticky-x-scroll__track {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    height: 16px;
    border: 1px solid rgba(92, 201, 255, .22);
    border-radius: 999px;
    background: rgba(7, 20, 39, .96);
    box-shadow: 0 18px 38px rgba(2, 6, 23, .38);
    backdrop-filter: blur(16px);
}

.alfacore-sticky-x-scroll__content {
    height: 1px;
}

.alfacore-sticky-x-scroll__track::-webkit-scrollbar {
    height: 14px;
}

.alfacore-sticky-x-scroll__track::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .24);
    border-radius: 999px;
}

.alfacore-sticky-x-scroll__track::-webkit-scrollbar-thumb {
    min-width: 52px;
    border: 2px solid rgba(15, 23, 42, .24);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(34, 211, 238, .92), rgba(14, 165, 233, .82));
}

.alfacore-sticky-x-scroll__track:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(103, 232, 249, .96), rgba(14, 165, 233, .9));
}

html[data-theme="light"] .alfacore-sticky-x-scroll__track {
    border-color: rgba(19, 103, 170, .18);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 30px rgba(15, 23, 42, .18);
}

html[data-theme="light"] .alfacore-sticky-x-scroll__track::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, .9);
}

html[data-theme="light"] .alfacore-sticky-x-scroll__track::-webkit-scrollbar-thumb {
    border-color: rgba(226, 232, 240, .9);
    background: linear-gradient(180deg, rgba(14, 165, 233, .88), rgba(2, 132, 199, .8));
}

html[data-theme="light"] .alfacore-sticky-x-scroll__track:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, .96), rgba(2, 132, 199, .88));
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .shell,
    .shell.shell--collapsed {
        display: block;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .shell__overlay {
        position: fixed;
        inset: 0;
        z-index: 1090;
        display: block;
        border: 0;
        background: rgba(2, 6, 23, .58);
        backdrop-filter: blur(2px);
        animation: support-modal-backdrop-in .16s ease-out both;
    }

    .shell__sidebar,
    .shell.shell--collapsed .shell__sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1100;
        width: min(320px, 86vw);
        height: 100dvh;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
        border-right: 1px solid var(--color-border);
        border-bottom: 0;
        background: rgba(8, 15, 28, .98);
        box-shadow: 24px 0 60px rgba(0, 0, 0, .42);
        transform: translateX(-104%);
        opacity: .98;
        transition: transform .24s cubic-bezier(.2, .8, .2, 1);
    }

    html[data-theme="light"] .shell__sidebar,
    html[data-theme="light"] .shell.shell--collapsed .shell__sidebar {
        background: rgba(255, 255, 255, .98);
    }

    .shell.shell--mobile-open .shell__sidebar {
        transform: translateX(0);
    }

    .shell--collapsed .brand,
    .shell.shell--collapsed .brand {
        display: flex;
        justify-items: initial;
        justify-content: flex-start;
        gap: .85rem;
        padding: 1rem;
    }

    .shell--collapsed .brand__content,
    .shell--collapsed .menu__section,
    .shell--collapsed .menu__link span:not(.menu__icon),
    .shell.shell--collapsed .brand__content,
    .shell.shell--collapsed .menu__section,
    .shell.shell--collapsed .menu__link span:not(.menu__icon) {
        display: block;
    }

    .shell--collapsed .menu,
    .shell.shell--collapsed .menu {
        display: block;
        padding: 0 1rem 1rem;
    }

    .shell--collapsed .menu__nav,
    .shell.shell--collapsed .menu__nav {
        align-items: stretch;
    }

    .shell--collapsed .menu__link,
    .shell.shell--collapsed .menu__link {
        justify-content: flex-start;
        padding: .8rem .9rem;
    }

    .shell__main {
        width: 100%;
        min-width: 0;
        padding: .85rem;
    }

    .shell__content {
        width: 100%;
        min-width: 0;
        padding: 0;
    }

    .shell__header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: .75rem;
        margin-bottom: .85rem;
    }

    .shell__mobile-toggle {
        display: inline-grid;
        place-items: center;
        width: 42px;
        min-width: 42px;
        height: 42px;
        border: 1px solid rgba(148, 163, 184, .18);
        border-radius: 10px;
        background: rgba(15, 23, 42, .58);
        color: var(--color-text);
        cursor: pointer;
    }

    html[data-theme="light"] .shell__mobile-toggle {
        background: rgba(15, 23, 42, .06);
        color: #0f172a;
    }

    .shell__header > .shell__actions {
        grid-column: 1 / -1;
    }

    .pwa-mobile-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
        margin: -.2rem 0 .75rem;
    }

    .pwa-mobile-actions__button,
    .pwa-mobile-actions__status {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .sidebar-toggle {
        width: 42px;
        min-width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .filters-grid,
    .form-grid,
    .page-intro,
    .panel-card__header,
    .actions,
    .table-toolbar,
    .conversations-filters__fields {
        grid-template-columns: 1fr;
        flex-wrap: wrap;
        min-width: 0;
    }

    .field input,
    .field select,
    .field textarea,
    input,
    select,
    textarea {
        width: 100%;
        min-width: 0;
    }

    .btn,
    button {
        min-height: 42px;
    }

    .panel-card {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .modal,
    .app-modal,
    .conversations-modal {
        max-width: calc(100vw - 1rem);
    }

    .shell:not(.shell--collapsed) .conversations-page--odoo,
    .shell.shell--collapsed .conversations-page--odoo {
        position: relative;
        inset: auto;
        z-index: auto;
        width: 100%;
        height: auto;
        min-height: calc(100dvh - 84px);
        overflow: hidden;
    }

    .conversations-page--odoo {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: .65rem;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: calc(100dvh - 84px);
        overflow: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active {
        grid-template-rows: minmax(0, 1fr);
    }

    .conversations-page--odoo:not(.conversations-page--chat-active) .conversations-filters {
        display: grid;
    }

    .conversations-page--odoo:not(.conversations-page--chat-active) .conversations-list {
        display: flex;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-filters,
    .conversations-page--odoo.conversations-page--chat-active .conversations-list,
    .conversations-page--odoo:not(.conversations-page--chat-active) .conversations-context {
        display: none;
    }

    .conversations-page--odoo:not(.conversations-page--chat-active) .conversations-chat {
        display: none;
    }

    .conversations-page--odoo .conversations-layout,
    .conversations-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        gap: 0;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-layout {
        height: calc(100dvh - 84px);
    }

    .conversations-page--odoo .conversations-filters {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        padding: .55rem .65rem;
        gap: .55rem;
    }

    .conversations-page--odoo .conversations-canal,
    .conversations-page--odoo .conversations-module-actions,
    .conversations-page--odoo .conversations-filters__modes,
    .conversations-page--odoo .conversations-filters__fields {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: .45rem;
        overflow-x: visible;
    }

    .conversations-page--odoo .conversations-filter-pill,
    .conversations-page--odoo .conversations-module-actions .btn,
    .conversations-page--odoo .conversations-filters__fields .btn,
    .conversations-page--odoo .conversations-filters input,
    .conversations-page--odoo .conversations-filters select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .conversations-page--odoo .conversations-filter-pill,
    .conversations-page--odoo .conversations-module-actions .btn,
    .conversations-page--odoo .conversations-filters__fields .btn {
        justify-content: center;
        min-height: 42px;
    }

    .conversations-page--odoo .conversations-list,
    .conversations-page--odoo .conversations-chat {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        padding: 0;
        border-width: 0;
    }

    .conversations-page--odoo .conversations-list {
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .conversations-page--odoo .conversations-list__items {
        max-height: calc(100dvh - 320px);
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: .45rem;
    }

    .conversations-page--odoo .conversation-row {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .conversations-page--odoo .conversations-chat {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: none;
        overflow: hidden;
    }

    .conversations-page--odoo .conversations-chat__header {
        grid-template-columns: minmax(0, 1fr);
        gap: .45rem;
        padding: .55rem .65rem;
    }

    .conversations-mobile-back {
        display: inline-flex;
        width: fit-content;
        min-height: 36px;
        padding: .38rem .68rem;
        gap: .4rem;
    }

    .conversation-header-state,
    .conversation-header-state__row,
    .conversation-header-state__trigger,
    .conversation-header-state__close {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .conversations-page--odoo .conversations-thread-shell {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .conversations-page--odoo .conversations-thread {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: .65rem;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .conversations-page--odoo .conversations-composer {
        flex: 0 0 auto;
        position: sticky;
        bottom: 0;
        z-index: 8;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        max-width: 100%;
        padding: .5rem .65rem calc(.5rem + env(safe-area-inset-bottom));
        background: var(--color-panel);
    }

    .conversations-page--odoo .conversations-composer textarea {
        resize: vertical;
        min-height: 38px;
        max-height: 140px;
        overflow: auto;
    }

    .conversations-page--odoo .conversations-composer__actions {
        overflow-x: visible;
        flex-wrap: wrap;
    }

    .conversations-page--odoo .message-bubble-shell,
    .conversations-page--odoo .message-row:has(.message-actions) .message-bubble-shell {
        max-width: 100%;
    }

    .conversations-page--odoo .message-card {
        min-width: 0;
        max-width: 92%;
    }

    .conversations-page--odoo .message-attachments,
    .conversations-page--odoo .message-attachment,
    .conversations-page--odoo .attachment-link,
    .conversations-page--odoo .wa-audio-player,
    .conversations-page--odoo .message-attachment--image img {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .message-contact-card {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .message-contact-card .btn {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .conversations-page--odoo .conversations-context-drawer {
        width: min(360px, 92vw);
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-context-drawer.is-open {
        display: flex;
    }

    .conversations-page--odoo:not(.conversations-page--chat-active) .conversations-context-drawer.is-open {
        display: flex;
    }

    .conversations-tools-panel {
        left: .65rem;
        right: .65rem;
        bottom: calc(5.8rem + env(safe-area-inset-bottom));
        width: auto;
        max-height: min(420px, calc(100dvh - 9rem));
    }

    .conversations-page--odoo {
        padding: .15rem 0 0;
        background:
            radial-gradient(circle at 18% -10%, rgba(20, 184, 166, .11), transparent 34%),
            linear-gradient(180deg, rgba(2, 6, 23, .7), rgba(2, 6, 23, .28));
    }

    .conversations-page--odoo .conversations-filters {
        gap: .75rem;
        padding: .75rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .conversations-page--odoo .conversations-mobile-filters.mobile-only {
        display: grid !important;
    }

    .conversations-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        min-width: 0;
    }

    .conversations-mobile-header h2 {
        margin: 0;
        color: var(--color-text);
        font-size: 1.05rem;
        line-height: 1.15;
    }

    .conversations-mobile-header span {
        color: var(--color-muted);
        font-size: .78rem;
        font-weight: 750;
    }

    .conversations-mobile-icon-button {
        display: inline-grid;
        place-items: center;
        width: 40px;
        min-width: 40px;
        height: 40px;
        border: 1px solid rgba(148, 163, 184, .16);
        border-radius: 12px;
        background: rgba(15, 23, 42, .62);
        color: var(--color-text);
    }

    .conversations-mobile-actions,
    .mobile-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .45rem;
        width: 100%;
        padding: .5rem;
        border: 1px solid rgba(148, 163, 184, .14);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(15, 23, 42, .78), rgba(15, 23, 42, .46));
        box-shadow: 0 16px 36px rgba(2, 6, 23, .26);
    }

    .conversations-mobile-action {
        display: grid;
        place-items: center;
        align-content: center;
        gap: .28rem;
        min-width: 0;
        min-height: 58px;
        padding: .35rem .2rem;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: var(--color-text);
        font-size: .72rem;
        font-weight: 800;
        text-align: center;
    }

    .conversations-mobile-action i {
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border-radius: 999px;
        background: rgba(14, 165, 233, .16);
        color: #8be8ff;
        font-size: 1rem;
    }

    .conversations-mobile-action.is-active i,
    .conversations-mobile-action:not(:disabled):hover i {
        background: linear-gradient(135deg, #06b6d4, #2dd4bf);
        color: #02111c;
    }

    .conversations-mobile-action:disabled {
        opacity: .52;
    }

    .conversations-page--odoo .conversations-canal,
    .conversations-page--odoo .conversations-module-actions,
    .conversations-page--odoo .conversations-filters__modes {
        display: none;
    }

    .conversations-mobile-quick-filters,
    .mobile-filter-chips {
        display: flex;
        align-items: center;
        gap: .45rem;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        padding-bottom: .05rem;
        -webkit-overflow-scrolling: touch;
    }

    .conversations-mobile-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 38px;
        min-width: 0;
        padding: .48rem .82rem;
        border: 1px solid rgba(148, 163, 184, .15);
        border-radius: 999px;
        background: rgba(15, 23, 42, .62);
        color: var(--color-text);
        font-size: .82rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .conversations-mobile-chip.is-active {
        border-color: rgba(45, 212, 191, .34);
        background: linear-gradient(135deg, rgba(6, 182, 212, .85), rgba(20, 184, 166, .78));
        color: #02111c;
    }

    .conversations-mobile-chip--icon {
        width: 42px;
        padding-inline: 0;
    }

    .conversations-mobile-states,
    .mobile-status-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
        width: 100%;
        min-width: 0;
    }

    .conversations-mobile-state-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .45rem;
        min-width: 0;
        min-height: 48px;
        padding: .65rem .75rem;
        border: 1px solid rgba(148, 163, 184, .14);
        border-radius: 12px;
        background: rgba(15, 23, 42, .58);
        color: var(--color-text);
        font-weight: 850;
    }

    .conversations-mobile-state-card.is-active {
        border-color: rgba(45, 212, 191, .34);
        background: linear-gradient(135deg, rgba(8, 145, 178, .62), rgba(20, 184, 166, .22));
    }

    .conversations-mobile-state-card span {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-mobile-state-card strong {
        display: inline-grid;
        place-items: center;
        min-width: 1.7rem;
        height: 1.45rem;
        padding: 0 .38rem;
        border-radius: 999px;
        background: linear-gradient(135deg, #22d3ee, #2dd4bf);
        color: #02111c;
        font-size: .78rem;
    }

    .conversations-page--odoo .conversations-filters__fields {
        display: grid;
        grid-template-columns: 1fr;
        gap: .55rem;
    }

    .conversations-page--odoo .conversations-filters__fields > .field:nth-of-type(3),
    .conversations-page--odoo .conversations-filters__fields > .btn {
        display: none;
    }

    .conversations-page--odoo .conversations-filters__fields label {
        color: var(--color-muted);
        font-size: .72rem;
        font-weight: 850;
    }

    .conversations-page--odoo .conversations-filters__fields .field:first-child label {
        display: none;
    }

    .conversations-page--odoo .conversations-filters__fields .field:nth-of-type(2) {
        position: relative;
    }

    .conversations-page--odoo .conversations-filters__fields .field:nth-of-type(2)::before {
        content: "Mi tecnico:";
        position: absolute;
        left: .75rem;
        bottom: .72rem;
        z-index: 1;
        color: var(--color-muted);
        font-size: .82rem;
        font-weight: 700;
        pointer-events: none;
    }

    .conversations-page--odoo .conversations-filters__fields .field:nth-of-type(2) label {
        display: none;
    }

    .conversations-page--odoo .conversations-filters__fields input,
    .conversations-page--odoo .conversations-filters__fields select {
        min-height: 44px;
        border-color: rgba(148, 163, 184, .15);
        border-radius: 12px;
        background: rgba(2, 6, 23, .42);
        box-shadow: none;
    }

    .conversations-page--odoo .conversations-filters__fields .field:nth-of-type(2) select {
        padding-left: 5.75rem;
    }

    .conversations-page--odoo .conversations-list {
        padding: 0 .75rem .75rem;
        background: transparent;
    }

    .conversations-page--odoo .conversations-list__header {
        padding: .2rem .1rem .45rem;
        border-bottom: 0;
    }

    .conversations-page--odoo .conversations-list__header .panel-card__title {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        color: var(--color-muted);
        font-size: .78rem;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .conversations-page--odoo .conversations-list__header .panel-card__title::after {
        content: attr(data-count);
    }

    .conversations-mobile-inbox-count {
        display: inline-grid;
        place-items: center;
        min-width: 1.55rem;
        height: 1.35rem;
        padding: 0 .32rem;
        border-radius: 999px;
        background: rgba(34, 211, 238, .18);
        color: #67e8f9;
        font-size: .72rem;
        letter-spacing: 0;
    }

    .conversations-mobile-inbox-count.mobile-only {
        display: inline-grid !important;
    }

    .conversations-page--odoo .conversations-list__header .panel-card__subtitle {
        display: none;
    }

    .conversations-page--odoo .conversations-list__items {
        display: grid;
        gap: .45rem;
        max-height: calc(100dvh - 320px);
        padding: 0 0 calc(.75rem + env(safe-area-inset-bottom));
    }

    .conversations-page--odoo .conversation-row {
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
        gap: .68rem;
        padding: .72rem .78rem;
        border: 0;
        border-radius: 12px;
        background: rgba(15, 23, 42, .46);
        box-shadow: 0 12px 24px rgba(2, 6, 23, .15);
    }

    .conversations-page--odoo .conversation-row__avatar {
        display: inline-grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, rgba(14, 165, 233, .42), rgba(45, 212, 191, .22));
        color: #e0faff;
        font-size: .82rem;
        font-weight: 900;
    }

    .conversations-page--odoo .conversation-row__content {
        display: grid;
        gap: .15rem;
    }

    .conversations-page--odoo .conversation-row__top {
        gap: .45rem;
    }

    .conversations-page--odoo .conversation-row__name {
        overflow: hidden;
        color: #f8fafc;
        font-size: .9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-page--odoo .conversation-row__date {
        font-size: .74rem;
    }

    .conversations-page--odoo .conversation-row__new-count {
        min-width: 1.25rem;
        height: 1.25rem;
        background: #22d3ee;
        color: #02111c;
    }

    .conversations-page--odoo .conversation-row__meta {
        gap: .28rem;
        color: rgba(226, 232, 240, .7);
        font-size: .75rem;
        white-space: nowrap;
        overflow: hidden;
    }

    .conversations-page--odoo .conversation-row__meta span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .conversations-page--odoo .conversation-row__badges {
        display: none;
    }

    .conversations-page--odoo .conversation-row__summary {
        color: rgba(226, 232, 240, .72);
        font-size: .78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    html[data-theme="light"] .conversations-page--odoo {
        background:
            radial-gradient(circle at 18% -10%, rgba(20, 184, 166, .12), transparent 34%),
            linear-gradient(180deg, #06111f, #081827);
        color: #e5eef8;
    }

    html[data-theme="light"] .conversations-page--odoo .conversations-filters,
    html[data-theme="light"] .conversations-page--odoo .conversations-list,
    html[data-theme="light"] .conversations-page--odoo .conversations-chat {
        background: transparent;
    }

    html[data-theme="light"] .conversations-page--odoo .conversations-mobile-actions,
    html[data-theme="light"] .conversations-page--odoo .conversations-mobile-state-card,
    html[data-theme="light"] .conversations-page--odoo .conversations-mobile-chip {
        border-color: rgba(148, 163, 184, .18);
        background-color: rgba(15, 23, 42, .76);
        color: #e5eef8;
    }

    html[data-theme="light"] .conversations-page--odoo .conversations-mobile-chip.is-active,
    html[data-theme="light"] .conversations-page--odoo .conversations-mobile-state-card.is-active {
        color: #02111c;
    }

    html[data-theme="light"] .conversations-page--odoo .conversations-filters__fields input,
    html[data-theme="light"] .conversations-page--odoo .conversations-filters__fields select {
        border-color: rgba(148, 163, 184, .2);
        background: rgba(2, 6, 23, .56);
        color: #e5eef8;
    }

    html[data-theme="light"] .conversations-page--odoo .conversations-filters__fields input::placeholder {
        color: rgba(226, 232, 240, .62);
    }

    html[data-theme="light"] .conversations-page--odoo .conversation-row,
    html[data-theme="light"] .conversations-page--odoo .conversation-row:hover {
        border-color: rgba(148, 163, 184, .08);
        background: rgba(15, 23, 42, .74);
    }

    html[data-theme="light"] .conversations-page--odoo .conversation-row.is-selected {
        background: linear-gradient(135deg, rgba(8, 145, 178, .72), rgba(20, 184, 166, .28));
    }

    html[data-theme="light"] .conversations-page--odoo .conversation-row__name {
        color: #f8fafc;
    }

    html[data-theme="light"] .conversations-page--odoo .conversation-row__date,
    html[data-theme="light"] .conversations-page--odoo .conversation-row__meta,
    html[data-theme="light"] .conversations-page--odoo .conversation-row__summary {
        color: rgba(226, 232, 240, .72);
    }

    .conversations-page--odoo .conversations-chat {
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .conversations-page--odoo .conversations-chat__header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: .5rem;
        padding: .55rem .75rem;
        border-bottom: 1px solid rgba(45, 212, 191, .18);
        background: rgba(2, 6, 23, .64);
    }

    .conversations-page--odoo .conversations-chat__identity {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: .6rem;
    }

    .conversations-page--odoo .conversations-chat__identity > div:first-of-type {
        min-width: 0;
    }

    .conversations-mobile-back {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 999px;
    }

    .conversations-mobile-back span {
        display: none;
    }

    .conversations-page--odoo .conversations-chat__header .panel-card__title {
        overflow: hidden;
        font-size: .98rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-page--odoo .conversations-chat__chips {
        grid-column: 2;
        justify-content: flex-start;
        gap: .35rem;
        overflow: hidden;
    }

    .conversations-page--odoo .conversation-header-state {
        display: none;
    }

    .conversations-page--odoo .conversations-thread {
        padding: .8rem .72rem;
    }

    .conversations-page--odoo .message-card {
        border-radius: 14px;
        max-width: 92%;
    }

    .conversations-page--odoo .message-row--outgoing .message-card {
        background: linear-gradient(135deg, rgba(6, 182, 212, .88), rgba(20, 184, 166, .72));
        color: #02111c;
    }

    .conversations-page--odoo .message-row--outgoing .message-card__meta,
    .conversations-page--odoo .message-row--outgoing .message-card__footer {
        color: rgba(2, 17, 28, .68);
    }

    .conversations-page--odoo .conversations-composer {
        border-top: 1px solid rgba(148, 163, 184, .12);
        background: rgba(2, 6, 23, .86);
    }

    .conversations-mobile-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1160;
        display: block;
        border: 0;
        background: rgba(2, 6, 23, .66);
        backdrop-filter: blur(2px);
    }

    .conversations-mobile-filter-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1170;
        display: grid;
        gap: .9rem;
        max-height: min(82dvh, 620px);
        padding: .55rem .9rem calc(.9rem + env(safe-area-inset-bottom));
        border: 1px solid rgba(148, 163, 184, .18);
        border-bottom: 0;
        border-radius: 22px 22px 0 0;
        background: rgba(8, 15, 28, .98);
        box-shadow: 0 -24px 70px rgba(2, 6, 23, .58);
        overflow-y: auto;
        animation: conversations-sheet-in .2s cubic-bezier(.2, .8, .2, 1) both;
    }

    .conversations-mobile-filter-sheet__handle {
        justify-self: center;
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: rgba(148, 163, 184, .28);
    }

    .conversations-mobile-filter-sheet header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
    }

    .conversations-mobile-filter-sheet h3 {
        margin: 0;
        color: var(--color-text);
        font-size: 1.05rem;
    }

    .conversations-mobile-sheet-group {
        display: grid;
        gap: .4rem;
    }

    .conversations-mobile-sheet-group > span {
        color: var(--color-muted);
        font-size: .78rem;
        font-weight: 850;
    }

    .conversations-mobile-sheet-option {
        display: flex;
        align-items: center;
        gap: .65rem;
        min-height: 44px;
        padding: .55rem .25rem;
        border: 0;
        border-bottom: 1px solid rgba(148, 163, 184, .1);
        background: transparent;
        color: var(--color-text);
        text-align: left;
    }

    .conversations-mobile-sheet-option i {
        color: #22d3ee;
    }

    .conversations-mobile-sheet-channel {
        display: flex;
        flex-wrap: wrap;
        gap: .45rem;
    }

    @keyframes conversations-sheet-in {
        from {
            opacity: .72;
            transform: translateY(22px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 430px) {
    .shell__main {
        padding: .65rem;
    }

    .brand__eyebrow {
        display: none;
    }

    .conversations-canal,
    .conversations-filters__modes,
    .conversations-module-actions {
        display: grid;
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .conversations-filter-pill,
    .conversations-module-actions .btn,
    .conversations-filters__fields .btn {
        width: 100%;
        justify-content: center;
    }

    .conversation-row__top,
    .conversation-row__meta,
    .conversation-row__badges,
    .message-card__meta,
    .message-card__footer {
        min-width: 0;
        align-items: flex-start;
    }

    .conversation-row__name,
    .conversation-row__summary,
    .conversation-badge,
    .panel-card__title,
    .panel-card__subtitle {
        overflow-wrap: anywhere;
    }

    .conversation-badge {
        white-space: normal;
    }

    .conversations-page--odoo .conversations-canal,
    .conversations-page--odoo .conversations-filters__modes,
    .conversations-page--odoo .conversations-module-actions {
        display: none;
    }

    .conversations-page--odoo .conversations-mobile-actions {
        display: grid;
    }

    .conversations-page--odoo .conversations-mobile-quick-filters {
        display: flex;
    }

    .conversations-page--odoo .conversations-mobile-states {
        display: grid;
    }

    .conversations-page--odoo .conversations-mobile-action {
        font-size: .68rem;
    }

    .conversations-page--odoo .conversations-list__items {
        max-height: calc(100dvh - 345px);
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-layout {
        height: calc(100dvh - 84px);
    }
}

@media (max-width: 768px) {
    body:has(.conversations-page--chat-active) {
        overflow: hidden;
    }

    .shell__main:has(.conversations-page--odoo) .pwa-mobile-actions {
        display: none;
    }

    .shell__main:has(.conversations-page--chat-active) {
        padding: 0;
    }

    .shell__main:has(.conversations-page--chat-active) .shell__header,
    .shell__main:has(.conversations-page--chat-active) .pwa-mobile-actions {
        display: none;
    }

    .shell__content:has(.conversations-page--chat-active) {
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
    }

    .shell:not(.shell--collapsed) .conversations-page--odoo.conversations-page--chat-active,
    .shell.shell--collapsed .conversations-page--odoo.conversations-page--chat-active,
    .conversations-page--odoo.conversations-page--chat-active {
        position: fixed;
        inset: 0;
        z-index: 1040;
        display: block;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
        background: #07111f;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-filters,
    .conversations-page--odoo.conversations-page--chat-active .conversations-list,
    .conversations-page--odoo.conversations-page--chat-active .conversations-context,
    .conversations-page--odoo.conversations-page--chat-active .conversations-context-drawer {
        display: none !important;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-layout {
        display: block;
        width: 100%;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        overflow-x: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        overflow: hidden;
        background: #07111f;
        overflow-x: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__header {
        position: sticky;
        top: 0;
        z-index: 6;
        flex: 0 0 auto;
        display: block;
        padding: calc(.3rem + env(safe-area-inset-top)) .62rem .42rem;
        border-bottom: 1px solid rgba(148, 163, 184, .14);
        background: rgba(7, 17, 31, .96);
        backdrop-filter: blur(10px);
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__identity {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: center;
        gap: .55rem;
        min-width: 0;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-mobile-back {
        display: inline-grid;
        place-items: center;
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        border-radius: 999px;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-mobile-back span {
        display: none;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__identity > div:first-of-type {
        min-width: 0;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__header .panel-card__title {
        margin: 0;
        overflow: hidden;
        color: #f8fafc;
        font-size: .98rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__header .panel-card__subtitle {
        margin: .12rem 0 0;
        overflow: hidden;
        color: rgba(226, 232, 240, .68);
        font-size: .76rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-chat__chips {
        grid-column: 2;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: .35rem;
        min-width: 0;
        margin-top: .1rem;
        overflow: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversation-badge {
        max-width: 100%;
        min-height: 20px;
        padding: .16rem .42rem;
        overflow: hidden;
        font-size: .68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversation-header-state,
    .conversations-page--odoo.conversations-page--chat-active .conversations-window-banner,
    .conversations-page--odoo.conversations-page--chat-active .conversations-notice {
        display: none;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-thread-shell {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-thread {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: .62rem .58rem .62rem;
        overflow-y: auto;
        overflow-x: hidden;
        background: #07111f;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-row {
        align-items: flex-end;
        padding-bottom: .48rem;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-bubble-shell,
    .conversations-page--odoo.conversations-page--chat-active .message-row:has(.message-actions) .message-bubble-shell {
        max-width: min(84%, 620px);
    }

    .conversations-page--odoo.conversations-page--chat-active .message-row--incoming {
        justify-content: flex-start;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-row--outgoing {
        justify-content: flex-end;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-card {
        max-width: 100%;
        border-radius: 12px;
        overflow-wrap: anywhere;
        padding: .52rem .62rem;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-card__meta,
    .conversations-page--odoo.conversations-page--chat-active .message-card__footer {
        font-size: .66rem;
        line-height: 1.2;
        gap: .3rem;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-card__text {
        margin-top: .22rem;
        margin-bottom: .22rem;
    }

    .conversations-page--odoo.conversations-page--chat-active .message-card__footer > span:first-child {
        display: none;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer {
        position: sticky;
        bottom: 0;
        z-index: 7;
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: .45rem;
        width: 100%;
        max-width: 100%;
        max-height: 38dvh;
        margin: 0;
        padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(148, 163, 184, .14);
        background: rgba(7, 17, 31, .98);
        overflow: hidden;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__reply label,
    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__note label {
        display: none;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__note,
    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__actions--note {
        display: none;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer .conversations-composer__note--mobile,
    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer .conversations-composer__actions--note-mobile {
        display: block;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer .conversations-composer__actions--note-mobile {
        display: flex;
        justify-content: flex-end;
        margin-top: .42rem;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer .conversations-composer__note--mobile textarea {
        min-height: 44px;
        max-height: 120px;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer textarea {
        min-height: 44px;
        max-height: 120px;
        resize: none;
        overflow-y: hidden;
        overflow-x: hidden;
        border-radius: 18px;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: .38rem;
        overflow: visible;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-composer__actions .btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 999px;
    }

    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel {
        left: .6rem;
        right: .6rem;
        bottom: calc(4.6rem + env(safe-area-inset-bottom));
        width: auto;
        max-height: min(48dvh, 420px);
    }
}

.conversations-page--odoo .message-bubble-shell > .message-reaction-picker {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    z-index: 90;
    order: -1;
    transform: none;
    margin: 0 0 .35rem;
}

.conversations-page--odoo .message-bubble-shell > .conversations-tools-panel--reaction,
.conversations-page--odoo.conversations-page--chat-active .message-bubble-shell > .conversations-tools-panel--reaction {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 90;
    order: -1;
    width: min(360px, calc(100vw - 7rem));
    max-width: 100%;
    max-height: min(260px, calc(100vh - 14rem));
    margin: 0 0 .45rem;
}

.conversations-page--odoo .message-row--outgoing .message-bubble-shell > .message-reaction-picker,
.conversations-page--odoo .message-row--outgoing .message-bubble-shell > .conversations-tools-panel--reaction {
    align-self: flex-end;
}

.conversations-page--odoo .conversations-tools-panel--composer,
.conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer {
    position: fixed;
    left: auto;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    z-index: 260;
    width: min(600px, calc(100vw - 2rem));
    max-height: min(430px, calc(100dvh - 7.5rem));
    overflow: auto;
}

@media (max-width: 720px) {
    .conversations-page--odoo .conversations-tools-panel--composer,
    .conversations-page--odoo.conversations-page--chat-active .conversations-tools-panel--composer {
        left: .65rem;
        right: .65rem;
        bottom: calc(5.2rem + env(safe-area-inset-bottom));
        width: auto;
        max-height: min(58dvh, calc(100dvh - 7rem));
    }
}


/* ── MainShellLayout global fallback ───────────────────────── */
.main-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--color-bg);
}

.main-shell__sidebar {
    border-right: 1px solid rgba(80, 118, 180, 0.18);
    background: rgba(6, 18, 34, 0.94);
    padding: 1.5rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-shell__brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.main-shell__logo {
    width: 3.25rem;
    height: 3.25rem;
    object-fit: contain;
    flex: 0 0 auto;
}

.main-shell__logo-link,
.main-shell__title {
    text-decoration: none;
}

.main-shell__eyebrow {
    color: rgba(196, 212, 237, 0.7);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.main-shell__title {
    color: #f5f8ff;
    font-size: 1.25rem;
    font-weight: 700;
}

.main-shell__nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.main-shell__back,
.main-shell__nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    color: rgba(220, 229, 244, 0.92);
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    border: 1px solid transparent;
}

.main-shell__back {
    margin-bottom: 0.35rem;
    color: rgba(205, 219, 242, 0.76);
}

.main-shell__nav-link:hover,
.main-shell__back:hover {
    background: rgba(53, 194, 255, 0.08);
    color: #f5fbff;
}

.main-shell__nav-link.is-active {
    background: rgba(53, 194, 255, 0.14);
    border-color: rgba(53, 194, 255, 0.18);
    color: #f5fbff;
}

.main-shell__footer {
    margin-top: auto;
    display: grid;
    gap: 0.35rem;
    color: rgba(190, 206, 232, 0.72);
    font-size: 0.83rem;
}

.main-shell__workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-shell__topbar {
    padding: 1.5rem 1.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.main-shell__module-label {
    color: rgba(173, 195, 228, 0.7);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.main-shell__module-title {
    margin: 0.15rem 0 0;
    color: #f5f8ff;
    font-size: 1.9rem;
}

.main-shell__topbar-meta {
    color: rgba(196, 212, 237, 0.78);
}

.main-shell__content {
    padding: 0 1.75rem 1.75rem;
}

.shell-empty-state {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 0.2rem 0.1rem;
    color: var(--color-muted);
}

.shell-empty-state strong {
    color: var(--color-text);
}

@media (max-width: 768px) {
    .main-shell {
        grid-template-columns: 1fr;
    }

    .main-shell__sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(80, 118, 180, 0.18);
    }
}

/* Tareas: panel rapido y vista completa */
.menu__footer .menu__button.is-active {
    background: rgba(37, 179, 198, 0.16);
    border-color: rgba(37, 179, 198, 0.28);
    color: #f5fbff;
}

.tareas-side-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1160;
    background: rgba(2, 8, 18, 0.34);
    border: 0;
    padding: 0;
}

.tareas-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1165;
    width: min(380px, calc(100vw - 1rem));
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto 1fr;
    background: #07111f;
    border-left: 1px solid rgba(84, 129, 190, 0.35);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.38);
    transform: translateX(104%);
    transition: transform 0.18s ease;
    color: #edf6ff;
}

.tareas-side-panel.is-open {
    transform: translateX(0);
}

.tareas-side-panel__head {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(84, 129, 190, 0.18);
}

.tareas-side-panel__title {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.tareas-side-panel__title span {
    color: rgba(150, 190, 225, 0.8);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    font-weight: 800;
}

.tareas-side-panel__title select {
    min-width: 0;
    max-width: 220px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f5fbff;
    font-size: 1rem;
    font-weight: 750;
    outline: 0;
}

.tareas-side-panel__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tareas-side-panel__actions a,
.tareas-side-panel__actions button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(221, 235, 250, 0.86);
    text-decoration: none;
    cursor: pointer;
}

.tareas-side-panel__actions a:hover,
.tareas-side-panel__actions button:hover {
    background: rgba(64, 199, 220, 0.12);
    color: #ffffff;
}

.tareas-side-panel__add {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(84, 129, 190, 0.14);
}

.tareas-side-panel__add i {
    color: #24c2dc;
    font-size: 1.15rem;
}

.tareas-side-panel__add input {
    min-width: 0;
    height: 36px;
    border: 0;
    background: transparent;
    color: #f5fbff;
    outline: 0;
    font-weight: 650;
}

.tareas-side-panel__add input::placeholder {
    color: rgba(167, 190, 220, 0.72);
}

.tareas-side-panel__body {
    min-height: 0;
    overflow: auto;
    padding: 0.8rem 1rem 1rem;
}

.tareas-side-panel__group {
    margin: 0.2rem 0 0.55rem;
    color: rgba(176, 205, 235, 0.92);
    font-size: 0.82rem;
}

.tareas-side-list {
    display: grid;
    gap: 0.18rem;
}

.tareas-side-row {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: start;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.38rem 0.2rem;
    border-radius: 8px;
}

.tareas-side-row:hover {
    background: rgba(92, 132, 185, 0.1);
}

.tareas-side-check {
    width: 24px;
    height: 24px;
    margin-top: 0.1rem;
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: rgba(221, 235, 250, 0.82);
    cursor: pointer;
}

.tareas-side-check:hover,
.tareas-side-check.is-done {
    color: #25c6da;
}

.tareas-side-row__body {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
    color: inherit;
    text-decoration: none;
}

.tareas-side-row__body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f4f8ff;
    font-size: 0.92rem;
}

.tareas-side-row__body span {
    min-height: 1rem;
    color: rgba(162, 190, 225, 0.78);
    font-size: 0.76rem;
}

.tareas-side-row.is-done strong {
    text-decoration: line-through;
    color: rgba(210, 224, 245, 0.62);
}

.tareas-side-completed {
    margin-top: 1rem;
    border-top: 1px solid rgba(84, 129, 190, 0.16);
    padding-top: 0.75rem;
}

.tareas-side-completed summary {
    cursor: pointer;
    color: rgba(221, 235, 250, 0.86);
    font-weight: 750;
}

.tareas-side-panel__empty {
    padding: 2.2rem 0.5rem;
    color: rgba(180, 204, 232, 0.72);
    text-align: center;
}

.tareas-side-panel__empty.is-error {
    color: #ff8b9b;
}

.shell__content .tareas-page {
    min-height: calc(100dvh - 84px);
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.85rem;
    padding: 0;
}

.shell__content .tareas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(80, 118, 180, 0.18);
    border-radius: 8px;
    background: rgba(6, 16, 30, 0.62);
}

.shell__content .tareas-header .shell__eyebrow,
.shell__content .tareas-header > div > span {
    display: none;
}

.shell__content .tareas-header h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.shell__content .tareas-shell {
    min-height: 0;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 300px;
    gap: 0.8rem;
}

.shell__content .tareas-lists,
.shell__content .tareas-main,
.shell__content .tareas-quick {
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(80, 118, 180, 0.18);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.82);
    box-shadow: none;
}

.shell__content .tareas-lists,
.shell__content .tareas-quick {
    padding: 1rem;
}

.shell__content .tareas-main {
    padding: 1rem;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 0.85rem;
}

.shell__content .tareas-list-button,
.shell__content .tareas-row,
.shell__content .tareas-note,
.shell__content .tareas-compose,
.shell__content .tareas-toolbar {
    border-radius: 8px;
    box-shadow: none;
}

.shell__content .tareas-list-button,
.shell__content .tareas-row,
.shell__content .tareas-note {
    background: transparent;
}

.shell__content .tareas-row:hover,
.shell__content .tareas-list-button:hover,
.shell__content .tareas-list-button.is-active {
    background: rgba(37, 179, 198, 0.12);
}

.shell__content .tareas-compose,
.shell__content .tareas-toolbar {
    border: 1px solid rgba(80, 118, 180, 0.16);
    background: rgba(10, 24, 42, 0.72);
}

.shell__content .tareas-toolbar {
    padding: 0.7rem 0.85rem;
}

.shell__content .tareas-assignee-filter {
    min-width: 230px;
}

.shell__content .tareas-toolbar select {
    min-height: 34px;
    padding-left: 0.7rem;
}

.shell__content .tareas-page input,
.shell__content .tareas-page select,
.shell__content .tareas-page textarea {
    border: 1px solid rgba(80, 118, 180, 0.22);
    background: rgba(12, 24, 43, 0.9);
    color: #edf6ff;
    border-radius: 8px;
}

.shell__content .tareas-compose input,
.shell__content .tareas-title-input {
    border: 0;
    background: transparent;
}

.shell__content .tareas-list {
    min-height: 0;
    overflow: auto;
}

.shell__content .tareas-completed {
    margin-top: 0;
}

.shell__content .tareas-modal {
    border-radius: 16px;
    background: #0b1728;
    padding: 1.65rem;
}

.shell__content .tareas-modal__head {
    margin-bottom: 1.2rem;
}

.shell__content .tareas-title-input {
    min-height: 48px;
    padding: 0 0.75rem;
}

.shell__content .tareas-form-grid {
    gap: 1.15rem 1.05rem;
    margin: 1.35rem 0 1.4rem;
}

.shell__content .tareas-form-grid label,
.shell__content .tareas-description {
    gap: 0.6rem;
}

.shell__content .tareas-form-grid input,
.shell__content .tareas-form-grid select {
    min-height: 38px;
    padding-left: 0.75rem;
}

.shell__content .tareas-description textarea {
    min-height: 160px;
    padding: 0.75rem;
}

.shell__content .tareas-task-share {
    margin: 0.15rem 0 1.05rem;
}

.shell__content .tareas-task-share-panel {
    margin: -0.25rem 0 1.2rem;
}

.shell__content .tareas-modal__actions {
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .shell__content .tareas-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .shell__content .tareas-quick {
        grid-column: 1 / -1;
    }
}

@media (max-width: 780px) {
    .tareas-side-panel {
        width: min(360px, calc(100vw - 0.5rem));
    }

    .shell__content .tareas-header,
    .shell__content .tareas-shell {
        grid-template-columns: 1fr;
    }

    .shell__content .tareas-header {
        align-items: stretch;
    }
}

.tareas-side-panel__title strong {
    color: #f5fbff;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.15;
}

.shell__content .tareas-list-form {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px 32px;
    align-items: center;
    gap: 0.35rem;
}

.shell__content .tareas-list-form input {
    min-width: 0;
    height: 36px;
    padding: 0 0.65rem;
}

.shell__content .tareas-icon-action {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(119, 152, 202, 0.25);
    border-radius: 10px;
    background: rgba(15, 29, 50, 0.95);
    color: rgba(222, 235, 250, 0.9);
    cursor: pointer;
}

.shell__content .tareas-icon-action:hover {
    background: rgba(42, 196, 215, 0.14);
    color: #ffffff;
}

.shell__content .tareas-icon-action.is-save {
    border-color: rgba(38, 199, 218, 0.35);
    color: #31d4e8;
}

.shell__content .tareas-form-grid input,
.shell__content .tareas-form-grid select,
.shell__content .tareas-description textarea,
.shell__content .tareas-modal input,
.shell__content .tareas-modal select,
.shell__content .tareas-modal textarea {
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(95, 132, 186, 0.32) !important;
    background: rgba(10, 23, 41, 0.96) !important;
    color: #edf6ff !important;
    border-radius: 8px !important;
}

.shell__content .tareas-form-grid select,
.shell__content .tareas-modal select {
    background-image: linear-gradient(45deg, transparent 50%, rgba(220, 234, 250, 0.85) 50%), linear-gradient(135deg, rgba(220, 234, 250, 0.85) 50%, transparent 50%) !important;
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50% !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
    padding-right: 2rem !important;
}

.shell__content .tareas-form-grid input[type="date"] {
    appearance: auto;
    -webkit-appearance: auto;
}

.shell__content .tareas-list-stack {
    gap: 0.6rem;
}

.shell__content .tareas-list-row {
    gap: 0.5rem;
}

.shell__content .tareas-list-button {
    min-height: 42px;
    padding: 0.6rem 0.7rem;
}

.shell__content .tareas-list-button span {
    gap: 0.35rem;
}

.shell__content .tareas-list-button .bi-share {
    font-size: 0.95rem;
    opacity: 1;
}

.shell__content .tareas-share-modal input[type="checkbox"],
.shell__content .tareas-task-share-panel input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0 !important;
    border-radius: 4px !important;
    accent-color: #22c7dc;
}

.shell__content .tareas-form-grid option,
.shell__content .tareas-modal option {
    background: #0b1728;
    color: #edf6ff;
}

.shell__content .tareas-note {
    grid-template-columns: 28px minmax(0, 1fr) 28px 28px;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
}

.shell__content .tareas-note span {
    line-height: 1.35;
}

.shell__content .tareas-note small {
    font-size: 0.78rem;
    line-height: 1.25;
}

.shell__content .tareas-note .tareas-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: 0;
}

/* Clientes / Proveedores: ficha comercial estilo Odoo */
.shell__content .cuentas-notas-grid {
    display: grid;
    gap: 1rem;
}

.shell__content .cuentas-rich-editor-note .tickets-rich-editor__surface {
    min-height: 10rem;
}

.shell__content .cuentas-rich-editor-note--compact .tickets-rich-editor__surface {
    min-height: 7rem;
}

.shell__content .cuentas-notas-grid .contactos-form__grid {
    margin-top: .25rem;
}

.shell__content .cuentas-partner-summary {
    align-items: stretch;
    border-bottom: 1px solid rgba(83, 124, 172, .22);
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 7.25rem minmax(0, 1fr) auto;
    margin: .35rem 0 1.1rem;
    padding: .2rem 0 1.15rem;
}

.shell__content .cuentas-partner-summary__avatar,
.shell__content .cuentas-contacto-item__avatar {
    align-items: center;
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    font-weight: 800;
    justify-content: center;
}

.shell__content .cuentas-partner-summary__avatar {
    aspect-ratio: 1;
    border-radius: .35rem;
    font-size: 3.2rem;
    min-width: 6.5rem;
}

.shell__content .cuentas-partner-summary__avatar--0,
.shell__content .cuentas-contacto-item__avatar--0 {
    background: #1fbf55;
}

.shell__content .cuentas-partner-summary__avatar--1,
.shell__content .cuentas-contacto-item__avatar--1 {
    background: #2f95c7;
}

.shell__content .cuentas-partner-summary__avatar--2,
.shell__content .cuentas-contacto-item__avatar--2 {
    background: #b3434b;
}

.shell__content .cuentas-partner-summary__avatar--3,
.shell__content .cuentas-contacto-item__avatar--3 {
    background: #6b5ccf;
}

.shell__content .cuentas-partner-summary__avatar--4,
.shell__content .cuentas-contacto-item__avatar--4 {
    background: #c1872d;
}

.shell__content .cuentas-partner-summary__body {
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.shell__content .cuentas-partner-summary__type {
    align-items: center;
    display: flex;
    gap: .75rem;
    font-size: .84rem;
    font-weight: 700;
}

.shell__content .cuentas-partner-summary__type span::before {
    border: 1px solid rgba(144, 164, 190, .65);
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: .65rem;
    margin-right: .35rem;
    vertical-align: -.08rem;
    width: .65rem;
}

.shell__content .cuentas-partner-summary__type .is-muted {
    color: var(--text-muted, #8da2bf);
}

.shell__content .cuentas-partner-summary__type .is-active::before {
    background: var(--accent, #22d3ee);
    border-color: var(--accent, #22d3ee);
    box-shadow: inset 0 0 0 2px rgba(11, 27, 46, .95);
}

.shell__content .cuentas-partner-summary h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.05;
    margin: 0;
    overflow-wrap: anywhere;
}

.shell__content .cuentas-partner-summary__meta,
.shell__content .cuentas-partner-summary__address {
    color: var(--text-muted, #8da2bf);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
}

.shell__content .cuentas-partner-summary__meta i {
    color: var(--accent, #22d3ee);
    margin-right: .4rem;
}

.shell__content .cuentas-partner-summary__address {
    display: grid;
    gap: .2rem;
}

.shell__content .cuentas-partner-summary__stats {
    align-content: start;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    justify-content: flex-end;
}

.shell__content .cuentas-smart-stat {
    align-items: center;
    background: rgba(12, 25, 43, .82);
    border: 1px solid rgba(83, 124, 172, .32);
    border-radius: .45rem;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: .1rem;
    grid-template-columns: auto auto;
    min-width: 7.4rem;
    padding: .55rem .7rem;
    text-align: left;
}

.shell__content .cuentas-smart-stat i {
    color: var(--accent, #22d3ee);
    grid-row: span 2;
}

.shell__content .cuentas-smart-stat strong {
    line-height: 1;
}

.shell__content .cuentas-smart-stat span {
    color: var(--text-muted, #8da2bf);
    font-size: .78rem;
}

.shell__content .cuentas-smart-stat.is-active,
.shell__content .cuentas-smart-stat:hover {
    border-color: rgba(34, 211, 238, .58);
}

.shell__content .contactos-tabs {
    align-items: flex-end;
    border-bottom: 1px solid rgba(83, 124, 172, .28);
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: .5rem;
    padding-left: .45rem;
}

.shell__content .cuentas-tab {
    background: rgba(18, 31, 52, .72);
    border: 1px solid rgba(83, 124, 172, .32);
    border-bottom: 0;
    border-radius: .35rem .35rem 0 0;
    color: var(--text-muted, #8da2bf);
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    min-height: 2.55rem;
    margin-right: .1rem;
    padding: .58rem 1.05rem;
    position: relative;
}

.shell__content .cuentas-tab:hover {
    color: var(--text-main, #e7f1ff);
}

.shell__content .cuentas-tab.is-active {
    background: rgba(9, 21, 37, .96);
    border-color: rgba(83, 124, 172, .42);
    color: var(--accent, #22d3ee);
    margin-bottom: -1px;
}

.shell__content .cuentas-tab.is-active::after {
    background: var(--accent, #22d3ee);
    bottom: 0;
    content: "";
    height: 2px;
    left: .9rem;
    position: absolute;
    right: .9rem;
}

.shell__content .contactos-form {
    border: 1px solid rgba(83, 124, 172, .28);
    border-top: 0;
    border-radius: 0 0 .45rem .45rem;
    padding: 1.15rem 1rem 1rem;
}

.shell__content .cuentas-contactos-panel {
    display: grid;
    gap: 1.25rem;
}

.shell__content .cuentas-contactos-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.shell__content .cuentas-contactos-header h4 {
    margin: 0;
}

.shell__content .cuentas-contactos-header p {
    color: var(--text-muted, #8da2bf);
    margin: .2rem 0 0;
}

.shell__content .cuentas-contactos-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.shell__content .cuentas-contacto-item {
    align-items: stretch;
    background: rgba(11, 27, 46, .7);
    border: 1px solid rgba(83, 124, 172, .36);
    border-radius: .35rem;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 0;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    min-height: 6.1rem;
    overflow: hidden;
    padding: 0;
    text-align: left;
}

.shell__content .cuentas-contacto-item--add {
    color: inherit;
    cursor: pointer;
}

.shell__content .cuentas-contacto-item--add:hover,
.shell__content .cuentas-contacto-item:hover {
    background: rgba(13, 33, 56, .86);
    border-color: rgba(34, 211, 238, .55);
    transform: translateY(-1px);
}

.shell__content .cuentas-contacto-item:focus-visible {
    border-color: rgba(34, 211, 238, .9);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
    outline: 0;
}

.shell__content .cuentas-contacto-item__avatar {
    font-size: 2.5rem;
    min-height: 100%;
}

.shell__content .cuentas-contacto-item__avatar--add {
    background: rgba(34, 211, 238, .14);
    color: var(--accent, #22d3ee);
    font-size: 1.5rem;
}

.shell__content .cuentas-contacto-item__content {
    display: flex;
    flex-direction: column;
    gap: .42rem;
    min-width: 0;
    padding: .8rem .95rem;
}

.shell__content .cuentas-contacto-item__main,
.shell__content .cuentas-contacto-item__meta,
.shell__content .cuentas-contacto-item__badges,
.shell__content .cuentas-contacto-item__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .7rem;
}

.shell__content .cuentas-contacto-item__main {
    justify-content: space-between;
}

.shell__content .cuentas-contacto-item__main strong,
.shell__content .cuentas-contacto-item__content strong {
    overflow-wrap: anywhere;
}

.shell__content .cuentas-contacto-item__main span,
.shell__content .cuentas-contacto-item__meta span,
.shell__content .cuentas-contacto-item__content small {
    color: var(--text-muted, #8da2bf);
}

.shell__content .cuentas-contacto-item__meta i {
    margin-right: .35rem;
}

.shell__content .cuentas-contacto-item__badges span {
    border: 1px solid rgba(34, 211, 238, .28);
    border-radius: .25rem;
    color: var(--accent, #22d3ee);
    font-size: .78rem;
    padding: .18rem .55rem;
}

.cuentas-modal-backdrop {
    align-items: center !important;
    background: rgba(2, 8, 18, .72);
    backdrop-filter: blur(5px);
    display: flex !important;
    inset: 0 !important;
    justify-content: center !important;
    padding: 1.5rem;
    position: fixed !important;
    z-index: 1100 !important;
}

.cuentas-modal {
    background: rgba(8, 22, 40, .98);
    border: 1px solid rgba(83, 124, 172, .45);
    border-radius: .65rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .42);
    color: var(--text-main, #e7f1ff);
    display: grid;
    max-height: min(88vh, 52rem);
    max-width: 54rem;
    overflow: hidden;
    width: min(100%, 54rem);
}

.cuentas-modal--compact {
    max-width: 38rem;
    width: min(100%, 38rem);
}

.cuentas-modal__header {
    align-items: flex-start;
    border-bottom: 1px solid rgba(83, 124, 172, .28);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
}

.cuentas-modal__header h3 {
    font-size: 1.18rem;
    margin: .2rem 0 0;
}

.cuentas-modal__eyebrow {
    color: var(--text-muted, #8da2bf);
    display: block;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cuentas-modal__close {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text-muted, #8da2bf);
    cursor: pointer;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.cuentas-modal__close:hover {
    color: var(--text-main, #e7f1ff);
}

.cuentas-modal__body {
    display: grid;
    gap: 1rem;
    overflow: auto;
    padding: 1.25rem;
}

.cuentas-modal__actions {
    align-items: center;
    border-top: 1px solid rgba(83, 124, 172, .24);
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-start;
    padding: 1rem 1.25rem 1.2rem;
}

.cuentas-action-reveal {
    align-items: center;
    border-radius: .8rem;
    display: inline-flex;
    gap: 0;
    justify-content: center;
    line-height: 1;
    min-height: 2.75rem;
    min-width: 2.75rem;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    transition: min-width .18s ease, padding .18s ease, gap .18s ease, background-color .18s ease, border-color .18s ease;
    white-space: nowrap;
    width: 2.75rem;
}

.cuentas-action-reveal.btn--primary,
.cuentas-action-reveal.btn--primary:hover,
.cuentas-action-reveal.btn--primary:focus-visible,
.cuentas-action-reveal.btn--ghost:hover,
.cuentas-action-reveal.btn--ghost:focus-visible {
    color: #fff;
}

.cuentas-action-reveal i {
    color: currentColor;
    flex: 0 0 auto;
    line-height: 1;
}

.cuentas-action-reveal span {
    display: inline-block;
    line-height: 1;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    text-align: center;
    transition: max-width .18s ease, opacity .12s ease;
}

.cuentas-action-reveal:hover,
.cuentas-action-reveal:focus-visible {
    gap: .45rem;
    min-width: 10.5rem;
    padding-left: .9rem;
    padding-right: .9rem;
    width: auto;
}

.cuentas-action-reveal:hover span,
.cuentas-action-reveal:focus-visible span {
    max-width: 14rem;
    opacity: 1;
}

.cuentas-contacto-preview {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: 5.5rem minmax(0, 1fr);
}

.cuentas-contacto-preview__role {
    color: var(--accent, #22d3ee);
    display: block;
    font-weight: 750;
    margin-bottom: .7rem;
}

.cuentas-contacto-preview dl {
    display: grid;
    gap: .65rem;
    margin: 0;
}

.cuentas-contacto-preview dl div {
    background: rgba(14, 31, 53, .62);
    border: 1px solid rgba(83, 124, 172, .24);
    border-radius: .4rem;
    padding: .7rem .85rem;
}

.cuentas-contacto-preview dt {
    color: var(--text-muted, #8da2bf);
    font-size: .78rem;
    font-weight: 750;
    margin-bottom: .2rem;
}

.cuentas-contacto-preview dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cuentas-contacto-preview dd .usuarios-input {
    background: rgba(8, 20, 36, .92);
    border: 1px solid rgba(83, 124, 172, .42);
    border-radius: .38rem;
    color: var(--text-main, #e7f1ff);
    font: inherit;
    min-height: 2.25rem;
    padding: .45rem .6rem;
    width: 100%;
}

.cuentas-contacto-preview dd .usuarios-input:focus {
    border-color: rgba(34, 211, 238, .82);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .16);
    outline: 0;
}

.cuentas-contacto-preview dd .usuarios-input:disabled {
    opacity: .72;
}

.cuentas-contacto-preview dd .usuarios-input::placeholder {
    color: var(--text-muted, #8da2bf);
}

.cuentas-link-search {
    align-items: end;
    display: grid;
    gap: .85rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.cuentas-link-results {
    display: grid;
    gap: .75rem;
}

.cuentas-link-result {
    align-items: stretch;
    background: rgba(11, 27, 46, .72);
    border: 1px solid rgba(83, 124, 172, .34);
    border-radius: .42rem;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 0;
    grid-template-columns: 4.4rem minmax(0, 1fr) 2.5rem;
    min-height: 4.8rem;
    overflow: hidden;
    padding: 0;
    text-align: left;
}

.cuentas-link-result:hover,
.cuentas-link-result:focus-visible {
    background: rgba(13, 33, 56, .9);
    border-color: rgba(34, 211, 238, .62);
    outline: 0;
}

.cuentas-link-result .cuentas-contacto-item__avatar {
    font-size: 1.9rem;
    min-height: 100%;
}

.cuentas-link-result__body {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: .72rem .85rem;
}

.cuentas-link-result__body strong,
.cuentas-link-result__body span,
.cuentas-link-result__body small {
    overflow-wrap: anywhere;
}

.cuentas-link-result__body small,
.cuentas-link-result__body span {
    color: var(--text-muted, #8da2bf);
}

.cuentas-link-result > i {
    align-self: center;
    color: var(--accent, #22d3ee);
    justify-self: center;
}

@media (max-width: 720px) {
    .shell__content .cuentas-partner-summary {
        grid-template-columns: 4.7rem minmax(0, 1fr);
    }

    .shell__content .cuentas-partner-summary__avatar {
        font-size: 2.15rem;
        min-width: 4.5rem;
    }

    .shell__content .cuentas-partner-summary__stats {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .shell__content .cuentas-contactos-header {
        align-items: stretch;
        flex-direction: column;
    }

    .shell__content .cuentas-contacto-item {
        grid-template-columns: 4.5rem minmax(0, 1fr);
    }

    .cuentas-modal {
        max-height: 92vh;
    }

    .cuentas-contacto-preview {
        grid-template-columns: 1fr;
    }
}

/* Ajustes finos de cabecera comercial */
.shell__content .cuentas-partner-summary {
    align-items: center;
    background: linear-gradient(180deg, rgba(13, 30, 52, .34), rgba(8, 22, 40, .12));
    border: 1px solid rgba(83, 124, 172, .18);
    border-radius: .55rem;
    grid-template-columns: 5.75rem minmax(0, 1fr) auto;
    margin: .7rem 0 1rem;
    padding: 1rem;
}

.shell__content .cuentas-partner-summary__avatar {
    aspect-ratio: auto;
    border-radius: .42rem;
    font-size: 2.25rem;
    height: 5.25rem;
    min-width: 0;
    width: 5.25rem;
}

.shell__content .cuentas-partner-summary__type {
    display: none;
}

.shell__content .cuentas-partner-summary__body {
    align-content: center;
    gap: .48rem;
}

.shell__content .cuentas-partner-summary h2 {
    font-size: clamp(1.55rem, 2.1vw, 2.05rem);
    font-weight: 750;
    letter-spacing: 0;
}

.shell__content .cuentas-partner-summary__meta {
    color: #b7c7dc;
    gap: .45rem 1rem;
    line-height: 1.35;
}

.shell__content .cuentas-partner-summary__meta span {
    align-items: center;
    display: inline-flex;
    min-width: 0;
}

.shell__content .cuentas-partner-summary__address {
    color: var(--text-muted, #8da2bf);
    font-size: .92rem;
    line-height: 1.35;
}

.shell__content .cuentas-partner-summary__stats {
    align-self: start;
    min-width: max-content;
}

.shell__content .cuentas-smart-stat {
    border-radius: .38rem;
    min-width: 6.4rem;
    padding: .48rem .65rem;
}

.shell__content .contactos-tabs {
    margin-top: .35rem;
    padding-left: .25rem;
}

.shell__content .cuentas-tab {
    background: rgba(15, 29, 49, .62);
    border-color: rgba(83, 124, 172, .24);
    border-radius: .32rem .32rem 0 0;
    min-height: 2.35rem;
    padding: .5rem .95rem;
}

.shell__content .cuentas-tab.is-active {
    background: rgba(8, 22, 40, 1);
    border-color: rgba(34, 211, 238, .42);
}

.shell__content .contactos-form {
    background: rgba(7, 18, 33, .22);
    padding: 1.35rem 1rem 1.15rem;
}

@media (max-width: 960px) {
    .shell__content .cuentas-partner-summary {
        grid-template-columns: 5.25rem minmax(0, 1fr);
    }

    .shell__content .cuentas-partner-summary__stats {
        grid-column: 1 / -1;
        justify-content: flex-start;
        min-width: 0;
    }
}

/* Punto de venta */
.pos-shell {
    min-height: 100dvh;
    margin: 0;
    background: linear-gradient(180deg, #eef1f6 0%, #e4e8ef 100%);
    color: #1f2d3d;
}

.pos-shell .empty-state,
.pos-shell .pos-loading {
    margin: 1rem;
}

.pos-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.4rem;
    background: linear-gradient(180deg, #5f95cc 0%, #5a8dc1 100%);
    border-bottom: 1px solid rgba(33, 58, 84, 0.16);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.16);
}

.pos-topbar__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pos-topbar__logo {
    display: grid;
    place-items: center;
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 1rem;
    background: #ffffff;
    color: #3b6ea4;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 20px rgba(27, 49, 76, 0.12);
}

.pos-topbar__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(237, 244, 252, 0.88);
}

.pos-topbar h1 {
    margin: 0.15rem 0 0;
    color: #ffffff;
    font-size: 1.9rem;
    line-height: 1;
}

.pos-topbar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pos-topbar__ghost,
.pos-topbar__cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.9rem;
    padding: 0.8rem 1.1rem;
    border: 0;
    border-radius: 0.4rem;
    background: rgba(88, 108, 128, 0.74);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.pos-topbar__cart-link {
    background: rgba(105, 121, 137, 0.86);
}

.pos-topbar__cart-link strong {
    font-weight: 800;
}

.pos-topbar__cart-count {
    position: absolute;
    top: -0.45rem;
    right: -0.45rem;
    display: grid;
    place-items: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #f0495c;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
}

.pos-topbar__company {
    display: grid;
    gap: 0.18rem;
    min-width: 17rem;
    padding: 0.72rem 1rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2d3d;
}

.pos-topbar__company span {
    font-size: 0.76rem;
    color: #5f6c7c;
}

.pos-topbar__company strong {
    font-size: 1rem;
}

.pos-stage {
    display: grid;
    grid-template-columns: 38rem minmax(0, 1fr);
    min-height: calc(100dvh - 5.4rem);
}

.pos-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    background: #f3f4f7;
    border-right: 1px solid #d6dce6;
    min-height: 0;
}

.pos-sidebar__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 0.7rem 0.6rem;
}

.pos-sidebar__link,
.pos-sidebar__danger,
.pos-sidebar__cash-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid #b6c0ce;
    background: #ffffff;
    color: #3b5e86;
    border-radius: 0.28rem;
    min-height: 2.3rem;
    padding: 0.55rem 0.8rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.pos-sidebar__danger {
    color: #d54f59;
    border-color: transparent;
    background: transparent;
}

.pos-sidebar__items {
    overflow: auto;
    padding: 0 0.7rem 0.8rem;
}

.pos-sidebar__empty {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px dashed #ccd3de;
    border-radius: 0.35rem;
    background: #ffffff;
    color: #5d6979;
}

.pos-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 0.9rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #dadfe7;
    background: rgba(255, 255, 255, 0.72);
}

.pos-line__main {
    display: grid;
    gap: 0.22rem;
}

.pos-line__main strong {
    color: #243447;
    font-size: 0.94rem;
    line-height: 1.25;
}

.pos-line__main span {
    color: #667483;
    font-size: 0.88rem;
}

.pos-line__price {
    align-self: start;
    font-size: 0.94rem;
    font-weight: 700;
    color: #243447;
}

.pos-line__actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.45rem;
}

.pos-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #c5cfdb;
    border-radius: 0.28rem;
    background: #ffffff;
    color: #42566f;
    font-weight: 700;
}

.pos-sidebar__notes {
    padding: 0.65rem 0.7rem 0;
}

.pos-sidebar__scan {
    width: 100%;
    min-height: 2.9rem;
    border: 1px solid #c8cfda;
    border-radius: 0.28rem;
    padding: 0.75rem 0.85rem;
    background: #ffffff;
    font-size: 0.95rem;
}

.pos-sidebar__client {
    padding: 0.65rem 0.7rem 0;
}

.pos-sidebar__client-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    color: #2b74e0;
    font-size: 1rem;
}

.pos-sidebar__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 0.7rem;
    border-top: 1px solid #ccd3de;
}

.pos-charge {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.65rem;
    min-height: 12rem;
    border: 0;
    background: #5c94cf;
    color: #ffffff;
}

.pos-charge__icon {
    display: grid;
    place-items: center;
    width: 5.4rem;
    height: 5.4rem;
    border-radius: 999px;
    background: #ffffff;
    color: #5c94cf;
    font-size: 2.6rem;
    font-weight: 900;
}

.pos-charge__label {
    font-size: 1.8rem;
    font-weight: 800;
}

.pos-total-card {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.8rem;
    min-height: 12rem;
    background: #ffffff;
    color: #2a3440;
    border-left: 1px solid #d0d7e2;
}

.pos-total-card span {
    font-size: 1.2rem;
    font-weight: 700;
}

.pos-total-card strong {
    font-size: 2.35rem;
    font-weight: 900;
}

.pos-sidebar__cash-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 0.7rem 0.7rem;
}

.pos-sidebar__cash-btn {
    background: #6f7680;
    border-color: #6f7680;
    color: #ffffff;
}

.pos-catalog {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
}

.pos-catalog__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem 0.55rem;
    background: #f3f4f7;
    border-bottom: 1px solid #d6dce6;
}

.pos-catalog__filters {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.pos-select {
    min-width: 20rem;
    min-height: 2.9rem;
    border: 1px solid #c8cfda;
    border-radius: 0.28rem;
    background: #ffffff;
    padding: 0.65rem 0.8rem;
    font-size: 0.95rem;
}

.pos-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pos-context-pill span,
.pos-catalog__meta span,
.pos-mini-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #dce7f5;
    color: #4a6988;
    font-size: 0.8rem;
    font-weight: 700;
}

.pos-catalog__search {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: min(34rem, 100%);
}

.pos-search-input {
    min-height: 2.9rem;
    border: 1px solid #c8cfda;
    border-radius: 0.28rem;
    background: #ffffff;
    padding: 0.75rem 0.9rem;
    font-size: 1rem;
    flex: 1 1 auto;
}

.pos-search-btn {
    min-height: 2.9rem;
    border: 0;
    border-radius: 0.28rem;
    background: #5c94cf;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 1.1rem;
}

.pos-catalog__meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.95rem;
    background: #f3f4f7;
    border-bottom: 1px solid #dce2eb;
}

.pos-grid-status {
    display: grid;
    place-items: center;
    padding: 2.2rem 1rem;
    color: #5c6978;
    font-size: 1rem;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 0.18rem;
    align-content: start;
    overflow: auto;
    padding: 0.18rem;
    background: #efeff2;
}

.pos-product {
    position: relative;
    display: grid;
    grid-template-rows: 220px auto auto;
    gap: 0.5rem;
    padding: 0;
    border: 1px solid #e1e4ea;
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pos-product:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(58, 73, 92, 0.12);
    z-index: 1;
}

.pos-product__price {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.25rem 0.55rem;
    background: #5c94cf;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
}

.pos-product__image-wrap {
    display: grid;
    place-items: center;
    padding: 0.9rem;
    background: #ffffff;
    overflow: hidden;
}

.pos-product__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pos-product__fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f7f8fb 0%, #dde5ef 100%);
    color: #5f6f83;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.pos-product__text {
    display: grid;
    gap: 0.25rem;
    padding: 0 0.8rem;
}

.pos-product__text strong {
    color: #304255;
    font-size: 0.92rem;
    line-height: 1.32;
    font-weight: 400;
}

.pos-product__text span {
    color: #6a7686;
    font-size: 0.84rem;
}

.pos-product__badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0 0.8rem 0.8rem;
}

.pos-mini-badge--muted {
    background: #ebedf1;
    color: #6b7582;
}

@media (max-width: 1280px) {
    .pos-stage {
        grid-template-columns: 30rem minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    .pos-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pos-topbar__actions {
        justify-content: stretch;
    }

    .pos-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .pos-sidebar {
        order: 2;
    }

    .pos-catalog {
        order: 1;
    }
}

@media (max-width: 640px) {
    .pos-shell {
        min-height: auto;
    }

    .pos-topbar,
    .pos-catalog__toolbar {
        padding-inline: 0.75rem;
    }

    .pos-catalog__toolbar,
    .pos-catalog__filters,
    .pos-catalog__search {
        flex-direction: column;
        align-items: stretch;
    }

    .pos-select,
    .pos-topbar__company {
        min-width: 0;
        width: 100%;
    }

    .pos-sidebar__footer {
        grid-template-columns: 1fr;
    }

    .pos-total-card {
        border-left: 0;
        border-top: 1px solid #d0d7e2;
    }
}
