/* ================================================================ tema */

:root, :root[data-theme="dark"] {
  --bg: #0d0e13;
  --bg-2: #111219;
  --surface: #171922;
  --surface-2: #1d202b;
  --surface-3: #262a38;
  --card: #1b1d28;
  --card-hover: #212433;
  --col-bg: rgba(255, 255, 255, .025);
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .13);
  --text: #eceef6;
  --text-2: #a6a9bd;
  --text-3: #6e7189;
  --accent: #7c5cff;
  --accent-2: #a18bff;
  --accent-soft: rgba(124, 92, 255, .16);
  --red: #ff5c6c;
  --red-soft: rgba(255, 92, 108, .15);
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, .14);
  --green: #2ec5a5;
  --green-soft: rgba(46, 197, 165, .15);
  --blue: #3fa7ff;
  --blue-soft: rgba(63, 167, 255, .14);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --tag-l: 72%;
  --tag-bg-a: .16;
  --overlay: rgba(6, 7, 12, .62);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-2: #eceef5;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --surface-3: #e9ebf3;
  --card: #ffffff;
  --card-hover: #fbfbff;
  --col-bg: rgba(20, 24, 60, .035);
  --border: rgba(20, 24, 60, .08);
  --border-2: rgba(20, 24, 60, .15);
  --text: #1a1c2a;
  --text-2: #565a72;
  --text-3: #8d91a8;
  --accent: #6a48f5;
  --accent-2: #5b3ae0;
  --accent-soft: rgba(106, 72, 245, .1);
  --red: #e5364a;
  --red-soft: rgba(229, 54, 74, .1);
  --amber: #d98a00;
  --amber-soft: rgba(217, 138, 0, .12);
  --green: #12a386;
  --green-soft: rgba(18, 163, 134, .12);
  --blue: #1f86e0;
  --blue-soft: rgba(31, 134, 224, .1);
  --shadow: 0 12px 40px rgba(30, 34, 80, .16);
  --shadow-sm: 0 1px 4px rgba(30, 34, 80, .1);
  --tag-l: 38%;
  --tag-bg-a: .12;
  --overlay: rgba(30, 32, 60, .35);
  color-scheme: light;
}

/* ================================================================ bas */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.ic { width: 16px; height: 16px; flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.spacer { flex: 1; }
kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); }
code { font: 12px ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); word-break: break-all; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ================================================================ layout */

.shell { display: flex; height: 100vh; }
.sidebar {
  width: 248px; flex: none; display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-2); border-right: 1px solid var(--border); padding: 14px 10px;
}
.main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.main.is-board { overflow: hidden; }
.main.is-board .page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-pad { padding: 8px 32px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand img { width: 28px; height: 28px; filter: drop-shadow(0 4px 10px rgba(124, 92, 255, .45)); transition: transform .3s; }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }

.search-trigger {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); text-align: left;
  transition: border-color .15s, color .15s;
}
.search-trigger span { flex: 1; }
.search-trigger:hover { border-color: var(--border-2); color: var(--text-2); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc, var(--accent)); }
.nav-item span:not(.nav-count):not(.p-emoji) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.nav-count.hot { background: var(--red-soft); color: var(--red); }
.nav-label { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 4px; padding: 0 4px 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.project-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.p-emoji { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--pc) 22%, transparent); font-size: 13px; flex: none; }
.empty-project { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px dashed var(--border-2); border-radius: 10px; color: var(--text-2); }
.empty-project:hover { border-color: var(--accent); color: var(--accent-2); }

