/* Wasabi Tickets: visual próprio, inspirado em help desks clássicos (azul-oceano). */
:root {
    --ocean-900: #0f2a44;
    --ocean-800: #15385a;
    --ocean-700: #1d4b75;
    --ocean-600: #24629a;
    --ocean-500: #2b7bc0;
    --ocean-400: #4a96d6;
    --ocean-100: #e3f0fb;
    --ocean-50: #f2f8fd;

    --bg: #f1f4f8;
    --surface: #ffffff;
    --border: #dde3ea;
    --border-strong: #c7d0db;
    --text: #1f2d3d;
    --text-2: #5b6b7d;
    --text-3: #8795a5;

    --low: #7f93a8;
    --medium: #2b7bc0;
    --high: #e8931a;
    --critical: #d9363e;

    --st-new: #2b7bc0;
    --st-progress: #c77700;
    --st-waiting: #7a4fc2;
    --st-approved: #0b7a99;
    --st-resolved: #1e8a4c;

    --ai: #0d8a8a;
    --ok: #1e8a4c;
    --warn: #b36b00;
    --error: #c62f37;

    --radius: 8px;
    --shadow: 0 1px 2px rgba(15, 42, 68, .06), 0 1px 6px rgba(15, 42, 68, .05);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--ocean-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
code, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--ocean-50); border: 1px solid var(--ocean-100); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--ocean-900); color: #e3f0fb; padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
small { font-size: 12px; }
.muted { color: var(--text-2); }
.right { text-align: right; margin-left: auto; }
svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand svg, .auth-brand svg { stroke: none; }

