:root {
    --ticp-primary: #1b6e3c;
    --ticp-primary-dark: #124f2b;
    --ticp-bg: #f4f6f5;
    --ticp-card: #ffffff;
    --ticp-border: #e2e5e3;
    --ticp-text: #1f2a24;
    --ticp-muted: #6b7873;
    --ticp-bubble-out: #d9f2df;
    --ticp-bubble-in: #ffffff;
}

/* ---------- LOGIN ---------- */
.ticp-login-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ticp-bg);
    padding: 40px 16px;
}
.ticp-login-box {
    background: var(--ticp-card);
    border: 1px solid var(--ticp-border);
    border-radius: 12px;
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.ticp-login-box h1 { margin: 0 0 4px; font-size: 22px; color: var(--ticp-text); }
.ticp-subtitle { margin: 0 0 24px; color: var(--ticp-muted); font-size: 14px; }
.ticp-form label { display: block; font-size: 13px; margin: 14px 0 6px; color: var(--ticp-text); font-weight: 600; }
.ticp-form input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--ticp-border);
    border-radius: 8px; font-size: 15px; box-sizing: border-box;
}
.ticp-btn {
    margin-top: 20px; width: 100%; padding: 11px; background: var(--ticp-primary);
    color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ticp-btn:hover { background: var(--ticp-primary-dark); }
.ticp-btn-link {
    margin-top: 10px; width: 100%; background: none; border: none; color: var(--ticp-muted);
    font-size: 13px; cursor: pointer; text-decoration: underline;
}
.ticp-alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.ticp-alert-error, .ticp-alert { background: #fdecea; color: #a12622; }
.ticp-alert-success { background: #e6f6ea; color: #1b6e3c; }
.ticp-alert-debug { background: #fff4e0; color: #7a4a00; font-size: 12px; margin-top: -8px; margin-bottom: 14px; font-family: monospace; }
.ticp-welcome-back, .ticp-welcome-new { font-size: 14px; color: var(--ticp-text); margin: 0 0 6px; }

/* ---------- PORTAL SHELL ---------- */
.ticp-portal { display: flex; min-height: 85vh; background: var(--ticp-bg); }
.ticp-sidebar {
    width: 230px; background: var(--ticp-card); border-right: 1px solid var(--ticp-border);
    display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0;
}
.ticp-brand { font-weight: 700; font-size: 16px; padding: 0 20px 20px; color: var(--ticp-text); }
.ticp-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ticp-nav a {
    padding: 12px 20px; color: var(--ticp-text); text-decoration: none; font-size: 14px; font-weight: 500;
    border-left: 3px solid transparent;
}
.ticp-nav a:hover { background: #f0f2f0; }
.ticp-nav a.active { background: #eaf5ee; border-left-color: var(--ticp-primary); color: var(--ticp-primary); font-weight: 700; }
.ticp-logout { padding: 12px 20px; color: #a12622; text-decoration: none; font-size: 14px; font-weight: 600; }
.ticp-content { flex: 1; padding: 32px; max-width: 980px; }
.ticp-page-title { font-size: 22px; margin: 0 0 20px; color: var(--ticp-text); }
.ticp-empty, .ticp-empty-small { color: var(--ticp-muted); padding: 20px; background: var(--ticp-card); border-radius: 10px; border: 1px solid var(--ticp-border); }

/* ---------- PROCESSOS ---------- */
.ticp-lawsuits { display: flex; flex-direction: column; gap: 16px; }
.ticp-lawsuit-card { background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px; padding: 20px; }
.ticp-lawsuit-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ticp-lawsuit-number { font-weight: 700; font-size: 16px; }
.ticp-lawsuit-court { color: var(--ticp-muted); font-size: 13px; text-transform: uppercase; }
.ticp-lawsuit-title { font-size: 14px; color: var(--ticp-text); margin-bottom: 10px; }
.ticp-lawsuit-local { font-size: 12px; color: var(--ticp-muted); margin-bottom: 10px; }
.ticp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ticp-tag { background: #eef1ef; color: var(--ticp-text); font-size: 12px; padding: 4px 10px; border-radius: 20px; }
.ticp-tag-status { background: #e6f6ea; color: #1b6e3c; }
.ticp-tag-fase { background: #fff4e0; color: #92600c; }
.ticp-tag-area { background: #eef0fb; color: #38408f; }
.ticp-tag-done { background: #e6f6ea; color: #1b6e3c; }
.ticp-polos { display: flex; gap: 24px; margin-bottom: 14px; flex-wrap: wrap; }
.ticp-polo-label { font-size: 11px; text-transform: uppercase; color: var(--ticp-muted); font-weight: 700; margin-bottom: 4px; }
.ticp-polo-nome { font-size: 14px; color: var(--ticp-text); }
.ticp-section-label { font-size: 12px; font-weight: 700; color: var(--ticp-muted); text-transform: uppercase; margin: 12px 0 6px; }
.ticp-publicacao-item { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--ticp-border); display: flex; gap: 10px; }
.ticp-pub-data { color: var(--ticp-muted); flex-shrink: 0; }

/* ---------- AGENDA ---------- */
.ticp-agenda-list { display: flex; flex-direction: column; gap: 10px; }
.ticp-agenda-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
    background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 10px; padding: 14px 18px;
}
.ticp-agenda-item.ticp-agenda-done { opacity: .6; }
.ticp-agenda-top { display: flex; align-items: center; gap: 8px; width: 64px; flex-shrink: 0; }
.ticp-agenda-date { color: var(--ticp-muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.ticp-agenda-title { flex: 1; min-width: 160px; font-weight: 700; word-break: break-word; overflow-wrap: break-word; }
.ticp-agenda-desc {
    flex-basis: 100%; font-size: 13px; color: var(--ticp-text);
    word-break: break-word; overflow-wrap: break-word; white-space: normal;
}
.ticp-agenda-meta { flex-basis: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ticp-agenda-processo { font-size: 12px; color: var(--ticp-muted); }

/* ---------- CHAT ---------- */
.ticp-chat { display: flex; flex-direction: column; height: 70vh; background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px; overflow: hidden; }
.ticp-chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; background: #eef2ef; }
.ticp-bubble-row { display: flex; }
.ticp-bubble-row.out { justify-content: flex-end; }
.ticp-bubble-row.in { justify-content: flex-start; }
.ticp-bubble { max-width: 65%; padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4; position: relative; cursor: pointer; }
.ticp-bubble-row.out .ticp-bubble { background: var(--ticp-bubble-out); border-top-right-radius: 2px; }
.ticp-bubble-row.in .ticp-bubble { background: var(--ticp-bubble-in); border-top-left-radius: 2px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.ticp-bubble-time { display: block; font-size: 10px; color: var(--ticp-muted); margin-top: 4px; text-align: right; }
.ticp-bubble-quote { background: rgba(0,0,0,.06); border-left: 3px solid var(--ticp-primary); padding: 4px 8px; border-radius: 4px; font-size: 12px; margin-bottom: 6px; color: var(--ticp-muted); cursor: pointer; }
.ticp-bubble-highlight { animation: ticp-flash 1s ease; }
@keyframes ticp-flash { 0% { background: #fff4c2; } 100% { background: transparent; } }

.ticp-reply-preview { display: flex; align-items: center; justify-content: space-between; background: #f0f2f0; padding: 8px 16px; border-top: 1px solid var(--ticp-border); font-size: 13px; }
.ticp-reply-preview button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ticp-muted); }

.ticp-chat-form { display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--ticp-border); background: var(--ticp-card); }
.ticp-chat-form textarea { flex: 1; resize: none; height: 40px; padding: 10px 12px; border: 1px solid var(--ticp-border); border-radius: 20px; font-size: 14px; font-family: inherit; }

/* ---------- ADMIN PANEL ---------- */
.ticp-admin-panel { display: flex; gap: 20px; height: 75vh; }
.ticp-admin-list { width: 280px; flex-shrink: 0; overflow-y: auto; background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px; padding: 12px; }
.ticp-admin-list h3 { font-size: 12px; text-transform: uppercase; color: var(--ticp-muted); margin: 8px 8px; }
.ticp-mt { margin-top: 20px !important; }
.ticp-admin-conv-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px; border-radius: 8px; text-decoration: none; color: var(--ticp-text); font-size: 14px; }
.ticp-admin-conv-item:hover { background: #f0f2f0; }
.ticp-admin-conv-item.active { background: #eaf5ee; font-weight: 700; }
.ticp-admin-conv-badge { background: var(--ticp-primary); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.ticp-admin-chat { flex: 1; }

/* ---------- SETTINGS ---------- */
.ticp-settings-form { background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px; padding: 24px; max-width: 420px; }
.ticp-settings-form label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.ticp-settings-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--ticp-border); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.ticp-settings-form input:disabled { background: #f4f6f5; color: var(--ticp-muted); }

/* ---------- MENU MOBILE: hambúrguer + gaveta lateral ---------- */
.ticp-mobile-topbar { display: none; }
.ticp-sidebar-overlay { display: none; }

@media (max-width: 720px) {
    :root { --ticp-mobile-topbar-h: 56px; }

    .ticp-mobile-topbar {
        display: flex; align-items: center; justify-content: center; position: fixed;
        top: 0; left: 0; right: 0; height: var(--ticp-mobile-topbar-h);
        background: var(--ticp-card); border-bottom: 1px solid var(--ticp-border);
        z-index: 300;
    }
    .ticp-hamburger-btn {
        position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
        width: 36px; height: 36px; background: none; border: none; cursor: pointer;
        display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0;
    }
    .ticp-hamburger-btn span { display: block; width: 20px; height: 2px; background: var(--ticp-text); border-radius: 2px; }
    .ticp-mobile-topbar-logo img { max-height: 32px; display: block; }
    .ticp-mobile-topbar-logo span { font-weight: 700; font-size: 15px; color: var(--ticp-text); }

    .ticp-portal { flex-direction: column; padding-top: var(--ticp-mobile-topbar-h); }

    /* A barra lateral vira uma "gaveta" que desliza da esquerda, escondida
       por padrão (fora da tela) — abre por cima do conteúdo ao clicar no
       hambúrguer, com o logo centralizado dentro dela também. */
    .ticp-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 260px; max-width: 82vw;
        flex-direction: column; align-items: center; text-align: center;
        overflow-y: auto; padding: 24px 0; z-index: 400;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 2px 0 16px rgba(0,0,0,.18);
    }
    .ticp-sidebar.ticp-sidebar-open { transform: translateX(0); }
    .ticp-portal-logo { margin-left: auto; margin-right: auto; }
    .ticp-nav { flex-direction: column; width: 100%; }
    .ticp-nav a { text-align: left; padding-left: 24px; }
    .ticp-logout { display: block; margin-top: 16px; text-align: left; padding-left: 24px; }

    .ticp-sidebar-overlay {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 350;
        opacity: 0; pointer-events: none; transition: opacity .25s ease;
    }
    .ticp-sidebar-overlay.ticp-sidebar-overlay-visible { opacity: 1; pointer-events: auto; }

    .ticp-admin-panel { flex-direction: column; height: auto; }
    .ticp-admin-list { width: 100%; }
}

/* ---------- NOTIFICAÇÃO DE MENSAGENS NOVAS (menu) ---------- */
.ticp-nav-badge {
    background: #d93025; color: #fff; font-size: 11px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: middle;
}

/* ---------- AVISO "ADVOGADO ONLINE" (canto inferior esquerdo) ---------- */
.ticp-online-badge {
    position: fixed; left: 16px; bottom: 16px; z-index: 250;
    background: #1b6e3c; color: #fff; padding: 10px 16px; border-radius: 24px;
    font-size: 13px; font-weight: 700; text-decoration: none;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.ticp-online-badge:hover { background: #124f2b; color: #fff; }
.ticp-online-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #fff;
    animation: ticp-online-pulse 2s infinite;
}
@keyframes ticp-online-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
    70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ---------- POPUPS (TOASTS) DE NOTIFICAÇÃO EM TEMPO REAL (admin) ---------- */
.ticp-toast-container {
    position: fixed; top: 16px; right: 16px; z-index: 500;
    display: flex; flex-direction: column; gap: 10px; max-width: 320px;
}
.ticp-toast {
    background: var(--ticp-card); border: 1px solid var(--ticp-border); border-left: 4px solid var(--ticp-primary);
    border-radius: 10px; padding: 12px 16px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
    animation: ticp-toast-in .25s ease;
}
.ticp-toast-clickable { cursor: pointer; }
.ticp-toast-clickable:hover { background: #f7faf8; }
.ticp-toast-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.ticp-toast-text { font-size: 12px; color: var(--ticp-muted); }
.ticp-toast-hide { animation: ticp-toast-out .3s ease forwards; }
@keyframes ticp-toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ticp-toast-out { to { opacity: 0; transform: translateX(30px); } }

@media (max-width: 720px) {
    .ticp-toast-container { top: calc(var(--ticp-mobile-topbar-h, 56px) + 10px); right: 10px; left: 10px; max-width: none; }
}

/* ---------- MENSAGENS: ocupa a tela toda no celular, estilo WhatsApp ---------- */
/* Só no mobile — no computador o chat continua exatamente como já era
   (cartão com altura fixa, dentro do layout normal do painel). */
@media (max-width: 720px) {
    /* --ticp-mobile-topbar-h já foi definida acima (56px). Usamos flexbox
       (não conta de altura fixa) pra dividir o espaço entre o título e o
       chat — assim funciona certinho não importa a altura exata do título
       ou do link "Voltar" no Painel, sem precisar acertar números à mão. */

    .ticp-content.ticp-content-chat {
        padding: 0;
        max-width: 100%;
        height: calc(100dvh - var(--ticp-mobile-topbar-h));
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .ticp-content.ticp-content-chat .ticp-page-title {
        flex-shrink: 0;
        margin: 0;
        padding: 14px 16px;
        font-size: 17px;
        background: var(--ticp-card);
        border-bottom: 1px solid var(--ticp-border);
    }

    /* O chat preenche todo o espaço que sobrar depois do título — sem
       borda, sem cartão, igual a um app de mensagens de verdade. */
    .ticp-content.ticp-content-chat .ticp-chat {
        flex: 1;
        height: auto;
        min-height: 0;
        border: none;
        border-radius: 0;
    }
    .ticp-content.ticp-content-chat .ticp-chat-messages {
        /* espaço reservado embaixo pra nenhuma mensagem ficar escondida
           atrás do campo de texto, que fica fixo na tela (ver abaixo). */
        padding-bottom: 76px;
    }

    /* Campo de texto fixado na parte inferior DA TELA (não só do cartão) —
       exatamente como o WhatsApp: fica sempre visível, mesmo rolando a
       conversa, independente de header/rodapé do tema do WordPress acima. */
    .ticp-content.ticp-content-chat .ticp-chat-form {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        border-radius: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,.08);
    }

    /* No Painel (admin), a lista de clientes fica acima do chat quando
       nenhum está selecionado — some quando o chat está aberto, pra
       aproveitar a tela toda também. */
    .ticp-content.ticp-content-chat .ticp-files-admin,
    .ticp-content.ticp-content-chat .ticp-admin-panel {
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    .ticp-content.ticp-content-chat .ticp-admin-list.ticp-admin-list-hidden-mobile {
        display: none;
    }
    .ticp-content.ticp-content-chat .ticp-back-link-mobile-only {
        display: block;
        flex-shrink: 0;
        padding: 10px 16px 0;
        margin-bottom: 4px;
    }
    .ticp-content.ticp-content-chat .ticp-admin-chat {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
}

/* ---------- BOTÕES PEQUENOS / LINKS ---------- */
.ticp-btn-small {
    background: #eef1ef; color: var(--ticp-text); border: none; padding: 6px 14px;
    border-radius: 16px; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.ticp-btn-small:hover { background: #e2e5e3; }
.ticp-back-link { display: inline-block; margin-bottom: 14px; color: var(--ticp-primary); text-decoration: none; font-size: 13px; font-weight: 600; }
.ticp-back-link-mobile-only { display: none; }
.ticp-lawsuit-actions { margin-top: 14px; }
.ticp-hint { font-size: 12px; color: var(--ticp-muted); margin-top: 10px; }
.ticp-inline-error { color: #a12622; font-size: 12px; margin-left: 8px; }

/* ---------- ANDAMENTOS ---------- */
.ticp-movements { display: flex; flex-direction: column; gap: 12px; }
.ticp-movement-item { display: flex; gap: 16px; background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 10px; padding: 14px 18px; }
.ticp-movement-date { width: 160px; flex-shrink: 0; color: var(--ticp-muted); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ticp-movement-type { font-weight: 700; margin-bottom: 4px; }
.ticp-movement-desc { font-size: 13px; color: var(--ticp-text); margin-bottom: 8px; white-space: pre-line; overflow-wrap: break-word; word-break: break-word; }
.ticp-movement-explain { font-size: 13px; background: #eef5f0; border-radius: 8px; padding: 8px 12px; color: #1b6e3c; }
.ticp-movement-explain-empty { background: #f4f6f5; color: var(--ticp-muted); font-style: italic; }

/* ---------- FINANCEIRO (reaproveita a estrutura de bloco da Agenda) ---------- */
.ticp-financeiro-item-valor { font-weight: 700; font-size: 15px; white-space: nowrap; margin-left: auto; }
.ticp-fin-valor-in { color: #1b6e3c; }
.ticp-fin-valor-out { color: #a12622; }
.ticp-fin-in { border-left: 3px solid #1b6e3c; }
.ticp-fin-out { border-left: 3px solid #a12622; }

/* ---------- CHAT: botão de enviar (estilo WhatsApp) ---------- */
.ticp-send-round {
    width: 42px; height: 42px; min-width: 42px; border-radius: 50%; border: none;
    background: var(--ticp-primary); display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; padding: 0; margin: 0;
}
.ticp-send-round:hover { background: var(--ticp-primary-dark); }

/* Estilos das mensagens antigas que já tinham anexo/áudio (o envio de novos
   anexos foi removido, mas o histórico continua sendo exibido normalmente). */
.ticp-bubble-image { max-width: 220px; border-radius: 8px; display: block; margin-bottom: 6px; }
.ticp-bubble-file { display: block; margin-bottom: 6px; color: inherit; text-decoration: underline; font-size: 13px; }
.ticp-bubble-audio { display: block; margin-bottom: 4px; max-width: 240px; }
.ticp-bubble-audio-fallback { display: block; font-size: 11px; color: inherit; opacity: .75; text-decoration: underline; margin-bottom: 6px; }

/* ---------- ANDAMENTOS (tabela) ---------- */
.ticp-table-wrap { overflow-x: auto; background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 10px; }
.ticp-movements-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ticp-movements-table th {
    text-align: left; padding: 14px 16px; background: #eef1ef; color: var(--ticp-text);
    font-size: 11px; text-transform: uppercase; font-weight: 700; border-bottom: 2px solid var(--ticp-border);
}
.ticp-movements-table th:not(:last-child),
.ticp-movements-table td:not(:last-child) {
    border-right: 1px solid var(--ticp-border);
}
.ticp-movements-table td { padding: 14px 16px; border-bottom: 1px solid var(--ticp-border); vertical-align: top; }
.ticp-movements-table tbody tr:last-child td { border-bottom: none; }
.ticp-movements-table tbody tr:nth-child(even) { background: #fafbfa; }
.ticp-movements-table tbody tr:hover { background: #eef5f0; }
.ticp-col-data { width: 160px; white-space: nowrap; color: var(--ticp-muted); font-weight: 700; }
.ticp-col-andamento { width: 34%; }
.ticp-col-explicacao { color: #1b6e3c; }
.ticp-row-nota { background: #fffaf0 !important; }
.ticp-row-nota:hover { background: #fff3e0 !important; }
.ticp-row-nota .ticp-col-explicacao { color: var(--ticp-muted); font-style: italic; }
.ticp-tag-nota { background: #fdeecb; color: #92600c; display: block; margin-top: 4px; width: fit-content; }
.ticp-movement-explain-icon { margin-right: 4px; }
.ticp-movement-explain-empty { color: var(--ticp-muted); font-style: italic; }

@media (max-width: 720px) {
    .ticp-table-wrap { overflow-x: visible; border: none; background: none; }
    .ticp-movements-table thead { display: none; }
    .ticp-movements-table, .ticp-movements-table tbody, .ticp-movements-table tr, .ticp-movements-table td { display: block; width: 100%; }
    .ticp-movements-table tr {
        margin-bottom: 16px; border: 1px solid var(--ticp-border); border-radius: 10px; overflow: hidden;
        background: var(--ticp-card);
    }
    .ticp-movements-table tr:nth-child(even) { background: #fafbfa; }
    .ticp-movements-table tr.ticp-row-nota { background: #fffaf0 !important; }
    .ticp-movements-table td {
        border-right: none; border-bottom: 1px solid var(--ticp-border); padding: 10px 14px;
        white-space: normal; word-break: break-word; overflow-wrap: break-word;
    }
    .ticp-movements-table td:last-child { border-bottom: none; }
    .ticp-movements-table td::before {
        content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase;
        color: var(--ticp-muted); font-weight: 700; margin-bottom: 4px; letter-spacing: .02em;
    }
    .ticp-col-data { width: auto; white-space: normal; }
    .ticp-movement-desc, .ticp-movement-type { white-space: normal; word-break: break-word; overflow-wrap: break-word; }
}

/* ---------- AGENDA: status ---------- */
.ticp-status-dot { display: inline-block; font-size: 14px; }
.ticp-status-ok { color: #1b6e3c; font-weight: 700; }
.ticp-status-late { color: #d93025; }
.ticp-status-pending { color: #c9a227; }
.ticp-agenda-late { border-color: #f3c6c1; }
.ticp-tag-late { background: #fdecea; color: #a12622; }
.ticp-new-conversation { margin-bottom: 16px; }
.ticp-new-conversation form { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.ticp-new-conversation input[type="text"] { padding: 6px 10px; border: 1px solid var(--ticp-border); border-radius: 8px; font-size: 13px; }

/* ---------- AGENDA/FINANCEIRO: empilhado no celular ---------- */
@media (max-width: 720px) {
    .ticp-agenda-item {
        flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 16px;
    }
    .ticp-agenda-top { width: auto; }
    .ticp-agenda-title { min-width: 0; }
    .ticp-financeiro-item-valor { margin-left: 0; margin-top: 2px; font-size: 16px; }
}

/* ---------- NOTÍCIAS (feed RSS) ---------- */
.ticp-news-list { display: flex; flex-direction: column; gap: 14px; }
.ticp-news-card {
    display: block; background: var(--ticp-card); border: 1px solid var(--ticp-border);
    border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit;
}
.ticp-news-card:hover { border-color: var(--ticp-primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ticp-news-title { font-weight: 700; font-size: 15px; color: var(--ticp-text); margin-bottom: 2px; }
.ticp-news-date { font-size: 11px; color: var(--ticp-muted); margin-bottom: 10px; }
.ticp-news-body { display: flex; gap: 14px; align-items: flex-start; }
.ticp-news-thumb {
    width: 120px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #f4f6f5;
}
.ticp-news-thumb-placeholder {
    display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.ticp-news-excerpt { font-size: 13px; color: var(--ticp-text); line-height: 1.5; }

@media (max-width: 720px) {
    .ticp-news-card { padding: 14px; }
    .ticp-news-thumb { width: 80px; height: 68px; }
    .ticp-news-excerpt { font-size: 12.5px; line-height: 1.45; }
}
/* ---------- LOGO DO PORTAL ---------- */
.ticp-portal-logo { max-width: 100%; max-height: 60px; display: block; margin: 8px 0 4px; }

/* ---------- ARQUIVOS (notas fiscais, sentenças etc.) ---------- */
.ticp-files-section { margin-bottom: 32px; }
.ticp-files-section h2 { font-size: 16px; margin: 0 0 12px; }
.ticp-files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.ticp-file-card {
    background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 10px;
    padding: 10px; position: relative; text-align: center;
}
.ticp-file-card-link { text-decoration: none; color: inherit; display: block; }
.ticp-file-thumb { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; background: #f4f6f5; }
.ticp-file-icon { width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: #f4f6f5; border-radius: 6px; margin-bottom: 8px; }
.ticp-file-name { font-size: 12px; font-weight: 600; word-break: break-word; line-height: 1.3; }
.ticp-file-meta { font-size: 11px; color: var(--ticp-muted); margin-top: 4px; }
.ticp-file-delete-btn {
    position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); border: 1px solid var(--ticp-border);
    border-radius: 50%; width: 26px; height: 26px; font-size: 12px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
}
.ticp-file-delete-btn:hover { background: #fdecea; }

.ticp-file-upload-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ticp-file-upload-form input[type="text"] {
    padding: 8px 12px; border: 1px solid var(--ticp-border); border-radius: 8px; font-size: 13px; flex: 1; min-width: 220px;
}
.ticp-file-upload-form input[type="file"] { font-size: 13px; }
#ticp-file-upload-status { margin-top: 10px; font-size: 13px; }
#ticp-file-upload-status:empty { display: none; }

.ticp-files-admin { display: flex; gap: 20px; align-items: flex-start; }
.ticp-files-client-list { width: 240px; flex-shrink: 0; background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px; padding: 12px; }
.ticp-files-client-list h3 { font-size: 12px; text-transform: uppercase; color: var(--ticp-muted); margin: 8px 8px; }
.ticp-client-search-input {
    width: 100%; box-sizing: border-box; padding: 8px 12px; margin-bottom: 10px;
    border: 1px solid var(--ticp-border); border-radius: 8px; font-size: 13px;
}
.ticp-admin-conv-cpf { display: block; font-size: 11px; color: var(--ticp-muted); font-weight: 400; }
.ticp-admin-conv-info { display: flex; flex-direction: column; gap: 1px; }
.ticp-files-client-content { flex: 1; min-width: 0; }

@media (max-width: 720px) {
    .ticp-files-admin { flex-direction: column; }
    .ticp-files-client-list { width: 100%; }
    .ticp-files-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- FILA DE ATENDIMENTO (VIDEOCHAMADA) ---------- */
.ticp-queue-client, .ticp-queue-admin { max-width: 640px; }
.ticp-queue-start, .ticp-queue-waiting-client, .ticp-queue-called-client {
    background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px;
    padding: 28px; text-align: center;
}
.ticp-queue-position { font-size: 18px; font-weight: 700; color: var(--ticp-primary); margin-bottom: 10px; }
.ticp-call-panel { margin: 16px 0; }
.ticp-call-status { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.ticp-call-timer { font-variant-numeric: tabular-nums; color: var(--ticp-primary); }
.ticp-twilio-device-status { font-size: 12px; color: var(--ticp-muted); margin-left: 8px; }
.ticp-twilio-device-status.ticp-status-error { color: #a12622; }
.ticp-btn-danger { background: #fdecea; color: #a12622; }
.ticp-btn-danger:hover { background: #f8d7d3; }

.ticp-queue-status-toggle { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.ticp-btn-online { background: #1b6e3c; color: #fff; }
.ticp-btn-online:hover { background: #124f2b; }
.ticp-btn-offline { background: #eef1ef; color: var(--ticp-text); }

.ticp-queue-serving {
    background: var(--ticp-card); border: 1px solid var(--ticp-border); border-radius: 12px;
    padding: 20px; margin-bottom: 24px;
}
.ticp-queue-serving-name { font-weight: 700; font-size: 15px; margin-bottom: 8px; }

.ticp-queue-waiting-list { display: flex; flex-direction: column; gap: 8px; }
.ticp-queue-waiting-item {
    display: flex; align-items: center; gap: 14px; background: var(--ticp-card);
    border: 1px solid var(--ticp-border); border-radius: 10px; padding: 10px 16px;
}
.ticp-queue-waiting-pos {
    width: 26px; height: 26px; border-radius: 50%; background: #eef1ef; color: var(--ticp-text);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ticp-queue-waiting-name { flex: 1; font-weight: 600; }

/* ---------- ESTATÍSTICAS ---------- */
.ticp-stats-overview { display: flex; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.ticp-stats-card {
    flex: 1; min-width: 160px; background: var(--ticp-card); border: 1px solid var(--ticp-border);
    border-radius: 10px; padding: 18px; text-align: center;
}
.ticp-stats-number { font-size: 28px; font-weight: 700; color: var(--ticp-primary); }
.ticp-stats-label { font-size: 12px; color: var(--ticp-muted); margin-top: 6px; }

.ticp-stats-section { margin-bottom: 32px; }
.ticp-stats-section h2 { font-size: 16px; margin: 0 0 4px; }
.ticp-stats-section .ticp-hint { margin-top: 0; margin-bottom: 12px; }

.ticp-stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ticp-stats-table th {
    text-align: left; padding: 12px 16px; background: #eef1ef; color: var(--ticp-text);
    font-size: 11px; text-transform: uppercase; font-weight: 700; border-bottom: 2px solid var(--ticp-border);
}
.ticp-stats-table th:not(:last-child), .ticp-stats-table td:not(:last-child) { border-right: 1px solid var(--ticp-border); }
.ticp-stats-table td { padding: 12px 16px; border-bottom: 1px solid var(--ticp-border); }
.ticp-stats-table tbody tr:last-child td { border-bottom: none; }
.ticp-stats-table tbody tr:nth-child(even) { background: #fafbfa; }
.ticp-stats-table tbody tr:hover { background: #eef5f0; }

@media (max-width: 720px) {
    .ticp-stats-table thead { display: none; }
    .ticp-stats-table, .ticp-stats-table tbody, .ticp-stats-table tr, .ticp-stats-table td { display: block; width: 100%; }
    .ticp-stats-table tr { margin-bottom: 14px; border: 1px solid var(--ticp-border); border-radius: 10px; overflow: hidden; background: var(--ticp-card); }
    .ticp-stats-table tr:nth-child(even) { background: #fafbfa; }
    .ticp-stats-table td { border-right: none; border-bottom: 1px solid var(--ticp-border); padding: 10px 14px; }
    .ticp-stats-table td:last-child { border-bottom: none; }
    .ticp-stats-table td::before {
        content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase;
        color: var(--ticp-muted); font-weight: 700; margin-bottom: 4px;
    }
}

@media (max-width: 720px) {
    .ticp-queue-start, .ticp-queue-waiting-client, .ticp-queue-called-client { padding: 20px 16px; }
    .ticp-call-status { font-size: 14px; }
}