.sidebar-foot { display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.me-btn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 8px; text-align: left; }
.me-btn:hover { background: var(--surface); }
.me-btn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.me-btn b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn small { color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 32px; min-height: 56px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); }
.crumbs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; }
.crumbs .ic { width: 14px; height: 14px; opacity: .5; }
.crumb:last-child { color: var(--text); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.mobile-only { display: none !important; }
.scrim { display: none; }

/* ================================================================ knappar & fält */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 11px 16px; font-size: 15px; }
.btn.full { width: 100%; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, .35); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(124, 92, 255, .45); }
.btn.success { background: linear-gradient(180deg, #3ad6b5, #22b394); border-color: transparent; color: #04241d; font-weight: 600; box-shadow: 0 4px 14px rgba(46, 197, 165, .3); }
.btn.success:hover { filter: brightness(1.06); box-shadow: 0 6px 22px rgba(46, 197, 165, .45); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--red); }
.btn.danger-ghost:hover { background: var(--red-soft); }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--text-2); position: relative; transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
.link-btn { color: var(--accent-2); font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

.input, .select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.full, .select.full { width: 100%; }
.input.sm, .select.sm { padding: 3px 6px; font-size: 13px; border-radius: 7px; }
.input.num { width: 64px; }
.select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%; background-size: 4px 4px; background-repeat: no-repeat; cursor: pointer; }
textarea.input { resize: vertical; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 13px; color: var(--text-2); border: 1px solid transparent; transition: all .15s; white-space: nowrap; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chip.sm { padding: 2px 9px; font-size: 12px; background: var(--surface-2); }
.chip.sm:hover { background: var(--surface-3); }
.avatar-chip { padding-left: 4px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { display: grid; place-items: center; padding: 5px 9px; border-radius: 7px; color: var(--text-3); transition: all .15s; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.prio-seg .p-high.active { color: var(--red); }
.prio-seg .p-low.active { color: var(--text-2); }

/* ================================================================ små komponenter */

.avatar { --c: #888; display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 700; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c)); box-shadow: 0 0 0 2px var(--card); letter-spacing: -.02em; }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.md { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; }
.avatar.unassigned { background: var(--surface-3); color: var(--text-3); box-shadow: none; border: 1px dashed var(--border-2); }
.avatar.unassigned .ic { width: 55%; height: 55%; }

.tag { --h: 250; display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: hsl(var(--h) 75% 60% / var(--tag-bg-a)); color: hsl(var(--h) 70% var(--tag-l)); white-space: nowrap; }
.tag.removable button { font-size: 14px; line-height: 1; color: inherit; opacity: .6; margin-right: -3px; }
.tag.removable button:hover { opacity: 1; }

.due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.due .ic { width: 12px; height: 12px; }
.due.overdue { background: var(--red-soft); color: var(--red); }
.due.today { background: var(--amber-soft); color: var(--amber); }
.due.soon { background: var(--amber-soft); color: var(--amber); }
.due.week { background: var(--blue-soft); color: var(--blue); }

.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-3); }
.meta .ic { width: 13px; height: 13px; }
.meta.ok { color: var(--green); }
.meta.stale { color: var(--amber); }

.progress { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.progress.full > div { background: linear-gradient(90deg, #22b394, #45e0bf); }
.progress.big { height: 8px; margin: 4px 0 10px; }
.progress.mini { width: 44px; height: 4px; }

.col-pill { --cc: #888; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--cc) 16%, transparent); color: color-mix(in srgb, var(--cc) 75%, var(--text)); white-space: nowrap; }
.col-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cc); }

.live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46, 197, 165, .6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 197, 165, .55); } 70% { box-shadow: 0 0 0 7px rgba(46, 197, 165, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 197, 165, 0); } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty > .ic { width: 38px; height: 38px; color: var(--text-3); }
.empty.small { padding: 22px 12px; gap: 6px; }
.empty.small > .ic { width: 24px; height: 24px; }
.empty p { margin: 0; max-width: 360px; font-size: 13px; }

/* ================================================================ notiser */

.notif-wrap { position: relative; }
.bell .badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.bell.has-unread .ic { animation: ring 2.5s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 88%, 100% { transform: rotate(0); } 90% { transform: rotate(14deg); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(8deg); } }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); z-index: 50; overflow: hidden; transform-origin: top right; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; padding: 6px; }
.notif { display: flex; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; align-items: flex-start; position: relative; transition: background .15s; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; flex: 1; }
.notif-task { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--text-3); font-size: 11px; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }

/* ================================================================ översikt */

