/* ============================================================
   GS IQ Workboard — design system
   Palette: ink #15153a · paper #f5f5fb · blue #2323e0 ·
            red #d11a2a · lavender #8a8ac0 (the "IQ" purple)
   The blue→red brand gradient is functional: blue = light load,
   red = overloaded. It appears only where load/intensity matters.
   ============================================================ */

:root {
  --ink: #15153a;
  --ink-soft: #4c4c78;
  --muted: #8a8ac0;
  --paper: #f5f5fb;
  --card: #ffffff;
  --line: #e4e4f1;
  --blue: #2323e0;
  --red: #d11a2a;
  --violet: #7c3aed;
  --green: #0f7a4d;
  --grad: linear-gradient(100deg, var(--blue), var(--violet) 55%, var(--red));
  --r: 12px;
  --shadow: 0 1px 2px rgba(21,21,58,.05), 0 6px 22px rgba(21,21,58,.06);
  --field: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Sora', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
}
.mono { font-family: 'JetBrains Mono', monospace; font-size: .92em; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 6px 0; }
.muted { color: var(--ink-soft); }
.t-red { color: var(--red); font-weight: 600; }
.empty { color: var(--muted); padding: 14px 0; }
.hint { color: var(--ink-soft); font-size: 13px; max-width: 70ch; }

