/* —— Suporte técnico (modal home) —— */
.modal-support {
    width: min(100%, 920px);
    max-height: min(92vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(56, 182, 255, 0.14), transparent 55%),
        radial-gradient(90% 70% at 100% 0%, rgba(10, 94, 201, 0.10), transparent 50%),
        var(--paper);
}

.modal-support .modal-header {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.support-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-right: 0.15rem;
    color: #fff;
    background: linear-gradient(145deg, var(--blue-600), var(--blue-900));
    box-shadow: 0 10px 22px rgba(10, 94, 201, 0.28);
    flex-shrink: 0;
}

.support-header-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.support-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.support-sidebar {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(244, 250, 255, 0.65);
}

.support-side-top {
    padding: 0.9rem 0.9rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex-shrink: 0;
}

.support-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    box-shadow: 0 8px 18px rgba(10, 94, 201, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.support-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(10, 94, 201, 0.28);
}

.support-ticket-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.25rem 0.65rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    scrollbar-width: thin;
}

.support-ticket-item {
    text-align: left;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
    background: rgba(255, 255, 255, 0.72);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.support-ticket-item:hover {
    border-color: rgba(26, 122, 224, 0.28);
    background: #fff;
}

.support-ticket-item.is-active {
    border-color: rgba(10, 94, 201, 0.35);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 42, 102, 0.08);
}

.support-ticket-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.support-ticket-item strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.support-ticket-item small {
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.support-ticket-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.support-ticket-meta time {
    font-size: 0.72rem;
    color: var(--offline);
    font-weight: 600;
}

.support-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: var(--blue-700);
}

.support-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.support-status.is-waiting {
    color: #9a6700;
    background: #fff6dd;
}

.support-status.is-in_progress {
    color: #0a5ec9;
    background: #e8f2fc;
}

.support-status.is-finished {
    color: #14804a;
    background: #e7f7ee;
}

.support-status.is-canceled_no_reply {
    color: #8a4b45;
    background: #fdecea;
}

.support-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.55);
}

.support-view {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.support-view.is-active {
    display: flex;
}

.support-empty,
.support-loading {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--ink-soft);
}

.support-empty-card {
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.support-empty-card .icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    color: var(--blue-700);
    background: linear-gradient(160deg, #e8f5ff, #f4faff);
    border: 1px solid var(--line);
}

.support-empty-card h4 {
    font-size: 1.15rem;
    color: var(--ink);
}

.support-empty-card p {
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
}

.support-compose {
    padding: 1.15rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow: auto;
}

.support-compose h4 {
    font-size: 1.05rem;
    color: var(--ink);
}

.support-compose .field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}

.support-compose .field input,
.support-compose .field textarea,
.support-composer textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.support-compose .field input:focus,
.support-compose .field textarea:focus,
.support-composer textarea:focus {
    border-color: rgba(26, 122, 224, 0.55);
    box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.18);
}

.support-compose .field textarea {
    min-height: 140px;
    resize: vertical;
}

.support-attach-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.support-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 11px;
    border: 1px dashed rgba(10, 94, 201, 0.35);
    background: rgba(244, 250, 255, 0.9);
    color: var(--blue-800);
    font-weight: 700;
    font-size: 0.86rem;
    transition: 0.18s ease;
}

.support-attach-btn:hover {
    background: #e8f5ff;
    border-style: solid;
}

.support-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.4rem 0.55rem 0.4rem 0.45rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
}

.support-attach-chip img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 8px;
}

.support-attach-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.support-attach-chip button {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    color: var(--ink-soft);
    background: var(--blue-50);
}

.support-chat-head {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.8);
}

.support-chat-head h4 {
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.3;
}

.support-chat-head p {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.support-back-mobile {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    place-items: center;
    background: var(--blue-50);
    color: var(--ink-soft);
    flex-shrink: 0;
}

.support-messages {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background:
        linear-gradient(180deg, rgba(244, 250, 255, 0.35), transparent 90px),
        repeating-linear-gradient(
            -18deg,
            transparent,
            transparent 18px,
            rgba(215, 230, 245, 0.18) 18px,
            rgba(215, 230, 245, 0.18) 19px
        );
    scrollbar-width: thin;
}

.support-bubble {
    max-width: min(82%, 460px);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    animation: supportIn 0.28s ease;
}

@keyframes supportIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-bubble.is-mine {
    align-self: flex-end;
}

.support-bubble.is-admin {
    align-self: flex-start;
}

.support-bubble-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
    padding: 0 0.2rem;
}

.support-bubble.is-mine .support-bubble-meta {
    justify-content: flex-end;
}

.support-bubble-body {
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.support-bubble.is-mine .support-bubble-body {
    color: #fff;
    background: linear-gradient(145deg, var(--blue-600), var(--blue-800));
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 18px rgba(10, 94, 201, 0.18);
}

.support-bubble.is-admin .support-bubble-body {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 42, 102, 0.05);
}

.support-bubble-body:empty {
    display: none;
}

.support-attach {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(215, 230, 245, 0.9);
    background: #fff;
    max-width: 260px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease;
}

.support-attach:hover {
    transform: translateY(-1px);
}

.support-attach img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.support-attach-file {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
}

.support-attach-file i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--blue-50);
    color: var(--blue-700);
}