.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.ov-head h1 { font-size: 28px; font-weight: 700; }
.ov-head p { margin: 4px 0 0; text-transform: none; }
.ov-head p::first-letter { text-transform: uppercase; }
.wave { display: inline-block; animation: wave 2.2s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

.people { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 30px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; transition: all .18s; }
.person small { font-size: 11px; color: var(--text-3); background: var(--surface-3); border-radius: 10px; padding: 0 6px; }
.person:hover { border-color: var(--border-2); color: var(--text); transform: translateY(-1px); }
.person.active { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 12%, var(--surface)); box-shadow: 0 4px 16px color-mix(in srgb, var(--c) 25%, transparent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat div { display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 700; line-height: 1.1; animation: pop .5s cubic-bezier(.3, 1.5, .5, 1); }
.stat span:not(.stat-icon) { color: var(--text-2); font-size: 12px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-icon .ic { width: 20px; height: 20px; }
.stat.violet .stat-icon { background: var(--accent-soft); color: var(--accent-2); }
.stat.red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat.red b { color: var(--red); }
.stat.amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat.green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat.muted .stat-icon { background: var(--surface-3); color: var(--text-3); }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 16px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 96px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day.past { opacity: .55; }
.day.today { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--text-3); font-size: 12px; text-transform: capitalize; }
.day-head b { font-size: 17px; color: var(--text); }
.day.today .day-head b { color: var(--accent-2); }
.day-tasks { display: flex; flex-direction: column; gap: 4px; }
.day-task { text-align: left; font-size: 12px; padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--pc) 16%, transparent); border-left: 3px solid var(--pc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .15s; }
.day-task:hover { transform: translateX(2px); }

.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.ov-grid .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head h2 .ic { color: var(--accent-2); }
.panel-hint { margin: -6px 0 12px; font-size: 12px; color: var(--text-3); }
.more { display: block; margin: 10px auto 0; }

.focus-list { display: flex; flex-direction: column; gap: 8px; }
.focus-card { text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--pc); display: flex; flex-direction: column; gap: 7px; transition: transform .18s, border-color .18s, box-shadow .18s; }
.focus-card:hover { transform: translateY(-2px); border-color: var(--border-2); border-left-color: var(--pc); box-shadow: var(--shadow-sm); }
.fc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-project { font-size: 12px; color: var(--text-3); }
.fc-title { font-weight: 600; font-size: 14px; }
.fc-progress { display: flex; align-items: center; gap: 10px; }
.fc-progress .progress { flex: 1; }
.fc-progress span { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.reason { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.reason.overdue { background: var(--red-soft); color: var(--red); }
.reason.today, .reason.soon { background: var(--amber-soft); color: var(--amber); }
.reason.active { background: var(--blue-soft); color: var(--blue); }
.reason.progress { background: var(--accent-soft); color: var(--accent-2); }
.reason.recent { background: var(--green-soft); color: var(--green); }
.reason.high { background: var(--red-soft); color: var(--red); }

.rows { display: flex; flex-direction: column; gap: 2px; }
.task-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; transition: background .15s, transform .15s; }
.task-row:hover { background: var(--surface-2); }
.tr-project { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--pc) 18%, transparent); font-size: 15px; }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-sub { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; overflow: hidden; max-height: 20px; }
.tr-progress { display: inline-flex; align-items: center; gap: 6px; }
.tr-progress small { font-size: 11px; color: var(--text-3); }
.stale-pill { font-size: 11px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.task-row.archived .tr-title { color: var(--text-2); }
.done-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.done-check .ic { width: 14px; height: 14px; }
.group-label { font-size: 13px; font-weight: 600; margin: 22px 0 6px 10px; text-transform: capitalize; color: var(--text-2); }

/* ================================================================ projekt */

.project-page { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.hero { display: flex; align-items: center; gap: 18px; padding: 4px 32px 16px; }
.hero-emoji { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; flex: none; background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 40%, transparent), color-mix(in srgb, var(--pc) 12%, transparent)); box-shadow: 0 8px 26px color-mix(in srgb, var(--pc) 30%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--pc) 40%, transparent); }
.hero-text { flex: 1; min-width: 0; }
.hero-text h1 { font-size: 24px; font-weight: 700; }
.hero-text p { margin: 2px 0 0; color: var(--text-2); max-width: 720px; }
.hero-stats { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.hero-stats b { color: var(--text); }
.hero-stats .hot, .hero-stats .hot b { color: var(--red); }
.hero-progress { width: 140px; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.hero-progress div { height: 100%; background: linear-gradient(90deg, var(--pc), color-mix(in srgb, var(--pc) 60%, #fff)); border-radius: inherit; transition: width .6s; }
.hero-actions { display: flex; gap: 8px; align-items: center; }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 0 32px 12px; flex-wrap: wrap; }
.page-pad .toolbar { padding: 0 0 12px; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); width: 200px; transition: border-color .15s, box-shadow .15s, width .25s; }
.search-field.grow { flex: 1; width: auto; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); width: 260px; }
.search-field.grow:focus-within { width: auto; }
.search-field input { border: 0; background: none; outline: none; flex: 1; min-width: 0; color: var(--text); }
.assignee-filter { display: flex; gap: 2px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filter-note { padding: 0 32px 10px; font-size: 12px; color: var(--text-2); display: flex; gap: 10px; }

.board { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 4px 32px 24px; overflow-x: auto; align-items: flex-start; }
.column { width: 300px; flex: none; max-height: 100%; display: flex; flex-direction: column; background: var(--col-bg); border: 1px solid var(--border); border-radius: 16px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 10px color-mix(in srgb, var(--cc) 70%, transparent); }
.col-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { font-size: 12px; color: var(--text-3); background: var(--surface-2); padding: 0 7px; border-radius: 10px; }
.col-flag { color: var(--blue); font-size: 9px; }
.col-rule { color: var(--amber); display: grid; }
.col-rule .ic { width: 14px; height: 14px; }
.col-head .icon-btn { opacity: 0; }
.column:hover .col-head .icon-btn, .col-head .icon-btn:focus { opacity: 1; }
.col-body { flex: 1; overflow-y: auto; padding: 4px 10px 6px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 12px; transition: background .2s; }
.col-body.drag-over { background: color-mix(in srgb, var(--cc) 6%, transparent); }
.col-empty { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-3); font-size: 12px; }
.is-dragging .col-empty { border-color: color-mix(in srgb, var(--cc) 50%, transparent); }
.col-foot { padding: 4px 10px 10px; }
.add-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 10px; border-radius: 10px; color: var(--text-3); font-weight: 500; transition: all .15s; }
.add-btn:hover { background: var(--surface-2); color: var(--text); }
.add-card { background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: 8px; box-shadow: 0 0 0 3px var(--accent-soft); }
.add-card textarea, .add-card input { width: 100%; border: 0; background: none; outline: none; resize: none; padding: 4px; }
.add-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ghost-col { background: none; border: 0; }
.add-column { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 16px; border: 1.5px dashed var(--border-2); color: var(--text-3); font-weight: 500; transition: all .15s; }
.add-column:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }

