:root { color-scheme: dark; --bg:#0b1220; --panel:#111b2e; --panel-2:#17243a; --line:#263650; --text:#edf3ff; --muted:#93a4bf; --primary:#5b8cff; --success:#35c48b; --danger:#f06d7a; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:linear-gradient(135deg,#0b1220,#0f1a2d); color:var(--text); font:15px/1.5 Inter,Segoe UI,Arial,sans-serif; }
button,input,textarea { font:inherit; }
button { cursor:pointer; }
.hidden { display:none !important; }
.muted { color:var(--muted); }
.eyebrow { margin:0 0 4px; color:#7fa4ff; font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.brand-mark { display:grid; place-items:center; width:48px; height:48px; border-radius:14px; background:linear-gradient(135deg,#6d9aff,#7d5cff); color:white; font-size:26px; font-weight:800; box-shadow:0 8px 24px #446cd455; }
.brand-mark.small { width:30px; height:30px; border-radius:9px; font-size:17px; }
.login-screen { display:grid; min-height:100vh; place-items:center; padding:24px; }
.login-card { width:min(100%,500px); padding:36px; border:1px solid var(--line); border-radius:22px; background:#111b2eef; box-shadow:0 24px 80px #0005; text-align:center; }
.login-card .brand-mark { margin:0 auto 24px; }
.login-card label { text-align:left; }
.login-card input { text-align:left; }
.login-card .form-message { text-align:center; }
h1,h2,h3 { line-height:1.2; }
h1 { margin:0 0 8px; font-size:28px; }
h2 { margin:0; font-size:23px; }
label { display:block; margin:20px 0 7px; color:#c8d5e9; font-weight:600; }
input,textarea,select { width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 12px; background:#0d1728; color:var(--text); outline:none; }
input:focus,textarea:focus,select:focus { border-color:var(--primary); box-shadow:0 0 0 3px #5b8cff22; }
textarea { min-height:130px; resize:vertical; }
.button { border:1px solid transparent; border-radius:10px; padding:10px 15px; color:var(--text); font-weight:700; transition:.15s ease; }
.button:hover { transform:translateY(-1px); filter:brightness(1.08); }
.button.primary { background:var(--primary); }
.button.ghost { border-color:var(--line); background:transparent; }
.button.danger { background:#7f2938; }
.button.full { width:100%; margin-top:22px; }
.form-message { min-height:22px; margin:10px 0 0; font-size:13px; }
.error { color:var(--danger); }
.success { color:var(--success); }
.app-shell { display:flex; min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; z-index:10; width:250px; padding:24px 14px; border-right:1px solid var(--line); background:#0d1728; }
.sidebar-brand { display:flex; align-items:center; gap:10px; padding:0 12px 30px; font-size:18px; font-weight:800; }
.nav { display:grid; gap:6px; }
.nav a { display:flex; align-items:center; gap:12px; padding:12px; border-radius:10px; color:var(--muted); text-decoration:none; }
.nav a:hover,.nav a.active { background:var(--panel-2); color:var(--text); }
.nav a.active { box-shadow:inset 3px 0 var(--primary); }
.main-content { flex:1; margin-left:250px; padding:0 34px 40px; width:calc(100% - 250px); }
.topbar { display:flex; align-items:center; gap:18px; min-height:100px; border-bottom:1px solid var(--line); }
.topbar-actions { display:flex; align-items:center; gap:12px; margin-left:auto; }
.user-pill { padding:7px 11px; border:1px solid var(--line); border-radius:99px; color:#c8d5e9; }
.icon-button { display:none; border:0; background:transparent; color:var(--text); font-size:22px; }
.view { width:100%; padding-top:30px; }
.view-toolbar { display:flex; justify-content:flex-end; margin-bottom:16px; }
.view-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.toolbar > * { flex:1 1 150px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; background:var(--panel); width:100%; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th,td { padding:13px 15px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.table-sort { display:inline-flex; align-items:center; gap:5px; padding:0; border:0; background:transparent; color:inherit; font:inherit; font-weight:700; letter-spacing:inherit; text-transform:inherit; }
.table-sort:hover,.table-sort.active { color:var(--text); }
.sort-indicator { color:#7fa4ff; font-size:14px; line-height:1; }
tbody tr { cursor:pointer; transition:background .15s; }
tbody tr:hover { background:var(--panel-2); }
tbody tr:last-child td { border-bottom:0; }
.row-actions { display:flex; gap:6px; white-space:nowrap; }
.button.small { padding:6px 9px; font-size:12px; }
.empty-state { padding:36px; text-align:center; color:var(--muted); }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:14px; color:var(--muted); font-size:13px; }
.pagination-controls { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.pagination-size { display:flex; align-items:center; gap:7px; color:var(--muted); white-space:nowrap; font-size:12px; font-weight:600; }
.pagination-size select { width:auto; min-width:64px; padding:6px 8px; }
.pagination-page { min-width:112px; text-align:center; color:#c8d5e9; }
.pagination .button:disabled { cursor:not-allowed; opacity:.45; transform:none; filter:none; }
.modal-backdrop { position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:20px; background:#020711bb; }
.modal { width:min(100%,800px); max-height:calc(100vh - 40px); overflow:auto; border:1px solid var(--line); border-radius:18px; background:var(--panel); box-shadow:0 25px 90px #0008; }
.modal-header,.modal-footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 22px; border-bottom:1px solid var(--line); }
.modal-header h3 { margin:0; }.modal-footer { justify-content:flex-end; border-top:1px solid var(--line); border-bottom:0; }
.modal-body { padding:4px 22px 22px; }.modal-close { border:0; background:transparent; color:var(--muted); font-size:22px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin:18px 0; }.detail-item strong { display:block; color:var(--muted); font-size:12px; margin-bottom:3px; }
.attachments { display:flex; flex-wrap:wrap; gap:8px; }.attachments a { color:#9dbaff; }
.timeline { display:grid; gap:0; margin:10px 0 0; }
.tl-item { display:flex; gap:12px; padding:6px 0; }
.tl-item > div { display:flex; flex-direction:column; gap:2px; }
.tl-dot { width:10px; height:10px; margin-top:6px; border-radius:50%; background:var(--primary); flex:0 0 auto; }
.tl-dot.done { background:var(--success); }
.attachments-list { display:grid; gap:8px; margin:10px 0 0; }
.att-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#0d1728; }
.att-row a { color:#9dbaff; text-decoration:none; white-space:nowrap; }
.att-row .small { font-size:12px; }
.summary { margin:0 0 18px; color:var(--muted); }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:18px; width:100%; }
.grid.charts { grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); margin-top:18px; }
.card { padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--panel); width:100%; }
.card h3 { margin:0 0 8px; }
.card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.center { text-align:center; }
.chart-bars { display:grid; gap:10px; }
.bar-row { display:grid; grid-template-columns:120px 1fr 46px; align-items:center; gap:10px; }
.bar-label { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-track { height:12px; border-radius:99px; background:var(--panel-2); overflow:hidden; }
.bar-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#5b8cff,#7d5cff); transition:width .4s ease; }
.bar-fill.accent { background:linear-gradient(90deg,#35c48b,#5b8cff); }
.bar-value { color:var(--text); font-size:13px; font-weight:700; text-align:right; }
.donut-wrap { display:grid; place-items:center; position:relative; padding:10px 0 4px; }
.donut { width:132px; height:132px; border-radius:50%; background:conic-gradient(var(--success) 0%, var(--danger) 0% 100%); }
.donut-center { position:absolute; display:grid; place-items:center; width:96px; height:96px; border-radius:50%; background:var(--panel); text-align:center; }
.donut-center strong { font-size:22px; }
.donut-center span { font-size:11px; }
.alert-list { display:grid; gap:10px; min-width:0; overflow:hidden; }
.alert-item { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--panel-2); min-width:0; overflow:hidden; }
.alert-item.overdue { border-color:#7f2938; background:#2a1420; }
.alert-item .badge { flex-shrink:0; }
.alert-body { flex:1; min-width:0; }
.alert-body strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alert-body .muted { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alert-time { color:var(--muted); font-size:12px; white-space:nowrap; flex-shrink:0; margin-left:auto; }
.status-row { display:flex; align-items:center; gap:12px; margin:18px 0; }
.detail-section { margin-top:18px; border-top:1px solid var(--line); padding-top:14px; }
.detail-section > strong { display:block; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:10px; }
.contact-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); }
.contact-row:last-child { border-bottom:0; }
.contact-name { font-weight:600; }
.perm-picker { position:relative; }
.perm-trigger { display:flex; align-items:center; gap:10px; width:100%; padding:10px 12px; background:var(--panel-2); border:1px solid var(--line); border-radius:8px; color:var(--text); cursor:pointer; font-size:13px; }
.perm-trigger:hover { border-color:var(--accent); }
.perm-tags { display:flex; flex-wrap:wrap; gap:6px; flex:1; }
.perm-tag { background:#29374d; color:#c4d2e7; border-radius:999px; padding:3px 10px; font-size:11px; font-weight:600; }
.perm-caret { color:var(--muted); }
.perm-dropdown { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:60; background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:8px; max-height:260px; overflow:auto; box-shadow:0 12px 32px rgba(0,0,0,.45); }
.perm-hint { margin:4px 8px 8px; font-size:12px; }
.perm-options { display:flex; flex-direction:column; gap:2px; max-height:220px; overflow:auto; }
.perm-option { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:6px; cursor:pointer; }
.perm-option:hover { background:rgba(127,164,255,.12); }
.perm-option.selected { background:rgba(127,164,255,.22); }
.perm-label { font-size:13px; flex:1; }
.perm-option code { font-size:11px; color:var(--muted); }
.perm-check { color:#85f1c6; font-weight:700; }
.perm-search { width:100%; margin-bottom:8px; }

/* Permissões como checkboxes agrupados (contato) */
.form-cols { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.form-col-permissions { border-left:1px solid var(--line); padding-left:24px; }
.perm-picker-checkboxes { display:flex; flex-direction:column; gap:16px; }
.perm-group-title { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 8px; }
.perm-check-list { display:grid; grid-template-columns:1fr 1fr; gap:4px 14px; }
.perm-check-item { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); cursor:pointer; padding:4px 0; }
.perm-check-item input[type="checkbox"] { width:16px; height:16px; accent-color:var(--accent); margin:0; flex-shrink:0; }

/* Checklist de conclusão no detalhe da tarefa */
.checklist-list { display:flex; flex-direction:column; gap:6px; margin:6px 0 14px; }
.checklist-item { display:flex; align-items:center; gap:8px; padding:7px 10px; background:var(--panel-2); border:1px solid var(--line); border-radius:8px; font-size:13px; }
.checklist-item.checked { border-color:rgba(133,241,198,.4); }
.checklist-check { width:18px; text-align:center; color:var(--muted); font-weight:700; flex-shrink:0; }
.checklist-item.checked .checklist-check { color:#85f1c6; }
.checklist-label { flex:1; }
@media (max-width:760px) { .form-cols { grid-template-columns:1fr; }.form-col-permissions { border-left:0; padding-left:0; }.perm-check-list { grid-template-columns:1fr; } }
.config-fields { display:grid; gap:14px; margin-top:10px; }
.config-field { display:flex; flex-direction:column; gap:6px; }
.config-field span, .config-label { font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.config-field input, .config-field select { width:100%; }
.config-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.config-row .config-label { text-transform:none; letter-spacing:0; font-weight:600; }
.kill-impact { font-size:12px; color:#f1c685; margin-top:-6px; }
.switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:#3a4a63; border-radius:24px; transition:.2s; }
.switch .slider::before { content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#c4d2e7; border-radius:50%; transition:.2s; }
.switch input:checked + .slider { background:#d95b5b; }
.switch input:checked + .slider::before { transform:translateX(20px); background:#fff; }
.badge { display:inline-flex; align-items:center; gap:7px; padding:5px 9px; border-radius:99px; font-size:12px; font-weight:700; }
.badge.success { background:#1a5a45; color:#85f1c6; }.badge.danger { background:#612b39; color:#ffadb7; }.badge.neutral { background:#29374d; color:#c4d2e7; }.badge.warning { background:#5a4a1a; color:#f1c685; }
.toast { position:fixed; right:24px; bottom:24px; z-index:30; max-width:340px; padding:13px 16px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); opacity:0; transform:translateY(10px); pointer-events:none; transition:.2s; }

/* ===== Dashboard: alertas em destaque ===== */
.dash-alerts-card { margin-top:18px; }
.dash-alerts-card .card-head { margin-bottom:6px; }

/* ===== Tarefas: código em destaque + resumo largo ===== */
.task-code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#7fa4ff; font-size:13px; letter-spacing:.02em; white-space:nowrap; }
td.task-summary-cell { max-width:380px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ===== Menu de ações compacto (⋯) ===== */
.row-menu { position:relative; }
.row-menu-dropdown { position:absolute; top:calc(100% + 6px); right:0; z-index:60; display:none; min-width:150px; padding:6px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); box-shadow:0 12px 32px rgba(0,0,0,.45); }
.row-menu-dropdown.open { display:flex; flex-direction:column; gap:2px; }
.row-menu-item { padding:8px 10px; border:0; border-radius:6px; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.row-menu-item:hover { background:rgba(127,164,255,.12); }

/* ===== Aprovações: pendentes vs histórico ===== */
.approval-section { margin-bottom:28px; }
.approval-section .card-head { margin-bottom:12px; }
.approval-pending-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.approval-pending-card { display:flex; flex-direction:column; gap:4px; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--panel-2); }
.approval-pending-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.approval-task-link { color:#9dbaff; font-weight:700; text-decoration:none; }
.approval-task-link:hover { text-decoration:underline; }
.approval-actions { margin-top:10px; }

/* ===== Detalhe da tarefa: faixa de resumo + blocos ===== */
.task-summary-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:18px; padding:18px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(135deg,#17243a,#111b2e); }
.task-summary-item { display:flex; flex-direction:column; gap:4px; }
.task-summary-item > span { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.task-summary-item > strong { font-size:16px; }
.task-summary-item .badge { align-self:flex-start; }
.detail-blocks { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:18px; align-items:start; margin-bottom:18px; }
.detail-blocks .card { margin-bottom:0; }
.detail-timeline-card { margin-bottom:18px; }

/* ===== Configurações/Julius: colapsáveis + salvar fixo ===== */
details.config-collapsible { padding:0 22px 18px; }
.config-collapsible summary { cursor:pointer; display:flex; flex-direction:column; gap:2px; padding:16px 0 6px; list-style:none; }
.config-collapsible summary::-webkit-details-marker { display:none; }
.config-collapsible summary::before { content:'▸'; color:#7fa4ff; font-size:13px; position:absolute; margin-left:-18px; transition:transform .15s; }
.config-collapsible[open] summary::before { transform:rotate(90deg); }
.config-summary-hint { font-size:12px; color:var(--muted); font-weight:500; text-transform:none; letter-spacing:0; }
.sticky-save-bar { position:sticky; bottom:16px; z-index:20; display:flex; justify-content:flex-end; margin-top:20px; }
.sticky-save-bar .button { box-shadow:0 10px 30px rgba(0,0,0,.5); }

/* ===== Responsivo: cards em telas pequenas ===== */
@media (max-width:760px) {
  .table-wrap { border:0; border-radius:0; background:transparent; }
  table { min-width:0; }
  thead { display:none; }
  tbody, tr, td { display:block; width:100%; }
  tbody tr { margin-bottom:12px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); cursor:default; }
  tbody tr:hover { background:var(--panel); }
  td { border-bottom:1px solid var(--line); padding:8px 0; }
  td:first-child { font-weight:700; }
  td:empty { display:none; }
  .row-actions { margin-top:8px; }
  td.task-summary-cell { max-width:none; white-space:normal; }
}
.toast.show { opacity:1; transform:none; }
@media (max-width:760px) { .sidebar { transform:translateX(-100%); transition:.2s; }.sidebar.open { transform:none; }.main-content { margin-left:0; padding:0 18px 30px; width:100%; }.icon-button { display:block; }.topbar-actions .user-pill { display:none; }.login-card { padding:28px 22px; }.detail-grid { grid-template-columns:1fr; }.pagination { align-items:stretch; flex-direction:column; }.pagination-controls { justify-content:space-between; } }