.support-attach-file strong {
    display: block;
    font-size: 0.84rem;
    color: var(--ink);
}

.support-attach-file small {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 600;
}

.support-bubble.is-mine .support-attach {
    border-color: rgba(255, 255, 255, 0.25);
}

.support-composer {
    border-top: 1px solid var(--line);
    padding: 0.75rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.92);
    flex-shrink: 0;
}

.support-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.support-composer textarea {
    min-height: 46px;
    max-height: 120px;
    resize: none;
    flex: 1;
}

.support-icon-btn,
.support-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: 0.18s ease;
}

.support-icon-btn {
    background: var(--blue-50);
    color: var(--blue-800);
}

.support-icon-btn:hover {
    background: #e8f5ff;
}

.support-send-btn {
    color: #fff;
    background: linear-gradient(145deg, var(--blue-600), var(--blue-800));
    box-shadow: 0 8px 16px rgba(10, 94, 201, 0.22);
}

.support-send-btn:hover {
    transform: translateY(-1px);
}

.support-send-btn:disabled,
.support-new-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.support-closed-note {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #fff6dd;
    color: #9a6700;
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Preview lightbox */
.support-preview-root {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.support-preview-root.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.support-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 18, 40, 0.78);
    backdrop-filter: blur(8px);
}

.support-preview-dialog {
    position: relative;
    width: min(100%, 920px);
    max-height: min(90vh, 820px);
    background: #0b1f38;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

.support-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    color: #d7e6f5;
    background: rgba(255, 255, 255, 0.04);
}

.support-preview-bar strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-preview-actions {
    display: flex;
    gap: 0.4rem;
}

.support-preview-actions a,
.support-preview-actions button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.support-preview-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0.75rem;
    overflow: auto;
}

.support-preview-stage img {
    max-width: 100%;
    max-height: min(74vh, 700px);
    object-fit: contain;
    border-radius: 10px;
}

.support-preview-stage iframe {
    width: min(100%, 860px);
    height: min(70vh, 680px);
    border: 0;
    border-radius: 10px;
    background: #fff;
}

.dropdown-link .support-nav-badge,
.mobile-link .support-nav-badge,
.painel-group-btn .support-nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: none;
    place-items: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff;
    background: #e11d48;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.dropdown-link .support-nav-badge.is-on,
.mobile-link .support-nav-badge.is-on,
.painel-group-btn .support-nav-badge.is-on,
.support-avatar-dot.is-on {
    display: inline-grid;
}

.support-avatar-dot {
    position: absolute;
    top: -5px;
    right: -6px;
    margin: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 0.28rem;
    border-radius: 999px;
    display: none;
    place-items: center;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: #e11d48;
    box-shadow: 0 0 0 2px #003888;
    z-index: 2;
}

.painel-menu-toggle .support-avatar-dot {
    box-shadow: 0 0 0 2px #fff;
}

.mobile-link .support-nav-badge {
    margin-right: 0.25rem;
}

.dropdown-link.has-unread {
    font-weight: 800;
}

/* —— Aviso fixo de atualização —— */
.support-alert {
    position: fixed;
    left: 1.1rem;
    bottom: 1.1rem;
    z-index: 9400;
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    max-width: min(420px, calc(100vw - 2.2rem));
    pointer-events: none;
}

.support-alert[hidden] {
    display: none !important;
}

.support-alert.is-on {
    pointer-events: auto;
    animation: support-alert-in 0.35s ease;
}

.support-alert-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border: 0;
    border-radius: 16px;
    text-align: left;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 55%, #9f1239 100%);
    box-shadow: 0 16px 36px rgba(190, 18, 60, 0.42);
    animation: support-alert-pulse 1.8s ease-in-out infinite;
}

.support-alert-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.16);
    font-size: 1.05rem;
}

.support-alert-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
}

.support-alert-copy strong {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.support-alert-copy small {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.support-alert-count {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #9f1239;
    background: #fff;
    flex-shrink: 0;
}

.support-alert-count[hidden] {
    display: none !important;
}

.support-alert-cta {
    flex-shrink: 0;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #9f1239;
    background: #fff;
}

.support-alert-dismiss {
    width: 2.1rem;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(159, 18, 57, 0.92);
    box-shadow: 0 10px 22px rgba(159, 18, 57, 0.28);
    cursor: pointer;
}

.support-alert-dismiss:hover {
    background: #9f1239;
}

@keyframes support-alert-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes support-alert-pulse {
    0%, 100% { box-shadow: 0 16px 36px rgba(190, 18, 60, 0.38); }
    50% { box-shadow: 0 20px 44px rgba(190, 18, 60, 0.55); }
}

@media (max-width: 780px) {
    .modal-support {
        width: min(100%, 100%);
        max-height: min(94vh, 100%);
        border-radius: 18px;
    }

    .support-shell {
        grid-template-columns: 1fr;
    }

    .support-sidebar,
    .support-main {
        min-height: min(72vh, 560px);
    }

    .support-shell.is-chat .support-sidebar {
        display: none;
    }

    .support-shell:not(.is-chat) .support-main {
        display: none;
    }

    .support-back-mobile {
        display: grid;
    }

    .support-alert {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 5.6rem;
        max-width: none;
    }

    .support-alert-copy small {
        max-width: none;
    }
}