.card {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px;
  cursor: grab; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s, background .18s, opacity .2s;
  animation: card-in .3s cubic-bezier(.2, .8, .2, 1);
}
.card:hover { transform: translateY(-2px); border-color: var(--border-2); background: var(--card-hover); box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.card:active { cursor: grabbing; }
.card::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc, transparent); box-shadow: 0 0 8px color-mix(in srgb, var(--pc, transparent) 50%, transparent); }
.card.prio-high { box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 55%, transparent), var(--shadow-sm); }
.card.prio-low { opacity: .8; }
.card.dragging { opacity: .35; transform: rotate(2deg) scale(.98); }
.card.dropped { animation: dropped .4s cubic-bezier(.3, 1.5, .5, 1); }
.card.completing { animation: complete .4s cubic-bezier(.5, 0, .75, 0) forwards; pointer-events: none; }
.card-project { font-size: 11px; color: var(--text-3); }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-title { font-weight: 500; line-height: 1.35; padding-right: 22px; word-break: break-word; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-done { position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: transparent; opacity: 0; transform: scale(.8); transition: all .2s cubic-bezier(.3, 1.5, .5, 1); background: var(--card); }
.card-done .ic { width: 12px; height: 12px; stroke-width: 3; }
.card:hover .card-done { opacity: 1; transform: scale(1); }
.card-done:hover { border-color: var(--green); background: var(--green); color: #fff; transform: scale(1.15) !important; box-shadow: 0 0 0 4px var(--green-soft); }
.drop-placeholder { border-radius: 12px; background: color-mix(in srgb, var(--cc, var(--accent)) 10%, transparent); border: 1.5px dashed color-mix(in srgb, var(--cc, var(--accent)) 55%, transparent); flex: none; animation: fade .15s; }

@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes dropped { 0% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes complete { 0% { transform: scale(1); } 30% { transform: scale(1.03); background: var(--green-soft); border-color: var(--green); } 100% { transform: scale(.85) translateX(40px); opacity: 0; } }

.list-wrap { padding: 0 32px 32px; overflow: auto; flex: 1; }
.task-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.task-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.th { font-weight: 600; color: inherit; }
.th.active, .th:hover { color: var(--text); }
.task-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { cursor: pointer; transition: background .12s; }
.task-table tbody tr:hover { background: var(--surface-2); }
.task-table tr.completing { animation: fade-out .4s forwards; }
.t-title { font-weight: 500; min-width: 220px; }
.prio-flag { color: var(--red); margin-right: 6px; display: inline-flex; vertical-align: -2px; }
.prio-flag .ic { width: 13px; height: 13px; }
.assignee-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.stale-text { color: var(--amber); }
.done-mini { opacity: .4; }
tr:hover .done-mini { opacity: 1; }
.done-mini:hover { color: var(--green); background: var(--green-soft); }

/* ================================================================ modaler */

.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px; overflow-y: auto; }
.dialog-overlay { z-index: 200; }
.task-modal { width: 100%; max-width: 1020px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; position: relative; }
.task-modal::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--pc), var(--cc)); }
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.tm-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.tm-crumbs .ic { width: 13px; height: 13px; opacity: .5; }
.tm-project:hover { color: var(--text); }
.live-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); margin-left: 6px; }
.tm-head-actions { display: flex; align-items: center; gap: 4px; }
.archived-banner { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--green-soft); color: var(--green); font-size: 13px; }
.archived-banner span { flex: 1; }
.archived-banner .btn { color: var(--text); }
.tm-body { display: grid; grid-template-columns: 1fr 290px; overflow-y: auto; }
.tm-main { padding: 18px 24px 28px; min-width: 0; }
.tm-side { padding: 18px; border-left: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 16px; }
.is-archived .tm-side { background: color-mix(in srgb, var(--green) 3%, var(--surface-2)); }
.tm-title { width: 100%; font-size: 22px; font-weight: 700; letter-spacing: -.015em; border: 0; background: none; outline: none; resize: none; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; line-height: 1.3; overflow: hidden; }
.tm-title:hover { background: var(--surface-2); }
.tm-title:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.section { margin-top: 20px; }
.section-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 6px; }
.section-label .ic { width: 14px; height: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tm-desc { width: 100%; min-height: 60px; border: 1px solid transparent; background: var(--surface-2); outline: none; resize: none; padding: 10px 12px; border-radius: 10px; line-height: 1.55; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.tm-desc:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ck-count { font-size: 12px; color: var(--text-2); font-weight: 500; }
.ck-count.ok { color: var(--green); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.ck-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; transition: background .12s; }
.ck-item:hover { background: var(--surface-2); }
.ck-item.dragging { opacity: .4; }
.ck-grip { color: var(--text-3); cursor: grab; opacity: 0; display: grid; }
.ck-grip .ic { width: 14px; height: 14px; }
.ck-item:hover .ck-grip { opacity: .7; }
.ck-box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: transparent; transition: all .2s cubic-bezier(.3, 1.5, .5, 1); }
.ck-box .ic { width: 13px; height: 13px; stroke-width: 3; transform: scale(0); transition: transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.ck-box:hover { border-color: var(--green); }
.ck-item.done .ck-box { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(46, 197, 165, .4); }
.ck-item.done .ck-box .ic { transform: scale(1); }
.ck-text { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 3px 4px; border-radius: 6px; transition: color .2s; }
.ck-text:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-soft); }
.ck-item.done .ck-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.ck-by { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.ck-del { opacity: 0; }
.ck-item:hover .ck-del { opacity: 1; }
.ck-add textarea { width: 100%; border: 1px dashed var(--border-2); background: none; outline: none; resize: none; padding: 8px 10px; border-radius: 9px; margin-top: 6px; color: var(--text); overflow: hidden; }
.ck-add textarea:focus { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--text-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tabs button span { font-size: 11px; background: var(--surface-3); padding: 0 6px; border-radius: 8px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; animation: fade .3s; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.c-head time { font-size: 12px; color: var(--text-3); }
.c-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.comment:hover .c-actions { opacity: 1; }
.c-text { background: var(--surface-2); padding: 9px 12px; border-radius: 4px 12px 12px 12px; line-height: 1.55; word-break: break-word; }
.comment.mine .c-text { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.c-text a { color: var(--accent-2); text-decoration: underline; }
.mention { color: var(--accent-2); font-weight: 600; }
.no-comments { margin: 0; }
.composer { display: flex; gap: 10px; margin-top: 4px; }
.composer-box { flex: 1; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box textarea { width: 100%; border: 0; background: none; outline: none; resize: none; padding: 10px 12px 4px; overflow: hidden; min-height: 48px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

.activity { list-style: none; margin: 0; padding: 0 0 0 8px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.activity li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-left: -18px; }
.activity li > span:not(.av-wrap):not(.avatar) { flex: 1; }
.activity li b { color: var(--text); font-weight: 500; }
.activity time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.activity .act-done b, .activity .act-done > span:not(.avatar) { color: var(--green); }
.activity .act-auto > span:not(.avatar) { color: var(--amber); }

.prop { display: flex; flex-direction: column; gap: 6px; }
.prop > label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.prop .link-btn { align-self: flex-start; font-size: 12px; }
.assignee-pick { display: flex; align-items: center; gap: 8px; }
.due-line { display: flex; }
.quick-dates { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); min-height: 36px; }
.tag-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag-editor input { border: 0; background: none; outline: none; flex: 1; min-width: 60px; font-size: 13px; padding: 2px 4px; }
.linked { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; transition: border-color .15s; }
.linked:hover { border-color: var(--accent); }
.linked span { display: flex; flex-direction: column; min-width: 0; }
.linked small { font-size: 11px; color: var(--text-3); }
.linked em { font-style: normal; font-size: 11px; color: var(--text-2); }
.meta-info { font-size: 12px; color: var(--text-3); gap: 2px; }
.side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.big-done { padding: 10px; font-size: 14px; }
.big-done .ic { stroke-width: 3; }

.dialog { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; margin-top: 4vh; }
.dialog.wide { max-width: 720px; }
.dialog h2 { font-size: 18px; margin-bottom: 14px; }
.dialog > p { margin: 0 0 8px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field small { font-size: 12px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--c); transition: transform .15s, box-shadow .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.emoji-grid button { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; transition: all .15s; }
.emoji-grid button:hover { background: var(--surface-2); transform: scale(1.1); }
.emoji-grid button.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.emoji-input { width: 52px; text-align: center; font-size: 16px; padding: 4px; }
.project-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; margin-bottom: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 22%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); }
.project-preview span { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--pc) 28%, transparent); }
.project-preview b { font-size: 16px; }
.profile-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.templates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template { text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; transition: all .15s; }
.template small { color: var(--text-3); font-size: 11px; }
.template:hover { border-color: var(--border-2); }
.template.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; margin-bottom: 14px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.toggle-row small { font-size: 12px; }
.toggle { width: 36px; height: 20px; border-radius: 20px; background: var(--surface-3); position: relative; flex: none; margin-top: 1px; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.toggle-row input:checked + .toggle { background: var(--accent); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle { box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; color: var(--text-2); cursor: pointer; }

.rules { margin-top: 8px; }
.rule-card { border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--border)); background: color-mix(in srgb, var(--amber) 4%, var(--surface-2)); border-radius: 12px; padding: 12px; margin-top: 8px; animation: fade .25s; }
.rule-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.rule-line .select { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.rule-line .icon-btn { margin-left: auto; }
.rule-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.rule-opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rule-opts label.disabled { opacity: .45; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.search-dialog { max-width: 620px; padding: 0; overflow: hidden; margin-top: 8vh; }
.search-big { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.search-big .ic { width: 20px; height: 20px; color: var(--text-3); }
.search-big input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; }
.search-results { max-height: 55vh; overflow-y: auto; padding: 6px; }
.sr-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 10px 4px; }
.sr-item, .sr-project { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; }
.sr-item.sel, .sr-item:hover, .sr-project:hover { background: var(--accent-soft); }
.sr-project .muted { margin-left: auto; font-size: 12px; }
.sr-emoji { font-size: 18px; width: 26px; text-align: center; }
.done-pill { color: var(--green); font-weight: 600; }
.search-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.search-foot kbd { margin-right: 3px; }

/* ================================================================ team */

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.team-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 60px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, transparent), transparent); }
.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tc-top { display: flex; align-items: center; gap: 12px; position: relative; }
.tc-top div { display: flex; flex-direction: column; }
.tc-top b { font-size: 15px; }
.tc-top small { color: var(--text-3); }
.tc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tc-stats span { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 11px; color: var(--text-3); }
.tc-stats b { font-size: 18px; color: var(--text); }
.tc-stats .hot b { color: var(--red); }
.tc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ================================================================ inloggning */