/* ---------- logo mark ---------- */
.logo-shield {
  width: 64px; height: 64px;
  background: linear-gradient(115deg, #1414c8, #d11a2a);
  border-radius: 16px 16px 50% 50% / 16px 16px 42% 42%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; line-height: .95; font-size: 20px;
  letter-spacing: .02em;
}
.logo-shield .iq { color: #b9a8e8; opacity: .9; }
.logo-shield.small { width: 40px; height: 40px; font-size: 12px; border-radius: 10px 10px 50% 50% / 10px 10px 40% 40%; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(700px 420px at 12% -8%, rgba(35,35,224,.16), transparent 60%),
    radial-gradient(700px 420px at 105% 110%, rgba(209,26,42,.13), transparent 60%),
    var(--paper);
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 40px 38px; width: min(400px, 92vw);
}
.login-mark { text-align: center; margin-bottom: 22px; }
.login-mark .logo-shield { margin: 0 auto 14px; }
.login-mark h1 { font-size: 24px; }
.login-mark .sub { color: var(--ink-soft); margin: 4px 0 0; font-size: 13px; }
.login-card label { display: block; margin: 14px 0; font-weight: 600; font-size: 13px; }
.login-card .btn-grad { width: 100%; margin-top: 18px; }

/* ---------- inputs & buttons ---------- */
input, select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink); background: var(--field);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

button { font: inherit; cursor: pointer; }
.btn-grad {
  background: var(--grad); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 20px; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 4px 14px rgba(60, 30, 160, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-grad:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(60,30,160,.3); }
.btn-ghost {
  background: var(--field); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-weight: 600;
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-mini {
  border: 1px solid var(--line); background: var(--field); border-radius: 7px;
  padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.btn-mini.ok { color: var(--green); border-color: #bfe3d2; background: #effaf4; }
.btn-mini.no { color: var(--red); border-color: #f1c8cc; background: #fdf1f2; }

/* ---------- layout ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: 220px;
  background: #101032; color: #cfcfee;
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: #fff; }
.brand-name { font-weight: 800; letter-spacing: -.01em; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a {
  color: #b9b9e2; padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px;
}
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: var(--grad); color: #fff; }
.pill-count {
  background: var(--red); color: #fff; border-radius: 99px;
  font-size: 11px; padding: 1px 7px; font-weight: 700;
}
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.me b { display: block; color: #fff; font-size: 13.5px; }
.me small { color: var(--muted); }
.logout { display: inline-block; margin-top: 8px; color: #b9b9e2; font-size: 13px; }

.main { margin-left: 220px; padding: 30px 34px 60px; max-width: 1240px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; }
.crumbs { margin: 0 0 2px; font-size: 12.5px; color: var(--muted); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.link { font-size: 13px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat b { font-size: 28px; font-weight: 800; display: block; letter-spacing: -.03em; }
.stat span { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.stat-bad b { color: var(--red); }
.stat-good b { color: var(--green); }

/* ---------- SIGNATURE: team load ribbon ----------
   One gradient spans the whole track; the fill clips it.
   Light load shows only the blue end; an overloaded person
   reaches the red end of the brand mark. */
.load-list { display: flex; flex-direction: column; gap: 14px; }
.load-row { display: grid; grid-template-columns: 220px 1fr 52px; gap: 14px; align-items: center; }
.load-name b { display: block; font-size: 14px; }
.load-name small { color: var(--ink-soft); font-size: 12px; }
.ribbon {
  height: 18px; border-radius: 99px; background: #ececf6; overflow: hidden; position: relative;
}
.ribbon.slim { height: 10px; width: 120px; display: inline-block; vertical-align: middle; }
.ribbon-fill {
  height: 100%; border-radius: 99px;
  background-image: linear-gradient(90deg, #2323e0, #7c3aed 55%, #d11a2a);
  background-size: calc(10000% / max(var(--p), 1)) 100%;
  background-repeat: no-repeat;
  width: calc(var(--p) * 1%);
  min-width: 6px;
  transition: width .4s ease;
}
.load-pct { font-weight: 600; color: var(--ink-soft); text-align: right; }
.legend { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 8px; border-radius: 4px; display: inline-block; }
.lg.cool { background: #2323e0; } .lg.mid { background: #7c3aed; } .lg.hot { background: #d11a2a; }

/* ---------- tags / priority ---------- */
.tag {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.tag.big { font-size: 13px; padding: 6px 14px; }
.tag.open      { background: #ededf8; color: var(--ink-soft); }
.tag.progress  { background: #e6e6fc; color: var(--blue); }
.tag.complete  { background: #e2f5ec; color: var(--green); }
.tag.overdue   { background: #fbe5e7; color: var(--red); }
.tag.today     { background: #fdf0dc; color: #a05a00; }
.tag.delay     { background: #f0e6fb; color: var(--violet); }
.prio { font-size: 11.5px; font-weight: 700; text-transform: capitalize; padding: 2px 8px; border-radius: 6px; }
.prio.low      { background: #eef1f4; color: #5a6b7a; }
.prio.normal   { background: #e8e8f8; color: var(--ink-soft); }
.prio.high     { background: #fdeede; color: #b35a00; }
.prio.critical { background: var(--red); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: none; }

/* ---------- tables ---------- */
.table-panel { padding: 6px 0 0; overflow-x: auto; }
.tasks-table { width: 100%; border-collapse: collapse; }
.tasks-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.tasks-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tasks-table tbody tr { cursor: pointer; transition: background .1s; }
.tasks-table tbody tr:hover { background: #f8f8fd; }
.tasks-table tr:last-child td { border-bottom: 0; }
.td-title { font-weight: 600; }
.td-bar { min-width: 140px; }
.td-bar .tc-bar { display: inline-block; width: 80px; vertical-align: middle; margin-right: 8px; }
.td-actions { white-space: nowrap; }
.td-actions .btn-mini { margin-right: 4px; }
.row-done { opacity: .55; }
.mini-select { width: auto; margin: 0; padding: 6px 8px; font-size: 12.5px; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; margin: 0; min-width: 140px; }
.filters input[type=search] { flex: 1; min-width: 180px; }

/* ---------- progress bars ---------- */
.tc-bar { height: 7px; background: #ececf6; border-radius: 99px; overflow: hidden; }
.tc-bar > div { height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s; }
.tc-bar.big { height: 12px; }

/* ---------- member task cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.task-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px; color: var(--ink); display: block;
  transition: transform .12s, box-shadow .12s;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(21,21,58,.1); }
.tc-top { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.tc-proj { flex: 1; }
.task-card h3 { margin: 10px 0 12px; line-height: 1.35; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }

/* ---------- mini lists / requests / activity ---------- */
.mini-task {
  display: flex; align-items: center; gap: 8px; padding: 9px 4px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.mini-task:last-child { border-bottom: 0; }
.mt-title { font-weight: 600; flex: 1; }
.mt-meta { color: var(--ink-soft); font-size: 12.5px; }

.req-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.req-row:last-child { border-bottom: 0; }
.req-row.inset { background: #f6f3fd; border: 1px solid #e5dcf7; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.req-title { font-weight: 700; color: var(--ink); display: block; margin-bottom: 2px; }
.req-row small { color: var(--ink-soft); line-height: 1.5; }
.req-actions { display: flex; gap: 6px; flex: none; }

.act-row {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 4px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap;
}
.act-row:last-child { border-bottom: 0; }
.act-who { font-weight: 700; }
.act-what { color: var(--ink-soft); flex: 1; min-width: 200px; }
.act-when { color: var(--muted); font-size: 12px; }

/* ---------- task detail ---------- */
.detail-grid { grid-template-columns: 1.1fr 1fr; }
.desc { background: #f8f8fd; border-radius: 10px; padding: 12px 14px; color: var(--ink-soft); }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.kv small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.prog-block { margin-top: 18px; }
.prog-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
input[type=range] { padding: 0; margin: 14px 0 4px; accent-color: var(--violet); }
.prog-actions { display: flex; gap: 10px; margin-top: 12px; }
.done-line { color: var(--green); font-weight: 600; }
.delay-box, .boss-tools { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; }
summary { cursor: pointer; font-weight: 700; color: var(--violet); }
.delay-box label, .boss-tools label { margin-top: 10px; }
.delay-box button, .boss-tools .prog-actions { margin-top: 12px; }
.flash { padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin: 12px 0; }
.flash.err { background: #fbe5e7; color: var(--red); font-weight: 600; }
.flash.info { background: #e6e6fc; color: var(--blue); font-weight: 600; }

.comment-box { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.comment-box textarea { margin: 0; }
.timeline-feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item p { margin: 3px 0 0; color: var(--ink-soft); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-top: 7px; flex: none; }
.feed-item.type-complete .feed-dot { background: var(--green); }
.feed-item.type-delay_request .feed-dot, .feed-item.type-delay_denied .feed-dot { background: var(--red); }
.feed-item.type-delay_approved .feed-dot { background: var(--violet); }
.feed-item.type-created .feed-dot { background: var(--blue); }

/* ---------- gantt ---------- */
.gantt-panel { padding: 22px; }
.gantt-axis { position: relative; height: 20px; margin-left: 0; border-bottom: 1px solid var(--line); }
.gantt-axis span { position: absolute; font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.gantt-body { position: relative; padding-top: 8px; }
.today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--red); opacity: .55; z-index: 2; pointer-events: none;
}
.gantt-group { margin: 14px 0 22px; }
.gantt-user { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13.5px; }
.heat-strip { position: relative; height: 5px; border-radius: 3px; background: #f0f0f8; margin-bottom: 6px; overflow: hidden; }
.heat-strip i { position: absolute; top: 0; bottom: 0; background: var(--red); }
.gantt-row { position: relative; height: 30px; margin: 4px 0; }
.gantt-bar {
  position: absolute; top: 0; bottom: 2px; border-radius: 7px;
  background: color-mix(in srgb, var(--mk) 16%, var(--card));
  border: 1.5px solid var(--mk);
  display: flex; align-items: center; padding: 0 8px;
  overflow: hidden; color: var(--ink);
}
.gantt-bar span { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
.gantt-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--mk) 32%, var(--card)); z-index: 0; }
.gantt-bar.g-late { border-color: var(--red); box-shadow: 0 0 0 2px rgba(209,26,42,.15); }
.gantt-bar.g-done { opacity: .45; border-style: dashed; }

/* ---------- projects ---------- */
.proj-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.proj-row:last-child { border-bottom: 0; }
.proj-main { flex: 1; }
.proj-main a { color: var(--ink); }
.proj-main small { display: block; color: var(--ink-soft); margin: 2px 0 6px; }
.proj-main .tc-bar { max-width: 320px; }

/* ---------- modal & toast ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(16,16,50,.55); z-index: 50;
  display: grid; place-items: center; padding: 20px;
}
.modal-card {
  background: var(--card); border-radius: 16px; padding: 26px 28px;
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal .x { background: none; border: 0; font-size: 26px; color: var(--muted); line-height: 1; }
.modal label { margin-top: 12px; }
.modal .btn-grad { margin-top: 18px; width: 100%; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; z-index: 99; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  max-width: 90vw;
}
.toast.bad { background: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .load-row { grid-template-columns: 1fr; gap: 6px; }
  .load-pct { text-align: left; }
}
@media (max-width: 760px) {
  .side {
    position: static; width: auto; flex-direction: row; align-items: center;
    padding: 10px 14px; gap: 10px; overflow-x: auto;
  }
  .side nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 10px; align-items: center; }
  .me small { display: none; }
  .brand-name { display: none; }
  .main { margin-left: 0; padding: 18px 14px 50px; }
  .kv { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.modal[hidden]{display:none !important;}

/* ---------- real GSIQ logo ---------- */
.logo-img { display: block; width: 84px; height: 84px; object-fit: contain; }
.logo-img.small { width: 30px; height: 30px; }
.login-mark .logo-img { margin: 0 auto 14px; }
.logo-chip {
  width: 42px; height: 42px; border-radius: 12px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); flex: 0 0 auto;
}

/* ---------- pause feature ---------- */
.tag.paused { background: #ececec; color: #555; }
.flash.info { background: #e9e9fb; color: var(--blue); }
.gantt-bar.g-paused {
  opacity: .55; filter: grayscale(.7);
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.45) 6px 12px);
}

/* ---------- timeline: all dates header & weekend shade ---------- */
.gantt-days { position: relative; height: 42px; margin-bottom: 4px; }
.gantt-days span {
  position: absolute; top: 0; height: 100%; text-align: center;
  font-family: 'JetBrains Mono', monospace; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  border-left: 1px solid transparent; overflow: visible;
}
.gantt-days span em { font-style: normal; font-size: 9px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.gantt-days span i  { font-style: normal; font-size: 8px; opacity: .65; line-height: 1.1; }
.gantt-days span b  { font-size: 10px; line-height: 1.2; }
.gantt-days span.we b, .gantt-days span.we i { color: #b06a6a; }
.gantt-days span.td b {
  background: var(--blue); color: #fff; border-radius: 6px;
  min-width: 16px; padding: 0 2px;
}
.gantt-shade { position: absolute; inset: 0; pointer-events: none; }
.gantt-shade i { position: absolute; top: 0; bottom: 0; background: rgba(21,21,58,.045); }
.gantt-body { position: relative; }
@media (max-width: 760px) {
  .gantt-days span i { display: none; }
  .gantt-days span b { font-size: 8px; }
  .gantt-days span em { display: none; }
}
.logo-chip{background:transparent;box-shadow:none;} .logo-img.small{width:38px;height:38px;}

/* ---------- mentions ---------- */
.mention { color: var(--violet); font-weight: 700; background: color-mix(in srgb, var(--violet) 12%, var(--card)); border-radius: 5px; padding: 0 4px; }

/* ---------- theme toggle ---------- */
.theme-btn {
  display: block; width: 100%; margin: 8px 0 2px; padding: 7px 10px; text-align: left;
  background: rgba(255,255,255,.07); border: 0; border-radius: 8px;
  color: #b9b9e2; font: inherit; font-size: 13px; cursor: pointer;
}
.theme-btn:hover { background: rgba(255,255,255,.13); color: #fff; }

/* ---------- dark theme ---------- */
[data-theme=dark] {
  --ink: #ebebf8;
  --ink-soft: #a9a9d2;
  --muted: #7e7eae;
  --paper: #0d0d20;
  --card: #17172f;
  --line: #2b2b4c;
  --field: #100f28;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 22px rgba(0,0,0,.35);
}
[data-theme=dark] body { background: var(--paper); }
[data-theme=dark] .tag.open      { background: #26264a; color: var(--ink-soft); }
[data-theme=dark] .tag.progress  { background: #1d1d52; color: #8c8cff; }
[data-theme=dark] .tag.complete  { background: #11352a; color: #4ecf95; }
[data-theme=dark] .tag.overdue   { background: #421a20; color: #ff7d8a; }
[data-theme=dark] .tag.today     { background: #3d2c10; color: #f0a84e; }
[data-theme=dark] .tag.delay     { background: #2c1d4a; color: #b88cff; }
[data-theme=dark] .tag.paused    { background: #2a2a3a; color: #9a9ab0; }
[data-theme=dark] .flash.err     { background: #421a20; color: #ff7d8a; }
[data-theme=dark] .flash.info    { background: #1d1d52; color: #9c9cff; }
[data-theme=dark] .gantt-shade i { background: rgba(255,255,255,.045); }
[data-theme=dark] a { color: #8c8cff; }
[data-theme=dark] .side nav a { color: #b9b9e2; }
[data-theme=dark] .side nav a.on { color: #fff; }

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; }
.cal-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  min-height: 96px; padding: 6px; font-size: 12px; overflow: hidden;
}
.cal-cell.out { opacity: .42; }
.cal-cell.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.cal-cell.we { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
.cal-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.cal-cell.today .cal-num { color: var(--blue); font-weight: 700; }
.cal-task {
  display: block; margin: 2px 0; padding: 2px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--mk) 18%, var(--card));
  border-left: 3px solid var(--mk);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-task.c-done { opacity: .5; text-decoration: line-through; }
.cal-task.c-late { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--card)); }
.cal-task.c-paused { opacity: .55; filter: grayscale(.6); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
@media (max-width: 760px) {
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-task { font-size: 9.5px; padding: 1px 3px; }
}

/* ---------- reports ---------- */
.rep-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 90px; }
.rep-bar i { display: block; height: 100%; background: var(--grad); }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }

/* ---------- audit ---------- */
.audit-type { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink-soft); white-space: nowrap; }

/* ---------- reports polish ---------- */
.rep-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rep-table th, .rep-table td { padding: 13px 16px; }
.rep-table .num { text-align: right; }
.rep-table b { font-weight: 700; }
.rep-cell { display: flex; align-items: center; gap: 10px; }
.rep-cell .rep-bar { flex: 1; }
.rep-cell .mono { min-width: 42px; text-align: right; }
.tasks-table.static tbody tr { cursor: default; }
.tasks-table.static tbody tr:hover { background: transparent; }
[data-theme=dark] .tasks-table tbody tr:hover { background: rgba(255,255,255,.03); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; margin-right: 10px;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em;
  vertical-align: middle; flex: 0 0 auto;
}
.avatar.big { width: 52px; height: 52px; font-size: 17px; margin-right: 0; }
.mk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 9px; vertical-align: baseline; }
.t-green { color: var(--green); font-weight: 600; }
.rep-kpis .stat b small { font-weight: 600; }

/* ---------- person page: delay cards ---------- */
.delay-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; background: var(--paper); }
.delay-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.delay-dates { margin: 6px 0 4px; font-size: 13px; }
.delay-reason { margin: 4px 0 8px; color: var(--ink); font-size: 14px; border-left: 3px solid var(--violet); padding-left: 10px; }
[data-theme=dark] .delay-card { background: var(--field); }
@media (max-width: 760px) {
  .rep-table th, .rep-table td { padding: 10px 10px; }
  .rep-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- task type chip ---------- */
.type-chip {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--violet) 13%, var(--card)); color: var(--violet);
  border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); vertical-align: baseline;
}

/* ---------- sortable table headers ---------- */
.tasks-table th.th-sort { padding: 0; }
.tasks-table th.th-sort a {
  display: block; padding: 13px 16px; color: var(--muted);
  text-decoration: none; white-space: nowrap; font: inherit; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  transition: color .12s, background .12s;
}
.tasks-table th.th-sort a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.tasks-table th.th-active a { color: var(--blue); }
[data-theme=dark] .tasks-table th.th-active a { color: #8c8cff; }