/* ---------- estrutura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; flex: 0 0 230px; background: linear-gradient(180deg, var(--ocean-800), var(--ocean-900));
    color: #c9dbec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--ocean-400); }
.sidebar nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: #c9dbec; font-weight: 500; }
.sidebar nav a svg { width: 18px; height: 18px; opacity: .85; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--ocean-600); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 8px; }
.sidebar-foot .me { display: flex; align-items: center; gap: 9px; color: #fff; flex: 1; min-width: 0; padding: 4px; border-radius: 6px; }
.sidebar-foot .me:hover, .sidebar-foot .me.active { background: rgba(255, 255, 255, .07); text-decoration: none; }
.sidebar-foot .me span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-foot .me strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .me small { color: #9fb8d0; }
.sidebar-foot .link { color: #9fb8d0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); }
.search input { padding-left: 32px; background: var(--bg); border-color: transparent; }
.search input:focus { background: #fff; }
.topbar .btn-primary { margin-left: auto; }
.content { padding: 24px; max-width: 1280px; width: 100%; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.empty { text-align: center; padding: 48px 20px; }
.card.empty p { color: var(--text-2); font-size: 15px; }
.table-card { padding: 0; overflow-x: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
    border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: 6px;
    font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--ocean-50); border-color: var(--ocean-400); text-decoration: none; }
.btn-primary { background: var(--ocean-500); border-color: var(--ocean-500); color: #fff; }
.btn-primary:hover { background: var(--ocean-600); border-color: var(--ocean-600); color: #fff; }
.btn-danger { color: var(--error); border-color: #efc2c5; }
.btn-danger:hover { background: #fdf1f2; border-color: var(--error); }
.btn-small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 40px; }
.link { background: none; border: 0; padding: 0; color: var(--ocean-600); cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; color: var(--text); }
label small { color: var(--text-3); font-weight: 400; }
input, select, textarea {
    font: 14px var(--font); color: var(--text); background: #fff; border: 1px solid var(--border-strong);
    border-radius: 6px; padding: 7px 10px; width: 100%; min-height: 36px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ocean-400); box-shadow: 0 0 0 3px rgba(43, 123, 192, .18); }
input:disabled { background: var(--bg); color: var(--text-2); }
input[type="file"] { padding: 6px; background: var(--ocean-50); border-style: dashed; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 500; font-size: 13px; margin-bottom: 5px; padding: 0; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form.narrow { max-width: 480px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; max-width: 520px; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.alert-ok { background: #ecf8f1; border-color: #b9e2c9; color: #13633a; }
.alert-error { background: #fdf1f2; border-color: #f1c4c7; color: #9b2027; }
.alert-warn { background: #fff7e8; border-color: #f2d7a6; color: #7d4c00; }
.alert-info { background: var(--ocean-50); border-color: var(--ocean-100); color: var(--ocean-700); }

/* badges de status e prioridade */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f4; color: var(--text-2); white-space: nowrap; }
.status-new { background: #e3f0fb; color: var(--st-new); }
.status-in_progress { background: #fff2dc; color: var(--st-progress); }
.status-waiting { background: #f1eafb; color: var(--st-waiting); }
.status-approved { background: #e0f3f8; color: var(--st-approved); }
.status-resolved { background: #e5f5ec; color: var(--st-resolved); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.prio i { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.prio-low { color: var(--low); }
.prio-medium { color: var(--medium); }
.prio-high { color: var(--high); }
.prio-critical { color: var(--critical); }
.prio-critical i { box-shadow: 0 0 0 3px rgba(217, 54, 62, .18); }

.who { display: inline-flex; align-items: center; gap: 7px; }
.avatar {
    --h: 210; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 26px;
    border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; background: hsl(var(--h) 50% 45%);
}
.av-0 { --h: 210; } .av-1 { --h: 250; } .av-2 { --h: 340; } .av-3 { --h: 20; }
.av-4 { --h: 140; } .av-5 { --h: 280; } .av-6 { --h: 190; } .av-7 { --h: 45; }
.avatar-ai { border-radius: 7px; background: var(--ai); }
.followup .avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 13px; }

/* ---------- lista de tickets ---------- */
.stats { display: flex; gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 112px; color: var(--text); border-left: 3px solid; }
.stat:hover { text-decoration: none; border-color: var(--ocean-400); }
.stat strong { font-size: 20px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--text-2); }
.stat-new { border-left-color: var(--st-new); }
.stat-in_progress { border-left-color: var(--st-progress); }
.stat-waiting { border-left-color: var(--st-waiting); }
.stat-approved { border-left-color: var(--st-approved); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--ocean-600); border-bottom-color: var(--ocean-500); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #e7ecf1; font-size: 11.5px; text-align: center; color: var(--text-2); }
.tabs a.active .count { background: var(--ocean-100); color: var(--ocean-600); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px; }
.filters label { min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
.filter-actions { display: flex; align-items: center; gap: 10px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-href] { cursor: pointer; }
tbody tr:hover td { background: var(--ocean-50); }
tr.inactive td { opacity: .55; }
table.compact td, table.compact th { padding: 7px 10px; }
table.compact { margin-bottom: 4px; }
.tickets td:first-child { box-shadow: inset 3px 0 0 transparent; }
.tickets .prio-row-critical td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.tickets .prio-row-high td:first-child { box-shadow: inset 3px 0 0 var(--high); }
.col-id { width: 80px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.col-id a { color: var(--text-2); }
.col-subject a { color: var(--text); font-weight: 600; display: block; }
.col-subject small { display: block; margin-top: 1px; }
.col-time { white-space: nowrap; color: var(--text-2); }
.col-due { white-space: nowrap; }
.active-filter { width: 100%; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.active-filter strong { color: var(--text); }

/* data e tags */
.due { white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.overdue { color: var(--error); font-weight: 600; }
.head-badges .due { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: #eef1f4; color: var(--text-2); }
.head-badges .due.overdue { background: #fdf1f2; color: var(--error); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { --tag-bg: var(--ocean-50); --tag-border: var(--ocean-100); --tag-fg: var(--ocean-700); --tag-hover: var(--ocean-400); display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--tag-bg); border: 1px solid var(--tag-border); color: var(--tag-fg); font-size: 11.5px; line-height: 18px; white-space: nowrap; }
/* cor por tag: matiz calculado do texto (View::tagColor) */
.tag-c0 { --tag-h: 0; }
.tag-c1 { --tag-h: 15; }
.tag-c2 { --tag-h: 30; }
.tag-c3 { --tag-h: 45; }
.tag-c4 { --tag-h: 60; }
.tag-c5 { --tag-h: 75; }
.tag-c6 { --tag-h: 90; }
.tag-c7 { --tag-h: 105; }
.tag-c8 { --tag-h: 120; }
.tag-c9 { --tag-h: 135; }
.tag-c10 { --tag-h: 150; }
.tag-c11 { --tag-h: 165; }
.tag-c12 { --tag-h: 180; }
.tag-c13 { --tag-h: 195; }
.tag-c14 { --tag-h: 210; }
.tag-c15 { --tag-h: 225; }
.tag-c16 { --tag-h: 240; }
.tag-c17 { --tag-h: 255; }
.tag-c18 { --tag-h: 270; }
.tag-c19 { --tag-h: 285; }
.tag-c20 { --tag-h: 300; }
.tag-c21 { --tag-h: 315; }
.tag-c22 { --tag-h: 330; }
.tag-c23 { --tag-h: 345; }
.tag[class*="tag-c"] { --tag-bg: hsl(var(--tag-h) 75% 95%); --tag-border: hsl(var(--tag-h) 55% 80%); --tag-fg: hsl(var(--tag-h) 65% 27%); --tag-hover: hsl(var(--tag-h) 50% 50%); }
a.tag:hover { border-color: var(--tag-hover); text-decoration: none; }
.col-subject .tags a.tag { display: inline-block; font-weight: 400; color: var(--tag-fg); }
.tag-added { background: #e5f5ec; border-color: #b9e2c9; color: #13633a; }
.tag-removed { background: #fdf1f2; border-color: #f1c4c7; color: #9b2027; text-decoration: line-through; }
.ticket-side .tags { margin-top: 0; }
.due-fields { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.more .due-fields label { margin-bottom: 12px; }

/* calendário da barra lateral */
.cal { margin: 10px 12px 6px; padding: 10px 8px 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #fff; text-transform: capitalize; }
.cal-head a { color: #9fb8d0; padding: 0 8px; border-radius: 4px; font-size: 15px; line-height: 22px; }
.cal-head a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cal-grid > * { height: 24px; line-height: 24px; border-radius: 5px; color: #7f9ab4; }
.cal-grid .cal-dow { color: #6f8aa5; font-weight: 600; font-size: 10.5px; }
.cal-grid .today { box-shadow: inset 0 0 0 1px #9fb8d0; color: #fff; }
.cal-grid a.has-due { color: #fff; font-weight: 700; background: var(--ocean-600); }
.cal-grid a.has-due:hover { background: var(--ocean-500); text-decoration: none; }
.cal-grid a.late { background: var(--critical); }
.cal-grid a.late:hover { background: #e5525a; }
.cal-grid a.all-done { background: rgba(255, 255, 255, .1); color: #c9dbec; font-weight: 600; }
.cal-grid .selected { box-shadow: 0 0 0 2px #fff; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--text-2); }

/* ---------- ticket ---------- */
.ticket-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.ticket-ref { font-family: var(--mono); font-weight: 600; color: var(--ocean-700); }
.copy { font: 11.5px var(--font); color: var(--text-2); background: none; border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; cursor: pointer; }
.copy:hover { border-color: var(--ocean-400); color: var(--ocean-600); }
.copy.done, .btn.done { color: var(--ok); border-color: var(--ok); }
.head-badges { display: flex; gap: 10px; align-items: center; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.ticket-side { position: sticky; top: 74px; padding: 16px 18px; }
.ticket-side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; }
.ticket-side dt { color: var(--text-2); font-size: 12.5px; }
.ticket-side dd { margin: 0; }

.timeline { position: relative; }
.followup { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; position: relative; }
.followup.first { border-top: 3px solid var(--ocean-500); }
.followup.by-ai { border-left: 3px solid var(--ai); }
.followup header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #edf0f4; }
.followup .meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex: 1; min-width: 0; }
.followup .when { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.followup .when small { color: var(--text-3); }
.followup .body { padding: 14px 16px; overflow-wrap: anywhere; }
.changes { list-style: none; margin: 0; padding: 10px 16px; background: #fafbfd; border-bottom: 1px solid #edf0f4; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; }
.changes:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.changes .arrow { color: var(--text-3); margin: 0 3px; }
.changes q { quotes: "“" "”"; }
.files { list-style: none; margin: 0; padding: 0 16px 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.files li { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; max-width: 320px; }
.files li > a:first-child { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--text); min-width: 0; }
.files li > a:first-child:hover { background: var(--ocean-50); text-decoration: none; }
.files img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.files svg { width: 22px; height: 22px; color: var(--text-3); flex: 0 0 22px; }
.files span { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.files small { color: var(--text-3); }
.files .dl { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--border); color: var(--text-2); }
.files .dl:hover { background: var(--ocean-50); text-decoration: none; }

.reply { border-top: 3px solid var(--ocean-500); }
.reply textarea { margin-bottom: 12px; }
.reply-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.more { margin-bottom: 14px; }
.more summary { cursor: pointer; color: var(--ocean-600); font-weight: 500; margin-bottom: 10px; }
.more[open] summary { margin-bottom: 12px; }
.more label { margin-bottom: 12px; }

.prio-picker { display: flex; flex-direction: column; }
.prio-picker > div, .prio-picker { gap: 6px; }
.prio-picker .chip { display: inline-flex; }
.prio-picker { flex-direction: row; flex-wrap: wrap; align-items: center; }
.prio-picker legend { width: 100%; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--text); }
.chip span i { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.chip.prio-low span i { color: var(--low); } .chip.prio-medium span i { color: var(--medium); }
.chip.prio-high span i { color: var(--high); } .chip.prio-critical span i { color: var(--critical); }
.chip input:checked + span { border-color: currentColor; background: var(--ocean-50); }
.chip.prio-low input:checked + span { color: var(--low); }
.chip.prio-medium input:checked + span { color: var(--medium); }
.chip.prio-high input:checked + span { color: var(--high); }
.chip.prio-critical input:checked + span { color: var(--critical); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(43, 123, 192, .25); }

/* ---------- atividade ---------- */
.activity { padding: 6px 20px 14px; }
.activity .day { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 16px 0 4px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.feed > li:last-child { border-bottom: 0; }
.feed-body { flex: 1; min-width: 0; }
.feed-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.feed-line .ref { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.feed-line a:not(.feed-time) { color: var(--text); font-weight: 600; }
.feed-time { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.feed .changes { background: none; border: 0; padding: 4px 0 0; }
.feed .excerpt { margin: 4px 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.feed-files { display: inline-block; margin-top: 4px; font-size: 12.5px; }

/* ---------- outros ---------- */
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.copy-row code { font-size: 13.5px; padding: 6px 10px; word-break: break-all; }
.token-box code { background: #fff; }
.steps ol { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.agent-list { list-style: none; margin: 0; padding: 0; }
.agent-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #edf0f4; }
.agent-list li:last-child { border-bottom: 0; }
.danger-zone { border-color: #f1c4c7; }
.danger-zone form { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* ---------- login / consentimento ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--ocean-600), transparent), linear-gradient(160deg, var(--ocean-800), var(--ocean-900)); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 12px; padding: 30px 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 14px; }
.auth-card.wide { max-width: 520px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--ocean-600); }
.auth-brand h1 { color: var(--text); }
.consent-client { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--ocean-50); border: 1px solid var(--ocean-100); border-radius: 8px; }
.consent-client strong { display: block; font-size: 15px; }
.actor-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.actor { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 400; }
.actor:has(input:checked) { border-color: var(--ocean-500); background: var(--ocean-50); box-shadow: 0 0 0 1px var(--ocean-500); }
.actor input { width: auto; min-height: 0; margin: 0; accent-color: var(--ocean-500); }
.actor span { display: flex; flex-direction: column; line-height: 1.3; }
.actor small { color: var(--text-2); }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .btn { flex: 1; height: 40px; }
.fine { font-size: 12px; color: var(--text-2); }

/* ---------- responsivo ---------- */
@media (max-width: 980px) {
    .ticket-layout { grid-template-columns: 1fr; }
    .ticket-side { position: static; order: -1; }
    .ticket-side dl { grid-template-columns: repeat(2, auto 1fr); }
}
@media (max-width: 760px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .menu-btn { display: block; }
    .topbar { padding: 8px 16px; }
    .topbar .btn-primary { display: none; }
    .content { padding: 16px; }
    .row, .reply-fields { grid-template-columns: 1fr; }
    .due-fields { grid-template-columns: 1fr 110px; }
    .stats { width: 100%; }
    .stat { flex: 1; min-width: 0; }
    .col-who, .col-time, .col-prio { display: none; }
    .ticket-side dl { grid-template-columns: auto 1fr; }
    .followup header { flex-wrap: wrap; }
    .filters label { min-width: calc(50% - 6px); flex: 1; }
}