.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: float 16s ease-in-out infinite; }
.auth-bg span:nth-child(1) { width: 480px; height: 480px; background: #7c5cff; top: -120px; left: -80px; }
.auth-bg span:nth-child(2) { width: 420px; height: 420px; background: #ff5c8a; bottom: -140px; right: -60px; animation-delay: -5s; }
.auth-bg span:nth-child(3) { width: 300px; height: 300px; background: #2ec5a5; top: 40%; left: 55%; opacity: .3; animation-delay: -10s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.08); } }
.auth-card { width: 100%; max-width: 400px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border-2); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 22px; }
.auth-brand img { width: 34px; height: 34px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card > p.muted { margin: 0 0 20px; }
.auth-error { color: var(--red); min-height: 20px; margin: 10px 0 0; font-size: 13px; text-align: center; }
.auth-link { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.auth-link:hover { color: var(--accent-2); }
.auth-done { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 16px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.auth-done .ic { width: 26px; height: 26px; }
.auth-card .btn.full + .auth-link { margin-top: 16px; }
.auth-card > .btn.full:not(.primary) { margin-top: 8px; }
.reset-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 12px; }
.reset-box > div { display: flex; flex-direction: column; gap: 2px; }
.reset-box small { font-size: 12px; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-2); background: var(--surface-2); margin: 8px 0; }
.link-box code { flex: 1; min-width: 0; font-size: 11px; background: none; padding: 0; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ================================================================ toasts & konfetti */

#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13px; animation: toast-in .35s cubic-bezier(.3, 1.4, .5, 1); }
.toast.out { animation: toast-out .25s forwards; }
.toast-icon { display: grid; color: var(--accent-2); }
.toast.success .toast-icon { color: var(--green); }
.toast.error { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.toast.error .toast-icon { color: var(--red); }
.toast-msg { flex: 1; }
.toast-msg .muted { color: var(--text-2); }
.toast-action { font-weight: 600; color: var(--accent-2); padding: 4px 8px; border-radius: 7px; }
.toast-action:hover { background: var(--accent-soft); }
.toast-close { display: grid; color: var(--text-3); padding: 4px; border-radius: 6px; }
.toast-close:hover { color: var(--text); }
.toast-close .ic { width: 14px; height: 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 500; }

/* ================================================================ animationer */

.fade-in { animation: fade .25s ease-out; }
.pop-in { animation: pop-in .22s cubic-bezier(.3, 1.4, .5, 1); }
.modal-in { animation: modal-in .3s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.95) translateY(-4px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ================================================================ prickar (växer vid hovring) */

.pips { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 10px; }
.pip { display: inline-flex; align-items: center; height: 10px; border-radius: 10px; flex: none; transition: height .2s, padding .2s, background .2s; }
.pip > i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); flex: none; box-shadow: 0 0 6px color-mix(in srgb, var(--pc) 45%, transparent); }
.pip > span { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--pc) 70%, var(--text)); transition: max-width .3s cubic-bezier(.2, .8, .2, 1), opacity .2s, margin .2s; }
.tile:hover .pip { height: 20px; padding: 0 8px 0 6px; background: color-mix(in srgb, var(--pc) 16%, transparent); }
.tile:hover .pip > span { max-width: 200px; opacity: 1; margin-left: 5px; }
.pip.due-overdue > i { animation: pulse-red 2s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 4px rgba(255, 92, 108, .2); } }

.av-wrap { position: relative; display: inline-flex; flex: none; }
.av-status { position: absolute; right: -5px; bottom: -4px; font-size: 11px; line-height: 1; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1.5px var(--surface); }
.avatar.xs + .av-status, .avatar.sm + .av-status { font-size: 9px; width: 14px; height: 14px; right: -4px; bottom: -3px; }

/* ================================================================ startsida med kort */

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.dash-head h1 { font-size: 26px; font-weight: 700; }
.dash-head p { margin: 2px 0 0; }
.dash-head p::first-letter { text-transform: uppercase; }
.dash-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-btn { font-size: 15px; }
.status-btn span { font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.viewing-chip .ic { width: 12px; height: 12px; }
.add-widget-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; font-weight: 500; }
.menu button:hover { background: var(--accent-soft); }
.menu .ic { color: var(--accent-2); }

.page-pad.dash { max-width: 1480px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.widget { grid-column: span 2; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; display: flex; flex-direction: column; min-width: 0; transition: box-shadow .2s, transform .2s, opacity .2s; }
.widget.half { grid-column: span 1; }
.widget:hover { box-shadow: var(--shadow-sm); }
.widget.w-dragging { opacity: .35; transform: scale(.98); }
.w-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px 10px; min-height: 48px; }
.w-head h2 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.w-head h2 .ic { color: var(--accent-2); }
.w-grip { display: grid; color: var(--text-3); cursor: grab; opacity: 0; transition: opacity .15s; padding: 2px; }
.widget:hover .w-grip { opacity: .8; }
.w-extra { flex: 1; display: flex; justify-content: flex-end; }
.w-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.widget:hover .w-tools { opacity: 1; }
.w-body { padding: 0 14px 14px; max-height: 520px; overflow-y: auto; }
.w-calendar .w-body { max-height: none; overflow: visible; }
.w-group + .w-group { margin-top: 12px; }
.w-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 0 10px 4px; }
.w-label small { background: var(--surface-3); padding: 0 6px; border-radius: 8px; letter-spacing: 0; }
.widget .stats { margin: 0; }
.widget .stat { background: var(--surface-2); }

