.shell { grid-template-columns: 90px minmax(0, 1fr); background: #fff; }
.main > [hidden] { display: none; }
.rail { background: #fff; color: #0c4a54; border-right: 1px solid #e1ebec; padding-inline: 7px; }
.rail .logo { background: #0c4a54; color: #fff; margin: 24px 0 26px; }
.rail-action { width: 100%; height: 56px; margin-bottom: 6px; align-content: center; gap: 3px; color: #435f64; font-size: .73rem; line-height: 1.2; font-weight: 700; }
.rail-action.active, .rail-action:hover { color: #0c4a54; background: #edf7f6; }
.rail-action.active::before { left: -7px; height: 27px; background: #0d8280; }
.rail-bottom { width: 100%; }
.connection:not(.off) { background: #f1f8f7; color: #345c60; border-color: #deebeb; }
.connection:not(.off) .dot { background: #0d8280; }
.list-toolbar { color: #4e6267; }
#connect-dialog { border: 1px solid #dce8e9; border-radius: 14px; max-width: min(450px, calc(100% - 24px)); padding: 22px; color: #1c3236; }
#connect-dialog::backdrop { background: #163b43aa; }
#connect-dialog h2 { color: #0c4a54; font-size: 1.22rem; margin-bottom: 8px; }
#connect-dialog p { margin-bottom: 14px; }
#connect-dialog .field { font-size: .875rem; }
.connect-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
#openai-setup > p { margin-bottom: 12px; }
#openai-setup a { color: #0a6766; }
.send-test-dialog a { color: #0a6766; }
.send-test-dialog form > p { margin-bottom: 10px; }
.send-test-dialog [hidden] { display: none; }
.send-test-details { display: grid; gap: 8px; margin: 0 0 12px; }
.send-test-details > div { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 8px; }
.send-test-details dt { color: var(--muted); font-weight: 700; }
.send-test-details dd { margin: 0; overflow-wrap: anywhere; }
.send-test-text { margin: 0 0 14px; padding: 12px; border-radius: 8px; background: #f1f8f7; white-space: pre-wrap; }
.send-test-notice { margin-top: 12px; }

.operations { min-width: 0; min-height: 0; overflow: auto; background: #fff; color: #1c3236; }
.ops-frame { margin-inline: auto; width: min(100%, 1100px); padding: 32px clamp(16px, 4vw, 44px) 48px; }
.task-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.task-head h2 { color: #0c4a54; font: 800 clamp(1.55rem, 2.2vw, 1.9rem)/1.2 'Manrope', system-ui, sans-serif; letter-spacing: -.055em; }
.task-head p, .task-meta { color: #4e6267; font-size: .875rem; }
.task-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ops-message { max-width: 54ch; padding-block: 16px; color: #4e6267; }
.task-status-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.task-status-filters button { border: 1px solid #dce8e9; border-radius: 8px; color: #23454b; background: #fff; min-height: 36px; padding: 5px 10px; font-size: .875rem; font-weight: 700; }
.task-status-filters button:hover, .task-status-filters button[aria-pressed="true"] { border-color: #b8dedd; background: #edf7f6; color: #0c4a54; }
.task-status-filters span { margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; color: #4e6267; }
.task-filters { display: grid; grid-template-columns: minmax(0,1.55fr) repeat(3,minmax(0,1fr)) auto; align-items: end; gap: 10px 12px; margin-bottom: 11px; padding: 11px 13px; border: 1px solid #e0e9ea; border-radius: 10px; background: #f7faf9; }
.task-filters label { min-width: 0; display: grid; gap: 4px; margin: 0; font-size: .81rem; font-weight: 700; color: #376168; }
.task-filters input, .task-filters select { width: 100%; min-width: 0; min-height: 36px; padding: 6px 9px; border: 1px solid #cfe0e1; border-radius: 7px; color: #19363c; background: #fff; font-size: .86rem; }
.task-filter-actions { display: flex; align-items: center; gap: 6px; }
.task-filter-actions button { min-height: 36px; }
.task-results { color: #4e6267; font-size: .85rem; font-variant-numeric: tabular-nums; margin-bottom: 7px; }

.task-table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: thin; border: 1px solid #e0e9ea; border-radius: 11px; }
.task-table { width: 100%; min-width: 45rem; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.task-table th, .task-table td { padding: 10px clamp(10px,1.3vw,15px); vertical-align: middle; text-align: left; }
.task-table thead { background: #f5f8f8; color: #47656a; font-size: .83rem; }
.task-table th:first-child { width: 32%; }
.task-table th[aria-sort="ascending"], .task-table th[aria-sort="descending"] { color: #0c4a54; background: #eaf5f4; }
.task-sort { display: inline-flex; align-items: center; gap: 5px; padding: 5px 3px; border: 0; border-radius: 5px; color: inherit; background: transparent; font: inherit; white-space: nowrap; }
.task-sort:hover { color: #0c4a54; background: #eaf5f4; }
.task-sort-icon { font-size: .75rem; line-height: 1; color: #36797d; }
.task-table td { border-top: 1px solid #edf2f2; font-size: .86rem; }
.task-table tbody > tr:first-child td { border-top-color: #dce8e9; }
.task-table tbody > tr:not(.task-table-detail):hover, .task-table tbody > tr.expanded { background: #f6fafa; }
.task-table .task-table-detail > td { padding: 0; background: #f5fafa; }
.task-table-detail .task-detail { border-top: 0; }
.task-table .task-empty, .task-empty td { padding: 18px 14px; color: #4e6267; }
.task-line { display: block; width: 100%; min-height: 36px; border: 0; padding: 2px 0; background: transparent; text-align: left; color: #1c3236; }
.task-line:hover strong { color: #0a6766; text-decoration: underline; text-underline-offset: 2px; }
.task-line:focus-visible { outline-offset: 3px; }
.task-details-button { min-height: 34px; padding: 5px 8px; border: 1px solid #dce8e9; border-radius: 7px; background: #fff; color: #0c4a54; font-size: .81rem; font-weight: 700; }
.task-details-button:hover, .task-details-button[aria-expanded="true"] { border-color: #b8dedd; background: #edf7f6; }
.task-title, .task-timer { display: grid; justify-items: start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.task-title strong { color: #19363c; font-size: .98rem; }
.task-title small, .task-timer small { color: #4e6267; font-size: .86rem; }
.task-priority, .task-status, .task-scheduled { display: inline-block; width: fit-content; border-radius: 5px; padding: 2px 7px; font-size: .8rem; line-height: 1.38; font-weight: 700; white-space: nowrap; }
.task-status-cell > .task-status, .task-status-cell > .task-scheduled { display: block; }
.task-status-cell > .task-scheduled:not(:first-child) { margin-top: 4px; }
.task-status, .task-priority.high, .task-scheduled { color: #0c4a54; background: #eaf5f4; }
.task-status.atrasado { color: #883a2b; background: #fbedeb; }
.task-status.cliente { color: #35576c; background: #eaf3f9; }
.task-status.follow-up { color: #704c0f; background: #fbf2df; }
.task-status.resolvido, .task-priority { color: #4d6066; background: #f0f4f4; }
.task-delay { color: #883a2b; white-space: nowrap; }
.task-timer :is(progress,.task-progress) { width: min(100%, 150px); height: 5px; margin-top: 2px; border: 0; border-radius: 6px; background-color: #e4eeee; color: #0d8280; }
.task-timer progress::-webkit-progress-bar { background: #e4eeee; border-radius: 6px; }
.task-timer progress::-webkit-progress-value { background: currentColor; border-radius: 6px; }
.task-timer progress::-moz-progress-bar { background: currentColor; border-radius: 6px; }
.task-table tr:has(.task-status.atrasado) progress { color: #b06452; }
.task-table tr:has(.task-status.follow-up) progress { color: #a67b34; }
.task-detail { padding: 14px clamp(10px, 2vw, 22px) 17px; border-top: 1px solid #e0e9ea; background: #f5fafa; overflow-wrap: anywhere; }
.task-detail strong { color: #0c4a54; }
.task-detail p { margin-top: 4px; }
.task-detail-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin-top: 12px; }
.task-priority-field { display: grid; gap: 3px; font-size: .875rem; color: #36585d; font-weight: 700; }
.task-priority-field select { min-height: 34px; border: 1px solid #cddfe0; border-radius: 8px; background: #fff; color: #19363c; padding: 3px 8px; }
.task-evidence { margin: 7px 0 0; padding-left: 20px; color: #4e6267; font-size: .875rem; }
.task-evidence .text-button { text-align: left; white-space: normal; }

@media (max-width: 820px) {
  .task-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 590px) {
  .shell { display: flex; flex-direction: column; }
  .shell .rail { order: 2; display: flex; flex-direction: row; padding: 4px 6px max(4px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid #e1ebec; }
  .rail .logo, .rail .rail-bottom { display: none; }
  .rail-action { margin: 0; height: 48px; }
  .rail-action.active::before { display: none; }
  .main { flex: 1; }
  .topbar h1 { font-size: 1.12rem; margin: 0; }
  .topbar:has(.connect-whatsync) { flex-wrap: wrap; row-gap: 7px; }
  .topbar:has([data-send-test]), .top-actions:has([data-send-test]) { flex-wrap: wrap; row-gap: 7px; }
  .topbar .connection { font-size: .66rem; }
  .topbar .profile { display: none; }
  .ops-frame { padding-block: 22px; }
  .task-head { margin-bottom: 13px; }
  .task-filters { padding: 9px; }
  .task-table th, .task-table td { padding: 8px 10px; }
}
