/* ── Work Tasks sheet (Paid / Commission / Future) ── */
.wt { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.wt-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }

/* Category colors — one place, referenced by sections, tags and pickers */
.wt-section--paid,       .wt-tag--paid,       .wt-cat-opt--paid       { --wt-cat: #10b981; --wt-cat-tint: rgba(16,185,129,0.12); }
.wt-section--commission, .wt-tag--commission, .wt-cat-opt--commission { --wt-cat: #8b5cf6; --wt-cat-tint: rgba(139,92,246,0.14); }
.wt-section--future,     .wt-tag--future,     .wt-cat-opt--future     { --wt-cat: #64748b; --wt-cat-tint: rgba(100,116,139,0.14); }
.wt-section--complete { --wt-cat: #94a3b8; --wt-cat-tint: rgba(148,163,184,0.14); }
[data-theme="dark"] .wt-section--paid,       [data-theme="dark"] .wt-tag--paid,       [data-theme="dark"] .wt-cat-opt--paid       { --wt-cat: #34d399; }
[data-theme="dark"] .wt-section--commission, [data-theme="dark"] .wt-tag--commission, [data-theme="dark"] .wt-cat-opt--commission { --wt-cat: #a78bfa; }
[data-theme="dark"] .wt-section--future,     [data-theme="dark"] .wt-tag--future,     [data-theme="dark"] .wt-cat-opt--future     { --wt-cat: #94a3b8; }

/* ── Header buttons ── */
.wt-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; border-radius: var(--radius-md);
  background: #10b981; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.wt-add-btn:hover { background: #059669; }
.wt-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: background .15s, color .15s, border-color .15s;
}
.wt-toggle-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.wt-toggle-btn[aria-pressed="true"] { border-color: #10b981; color: #059669; background: rgba(16,185,129,0.08); }
[data-theme="dark"] .wt-toggle-btn[aria-pressed="true"] { color: #34d399; }
.wt-toggle-btn__count {
  padding: 1px 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
  background: var(--bg-hover); color: var(--text-muted);
}

/* ── Active clock banner ── */
.wt-active {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: #ecfdf5; border: 1px solid rgba(16,185,129,0.25); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .wt-active { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.18); }
.wt-active--shop, .wt-active--vehicle { background: var(--tint-info, rgba(59,130,246,0.08)); border-color: rgba(59,130,246,0.25); }
.wt-active__icon-wrap {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: rgba(16,185,129,0.15); display: flex; align-items: center; justify-content: center;
}
.wt-active--shop .wt-active__icon-wrap, .wt-active--vehicle .wt-active__icon-wrap { background: rgba(59,130,246,0.15); }
.wt-active__icon { width: 22px; height: 22px; color: #059669; animation: wt-pulse 2s ease-in-out infinite; }
.wt-active--shop .wt-active__icon, .wt-active--vehicle .wt-active__icon { color: #2563eb; }
[data-theme="dark"] .wt-active__icon { color: #34d399; }
[data-theme="dark"] .wt-active--shop .wt-active__icon, [data-theme="dark"] .wt-active--vehicle .wt-active__icon { color: #60a5fa; }
@keyframes wt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.wt-active__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wt-active__title { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-active__title strong { font-weight: 700; }
.wt-active__meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }
.wt-active__elapsed { font-weight: 600; font-variant-numeric: tabular-nums; color: #059669; }
[data-theme="dark"] .wt-active__elapsed { color: #34d399; }
.wt-active--shop .wt-active__elapsed, .wt-active--vehicle .wt-active__elapsed { color: #2563eb; }
[data-theme="dark"] .wt-active--shop .wt-active__elapsed, [data-theme="dark"] .wt-active--vehicle .wt-active__elapsed { color: #60a5fa; }
.wt-active__hint { font-size: 12px; color: var(--text-muted); font-style: italic; }
.wt-active__actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; margin-left: auto; }
.wt-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.wt-check input { width: 15px; height: 15px; accent-color: #10b981; margin: 0; }

/* ── Buttons ── */
.wt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s, box-shadow .15s, transform .1s; white-space: nowrap;
}
.wt-btn:active { transform: scale(.97); }
.wt-btn:disabled { opacity: .6; cursor: default; }
.wt-btn--sm { padding: 7px 13px; font-size: 13px; }
.wt-btn--in { background: #10b981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.wt-btn--in:hover { background: #059669; }
.wt-btn--out { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.wt-btn--out:hover { background: #dc2626; }
.wt-btn--ghost { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); box-shadow: none; }
.wt-btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.wt-icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.wt-icon-btn svg { width: 15px; height: 15px; }
.wt-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.wt-icon-btn--done:hover { color: #059669; border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.1); }
.wt-icon-btn--danger:hover { color: #dc2626; border-color: rgba(220,38,38,0.35); background: rgba(220,38,38,0.08); }
[data-theme="dark"] .wt-icon-btn--done:hover { color: #34d399; }
[data-theme="dark"] .wt-icon-btn--danger:hover { color: #f87171; }

/* ── Sections ── */
.wt-section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.wt-section--complete { display: none; }
.wt--show-complete .wt-section--complete { display: block; }
.wt-section__head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border);
}
.wt-section__bar { width: 5px; align-self: stretch; background: var(--wt-cat); border-radius: 0 3px 3px 0; flex-shrink: 0; }
.wt-section__heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wt-section__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.wt-section__count {
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-sm);
  background: var(--wt-cat-tint); color: var(--wt-cat);
}
.wt-section__desc { margin: 0; font-size: 12px; color: var(--text-muted); }
.wt-section__add {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.wt-section__add:hover { color: var(--wt-cat); border-color: var(--wt-cat); background: var(--wt-cat-tint); }
.wt-section__empty { padding: 26px 18px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ── Task rows ── */
.wt-list { display: flex; flex-direction: column; }
.wt-task {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.wt-task:last-child { border-bottom: none; }
.wt-task:hover { background: var(--bg-hover); }
.wt-task--mine { background: rgba(16,185,129,0.05); box-shadow: inset 3px 0 0 #10b981; }
[data-theme="dark"] .wt-task--mine { background: rgba(16,185,129,0.07); }
.wt-task--done .wt-task__title { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--text-muted); }
.wt-task__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wt-task__title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-task__notes { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; white-space: pre-line; }
.wt-task__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-task__by { font-size: 11px; color: var(--text-muted); }
.wt-task__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wt-task__icons { display: flex; align-items: center; gap: 2px; }

/* Tags and chips — square-cornered, never pill-shaped */
.wt-tag {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--radius-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: var(--wt-cat-tint); color: var(--wt-cat);
}
.wt-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 500; color: var(--text-secondary); background: var(--bg-hover);
}
.wt-chip__icon { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-muted); }
.wt-chip--hours { font-variant-numeric: tabular-nums; }
.wt-chip--active { background: rgba(16,185,129,0.12); color: #059669; font-weight: 600; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .wt-chip--active { color: #34d399; }
.wt-chip__pulse { width: 7px; height: 7px; border-radius: 50%; background: #10b981; animation: wt-pulse 1.6s ease-in-out infinite; }

/* ── Priority + drag and drop ── */
.wt-task--p1 { box-shadow: inset 3px 0 0 #f59e0b; }
.wt-task--p2 { box-shadow: inset 3px 0 0 #dc2626; }
.wt-task--mine.wt-task--p1, .wt-task--mine.wt-task--p2 { box-shadow: inset 3px 0 0 #10b981; }
.wt-ptag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--radius-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.wt-ptag__icon { width: 11px; height: 11px; }
.wt-ptag--1 { background: rgba(245,158,11,0.14); color: #b45309; }
.wt-ptag--2 { background: rgba(220,38,38,0.12); color: #b91c1c; }
[data-theme="dark"] .wt-ptag--1 { color: #fbbf24; }
[data-theme="dark"] .wt-ptag--2 { color: #f87171; }
.wt-icon-btn--flag.is-p1 { color: #d97706; }
.wt-icon-btn--flag.is-p2 { color: #dc2626; }
[data-theme="dark"] .wt-icon-btn--flag.is-p1 { color: #fbbf24; }
[data-theme="dark"] .wt-icon-btn--flag.is-p2 { color: #f87171; }
.wt-icon-btn--flag:hover { color: #d97706; border-color: rgba(217,119,6,0.4); background: rgba(217,119,6,0.1); }

.wt-task__grip {
  width: 22px; align-self: stretch; margin: -14px 0 -14px -10px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted); cursor: grab;
  touch-action: none; opacity: .55; transition: opacity .15s, color .15s;
}
.wt-task__grip svg { width: 16px; height: 16px; }
.wt-task:hover .wt-task__grip, .wt-task__grip:focus-visible { opacity: 1; color: var(--text-secondary); }
.wt-task__grip:active { cursor: grabbing; }
.wt--dragging, .wt--dragging * { cursor: grabbing !important; user-select: none; }
.wt-task--dragging { opacity: .35; }
.wt-drag-ghost {
  position: fixed; left: 0; top: 0; z-index: var(--z-overlay); pointer-events: none;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.2)); padding: 10px 14px; max-width: 320px;
  font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wt-section--drop-target { border-color: var(--wt-cat); box-shadow: 0 0 0 3px var(--wt-cat-tint); }
.wt-section--drop-blocked { opacity: .5; }
.wt-list--empty [data-wt-empty] { transition: background .15s; }
.wt-section--drop-target .wt-list--empty [data-wt-empty] { background: var(--wt-cat-tint); color: var(--wt-cat); }
.wt-list--empty .wt-task ~ [data-wt-empty] { display: none; }

.wt-prio-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.wt-prio-opt { position: relative; cursor: pointer; }
.wt-prio-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.wt-prio-opt__box {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--bg-base);
  font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: border-color .15s, background .15s, color .15s;
}
.wt-prio-opt__icon { width: 13px; height: 13px; }
.wt-prio-opt--1 { --wt-prio: #d97706; --wt-prio-tint: rgba(217,119,6,0.12); }
.wt-prio-opt--2 { --wt-prio: #dc2626; --wt-prio-tint: rgba(220,38,38,0.12); }
.wt-prio-opt--0 { --wt-prio: var(--text-primary); --wt-prio-tint: var(--bg-hover); }
[data-theme="dark"] .wt-prio-opt--1 { --wt-prio: #fbbf24; }
[data-theme="dark"] .wt-prio-opt--2 { --wt-prio: #f87171; }
.wt-prio-opt:hover .wt-prio-opt__box { border-color: var(--wt-prio); }
.wt-prio-opt input:checked + .wt-prio-opt__box { border-color: var(--wt-prio); background: var(--wt-prio-tint); color: var(--wt-prio); }
.wt-prio-opt input:focus-visible + .wt-prio-opt__box { outline: 2px solid var(--wt-prio); outline-offset: 2px; }

/* ── Modal ── */
.wt-modal { max-width: 560px; width: 100%; }
.wt-modal__body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; }
.wt-modal__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); }
.wt-cat-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wt-cat-opt { position: relative; cursor: pointer; }
.wt-cat-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.wt-cat-opt__box {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; height: 100%; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--bg-base);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.wt-cat-opt__name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.wt-cat-opt__desc { font-size: 11px; line-height: 1.35; color: var(--text-muted); }
.wt-cat-opt:hover .wt-cat-opt__box { border-color: var(--wt-cat); }
.wt-cat-opt input:checked + .wt-cat-opt__box { border-color: var(--wt-cat); background: var(--wt-cat-tint); box-shadow: 0 0 0 3px var(--wt-cat-tint); }
.wt-cat-opt input:checked + .wt-cat-opt__box .wt-cat-opt__name { color: var(--wt-cat); }
.wt-cat-opt input:focus-visible + .wt-cat-opt__box { outline: 2px solid var(--wt-cat); outline-offset: 2px; }

/* ── FAB (mobile/tablet) ── */
.wt-fab {
  width: 52px; height: 52px; border-radius: 16px; border: none; cursor: pointer;
  background: #10b981; color: #fff; box-shadow: 0 6px 24px rgba(16,185,129,0.35);
  display: none; align-items: center; justify-content: center; flex-shrink: 0;
}
.wt-fab__icon { width: 22px; height: 22px; }
.wt-fab:active { transform: scale(.95); }
@media (max-width: 1024px) {
  .wt-fab { display: flex; }
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .wt-active { flex-wrap: wrap; padding: 14px; }
  .wt-active__actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .wt-active__actions .wt-btn { flex: 1; }
  .wt-task { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px 12px 34px; position: relative; }
  .wt-task__grip { position: absolute; left: 6px; top: 10px; bottom: auto; margin: 0; width: 24px; height: 32px; opacity: .7; }
  .wt-task__actions { justify-content: space-between; flex-wrap: wrap; }
  .wt-task__actions > .wt-btn { flex: 1; }
  .wt-task__icons { margin-left: auto; }
  .wt-cat-picker { grid-template-columns: 1fr; }
  .wt-section__head { padding-right: 12px; }
  .wt-toggle-btn__count { display: none; }
}