.task-row .tr-main { gap: 4px; }
.tr-dot { width: 4px; align-self: stretch; border-radius: 4px; background: var(--pc); flex: none; opacity: .85; }

.focus-card { border-left: 3px solid var(--pc); }
.focus-card .fc-title { font-weight: 600; }

/* ---------------------------------------------------------------- närmast på tur */

.next-list { display: flex; flex-direction: column; gap: 8px; }
.next-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--pc); transition: transform .18s, box-shadow .18s, border-color .18s; }
.next-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-2); border-left-color: var(--pc); }
.next-rank { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.next-card:first-child .next-rank { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(124, 92, 255, .4); }
.next-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.next-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-due { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 11px; background: var(--surface-3); color: var(--text-2); }
.next-due b { font-size: 20px; line-height: 1; }
.next-due small { font-size: 10px; white-space: nowrap; }
.next-due.overdue { background: var(--red-soft); color: var(--red); }
.next-due.today, .next-due.soon { background: var(--amber-soft); color: var(--amber); }
.next-due.week { background: var(--blue-soft); color: var(--blue); }

/* ---------------------------------------------------------------- kategorier */

.cat-groups { display: flex; flex-direction: column; gap: 6px; }
.cat-group { border-radius: 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--cat) 4%, transparent); transition: border-color .2s; }
.cat-group.open { border-color: color-mix(in srgb, var(--cat) 30%, var(--border)); }
.cat-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 12px; text-align: left; transition: background .15s; }
.cat-head:hover { background: color-mix(in srgb, var(--cat) 10%, transparent); }
.cat-chevron { display: grid; color: var(--text-3); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.cat-chevron .ic { width: 14px; height: 14px; }
.cat-group.open .cat-chevron { transform: rotate(90deg); }
.cat-emoji { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--cat) 20%, transparent); font-size: 14px; }
.cat-name { font-weight: 600; }
.cat-count { font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 10px; background: color-mix(in srgb, var(--cat) 22%, transparent); color: color-mix(in srgb, var(--cat) 70%, var(--text)); }
.cat-hot { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--red-soft); color: var(--red); }
.cat-rows { padding: 0 6px 6px; animation: fade .2s; }

