:root {
      --bg:#f6f2ea; --canvas:#fbf8f2; --surface:#fffdf8; --surface-2:#f7f1e8;
      --ink:#17212b; --muted:#667085; --subtle:#98a2b3; --line:#e7dccb;
      --brand:#0d4f63; --brand-2:#113948; --accent:#c9812f; --accent-soft:#fff1dc;
      --ok:#267a52; --warn:#9a6200; --bad:#a13a3a; --info:#315f86;
      --shadow:0 18px 45px rgba(23,33,43,.075); --soft-shadow:0 8px 22px rgba(23,33,43,.055);
      --radius:18px; --radius-lg:26px;
    }
    * { box-sizing:border-box; }
    body { margin:0; font-family:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; background:linear-gradient(135deg,#f7f1e7 0%,#f8fafb 48%,#eef4f5 100%); color:var(--ink); }
    button, input, textarea, select { font:inherit; }
    button { border:0; border-radius:12px; padding:10px 14px; font-weight:800; cursor:pointer; background:var(--brand); color:white; transition:.15s ease; }
    button:hover { transform:translateY(-1px); box-shadow:0 8px 18px rgba(13,79,99,.14); }
    button.secondary { background:#415466; } button.ok { background:var(--ok); } button.warn { background:var(--warn); } button.ghost { background:#edf4f5; color:#174354; box-shadow:none; }
    button:disabled { opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }
    input, textarea, select { width:100%; border:1px solid var(--line); border-radius:13px; padding:11px 12px; background:white; color:var(--ink); outline:none; }
    input:focus, textarea:focus, select:focus { border-color:#8ab4bf; box-shadow:0 0 0 4px rgba(13,79,99,.10); }
    textarea { min-height:92px; resize:vertical; }
    label { display:block; font-size:11px; font-weight:900; color:#667085; margin:12px 0 6px; text-transform:uppercase; letter-spacing:.07em; }
    .muted { color:var(--muted); } .row { display:flex; align-items:center; gap:10px; }
    .app { min-height:100vh; display:grid; grid-template-columns:268px 1fr; }
    .sidebar { position:sticky; top:0; height:100vh; padding:20px 16px; background:linear-gradient(180deg,#123f50,#092b3a 72%,#082431); color:white; overflow:auto; }
    .brand { display:flex; gap:12px; align-items:center; margin-bottom:22px; padding:5px 4px; }
    .logo { width:42px; height:42px; border-radius:15px; display:grid; place-items:center; background:linear-gradient(135deg,#f3c06d,#c9812f); color:#142f39; font-weight:950; box-shadow:inset 0 1px 0 #ffffff66; }
    .brand h1 { margin:0; font-size:18px; line-height:1.1; letter-spacing:-.02em; }
    .brand p { margin:4px 0 0; opacity:.76; font-size:12px; }
    .nav { display:flex; flex-direction:column; gap:7px; }
    .tab-btn { display:flex; align-items:center; justify-content:space-between; width:100%; background:transparent; color:#e8f2f4; text-align:left; border:1px solid rgba(255,255,255,.09); box-shadow:none; padding:11px 12px; }
    .tab-btn:hover { background:rgba(255,255,255,.075); transform:none; box-shadow:none; }
    .tab-btn.active { background:#f8fbfc; color:#123f50; }
    .tab-count { min-width:26px; text-align:center; border-radius:999px; padding:2px 7px; background:rgba(255,255,255,.14); font-size:12px; }
    .tab-btn.active .tab-count { background:#dcebee; color:#123f50; }
    .side-card { margin-top:18px; padding:14px; border:1px solid rgba(255,255,255,.13); border-radius:20px; background:rgba(255,255,255,.075); }
    .side-card h3 { margin:0 0 8px; font-size:14px; }
    .side-card p { margin:0; font-size:12.5px; color:#d8e7eb; line-height:1.45; }
    .main { min-width:0; padding:22px; }
    .topbar { display:flex; gap:16px; justify-content:space-between; align-items:flex-start; margin-bottom:16px; }
    .eyebrow { margin:0 0 6px; color:var(--brand); font-weight:950; text-transform:uppercase; letter-spacing:.09em; font-size:11px; }
    .topbar h2 { margin:0; font-size:31px; letter-spacing:-.035em; }
    .topbar p { margin:8px 0 0; color:var(--muted); max-width:800px; line-height:1.45; }
    .toolbar { display:flex; gap:9px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
    .user-badge { display:inline-flex; align-items:center; gap:8px; border-radius:999px; padding:8px 12px; background:rgba(255,255,255,.84); border:1px solid var(--line); color:#123f50; font-weight:850; box-shadow:var(--soft-shadow); }
    .panel, section { background:rgba(255,253,248,.94); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow); }
    .panel { padding:16px; } section { padding:18px; }
    .tab-panel { display:none; } .tab-panel.active { display:block; }
    .grid { display:grid; gap:14px; } .grid.two { grid-template-columns:1.1fr .9fr; } .grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .overview { display:grid; grid-template-columns:repeat(5, minmax(135px, 1fr)); gap:11px; margin-bottom:14px; }
    .metric { background:linear-gradient(180deg,#fff,#f8fafb); border:1px solid var(--line); border-radius:18px; padding:14px; box-shadow:0 1px 0 #fff inset; }
    .metric strong { display:block; font-size:28px; margin-bottom:3px; letter-spacing:-.045em; }
    .metric span { color:var(--muted); font-size:12.5px; }
    .queue-list { display:flex; gap:7px; flex-wrap:wrap; margin:8px 0 14px; }
    .pill { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:5px 9px; font-size:11.5px; background:#e8f1f4; color:#164154; font-weight:850; }
    .pill.warn { background:#fff3d6; color:#865500; } .pill.ok { background:#e0f5ea; color:#216144; } .pill.bad { background:#f8e6e6; color:#8b2c2c; }
    .filters { display:grid; grid-template-columns:1fr 170px 170px 170px; gap:10px; margin-bottom:14px; }
    .subnav { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 14px; }
    .kanban { display:grid; grid-template-columns:repeat(5, minmax(210px, 1fr)); gap:12px; align-items:start; }
    .col { background:#fbf7ef; border:1px solid var(--line); border-radius:18px; min-height:180px; padding:10px; }
    .col h3 { display:flex; justify-content:space-between; align-items:center; margin:0 0 10px; font-size:13px; color:#344455; }
    .ticket { background:white; border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:16px; padding:12px; margin-bottom:10px; cursor:pointer; transition:.14s ease; box-shadow:0 1px 0 #fff inset; }
    .ticket:hover { transform:translateY(-2px); box-shadow:0 10px 22px rgba(31,41,51,.09); }
    .ticket.selected { outline:3px solid rgba(13,79,99,.20); }
    .ticket .title { font-weight:950; letter-spacing:-.01em; }
    .ticket p { margin:9px 0 0; color:#475569; font-size:13px; line-height:1.35; }
    .owner-line { margin-top:7px; color:#667085; font-size:12px; font-weight:750; }
    .hidden { display:none !important; }
    .empty { border:1px dashed var(--line); border-radius:18px; padding:18px; text-align:center; color:var(--muted); background:rgba(255,255,255,.60); }
    .split { display:grid; grid-template-columns:minmax(315px, 405px) 1fr; gap:14px; }
    .service-workspace { display:grid; grid-template-columns:340px minmax(520px,1fr) 330px; min-height:0; height:100%; }
    .service-queue { min-width:0; border-right:1px solid var(--line); background:#fbf8f2; overflow:hidden; display:flex; flex-direction:column; }
    .service-queue-head { flex:0 0 auto; padding:12px 12px 8px; border-bottom:1px solid var(--line); background:#fffdf8; }
    .service-queue-head h3 { margin:0; font-size:13px; text-transform:uppercase; letter-spacing:.07em; color:#667085; }
    .service-queue-head p { margin:4px 0 0; font-size:12px; color:var(--muted); }
    .service-list { flex:1; min-height:0; overflow:auto; padding:10px; }
    .service-conversation { min-width:0; min-height:0; overflow:hidden; background:#efe7d7; }
    .list { display:flex; flex-direction:column; gap:10px; }
    .contact-card { border:1px solid var(--line); border-radius:16px; background:white; padding:12px; cursor:pointer; }
    .contact-card strong { display:block; } .contact-card small { color:var(--muted); }
    .detail { padding:0; overflow:hidden; min-height:640px; box-shadow:var(--shadow); }
    .detail-layout { display:grid; grid-template-columns:minmax(440px,1fr) 340px; min-height:640px; background:#f8f1e7; }
    .chat-shell { min-height:640px; display:flex; flex-direction:column; background:#eee5d6; }
    .chat-header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:16px; background:#fffdf8; border-bottom:1px solid var(--line); }
    .chat-name { font-size:19px; font-weight:950; letter-spacing:-.02em; }
    .chat-meta { margin-top:4px; color:var(--muted); font-size:13px; }
    .chat-ai { display:flex; gap:10px; align-items:center; justify-content:space-between; background:#fff7ed; border-bottom:1px solid #f5d6ad; padding:12px 16px; font-size:14px; }
    .messages { flex:1; padding:18px; max-height:520px; overflow:auto; background:linear-gradient(180deg,#efe7d7,#f8f2e8); }
    .msg { margin:8px 0; padding:10px 12px; border-radius:15px; max-width:78%; box-shadow:0 2px 8px rgba(31,41,51,.055); line-height:1.35; }
    .msg small { display:block; margin-bottom:4px; color:var(--muted); font-size:11px; font-weight:850; }
    .msg-media { margin-top:8px; }
    .msg-media img { max-width:320px; max-height:260px; border-radius:12px; display:block; }
    .msg-media audio, .msg-media video { width:min(360px,100%); display:block; }
    .msg-file { display:inline-flex; align-items:center; gap:8px; padding:9px 11px; border-radius:12px; background:#f1f5f7; color:#174354; font-weight:850; text-decoration:none; }
    .inbound { background:#ffffff; border-top-left-radius:4px; } .outbound { background:#dff2d3; margin-left:auto; border-top-right-radius:4px; }
    .quoted-selected { outline:2px solid rgba(13,79,99,.35); }
    .quoted-preview, .selected-quote { border-left:4px solid #0d4f63; background:rgba(255,255,255,.62); border-radius:10px; padding:8px 10px; margin:2px 0 8px; color:#31515d; font-size:12px; }
    .selected-quote { display:flex; justify-content:space-between; gap:10px; align-items:center; width:100%; box-sizing:border-box; }
    .selected-quote small { display:block; color:var(--muted); font-weight:850; margin-bottom:3px; }
    .selected-quote strong { display:block; font-size:13px; }
    .link-button { border:0; background:transparent; color:#0d4f63; padding:0; font:inherit; font-weight:850; cursor:pointer; text-decoration:underline; }
    .chat-composer { display:flex; gap:10px; padding:12px; background:#fffdf8; border-top:1px solid var(--line); align-items:flex-end; flex-wrap:wrap; }
    .chat-composer textarea { min-height:54px; max-height:150px; }
    .chat-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
    .context-rail { background:#fffdf8; border-left:1px solid var(--line); padding:16px; overflow:auto; }
    .rail-block { border:1px solid var(--line); background:#fff; border-radius:18px; padding:13px; margin-bottom:12px; }
    .rail-block h4 { margin:0 0 10px; font-size:13px; letter-spacing:.02em; text-transform:uppercase; color:#44566a; }
    .field-list { display:grid; gap:8px; font-size:13px; }
    .field-list div { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid #f0e6d9; padding-bottom:7px; }
    .field-list div:last-child { border-bottom:0; padding-bottom:0; }
    .field-list span { color:var(--muted); } .field-list strong { text-align:right; }
    .wa-card { border:1px solid var(--line); border-radius:18px; padding:16px; background:#f8fafb; }
    .wa-state { font-weight:950; } .wa-state.open { color:var(--ok); } .wa-state.qr, .wa-state.connecting { color:var(--warn); } .wa-state.offline, .wa-state.close { color:var(--bad); }
    .wa-table { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
    .wa-table th { text-align:left; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; border-bottom:1px solid var(--line); padding:9px 8px; }
    .wa-table td { border-bottom:1px solid #f0e6d9; padding:10px 8px; vertical-align:middle; }
    .wa-table code { background:#eef4f5; color:#174354; padding:3px 7px; border-radius:8px; font-size:12px; }
    .wa-qr-panel { margin-top:12px; border:1px solid var(--line); border-radius:18px; background:#f8fafb; padding:12px; text-align:center; }
    .wa-qr-panel iframe { width:min(460px,100%); height:560px; border:0; border-radius:14px; background:white; }
    .timeline { display:flex; flex-direction:column; gap:10px; }
    .step { display:grid; grid-template-columns:32px 1fr; gap:10px; align-items:start; }
    .dot { width:32px; height:32px; display:grid; place-items:center; border-radius:999px; background:#e8f1f4; color:#164154; font-weight:950; }
    .step strong { display:block; margin-bottom:3px; } .step p { margin:0; color:var(--muted); font-size:13px; line-height:1.35; }
    pre { white-space:pre-wrap; overflow:auto; background:#111827; color:#e5e7eb; border-radius:16px; padding:14px; max-height:260px; }

    .pipeline-board { display:grid; grid-template-columns:repeat(9, minmax(230px,1fr)); gap:12px; overflow:auto; height:calc(100vh - 190px); padding-bottom:10px; }
    .opp-col { background:#fbf7ef; border:1px solid var(--line); border-radius:18px; min-height:260px; padding:10px; }
    .opp-col.drag-over { outline:3px solid rgba(13,79,99,.18); }
    .opp-card { background:white; border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:16px; padding:12px; margin-bottom:10px; cursor:pointer; box-shadow:0 1px 0 #fff inset; }
    .opp-card.overdue { border-left-color:var(--bad); background:linear-gradient(180deg,#fff,#fff8f8); }
    .opp-card strong { display:block; margin-bottom:5px; }
    .opp-card small { color:var(--muted); line-height:1.35; display:block; }
    .opp-card select { margin-top:8px; padding:7px; border-radius:10px; font-size:12px; }
    .pipeline-layout { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:12px; min-height:0; }
    .opp-detail { max-height:calc(100vh - 160px); overflow:auto; }
    .day-summary { display:grid; grid-template-columns:repeat(3,minmax(140px,1fr)); gap:10px; margin-bottom:12px; }
    .day-board { display:grid; grid-template-columns:repeat(4,minmax(220px,1fr)); gap:12px; }
    .dashboard-scroll { height:calc(100vh - 130px); overflow:auto; padding:16px; }
    .dashboard-grid { display:grid; grid-template-columns:repeat(2,minmax(280px,1fr)); gap:14px; }
    .dashboard-wide { grid-column:1/-1; }
    .bar-row { display:grid; grid-template-columns:150px 1fr 70px; gap:10px; align-items:center; margin:8px 0; font-size:13px; }
    .bar { height:10px; border-radius:999px; background:#e8f1f4; overflow:hidden; }
    .bar > span { display:block; height:100%; background:var(--brand); }
    .data-quality { color:var(--warn); font-size:12px; font-weight:850; }
    .task-card { border:1px solid var(--line); border-left:4px solid var(--info); border-radius:16px; padding:12px; background:white; margin-bottom:10px; }
    .task-card.overdue { border-left-color:var(--bad); }
    .modal-backdrop { position:fixed; inset:0; z-index:10000; background:rgba(11,30,40,.42); display:grid; place-items:center; }
    .modal-card { width:min(560px,92vw); max-height:88vh; overflow:auto; background:#fffdf8; border:1px solid var(--line); border-radius:22px; box-shadow:0 24px 80px rgba(0,0,0,.24); padding:18px; }
    .modal-card h3 { margin:0 0 8px; }
    .modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }

    /* Professional operator workspace: Zendesk/Intercom-like density */
    .nav-toggle { margin-left:auto; width:34px; height:34px; padding:0; display:grid; place-items:center; background:rgba(255,255,255,.10); color:#e8f2f4; border:1px solid rgba(255,255,255,.12); }
    .app.nav-collapsed { grid-template-columns:76px 1fr; }
    .app.nav-collapsed .sidebar { padding:16px 10px; }
    .app.nav-collapsed .brand { justify-content:center; }
    .app.nav-collapsed .brand-text, .app.nav-collapsed .side-card, .app.nav-collapsed .nav-label { display:none; }
    .app.nav-collapsed .tab-btn { justify-content:center; padding:11px 8px; }
    .app.nav-collapsed .tab-count { min-width:22px; padding:2px 6px; }
    .app.nav-collapsed .nav-toggle { position:absolute; top:62px; left:21px; }

    .main { height:100vh; overflow:hidden; display:flex; flex-direction:column; }
    .topbar { flex:0 0 auto; align-items:center; padding:4px 2px 10px; margin-bottom:8px; border-bottom:1px solid rgba(231,220,203,.65); }
    .topbar h2 { font-size:24px; }
    .topbar p:not(.eyebrow) { display:none; }
    .toolbar button { padding:8px 11px; }

    .workspace-panel { flex:1; min-height:0; padding:0; overflow:hidden; border-radius:22px; }
    #tab-importacoes.tab-panel.active { overflow-y:auto; padding:18px; }
    #tab-atendimento.tab-panel.active { display:flex; flex-direction:column; min-height:0; }
    #tab-atendimento .overview { display:none; }
    #tab-atendimento .filters { flex:0 0 auto; margin:0; padding:10px 12px; grid-template-columns:minmax(220px, 1fr) 150px 150px 150px; border-bottom:1px solid var(--line); background:#fffdf8; }
    #tab-atendimento .filters input, #tab-atendimento .filters select { padding:9px 10px; border-radius:11px; font-size:13px; }
    #tab-atendimento .service-workspace { flex:1 1 auto; min-height:0; height:auto; }
    #tab-atendimento .detail { height:100%; min-height:0; border:0; border-radius:0; box-shadow:none; background:transparent; }
    #tab-atendimento .ticket { border-left-width:3px; padding:11px; margin-bottom:8px; }
    #tab-atendimento .ticket p { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
    .queue-ticket { border-left-color:#cbd5df; }
    .queue-ticket.needs-answer { border-left-color:var(--bad); background:linear-gradient(180deg,#fff,#fff8f8); }
    .queue-ticket.stale { box-shadow:0 0 0 2px rgba(161,58,58,.08) inset; }
    .queue-ticket .title-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
    .queue-ticket .title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .queue-ticket .last-line { color:#475569; font-size:12.5px; line-height:1.35; margin-top:7px; }
    .queue-ticket .quick-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:9px; }
    .queue-ticket .queue-name { color:#164154; font-size:11.5px; font-weight:900; background:#e8f1f4; border-radius:999px; padding:4px 8px; }
    .channel-pill { color:#6b3f13; font-size:11.5px; font-weight:900; background:#fff3d6; border-radius:999px; padding:4px 8px; white-space:nowrap; }
    .channel-line { color:#6b3f13; }
    .queue-ticket .age { color:#667085; font-size:11.5px; font-weight:850; }
    .queue-ticket .answer-dot { width:9px; height:9px; border-radius:999px; background:var(--bad); flex:0 0 auto; box-shadow:0 0 0 4px rgba(161,58,58,.10); }

    .detail-layout { height:100%; min-height:0; grid-template-columns:1fr; overflow:hidden; }
    .chat-shell { min-height:0; height:100%; display:flex; flex-direction:column; overflow:hidden; }
    .chat-shell.only-chat { border:0; box-shadow:none; }
    .chat-header { flex:0 0 auto; padding:12px 14px; }
    .chat-name { font-size:17px; }
    .chat-actions button { padding:7px 9px; font-size:12px; }
    .chat-actions select { padding:7px 9px; font-size:12px; }
    .chat-ai { flex:0 0 auto; padding:10px 14px; }
    .messages { flex:1 1 auto; max-height:none; min-height:0; overflow-y:auto; }
    .chat-composer { flex:0 0 auto; position:relative; z-index:0; }
    .chat-composer textarea { min-height:44px; max-height:96px; }
    .context-rail { padding:12px; }
    .rail-block { padding:11px; margin-bottom:10px; }
    .rail-block h4 { font-size:11px; margin-bottom:8px; }
    .field-list { gap:6px; font-size:12px; }
    .chat-composer { padding:10px; }
    .chat-composer textarea { min-height:44px; }

    #tab-atendimento .chat-shell > .panel { display:none; }

    @media (max-width: 1280px) { .service-workspace { grid-template-columns:310px minmax(430px,1fr) 300px; } .kanban { grid-template-columns:repeat(3,1fr); } }
    @media (max-width: 1160px) { .app { grid-template-columns:1fr; } .sidebar { position:static; height:auto; } .nav { display:grid; grid-template-columns:repeat(3,1fr); } .split, .grid.two, .service-workspace { grid-template-columns:1fr; } .service-queue { max-height:320px; border-right:0; border-bottom:1px solid var(--line); } .context-rail { border-left:0; border-top:1px solid var(--line); } .kanban { grid-template-columns:repeat(2,1fr); } }
    @media (max-width: 760px) { .main { padding:14px; } .topbar { flex-direction:column; } .overview, .grid.three, .filters, .kanban, .nav { grid-template-columns:1fr; } .chat-header, .chat-ai, .chat-composer { flex-direction:column; } .msg { max-width:95%; } }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline:3px solid rgba(13,79,99,.35); outline-offset:2px; }
.toast { border:1px solid var(--line); border-radius:14px; padding:11px 13px; background:#fffdf8; color:var(--ink); box-shadow:var(--shadow); font-weight:850; }
.toast.ok { border-left:4px solid var(--ok); }
.toast.error { border-left:4px solid var(--bad); background:#fff8f8; }
.modal-error { background:#fff0f0; color:#8b2c2c; border:1px solid #f0caca; border-radius:12px; padding:10px 12px; font-weight:850; }
@media (min-width: 1161px) and (max-width: 1450px) {
  .service-workspace { grid-template-columns:315px minmax(470px,1fr) 300px; }
  .main { padding:16px; }
}


/* Fase 1A — tela operacional */
.operational-home { height:100%; overflow:auto; padding:18px; }
.op-hero { display:flex; justify-content:space-between; gap:16px; align-items:center; background:linear-gradient(135deg,#fffdf8,#eef6f7); border:1px solid var(--line); border-radius:24px; padding:22px; margin-bottom:14px; box-shadow:var(--shadow); }
.op-hero h3 { margin:0; font-size:30px; letter-spacing:-.04em; }
.start-work { font-size:16px; padding:16px 24px; border-radius:16px; }
.op-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.op-metrics { grid-template-columns:repeat(3,minmax(130px,1fr)); margin:0; }
.work-card .title-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.composer-mode { display:flex; flex-direction:column; gap:6px; min-width:145px; align-self:stretch; justify-content:flex-end; }
.composer-mode button { padding:8px 9px; font-size:12px; }
.composer-mode button.active { background:var(--brand); color:white; }
.composer-feedback { width:100%; flex-basis:100%; font-size:12px; font-weight:850; padding:8px 10px; border-radius:10px; background:#fff8f8; color:#8b2c2c; border:1px solid #f0caca; }
.composer-feedback.ok { background:#f3fbf3; color:#236b36; border-color:#bfe4c4; }
.composer-feedback:empty { display:none; }
.msg.internal-note { background:#fff7d8; border:1px dashed #d6a94e; color:#4d3a12; margin-left:auto; margin-right:auto; max-width:84%; }
@media (max-width: 900px) { .op-hero, .op-grid { grid-template-columns:1fr; display:grid; } .op-metrics { grid-template-columns:1fr; } .composer-mode { flex-direction:row; min-width:0; width:100%; } }
/* Keep sidebar usable on short viewports */
.sidebar { overscroll-behavior:contain; scrollbar-width:thin; }
.nav { padding-bottom:12px; }


/* Fase 1A.2 — integração operacional */
#tab-atendimento .atendimento-filters { grid-template-columns:minmax(220px,1fr) 145px 145px 145px 160px; }
.task-card strong { display:block; margin-bottom:5px; }
.task-card small { display:block; color:var(--muted); line-height:1.35; margin-top:3px; }
.task-card p { margin:8px 0; line-height:1.35; }
.opp-action-head { border:1px solid var(--line); background:linear-gradient(180deg,#fff,#f8fafb); border-radius:18px; padding:13px; margin-bottom:12px; }
.opp-detail details.rail-block > summary { cursor:pointer; font-weight:900; color:#44566a; text-transform:uppercase; font-size:12px; }
#tab-contatos.tab-panel.active { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
#tab-contatos .people-tabs, #tab-contatos .filters { flex:0 0 auto; }
#tab-contatos .people-layout { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:minmax(320px,420px) minmax(0,1fr); gap:14px; align-items:stretch; }
#tab-contatos .people-layout > .panel { min-height:0; overflow:auto; }
#tab-contatos #contactsList { min-height:0; }
#tab-contatos #contactDetail { min-height:0; }
@media (max-width:1160px){
  #tab-contatos.tab-panel.active { overflow:auto; }
  #tab-contatos .people-layout { grid-template-columns:1fr; overflow:visible; }
  #tab-contatos .people-layout > .panel { overflow:visible; }
  #tab-atendimento .atendimento-filters { grid-template-columns:1fr; }
}
@media (max-width:760px){ #tab-atendimento .atendimento-filters { grid-template-columns:1fr; } }


/* Header compacto — Identidade 360 */
.topbar[data-identity360="1"] { min-height:38px; padding:2px 2px 8px; margin-bottom:6px; align-items:center; }
.topbar[data-identity360="1"] h2 { font-size:24px; margin:0; }
.topbar[data-identity360="1"] .compact-toolbar { align-items:center; gap:6px; }
.topbar[data-identity360="1"] .icon-refresh { width:36px; height:34px; padding:0; display:grid; place-items:center; font-size:18px; }
.user-menu { position:relative; }
.user-menu-pop { display:none; position:absolute; right:0; top:calc(100% + 6px); z-index:50; min-width:150px; background:#fffdf8; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); padding:10px; }
.user-menu.open .user-menu-pop { display:grid; gap:8px; }
.user-menu-pop small { color:var(--muted); font-weight:800; text-transform:capitalize; }
