:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #1c2434;
  --muted: #8b95a8;
  --line: #e8ecf3;
  --blue: #3b82f6;
  --blue-deep: #2563eb;
  --pink: #f472b6;
  --yellow: #fbbf24;
  --green: #22c55e;
  --red: #ef4444;
  --sidebar: 260px;
  --right: 300px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(28, 36, 52, 0.06);
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Sora", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 114, 182, 0.08), transparent 24%),
    var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr var(--right);
  min-height: 100vh;
  gap: 0;
}
.app-shell.no-right {
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  padding: 28px 22px;
  background: rgba(255,255,255,0.72);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
}
.brand-name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #93c5fd, #f9a8d4);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}
.profile-card strong { display: block; font-size: 0.95rem; }
.profile-card span { color: var(--muted); font-size: 0.8rem; }

.nav-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  transition: 0.2s ease;
}
.nav-list a:hover,
.nav-list a.active {
  background: #edf4ff;
  color: var(--blue-deep);
}
.nav-list a.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.sidebar-actions { margin-top: auto; display: grid; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-soft {
  background: #edf4ff;
  color: var(--blue-deep);
}
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-sm { padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; }

.main {
  padding: 24px 28px 40px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.search {
  flex: 1;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel + .panel { margin-top: 20px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-head h1,
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.03em;
}
.panel-head h1 { font-size: 1.5rem; }
.panel-head h2 { font-size: 1.15rem; }

.rightbar {
  padding: 24px 18px;
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.icon-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 22px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.mini-cal {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.mini-cal h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 1rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 0.78rem;
}
.cal-grid .dow { color: var(--muted); font-weight: 600; }
.cal-grid .day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
}
.cal-grid .day.today {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}
.cal-grid .day.muted { color: #c5CAD6; }

.upcoming-list, .report-list { display: grid; gap: 10px; }
.upcoming-item, .report-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.upcoming-item .dot {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.upcoming-item strong, .report-item strong { display: block; font-size: 0.88rem; }
.upcoming-item span, .report-item span { color: var(--muted); font-size: 0.75rem; }

.week-grid {
  display: grid;
  grid-template-columns: 64px repeat(6, 1fr);
  gap: 8px;
  min-height: 360px;
}
.week-head, .time-col, .day-col {
  min-height: 40px;
}
.week-head {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding-bottom: 8px;
}
.time-col {
  color: var(--muted);
  font-size: 0.75rem;
  display: grid;
  gap: 28px;
  padding-top: 8px;
}
.day-col {
  background: #f8fafc;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 300px;
}
.task-chip {
  border-radius: 14px;
  padding: 10px;
  color: #fff;
  font-size: 0.78rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}
.task-chip.pending { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.task-chip.running { background: linear-gradient(135deg, #f472b6, #ec4899); }
.task-chip.complete { background: linear-gradient(135deg, #34d399, #10b981); }
.task-chip strong { display: block; margin-bottom: 4px; }
.task-chip span { opacity: 0.9; }

/* ===== Timeline / Gantt (Task Management) ===== */
.cal-toolbar-wrap {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}
.cal-range-label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.cal-view-toggle {
  display: inline-flex;
  background: linear-gradient(180deg, #eef2f7, #e8edf5);
  border-radius: 14px;
  padding: 4px;
  gap: 2px;
  border: 1px solid #e2e8f0;
}
.cal-view-btn {
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: 0.18s ease;
}
.cal-view-btn:hover { color: var(--ink); }
.cal-view-btn.active {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}
.cal-nav { display: inline-flex; gap: 4px; }
.cal-nav-btn {
  width: 36px;
  padding-left: 0;
  padding-right: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.cal-jump {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.cal-jump input[type="date"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.cal-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.cal-legend .lg-blue { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }
.cal-legend .lg-violet { background: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.16); }
.cal-legend .lg-pink { background: #ec4899; box-shadow: 0 0 0 3px rgba(236,72,153,0.16); }
.cal-legend .lg-orange { background: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.16); }
.cal-legend-note {
  margin-left: auto;
  background: #edf4ff;
  color: var(--blue-deep);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.tm-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.06), transparent 40%),
    #fff;
}
.gantt-board {
  background: linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
  border: 1px solid #e7ecf4;
  border-radius: 22px;
  padding: 16px 14px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.gantt-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.gantt-scroll.is-month .gantt { min-width: 1100px; }
.gantt-scroll.is-week .gantt { min-width: 780px; }

.gantt {
  display: grid;
  grid-template-columns: minmax(200px, 250px) 1fr;
  gap: 8px 14px;
  align-items: stretch;
  --cols: 7;
}
.gantt-sidebar-head {
  min-height: 78px;
  display: flex;
  align-items: end;
  padding: 0 6px 12px;
}
.gantt-head-note {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gantt-dates,
.gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr));
  position: relative;
  min-height: 78px;
}
.gantt-date {
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  display: grid;
  gap: 1px;
  justify-items: center;
  align-content: center;
  padding: 10px 4px;
  border-radius: 16px;
  transition: 0.18s ease;
  position: relative;
}
.gantt-date:hover { background: rgba(255,255,255,0.85); }
.gantt-dow {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.62rem;
}
.gantt-date strong {
  color: var(--ink);
  font-size: 1.15rem;
  font-family: var(--display);
  line-height: 1.1;
}
.gantt-mon {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.8;
}
.gantt-day-count {
  font-style: normal;
  font-size: 0.62rem;
  color: var(--blue-deep);
  font-weight: 700;
  margin-top: 4px;
  background: rgba(59,130,246,0.1);
  padding: 2px 7px;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-day-count.muted {
  background: transparent;
  color: #c0c7d4;
}
.gantt-date.is-today {
  background: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,0.10);
}
.gantt-date.is-today strong {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}
.gantt-date.is-selected:not(.is-today) {
  background: #eaf2ff;
  outline: 1px solid rgba(59,130,246,0.25);
}

.gantt-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  min-height: 64px;
  background: rgba(255,255,255,0.72);
  border-radius: 16px;
  border: 1px solid rgba(231,236,244,0.9);
}
.gantt-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(28,36,52,0.12);
}
.gantt-meta { min-width: 0; flex: 1; }
.gantt-meta strong {
  display: block;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-meta span {
  color: var(--muted);
  font-size: 0.72rem;
}
.gantt-meta b { color: var(--ink); font-weight: 700; }
.gantt-status {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.gantt-status.st-pending { background: #dbeafe; color: #1d4ed8; }
.gantt-status.st-running { background: #fce7f3; color: #be185d; }
.gantt-status.st-complete { background: #dcfce7; color: #15803d; }
.gantt-more {
  color: var(--muted);
  font-size: 1.15rem;
  padding: 0 2px;
  line-height: 1;
}

.gantt-track {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.2)),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(100% / var(--cols, 7) - 1px),
      rgba(203,213,225,0.7) calc(100% / var(--cols, 7) - 1px),
      rgba(203,213,225,0.7) calc(100% / var(--cols, 7))
    );
  border-radius: 18px;
  min-height: 72px;
  align-items: center;
  border: 1px solid rgba(231,236,244,0.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  position: relative;
  overflow: hidden;
}
.gantt-cell {
  min-height: 72px;
  position: relative;
}
.gantt-cell.is-today-col {
  background: rgba(59,130,246,0.06);
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 48px;
  max-width: calc(100% - 8px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 6px;
  color: #fff;
  overflow: hidden;
  box-shadow:
    0 10px 20px rgba(28, 36, 52, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.28);
  z-index: 2;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-sizing: border-box;
}
.gantt-bar:hover {
  transform: translateY(-50%) scale(1.015);
  filter: brightness(1.04);
  box-shadow: 0 14px 26px rgba(28, 36, 52, 0.2);
  z-index: 3;
}
.gantt-bar-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.35);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  z-index: 2;
  position: relative;
}
.gantt-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(0,0,0,0.10));
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}
.gantt-bar-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
  z-index: 2;
  position: relative;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.gantt-bar-title {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: -0.01em;
}
.gantt-bar-time {
  font-size: 0.66rem;
  opacity: 0.92;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-bar.is-compact .gantt-bar-time {
  font-size: 0.62rem;
}
.gantt-bar-pct {
  display: none;
}
.gantt-empty {
  grid-column: 1 / -1;
  padding: 18px 8px;
}
.gantt-empty-card {
  text-align: center;
  background: #fff;
  border: 1px dashed #d5dbe7;
  border-radius: 18px;
  padding: 28px 16px;
  color: var(--muted);
}
.gantt-empty-card strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
  font-family: var(--display);
}
.gantt-empty-card p { margin: 0; font-size: 0.88rem; }

.tone-blue { background: linear-gradient(90deg, #7dd3fc, #3b82f6 45%, #2563eb); }
.tone-violet { background: linear-gradient(90deg, #c4b5fd, #8b5cf6 45%, #7c3aed); }
.tone-pink { background: linear-gradient(90deg, #f9a8d4, #f472b6 45%, #ec4899); }
.tone-orange { background: linear-gradient(90deg, #fdba74, #fb923c 45%, #f97316); }
.gantt-avatar.tone-blue,
.plan-avatar.tone-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.gantt-avatar.tone-violet,
.plan-avatar.tone-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.gantt-avatar.tone-pink,
.plan-avatar.tone-pink { background: linear-gradient(135deg, #f9a8d4, #ec4899); }
.gantt-avatar.tone-orange,
.plan-avatar.tone-orange { background: linear-gradient(135deg, #fdba74, #f97316); }

.cal-grid .day.selected {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}
.cal-grid a.day {
  color: inherit;
  transition: 0.15s ease;
}
.cal-grid a.day:hover {
  background: #eef2ff;
}

.plan-panel .panel-head {
  margin-bottom: 10px;
  align-items: baseline;
}
.plan-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.plan-list {
  display: grid;
  gap: 10px;
}
.plan-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(28,36,52,0.04);
  transition: transform 0.15s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.plan-item:hover { transform: translateY(-1px); }
.plan-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.plan-time {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.plan-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.plan-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 30px;
}
.plan-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.plan-text strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.plan-text span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.plan-accent {
  flex: 0 0 5px;
  width: 5px;
  border-radius: 999px;
  align-self: stretch;
  min-height: 42px;
}
.plan-accent.tone-blue { background: #3b82f6; }
.plan-accent.tone-violet { background: #7c3aed; }
.plan-accent.tone-pink { background: #ec4899; }
.plan-accent.tone-orange { background: #f97316; }

/* ===== Kanban ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.kanban-col {
  background: #f7f8fb;
  border-radius: 18px;
  padding: 14px;
  min-height: 280px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kanban-col-head small {
  background: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink);
}
.kanban-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.kanban-card:hover { transform: translateY(-2px); }
.kanban-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.kanban-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.kanban-card strong { font-size: 0.9rem; line-height: 1.3; }
.kanban-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.kanban-time { font-weight: 600; color: var(--ink) !important; }
.kanban-note {
  margin: 0 0 8px !important;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #93c5fd;
  color: var(--ink) !important;
  font-size: 0.76rem !important;
  line-height: 1.35;
}

.docs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
}
.doc-chip a { color: var(--blue-deep); font-weight: 600; }
.doc-chip span { color: var(--muted); }
.doc-del {
  color: #b91c1c !important;
  font-weight: 800;
  margin-left: 2px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 22px;
  align-items: start;
}
.account-card {
  background: linear-gradient(180deg, #f8fbff, #fff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.account-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}
.account-card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
}
.account-card p { margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; }
.account-meta { font-size: 0.8rem !important; }

.profile-card { text-decoration: none; }
.profile-card:hover strong { color: var(--blue-deep); }

@media (max-width: 820px) {
  .account-grid { grid-template-columns: 1fr; }
}

.kanban-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink);
  margin: 8px 0;
}
.kanban-sub .dot {
  width: 8px;
  height: 28px;
  border-radius: 6px;
}
.kanban-sub .dot.tone-blue { background: #3b82f6; }
.kanban-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.kanban-progress-bar {
  flex: 1;
  height: 8px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}
.kanban-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  border-radius: inherit;
}
.kanban-progress em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-deep);
}
.kanban-done-list {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  font-size: 0.8rem;
  color: #15803d;
}
.kanban-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}
.tasks-hero {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 42%),
    radial-gradient(circle at bottom left, rgba(244,114,182,0.10), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  overflow: hidden;
}
.tasks-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.task-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.task-stat {
  display: block;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.task-stat::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -12px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  opacity: 0.14;
  background: var(--blue);
}
.task-stat.pending::after { background: #3b82f6; }
.task-stat.running::after { background: #f472b6; }
.task-stat.complete::after { background: #22c55e; }
.task-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.task-stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.task-stat:hover,
.task-stat.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cfe0ff;
  background: #fff;
}
.task-stat.pending.active { border-color: #93c5fd; background: #eff6ff; }
.task-stat.running.active { border-color: #f9a8d4; background: #fdf2f8; }
.task-stat.complete.active { border-color: #86efac; background: #f0fdf4; }

.task-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px 10px 16px;
  box-shadow: var(--shadow);
}
.task-search-icon {
  color: var(--blue);
  font-size: 1.05rem;
  font-weight: 700;
}
.task-search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.tasks-upcoming {
  background:
    linear-gradient(135deg, rgba(251,191,36,0.10), transparent 46%),
    #fff;
}
.upcoming-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.upcoming-pill {
  min-width: 210px;
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #fde68a;
  background: linear-gradient(180deg, #fffbeb, #fff);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.upcoming-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.upcoming-time {
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.upcoming-pill strong {
  font-size: 0.92rem;
  line-height: 1.3;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  animation: taskCardIn 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes taskCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.task-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}
.tone-border-blue::before { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.tone-border-pink::before { background: linear-gradient(180deg, #f9a8d4, #ec4899); }
.tone-border-green::before { background: linear-gradient(180deg, #86efac, #16a34a); }
.tone-border-blue::after { background: #3b82f6; }
.tone-border-pink::after { background: #f472b6; }
.tone-border-green::after { background: #22c55e; }
.task-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(28,36,52,0.11);
}
.task-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.task-card-identity {
  display: flex;
  gap: 12px;
  min-width: 0;
  align-items: center;
}
.task-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37,99,235,0.18);
}
.task-avatar.tone-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.task-avatar.tone-pink {
  background: linear-gradient(135deg, #f9a8d4, #ec4899);
  box-shadow: 0 8px 18px rgba(236,72,153,0.18);
}
.task-avatar.tone-green {
  background: linear-gradient(135deg, #86efac, #16a34a);
  box-shadow: 0 8px 18px rgba(34,197,94,0.18);
}
.task-card-identity h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.task-card-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.task-card-desc {
  margin: 0 0 12px;
  color: #4b5568;
  font-size: 0.86rem;
  line-height: 1.45;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #eef2f7;
}
.task-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.task-meta-cell {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #eef2f7;
}
.task-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.task-meta-grid strong {
  font-size: 0.86rem;
}
.task-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-chip {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.task-chip.docs {
  background: #fdf2f8;
  color: #be185d;
}
.task-chip.warn {
  background: #fff7ed;
  color: #c2410c;
}
.task-card-actions {
  display: flex;
  gap: 6px;
}
.tasks-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.tasks-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-weight: 800;
  font-family: var(--display);
  box-shadow: 0 12px 24px rgba(37,99,235,0.22);
}
.tasks-empty strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  margin-bottom: 6px;
  font-size: 1.15rem;
}
.tasks-empty p { margin: 0 0 14px; }
.task-form-panel {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.08), transparent 40%),
    radial-gradient(circle at bottom right, rgba(244,114,182,0.06), transparent 36%),
    #fff;
}
.task-form input,
.task-form select,
.task-form textarea {
  background: #fbfcfe;
}
.task-side-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}
.task-side-panel {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.06), transparent 42%),
    #fff;
}

@media (max-width: 900px) {
  .task-stats { grid-template-columns: repeat(2, 1fr); }
  .task-board { grid-template-columns: 1fr; }
  .task-side-grid { grid-template-columns: 1fr; }
}

.kanban-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.tab.active, .tab:hover {
  background: #edf4ff;
  color: var(--blue-deep);
}

.client-cards { display: grid; gap: 14px; }
.client-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}
.client-thumb {
  width: 120px;
  height: 84px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(59,130,246,0.85), rgba(244,114,182,0.75)),
    #dbeafe;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
}
.client-card h3 { margin: 0 0 6px; font-size: 1rem; }
.client-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* ===== Clients list ===== */
.clients-hero {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 42%),
    radial-gradient(circle at bottom left, rgba(34,197,94,0.08), transparent 36%),
    #fff;
}
.client-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.client-stat {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.client-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.client-stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 1.45rem;
}
.client-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.client-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: taskCardIn 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.client-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.client-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(28,36,52,0.10);
}
.client-tile-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.client-tile-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.client-tile-identity h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.client-tile-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.client-tile-addr {
  margin: 0 0 12px;
  color: #4b5568;
  font-size: 0.84rem;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}
.client-tile-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.client-tile-meta > div {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.client-tile-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.client-tile-meta strong {
  font-family: var(--display);
  font-size: 1.1rem;
}
.client-tile-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ===== Client profile ===== */
.client-profile-hero {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 40%),
    radial-gradient(circle at bottom left, rgba(244,114,182,0.10), transparent 36%),
    linear-gradient(180deg, #fff, #f8fbff);
}
.client-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.client-profile-identity {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.client-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 14px 28px rgba(37,99,235,0.22);
  flex-shrink: 0;
}
.client-profile-identity h1 {
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.client-profile-addr {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.client-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.client-profile-stats > div {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.client-profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.client-profile-stats strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 1.35rem;
}
.client-profile-bio {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 12px 14px;
}
.client-profile-bio span {
  display: block;
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.client-profile-bio p {
  margin: 0;
  color: #78350f;
  line-height: 1.5;
  font-size: 0.9rem;
}
.client-profile-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}
.client-section {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.05), transparent 42%),
    #fff;
}
.client-inline-form {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.doc-chip.rich {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
}
.doc-chip.rich > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.doc-chip.rich span {
  font-size: 0.72rem;
}
.policy-board,
.client-task-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.policy-card,
.client-task-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fbfcfe;
  position: relative;
  overflow: hidden;
}
.policy-card::before,
.client-task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.policy-card-top,
.client-task-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.policy-card p,
.client-task-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}
.client-task-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.policy-expiry {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.client-task-card .task-chips { margin-bottom: 12px; }
.task-avatar.tone-orange {
  background: linear-gradient(135deg, #fdba74, #f97316);
  box-shadow: 0 8px 18px rgba(249,115,22,0.18);
}
.tone-border-orange::before { background: linear-gradient(180deg, #fdba74, #f97316); }

/* ===== Notes page ===== */
.notes-hero {
  background:
    radial-gradient(circle at top right, rgba(251,191,36,0.14), transparent 40%),
    radial-gradient(circle at bottom left, rgba(59,130,246,0.10), transparent 36%),
    #fff;
}
.notes-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.note-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: taskCardIn 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.note-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(28,36,52,0.10);
}
.note-card.compact {
  box-shadow: none;
  border-radius: 16px;
  animation: none;
}
.note-card.compact:hover { transform: none; }
.note-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.note-card-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.note-card-identity h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.note-card-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.note-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.note-lang {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 800;
}
.note-card-body {
  margin: 0 0 14px;
  line-height: 1.55;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
}
.note-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.note-link-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-pending { background: #dbeafe; color: #1d4ed8; }
.badge-running { background: #fce7f3; color: #be185d; }
.badge-complete { background: #dcfce7; color: #15803d; }
.badge-active { background: #dcfce7; color: #15803d; }

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
table.data th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="datetime-local"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 0.8rem; }
.stat strong { display: block; margin-top: 6px; font-size: 1.5rem; font-family: var(--display); }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  letter-spacing: -0.03em;
}
.auth-card p { margin: 0 0 22px; color: var(--muted); }
.auth-card .form-grid { grid-template-columns: 1fr; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.voice-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 58ch;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.voice-controls label {
  min-width: 200px;
}

.mic-btn.listening {
  background: linear-gradient(135deg, #f472b6, #ec4899);
  animation: pulseMic 1.2s ease-in-out infinite;
}

@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.voice-result {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
}

.voice-result.hidden { display: none; }

.result-block { margin-bottom: 12px; }
.result-block p { margin: 6px 0 0; color: var(--ink); }
.result-block ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink); }

.notes-list { display: grid; gap: 12px; }
.note-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}
.note-item p { margin: 0; line-height: 1.5; }

/* ===== Users (admin) ===== */
.users-hero {
  background:
    radial-gradient(circle at top right, rgba(249,115,22,0.12), transparent 40%),
    radial-gradient(circle at bottom left, rgba(59,130,246,0.10), transparent 36%),
    #fff;
}
.user-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.user-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: taskCardIn 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.user-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.user-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.user-card-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.user-card-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ===== My Schedule (full calendar) ===== */
.schedule-hero {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 42%),
    radial-gradient(circle at bottom left, rgba(251,191,36,0.10), transparent 36%),
    #fff;
}
.schedule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.schedule-summary > div {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.schedule-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.schedule-summary strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 1.35rem;
}
.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}
.schedule-calendar-panel,
.schedule-detail-panel {
  margin-bottom: 0;
}

.month-cal-head,
.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.month-cal-head {
  margin-bottom: 8px;
}
.month-cal-head div {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}
.month-day {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.month-day:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cfe0ff;
  background: #fff;
}
.month-day.is-out {
  opacity: 0.45;
  background: #f5f7fa;
}
.month-day.is-today {
  border-color: #93c5fd;
  background: #eff6ff;
}
.month-day.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
  background: #fff;
}
.month-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.month-day-top strong {
  font-family: var(--display);
  font-size: 1rem;
}
.month-day-top em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 2px 7px;
}
.month-day-events {
  display: grid;
  gap: 4px;
}
.month-event {
  display: block;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-event.tone-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.month-event.tone-pink { background: linear-gradient(135deg, #f9a8d4, #ec4899); }
.month-event.tone-orange { background: linear-gradient(135deg, #fdba74, #f97316); }
.month-event.tone-green { background: linear-gradient(135deg, #86efac, #16a34a); }
.month-more {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.week-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.week-day {
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.week-day.is-today { background: #eff6ff; border-color: #93c5fd; }
.week-day.is-selected { box-shadow: 0 0 0 2px rgba(37,99,235,0.15); border-color: #2563eb; background: #fff; }
.week-day-head {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.week-day-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.week-day-head strong {
  font-family: var(--display);
  font-size: 1.35rem;
}
.week-day-head em {
  font-style: normal;
  color: var(--blue-deep);
  font-size: 0.72rem;
  font-weight: 700;
}
.week-day-body {
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  flex: 1;
}
.week-empty {
  color: #c0c7d4;
  text-align: center;
  font-size: 0.8rem;
  padding: 24px 8px;
}
.week-event {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
}
.week-event.tone-blue { background: linear-gradient(160deg, #60a5fa, #2563eb); }
.week-event.tone-pink { background: linear-gradient(160deg, #f9a8d4, #ec4899); }
.week-event.tone-orange { background: linear-gradient(160deg, #fdba74, #f97316); }
.week-event.tone-green { background: linear-gradient(160deg, #86efac, #16a34a); }
.week-event-time { font-size: 0.68rem; font-weight: 800; opacity: 0.92; }
.week-event strong { font-size: 0.82rem; line-height: 1.25; }
.week-event span:last-child { font-size: 0.72rem; opacity: 0.9; }

.schedule-empty {
  text-align: center;
  padding: 42px 16px;
  color: var(--muted);
}
.schedule-empty strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  margin-bottom: 6px;
}
.schedule-empty p { margin: 0 0 14px; }

.day-agenda {
  display: grid;
  gap: 12px;
}
.agenda-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.agenda-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.agenda-card.tone-border-blue::before { background: #2563eb; }
.agenda-card.tone-border-pink::before { background: #ec4899; }
.agenda-card.tone-border-orange::before { background: #f97316; }
.agenda-card.tone-border-green::before { background: #16a34a; }
.agenda-time-col {
  text-align: center;
  padding-top: 4px;
}
.agenda-time-col strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1;
}
.agenda-time-col span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  margin: 2px 0 8px;
}
.agenda-time-col em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}
.agenda-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.agenda-identity {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.agenda-identity h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.3;
}
.agenda-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.agenda-desc {
  margin: 0 0 10px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #4b5568;
}
.agenda-note {
  margin: 0 0 10px;
  border-left: 3px solid #fbbf24;
  background: #fffbeb;
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
}
.agenda-note span {
  display: block;
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.agenda-note p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #78350f;
}
.agenda-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.agenda-meta > div {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #eef2f7;
}
.agenda-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.agenda-meta strong { font-size: 0.82rem; }
.agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .app-shell,
  .app-shell.no-right { grid-template-columns: 220px 1fr; }
  .rightbar { display: none; }
  .schedule-layout { grid-template-columns: 1fr; }
  .client-profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .month-day { min-height: 92px; padding: 8px; }
  .month-event { font-size: 0.62rem; padding: 3px 5px; }
  .month-day-events .month-event:nth-child(n+3) { display: none; }
  .schedule-summary { grid-template-columns: 1fr; }
  .client-board,
  .notes-board,
  .user-board { grid-template-columns: 1fr; }
  .client-stats,
  .client-profile-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .app-shell,
  .app-shell.no-right { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .client-card { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 48px repeat(3, 1fr); }
  .kanban { grid-template-columns: 1fr; }

  .cal-toolbar-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cal-toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cal-jump { width: 100%; }
  .cal-jump input[type="date"] { flex: 1; min-width: 0; }
  .cal-legend { flex-wrap: wrap; gap: 8px; }

  .gantt-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .gantt-scroll.is-week .gantt { min-width: 720px; }
  .gantt-scroll.is-month .gantt { min-width: 980px; }
  .gantt {
    grid-template-columns: minmax(160px, 200px) 1fr;
  }
  .gantt-row-label {
    flex-wrap: wrap;
    gap: 6px;
  }
  .gantt-status { display: none; }
  .gantt-bar {
    height: 44px;
    padding: 0 10px 0 5px;
    gap: 6px;
  }
  .gantt-bar-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 0.65rem;
  }
  .gantt-bar-text { min-width: 0; }
  .gantt-bar-title {
    font-size: 0.7rem;
  }
  .gantt-bar-time {
    font-size: 0.58rem;
  }

  .month-cal-head,
  .month-cal-grid { gap: 4px; }
  .month-day { min-height: 74px; border-radius: 12px; }
  .month-day-events .month-event:nth-child(n+2) { display: none; }
  .month-day-top strong { font-size: 0.9rem; }

  .week-cal {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
  }

  .agenda-card { grid-template-columns: 58px 1fr; padding: 12px; }
  .agenda-meta { grid-template-columns: 1fr; }
  .agenda-top { flex-direction: column; }
}

@media (max-width: 560px) {
  .month-cal-head div:nth-child(n) {
    font-size: 0.62rem;
  }
  .month-day {
    min-height: 64px;
    padding: 6px;
  }
  .month-day-events { display: none; }
  .month-day-top em {
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    background: #2563eb;
  }
  .gantt {
    grid-template-columns: minmax(130px, 150px) 1fr;
  }
  .gantt-meta span { display: none; }
}