.cat-editor { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--cat, var(--border-2)); }
.cat-row.new { border-left-style: dashed; border-left-color: var(--border-2); margin-top: 6px; }
.cat-row .input.full { flex: 1; min-width: 80px; }
.cat-move { display: flex; flex-direction: column; }
.cat-move .icon-btn { width: 20px; height: 16px; }
.cat-move .ic { transform: rotate(90deg); width: 12px; height: 12px; }
.cat-move .icon-btn:disabled { opacity: .25; }
.mini-swatches { display: flex; gap: 3px; flex: none; }
.mini-swatches .swatch { width: 14px; height: 14px; }
.cat-uses { font-size: 11px; color: var(--text-3); background: var(--surface-3); border-radius: 8px; padding: 1px 7px; }
.hc-cat { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; margin: 0 2px; }

/* ---------------------------------------------------------------- kalender */

.cal-nav { display: flex; align-items: center; gap: 4px; }
.seg.mini button { padding: 2px 8px; font-size: 12px; }
.cal { --person-w: 150px; overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.cal-row { display: flex; min-width: calc(var(--person-w) + var(--n) * 44px); border-top: 1px solid var(--border); transition: background .15s; }
.cal-row.me { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cal-row.viewing { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cal-row.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 10px; }
.cal-header { border-top: 0; position: sticky; top: 0; z-index: 2; background: var(--surface); }
.cal-person { width: var(--person-w); flex: none; display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 4px; text-align: left; font-weight: 600; border-radius: 10px; flex-wrap: wrap; }
button.cal-person:hover { background: var(--surface-2); }
.cal-header .cal-person { color: var(--text-3); font-size: 12px; text-transform: capitalize; font-weight: 500; }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.unassigned-row { color: var(--text-3); }
.cal-days { flex: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(40px, 1fr)); }
.cal-day { display: flex; flex-direction: column; align-items: center; padding: 6px 0 8px; color: var(--text-3); font-size: 11px; text-transform: uppercase; }
.cal-day b { font-size: 15px; color: var(--text-2); font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.weekend { opacity: .55; }
.cal-day.today b { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, .45); }
.cal-lanes { flex: 1; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(40px, 1fr)); grid-auto-rows: 30px; row-gap: 5px; padding: 9px 0; min-height: 52px; align-content: start; }
.cal-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(40px, 1fr)); pointer-events: none; }
.cal-bg span { border-left: 1px solid var(--border); }
.cal-bg span.weekend { background: var(--col-bg); }
.cal-bg span.today { background: color-mix(in srgb, var(--accent) 8%, transparent); border-left: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.cal-bar {
  position: relative; z-index: 1; margin: 0 3px; border-radius: 9px; overflow: hidden; display: flex; align-items: center;
  padding: 0 10px; font-size: 12px; font-weight: 600; text-align: left; color: var(--text); cursor: grab; touch-action: none;
  background: color-mix(in srgb, var(--pc) 26%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--pc) 18%, transparent);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.cal-bar:hover { transform: translateY(-1px); filter: brightness(1.12); box-shadow: 0 6px 18px color-mix(in srgb, var(--pc) 35%, transparent); }
.cal-bar.dragging { cursor: grabbing; z-index: 5; transform: scale(1.03); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); transition: none; }
.cal-bar.overdue { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 2px 10px rgba(255, 92, 108, .3); }
.cal-bar.high::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.cal-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; border-left-style: dashed; }
.cal-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; border-right-style: dashed; }
.cal-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--pc) 28%, transparent); pointer-events: none; }
.cal-title { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.cal-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.cal-handle.l { left: 0; }
.cal-handle.r { right: 0; }
.cal-handle::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--text) 50%, transparent); opacity: 0; transition: opacity .15s; }
.cal-bar:hover .cal-handle::after { opacity: 1; }
.cal-dragging, .cal-dragging * { cursor: grabbing !important; user-select: none; }
.cal-hint { margin: 10px 0 0; font-size: 11px; color: var(--text-3); text-align: right; }

