/* Projectes · Sala — estils */
:root {
  --bg: #f3f4f5;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --border: #e1e4e8;
  --border-strong: #c9ced4;
  --text: #1f2328;
  --text-2: #57606a;
  --text-3: #7d8590;
  --side: #262a30;
  --side-2: #30353c;
  --side-text: #c9d1d9;
  --accent: #2e7d73;
  --accent-strong: #246860;
  --accent-soft: #e3f1ef;
  --warn: #a8573d;
  --warn-soft: #f7e9e4;
  --ok: #4f8a52;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .06), 0 2px 8px rgba(31, 35, 40, .05);
  --shadow-lg: 0 10px 40px rgba(20, 24, 28, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191d;
    --surface: #1e2227;
    --surface-2: #23282e;
    --border: #30363d;
    --border-strong: #444c56;
    --text: #e6edf3;
    --text-2: #a5afba;
    --text-3: #7d8590;
    --side: #111317;
    --side-2: #1c2026;
    --accent: #5fb3a6;
    --accent-strong: #7fc4b8;
    --accent-soft: #1d3330;
    --warn: #e08d70;
    --warn-soft: #3a2620;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-3); }
.hidden { display: none !important; }

/* ---------- Controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0e1512; } }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--warn); }
.btn.sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 8px; padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 70px; }
input[type=color] { width: 34px; height: 30px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px; background: var(--surface); cursor: pointer; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-text); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 650; font-size: 15px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--side-2); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { display: block; font-weight: 450; color: #8b949e; font-size: 11.5px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--side-text); font-weight: 520; text-decoration: none;
}
.nav a:hover { background: var(--side-2); text-decoration: none; }
.nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 #7fc4b8; }
.nav svg { width: 17px; height: 17px; opacity: .85; flex: none; }
.side-foot { margin-top: auto; border-top: 1px solid #3a4048; padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 11.5px; color: #8b949e; }
.side-foot .btn.ghost { color: #8b949e; width: 100%; justify-content: flex-start; }
.side-foot .btn.ghost:hover { background: var(--side-2); color: #fff; }

main { padding: 26px 32px 60px; min-width: 0; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-2 > *, .split > * { min-width: 0; }
.actions select { width: auto; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.empty { color: var(--text-3); padding: 14px 0; text-align: center; font-size: 13px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--text-2); font-size: 12.5px; }
.kpi.warn .v { color: var(--warn); }

.dist { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); margin: 4px 0 10px; }
.dist span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.legend b { color: var(--text); font-weight: 650; margin-left: 4px; }

/* ---------- Pills, avatars ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.tag { display: inline-block; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-3); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 10.5px; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.avatar.sm { width: 19px; height: 19px; font-size: 9px; }
.person { display: inline-flex; align-items: center; gap: 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag.late { color: var(--warn); background: var(--warn-soft); border-color: transparent; font-weight: 600; }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }
.due { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.due.late { color: var(--warn); font-weight: 650; }
.due.soon { color: var(--accent); font-weight: 600; }
.bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* ---------- Tasques ---------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 520; word-wrap: break-word; }
.task.fet .task-title { color: var(--text-3); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--text-2); }
.task-notes { font-size: 12.5px; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
.status-chip { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.add-task { display: grid; grid-template-columns: 1fr 160px 140px auto; gap: 8px; margin-bottom: 8px; }

/* ---------- Bitàcola ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .msg { white-space: pre-wrap; word-wrap: break-word; }
.feed .meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.feed .note .msg { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.note-box { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.note-box textarea { min-height: 44px; }

/* ---------- Cartera ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { width: 240px; }
.toolbar select { width: auto; min-width: 140px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 12px; cursor: pointer; color: var(--text-2); font-weight: 550; }
.seg button.on { background: var(--side); color: #fff; }
.spacer { flex: 1; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 650; font-size: 13px; }
.col-head .n { color: var(--text-3); font-weight: 500; }
.col-head .dot { width: 9px; height: 9px; border-radius: 3px; }
.pcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px;
  margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); display: block; color: inherit;
}
.pcard:hover { border-color: var(--border-strong); text-decoration: none; }
.pcard.dragging { opacity: .45; }
.pcard .t { font-weight: 600; margin: 3px 0 6px; color: var(--text); }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th { font-size: 12px; font-weight: 650; color: var(--text-2); background: var(--surface-2); white-space: nowrap; cursor: pointer; user-select: none; }
table.list th.nosort { cursor: default; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list tr:last-child td { border-bottom: 0; }
table.list .ttl { font-weight: 600; }

/* ---------- Fitxa ---------- */
.p-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.p-head h1 { margin-top: 2px; }
.p-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.p-pills select { width: auto; padding: 3px 8px; font-size: 12.5px; font-weight: 600; border-radius: 999px; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
dl.details { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 0; }
dl.details dt { color: var(--text-3); font-size: 12.5px; }
dl.details dd { margin: 0; min-width: 0; word-wrap: break-word; }
.people { display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; align-items: center; gap: 8px; }
.links a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mails { list-style: none; margin: 0; padding: 0; }
.mails li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.mails li:last-child { border-bottom: 0; }
.m-subj { font-weight: 600; word-wrap: break-word; }
ol.steps { padding-left: 20px; }
ol.steps li { margin-bottom: 10px; }
.archived-banner { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-weight: 600; }

/* ---------- Configuració ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.opt-row { display: grid; grid-template-columns: 34px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.opt-row.estat { grid-template-columns: 34px 1fr auto auto auto auto; }
.opt-row.off input[type=text] { color: var(--text-3); text-decoration: line-through; }
.add-opt { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding-top: 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-grid .card + .card { margin-top: 0; }
.tpl-grid ol { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); font-size: 13px; }
.tpl-grid ol li { margin-bottom: 3px; }
.step-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.step-head { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.member-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 8px; max-height: 160px; overflow: auto; }
.temp-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .06em; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px; text-align: center; margin: 12px 0; user-select: all; }

/* ---------- Modal i avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.form-error { color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; animation: fade .15s ease; max-width: 360px; }
.toast.err { background: var(--warn); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Accés ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.login { width: 100%; max-width: 360px; background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-lg); }
.login .brand { color: var(--text); padding: 0 0 20px; }
.login .brand small { color: var(--text-3); }
.login .brand-mark { background: var(--side); }
.login .btn { width: 100%; justify-content: center; padding: 10px; }
.login p { font-size: 13px; }

/* ---------- Tasques: extres ---------- */
.linkish { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.linkish:hover { color: var(--accent); }
.ptag { display: inline-flex; gap: 4px; align-items: baseline; color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.danger-link { color: var(--warn); }

/* ---------- El meu dia ---------- */
.quick-add { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 14px; }
.day-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; color: var(--text-2); font-size: 13px; }
.day-stats b { color: var(--text); font-size: 15px; margin-right: 3px; font-variant-numeric: tabular-nums; }
.day-stats .late, .day-stats .late b { color: var(--warn); }
.day-grid > div > .card + .card { margin-top: 16px; }
.late-card { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.late-card h2 { color: var(--warn); }
.day-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 12px 0 2px; }
.day-h:first-child { margin-top: 0; }

/* ---------- Equip ---------- */
.team { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.tcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 140px; }
.tcol.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.tcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; }
.tcol-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tcol-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load { height: 4px; background: var(--border); border-radius: 2px; margin: 0 2px 10px; overflow: hidden; }
.load > span { display: block; height: 100%; background: var(--accent); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.tcard:hover, .tcard:focus { border-color: var(--border-strong); outline: none; }
.tcard.is-late { box-shadow: inset 3px 0 0 var(--warn); }
.tcard.dragging { opacity: .45; }
.tc-title { font-weight: 560; margin-bottom: 4px; word-wrap: break-word; }

/* ---------- Agenda ---------- */
.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ag-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.ag-day.is-weekend { background: var(--surface-2); }
.ag-day.is-today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.ag-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px 10px; border-bottom: 1px solid var(--border); }
.ag-dn { font-size: 12px; color: var(--text-3); text-transform: uppercase; }
.ag-num { font-weight: 680; font-size: 17px; flex: 1; }
.is-today .ag-num { color: var(--accent); }
.ag-list { padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.ag-item { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; color: var(--text);
  border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 6px 7px; cursor: pointer; font-size: 12.5px; }
.ag-item:hover { border-color: var(--border-strong); }
.ag-row { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.ag-t { font-weight: 560; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ag-p { font-size: 11px; color: var(--text-3); }
.ag-item.fet .ag-t { text-decoration: line-through; color: var(--text-3); }
.ag-item.is-late { border-color: var(--warn); }

/* ---------- Menú inferior (només mòbil) i menú «Més» ---------- */
.bottom-nav { display: none; }
.more-menu { display: flex; flex-direction: column; }
.more-menu a, .more-menu button { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; text-decoration: none; }
.more-menu svg { width: 20px; height: 20px; color: var(--text-2); }
.remember { margin: -2px 0 14px; font-size: 13px; color: var(--text-2); }

/* ---------- Mòbil ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); z-index: 20; gap: 6px; }
  .brand { padding: 0; flex: 1; font-size: 16px; }
  .side .brand small { display: none; }
  .side .nav { display: none; }
  .side-foot { margin: 0; border: 0; padding: 0; display: flex; align-items: center; }
  .side-foot .btn { display: none; }
  .me { padding: 0; }
  .me .who { display: none; }
  main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
    color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 8px; min-height: 48px; justify-content: center; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--accent); }
  h1 { font-size: 20px; }
  .page-head { margin-bottom: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2, .split { grid-template-columns: 1fr; }
  .day-grid > div + div { margin-top: 16px; }
  .add-task { grid-template-columns: 1fr 1fr; }
  .add-task input[type=text] { grid-column: 1 / -1; }
  .quick-add { grid-template-columns: 1fr auto; }
  .quick-add input { grid-column: 1 / -1; }
  .toolbar input[type=search] { width: 100%; }
  .task { padding: 11px 2px; }
  .task input[type=checkbox] { width: 22px; height: 22px; }
  .task { flex-wrap: wrap; }
  .task-actions { opacity: 1; width: 100%; padding-left: 32px; justify-content: flex-start; gap: 6px; }
  .task-actions:empty { display: none; }
  .row { flex-direction: column; gap: 0; }
  .card { padding: 14px; }
  .card-head { flex-wrap: wrap; }
  /* iOS no fa zoom si els camps tenen 16px */
  input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea { font-size: 16px; padding: 9px 10px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .kanban, .team { grid-auto-columns: 84%; scroll-snap-type: x mandatory; }
  .col, .tcol { scroll-snap-align: start; }
  .agenda { grid-template-columns: 1fr; gap: 6px; }
  .ag-day { min-height: 0; flex-direction: row; }
  .ag-day.is-empty .ag-list { display: none; }
  .ag-head { flex-direction: column; justify-content: center; gap: 0; border-bottom: 0; border-right: 1px solid var(--border); width: 58px; flex: none; padding: 6px 4px; }
  .ag-day.is-empty .ag-head .icon-btn { margin-top: 0; }
  .ag-item { font-size: 14px; padding: 8px 10px; }
  .ag-head .icon-btn { margin-top: 2px; }
  .ag-list { flex: 1; min-width: 0; }
  .ag-day.is-empty { opacity: .7; }
  .ag-day.is-empty::after { content: 'Res previst'; align-self: center; color: var(--text-3); font-size: 12.5px; padding-left: 12px; }
  .overlay { place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; left: 12px; }
  .toast { max-width: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions select { flex: 1; }
}

/* ---------- Verificació en dos passos ---------- */
.login.wide { max-width: 460px; }
input.otp { font-size: 24px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { margin: 10px 0 6px; }
.qr img { display: block; width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--border); }
code.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.totp-steps li { margin-bottom: 14px; }
.totp-steps input.otp { margin-top: 8px; }
.ok-text { color: var(--ok); font-weight: 600; }
.bookmarklet { cursor: grab; border-style: dashed; margin-left: 6px; }