/* ---------------------------------------------------------------- teamet idag */

.team-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tt { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: transform .18s, border-color .18s; }
.tt::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 14px 14px 0 0; background: var(--c); opacity: .7; }
.tt:hover { transform: translateY(-2px); border-color: var(--border-2); }
.tt-head { display: flex; align-items: center; gap: 9px; text-align: left; flex-wrap: wrap; }
.tt-name { font-weight: 600; }
.tt-status { width: 100%; font-size: 11px; color: var(--text-3); max-height: 0; overflow: hidden; transition: max-height .25s; }
.tt:hover .tt-status { max-height: 30px; }
.tt-tasks { display: flex; flex-direction: column; gap: 3px; }
.tt-task { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 8px; text-align: left; font-size: 12px; transition: background .15s; }
.tt-task:hover { background: color-mix(in srgb, var(--pc) 14%, transparent); }
.tt-task > i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); flex: none; }
.tt-task > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-free { font-size: 12px; color: var(--text-3); padding: 4px 7px; }
.tt-ask { position: absolute; top: 8px; right: 8px; opacity: 0; }
.tt:hover .tt-ask { opacity: 1; }

/* ---------------------------------------------------------------- förfrågningar */

.msg-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; transition: background .15s; }
.msg-row:hover, .msg-row.active { background: var(--surface-2); }
.msg-row.unread .tr-title { font-weight: 700; }
.msg-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.msg-kind { font-size: 16px; width: 22px; text-align: center; flex: none; }
.msg-kind.big { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); }
.inbox-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.inbox-list { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.seg-count { font-size: 10px; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 5px; margin-left: 3px; }
.inbox-view { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; min-height: 300px; }
.msg-view { display: flex; flex-direction: column; gap: 14px; }
.msg-head { display: flex; align-items: center; gap: 14px; }
.msg-headtext { flex: 1; min-width: 0; }
.msg-headtext h2 { font-size: 18px; }
.msg-people { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); margin-top: 4px; flex-wrap: wrap; }
.msg-people .ic { width: 12px; height: 12px; opacity: .5; }
.to-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; font-weight: 500; transition: all .15s; }
.status-opt span { font-size: 18px; }
.status-opt:hover { border-color: var(--border-2); transform: translateY(-1px); }
.status-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-custom { display: flex; gap: 8px; }
.date-pair { display: flex; align-items: center; gap: 4px; }
.date-pair .input { flex: 1; min-width: 0; padding: 6px 6px; font-size: 12px; }
.date-pair span { color: var(--text-3); }

/* ---------------------------------------------------------------- hovringskort */

#hovercard { position: fixed; left: 0; top: 0; z-index: 300; width: 290px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .15s; display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
#hovercard.show { opacity: 1; }
.hc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-3); }
.hc-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hc-line { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.hc-line .ic { width: 14px; height: 14px; color: var(--text-3); }
.hc-line .due { margin-left: auto; }
.hc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.hc-last { color: var(--text-3); font-size: 11px; border-top: 1px solid var(--border); padding-top: 7px; }

@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
  .widget, .widget.half { grid-column: span 1; }
  .inbox-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cal { --person-w: 64px; }
  .cal-name, .cal-person .pips { display: none; }
  .dash-actions .btn span { display: none; }
}

/* Intro-animationer bara första gången en sida visas – inte vid live-omritningar. */
.settled .fade-in, .settled .card:not(.dropped):not(.completing), .settled .stat b, .settled .comment,
.settled .rule-card, .settled .wave, .settled .bell .badge, .settled .pop-in:not(.notif-panel):not(.add-card) { animation: none; }
#task-layer .comment, #dialog-layer .rule-card { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================================================================ mindre skärmar */

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ov-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 90; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 80; background: var(--overlay); }
  .mobile-only { display: inline-grid !important; }
  .topbar, .hero, .toolbar, .board, .list-wrap, .filter-note { padding-left: 16px; padding-right: 16px; }
  .page-pad { padding: 8px 16px 40px; }
  .hero { flex-wrap: wrap; }
  .hero-actions { width: 100%; }
  .hero-actions .btn span { display: none; }
  .toolbar-right { margin-left: 0; }
  .week-strip { grid-template-columns: repeat(7, minmax(88px, 1fr)); overflow-x: auto; }
  .tm-body { grid-template-columns: 1fr; }
  .tm-side { border-left: 0; border-top: 1px solid var(--border); }
  .overlay { padding: 0; }
  .task-modal { max-height: 100vh; border-radius: 0; min-height: 100vh; }
  .column { width: 280px; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
  .tr-progress, .task-row .tag { display: none; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 32px; height: 32px; }
  .ov-head h1 { font-size: 22px; }
  .search-field, .search-field:focus-within { width: 100%; }
  .templates { grid-template-columns: 1fr; }
}
