:root {
  --ink: #172033;
  --muted: #6d7890;
  --line: rgba(91, 33, 182, 0.12);
  --soft: #f3eefe;
  --shadow: 0 22px 50px rgba(91, 33, 182, 0.16);
  --radius: 22px;
  --main: #7c3aed;
  --main-deep: #5b21b6;
  --main-soft: #ede4ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; }
body {
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  overflow: hidden;
  background:
    radial-gradient(1100px 680px at -6% -12%, #93c5fd, transparent 58%),
    radial-gradient(980px 720px at 108% -8%, #c4b5fd, transparent 56%),
    radial-gradient(860px 640px at 72% 118%, #7dd3fc, transparent 52%),
    radial-gradient(520px 420px at 40% 40%, rgba(244, 114, 182, 0.35), transparent 60%),
    linear-gradient(155deg, #bfdbfe 0%, #e9d5ff 48%, #ddd6fe 100%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.avatar, .mark img, .who img {
  width: 44px; height: 44px; min-width: 44px; max-width: 44px; flex: 0 0 44px;
  border-radius: 50%; object-fit: cover; object-position: center; image-rendering: auto;
}
a { color: inherit; }

.stage { height: 100%; }
#login { overflow: auto; }
#app { overflow: hidden; }
.hidden { display: none !important; }

.login-card {
  width: min(440px, calc(100% - 32px));
  margin: 48px auto;
  background: #fff;
  border-radius: 32px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand img, .brand img { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: #fff; }
.login-brand strong { display: block; font-size: 1.05rem; }
.login-brand span, .lede { color: var(--muted); }
.login-card h1 { margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -0.04em; }
.lede { margin: 0 0 18px; line-height: 1.5; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--soft); padding: 6px; border-radius: 16px; margin-bottom: 18px; }
.role-switch button, .ranges button {
  border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; font-weight: 700; color: var(--muted);
}
.role-switch button.on, .ranges button.on, .ranges button.on:hover { background: #6d28d9; color: #fff; box-shadow: none; }
.ranges input[type="date"] { width: auto; border: 0; border-radius: 999px; padding: 6px 8px; background: #f6f3fb; }
label { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #c4b5fd; box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16); }
.pw { position: relative; }
.pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.form-error { min-height: 1.1em; color: #e11d48; font-size: 0.85rem; margin: 0 0 8px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; }
.btn.solid { background: #6d28d9; color: #fff; width: 100%; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; }
.live-row { display: flex; gap: 8px; flex-wrap: wrap; }
.live-person { display: flex; align-items: center; gap: 8px; background: #dcfce7; color: #047857; border: 0; border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 800; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.btn.ghost { background: var(--main-soft); color: var(--main-deep); }
.btn.green { background: #d9fbe8; color: #047857; }
.btn.rose { background: #ffe0e7; color: #be123c; }
.btn.blue { background: #dbeafe; color: #1d4ed8; }
.btn.tiny { padding: 8px 12px; border-radius: 12px; font-size: 0.8rem; }
.text-btn { display: inline-block; margin-top: 14px; background: none; border: 0; font-weight: 700; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100% - 28px);
  margin: 14px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.35), 0 24px 60px rgba(99, 102, 241, 0.18);
  overflow: hidden;
}
aside {
  display: flex; flex-direction: column; gap: 8px; padding: 18px 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(237, 233, 254, 0.38) 100%);
  border-right: 1px solid rgba(124, 58, 237, 0.14);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; padding: 6px 8px 16px; letter-spacing: -0.03em; }
nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow: auto; }
nav button, .rail-out {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 16px; padding: 8px 10px; font-weight: 700; color: #44506a;
}
nav button i { width: 34px; height: 34px; border-radius: 12px; background: #e7eeff; color: #3157d5; }
nav button:nth-child(2) i { background: #ddfbea; color: #059669; }
nav button:nth-child(3) i { background: #fff1df; color: #ea580c; }
nav button:nth-child(4) i { background: #ffe4ee; color: #e11d48; }
nav button:nth-child(5) i { background: #f3e8ff; color: #7c3aed; }
nav button:nth-child(6) i { background: #e0f7ff; color: #0284c7; }
nav button:nth-child(7) i { background: #fef3c7; color: #d97706; }
nav button:nth-child(8) i { background: #e0f2fe; color: #0369a1; }
nav button:nth-child(9) i { background: #e8eefc; color: #4338ca; }
nav button.on, nav button.on:hover {
  background: #6d28d9;
  color: #fff;
  box-shadow: none;
}
nav button.on i, nav button.on:hover i { background: rgba(255,255,255,0.22); color: #fff; }
nav button:hover { background: rgba(124, 58, 237, 0.1); color: #44506a; }
.rail-out:hover { background: rgba(225, 29, 72, 0.08); }
.rail-out { color: #e11d48; }
.badge { margin-left: auto; background: #ffe4e6; color: #9f1239; border-radius: 999px; padding: 2px 7px; font-size: 0.7rem; }
nav button.on .badge { background: #fff; color: #1e2433; }
i[data-ico] { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 18px; }
i[data-ico] svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.workspace { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px 10px; flex-wrap: wrap; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(247, 243, 255, 0.28) 100%);
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}
.titles { min-width: 150px; }
.titles p { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.titles h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.04em; }
.ranges { display: flex; gap: 4px; flex-wrap: wrap; background: #fff; padding: 4px; border-radius: 999px; box-shadow: 0 6px 18px rgba(40, 56, 90, 0.06); }
.ranges button { border-radius: 999px; padding: 8px 12px; font-size: 0.8rem; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #eadfff; border-radius: 999px; padding: 0 14px; min-width: 220px; flex: 1; box-shadow: 0 8px 18px rgba(124, 58, 237, 0.08); }
.search input { border: 0; box-shadow: none; padding: 11px 0; background: transparent; }
.who { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; }
.who img, .avatar { background: #e8eef8; }
.who strong { display: block; font-size: 0.86rem; }
.who span { color: var(--muted); font-size: 0.72rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; border: 0; background: #fff; display: none; place-items: center; color: var(--ink); }
.theme-btn { display: grid; width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; }
.login-theme { position: absolute; top: 18px; right: 18px; }

#view { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 28px; scrollbar-width: none; }
#view::-webkit-scrollbar, nav::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .op-week::-webkit-scrollbar, .shot-row::-webkit-scrollbar, .week::-webkit-scrollbar, #login::-webkit-scrollbar, .dialog::-webkit-scrollbar { width: 0; height: 0; display: none; }
nav, .table-wrap, .op-week, .shot-row, .week, #login, .dialog { scrollbar-width: none; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  border-radius: 22px; padding: 16px; color: #fff; min-height: 124px;
  display: grid; grid-template-columns: 1fr 44px; grid-template-rows: auto 1fr auto; gap: 6px 10px; align-content: space-between;
  position: relative; overflow: hidden;
}
.kpi::before, .kpi::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,0.16);
}
.kpi::before { width: 140px; height: 140px; right: -48px; top: -56px; }
.kpi::after { width: 84px; height: 84px; left: -28px; bottom: -36px; background: rgba(255,255,255,0.1); }
.kpi b, .kpi span, .kpi em, .kpi > i { color: #fff; opacity: 1; position: relative; z-index: 1; }
.kpi span { font-size: 0.78rem; font-weight: 800; align-self: center; line-height: 1.2; }
.kpi b { grid-column: 1 / -1; font-size: 1.55rem; letter-spacing: -0.04em; line-height: 1.1; }
.kpi em { grid-column: 1 / -1; font-style: normal; font-size: 0.75rem; font-weight: 700; line-height: 1.3; }
.kpi > i {
  width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,0.22); color: #fff;
  display: grid; place-items: center; flex: none;
}
.kpi > i svg { width: 22px; height: 22px; }
.mint { background: linear-gradient(160deg, #10b981, #047857); }
.sky { background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.violet { background: linear-gradient(160deg, #8b5cf6, #6d28d9); }
.amber { background: linear-gradient(160deg, #f97316, #c2410c); }
.rose { background: linear-gradient(160deg, #f43f5e, #be123c); }
.slate { background: linear-gradient(160deg, #475569, #1e293b); }

.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.quick-btn {
  display: grid; justify-items: center; gap: 8px; border: 0; border-radius: 18px;
  background: #fff; padding: 14px 8px; font-weight: 800; font-size: 0.78rem; color: var(--ink);
}
.quick-btn i { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; }
.quick-btn.sky i { background: #dbeafe; color: #1d4ed8; }
.quick-btn.mint i { background: #dcfce7; color: #047857; }
.quick-btn.amber i { background: #ffedd5; color: #c2410c; }
.quick-btn.violet i { background: #ede9fe; color: #6d28d9; }
.quick-btn.rose i { background: #ffe4e6; color: #be123c; }
.quick-btn.slate i { background: #e2e8f0; color: #1e293b; }
.quick-btn i svg { width: 20px; height: 20px; }
.split { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
.split-3 { grid-template-columns: 0.92fr 1.15fr 0.9fr; align-items: start; }
.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 12px 28px rgba(63, 92, 160, 0.08); border: 1px solid rgba(255,255,255,0.8); }
.card h2 { margin: 0 0 12px; font-size: 1rem; letter-spacing: -0.03em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { margin: 0 0 4px; font-size: 0.95rem; }
.donut-wrap { position: relative; height: 168px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 1.6rem; display: block; }
.donut-center span { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.legend { display: flex; gap: 12px; justify-content: center; color: var(--muted); font-size: 0.78rem; font-weight: 700; margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.task-list, .stack { display: grid; gap: 10px; }
.task {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  border-radius: 18px; padding: 12px; background: var(--soft); text-align: left; border: 0; width: 100%;
}
.task strong, .task p { display: block; line-height: 1.3; }
.task p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task:nth-child(4n+1) { background: #ffe8d6; }
.task:nth-child(4n+2) { background: #e4edff; }
.task:nth-child(4n+3) { background: #f3e4ff; }
.task:nth-child(4n) { background: #ddf8ea; }
.mark { position: relative; width: 44px; height: 44px; min-width: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-weight: 800; overflow: hidden; }
.mark b { font-size: 0.72rem; letter-spacing: 0.02em; line-height: 1; }
.mark.lg { width: 72px; height: 72px; min-width: 72px; }
.mark.lg b { font-size: 1.05rem; }
.mark img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: inherit; z-index: 1; background: #fff; }
.task p, .meta { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }
.pill { border-radius: 999px; padding: 4px 8px; font-size: 0.72rem; font-weight: 800; background: #fff; white-space: nowrap; }
.pill.ok { color: #166534; background: #dcfce7; }
.pill.warn { color: #9a3412; background: #ffedd5; }
.pill.bad { color: #9f1239; background: #ffe4e6; }
.pill.info { color: #1d4ed8; background: #dbeafe; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 8px; }
td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f8fafc; }
tr.live td { background: #f0fdf4; }
tr.live .person { color: #047857; }
tr.live .bar > span { background: linear-gradient(90deg, #4ade80, #16a34a); }
tr.live:hover td { background: #dcfce7; }
.task.live { background: #dcfce7; }
.task.live strong { color: #047857; }
.person { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; min-width: 72px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #c4b5fd, #7c3aed); }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board.single { grid-template-columns: 1fr; }
button.kpi { border: 0; text-align: left; width: 100%; }
button.kpi.on { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.9); }
.col { background: #f4f0ff; border-radius: 20px; padding: 12px; min-height: 220px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); }
.col-soon { background: #fff4e8; }
.col-progress { background: #eefbf3; }
.col-done { background: #eef2ff; }
.col h3 { margin: 0 0 8px; font-size: 0.92rem; letter-spacing: 0; text-transform: none; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.col h3 em { font-style: normal; background: #fff; border-radius: 999px; min-width: 28px; text-align: center; padding: 2px 8px; color: var(--main-deep); }
.col-body { overflow: auto; scrollbar-width: none; display: grid; gap: 8px; align-content: start; }
.col-body::-webkit-scrollbar { display: none; }
.ticket { background: #fff; border-radius: 16px; padding: 12px; border: 0; width: 100%; text-align: left; box-shadow: 0 8px 18px rgba(91, 33, 182, 0.06); }
.proj-card { display: grid; gap: 4px; border-left: 4px solid #7c3aed; }
.proj-card.soon { border-left-color: #f97316; }
.proj-card.progress { border-left-color: #16a34a; }
.proj-card.done { border-left-color: #64748b; }
.proj-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.proj-top b { font-size: 0.92rem; }
.app-list { display: flex; gap: 12px; flex-wrap: wrap; }
.app-card { width: 280px; border: 2px solid transparent; }
.app-card.on { border-color: #6d28d9; }
.detail-page { display: grid; gap: 16px; }
.member-stats { grid-template-columns: 1.1fr 0.9fr 1.2fr; }
.member-split { grid-template-columns: 1.45fr 0.85fr; align-items: start; }
.stat-card { display: grid; align-content: space-between; min-height: 128px; position: relative; }
.stat-card span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.stat-card b { font-size: 1.7rem; letter-spacing: -0.04em; }
.stat-card em { font-style: normal; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.stat-donut .donut-wrap.mini { position: absolute; right: 12px; top: 28px; width: 84px; height: 84px; }
.donut-wrap.tall { height: 240px; }
.donut-wrap.spark { height: 72px; }
.slim-row .kpi { min-height: 108px; }
.slim-row .kpi b { font-size: 1.15rem; word-break: break-word; }
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.proj-head h2 { margin: 0; }
.proj-head .donut-wrap.mini { width: 84px; height: 84px; position: relative; flex: 0 0 84px; }
.proj-line { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.proj-line i { width: 8px; height: 28px; border-radius: 99px; }
.proj-line b, .proj-line small { display: block; }
.proj-line small { color: var(--muted); font-weight: 700; margin-top: 2px; }
.proj-line em { font-style: normal; font-weight: 800; }
.person-head {
  display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
  background: linear-gradient(115deg, #ffffff 0%, #efe8ff 58%, #dbeafe 100%);
  border: 1px solid rgba(124, 58, 237, 0.14);
}
.person-head::before, .person-head::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.person-head::before { width: 180px; height: 180px; right: -50px; top: -80px; background: rgba(124, 58, 237, 0.14); }
.person-head::after { width: 90px; height: 90px; left: 180px; bottom: -40px; background: rgba(59, 130, 246, 0.16); }
.person-head > * { position: relative; z-index: 1; }
.person-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.person-head .mark.lg { box-shadow: 0 0 0 4px #fff, 0 0 0 7px #c4b5fd; }
.person-head .btn { margin-left: auto; }
.role-pill { display: inline-flex; margin-top: 6px; background: #ede9fe; color: #6d28d9; border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 800; }
.report-tabs { width: fit-content; }
.report-sticky {
  position: sticky; top: -16px; z-index: 5;
  margin: -16px -22px 4px; padding: 16px 22px 12px;
  display: grid; gap: 10px;
  background: linear-gradient(180deg, #efe7ff 0%, #efe7ff 72%, rgba(239, 231, 255, 0) 100%);
}
.set-row, .report-member { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card > .set-row:first-child, .report-members .report-member:first-child { border-top: 0; padding-top: 0; }
.set-row b, .report-member b { display: block; }
.who-bit { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-bit small, .report-member small { display: block; color: var(--muted); font-weight: 700; }
.report-card .op-week { margin-top: 12px; }
.report-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-bar h2 { margin: 0; }
.report-bar .btn { width: auto; }
.report-bar .ranges { margin-left: auto; }
.report-setup { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
.mail-list, .report-members { display: grid; gap: 8px; }
.mail-chip { display: inline-flex; align-items: center; gap: 8px; background: #ede9fe; color: #5b21b6; border-radius: 999px; padding: 6px 8px 6px 12px; font-weight: 800; width: fit-content; }
.mail-chip button { border: 0; background: #fff; color: #6d28d9; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; }
.report-add { display: flex; gap: 8px; align-items: center; }
.report-add input { margin: 0; }
.report-add .btn { width: auto; white-space: nowrap; }
.report-card header { display: flex; align-items: center; gap: 12px; }
.report-card header h2 { margin: 0; font-size: 1rem; }
.report-card header b { margin-left: auto; font-size: 1.2rem; }
.report-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.report-metrics span { background: #f8fafc; border: 1px solid #e8edf3; border-radius: 14px; padding: 8px; }
.report-metrics small { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; }
.report-card .proj-line i { background: #2563eb; }
.avatar.lg { width: 72px; height: 72px; min-width: 72px; max-width: 72px; flex-basis: 72px; border-radius: 50%; }
.break-table thead th { background: transparent; color: var(--muted); }
.break-table td:first-child { text-align: left; font-weight: 700; }
.day-block { background: #f7f4ff; border: 0; border-radius: 18px; overflow: hidden; }
.day-block summary { cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.day-block summary::-webkit-details-marker { display: none; }
.day-block summary b { display: block; }
.day-block summary small { color: var(--muted); font-weight: 700; }
.day-body { padding: 0 12px 14px; }
.day-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.day-stats div { background: #fff; border-radius: 14px; padding: 10px 12px; }
.day-stats span { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.day-stats b { font-size: 0.92rem; }
.hour-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; margin-top: 8px; }
.hour-label { font-weight: 800; color: #5b21b6; background: #fff; border-radius: 14px; text-align: center; padding: 10px 0; }
.hour-sessions { display: grid; gap: 10px; }
.chunk { background: #fff; border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 20px rgba(91, 33, 182, 0.06); }
.chunk-head { background: transparent; color: var(--ink); font-weight: 700; padding: 12px; display: flex; align-items: center; gap: 10px; }
.chunk-head small { display: block; color: var(--muted); font-weight: 700; }
.chunk .shot-row { padding: 0 12px 12px; }
.shot-card { margin: 0; min-width: 176px; background: #f7f4ff; border-radius: 16px; padding: 8px; }
.shot { border: 0; padding: 0; background: transparent; border-radius: 12px; overflow: hidden; }
.shot img, .shot-full { width: 160px; height: 96px; object-fit: cover; display: block; background: #efeaf8; border-radius: 12px; }
.shot-full { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.shot-card figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.no-shot { width: 160px; min-height: 96px; display: grid; place-items: center; border: 0; border-radius: 12px; background: #fff; color: var(--muted); font-size: 0.75rem; padding: 8px; text-align: center; }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 6px; height: 14px; border-radius: 3px; background: #e4e0ee; }
.meter i.on { background: linear-gradient(180deg, #c4b5fd, #6d28d9); }
.dialog.wide { width: min(920px, 100%); }
.op-card { margin-top: 16px; }
.op-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.op-bar select { width: auto; min-width: 200px; }
.op-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.op-day {
  background: color-mix(in srgb, var(--day, #64748b) 14%, #fff);
  border-radius: 18px; min-height: 112px; padding: 8px; display: flex; flex-direction: column;
  box-shadow: inset 0 3px 0 var(--day, #64748b);
}
.op-day.weekend { background: color-mix(in srgb, var(--day, #64748b) 8%, #f8fafc); }
.op-day.today { box-shadow: inset 0 3px 0 var(--day, #334155), inset 0 0 0 2px var(--day, #334155); }
.op-total { text-align: center; font-weight: 800; color: var(--day, #334155); }
.op-pills { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; flex: 1; margin: 8px 0; }
.op-pill { color: #fff; border-radius: 12px; padding: 8px; display: grid; gap: 2px; min-height: 52px; }
.op-pill b { font-size: 0.82rem; }
.op-pill span { font-size: 0.7rem; line-height: 1.25; }
.op-pill em { font-style: normal; font-size: 0.65rem; opacity: 0.9; }
.op-name { text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--day, #334155); }
.op-name small { display: block; color: var(--muted); font-weight: 700; }
.op-empty { margin: auto; color: var(--muted); font-weight: 700; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.day-col { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: 170px; }
.capsule { border-radius: 16px; color: #fff; font-size: 0.72rem; font-weight: 800; padding: 10px 8px; text-align: center; }
.day-label { text-align: center; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.shot-row { display: flex; gap: 8px; overflow: auto; padding-bottom: 4px; }
.shot-row figure { margin: 0; min-width: 148px; }
.shot-row img { width: 148px; height: 88px; object-fit: cover; border-radius: 12px; background: #e5e7eb; }
.shot-row figcaption { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: auto; }
.well-grid { grid-template-columns: 1fr 1fr; align-items: start; }
.well-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.well-card header h2 { margin: 0; }
.well-card header > i { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: #ede9fe; color: #6d28d9; flex: 0 0 46px; }
.well-card header > i svg { width: 22px; height: 22px; }
.well-grid .well-card:nth-child(1) header > i { background: #dbeafe; color: #1d4ed8; }
.well-grid .well-card:nth-child(2) header > i { background: #ffedd5; color: #c2410c; }
.switch { position: relative; width: 48px; height: 28px; margin-left: auto; flex: 0 0 48px; }
.switch input { position: absolute; inset: 0; width: 48px; height: 28px; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #e5e7eb; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(23, 32, 51, 0.18); transition: left 0.2s ease; }
.switch input:checked + i { background: #6d28d9; }
.switch input:checked + i::after { left: 23px; }
.well-save { display: flex; align-items: flex-end; gap: 12px; }
.well-save label { flex: 1; margin: 0; max-width: 220px; }
.well-save .btn { width: auto; margin-bottom: 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.file-row, .note { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.modal { position: fixed; inset: 0; background: rgba(20, 27, 43, 0.35); display: grid; place-items: center; padding: 18px; z-index: 20; }
.dialog { width: min(560px, 100%); background: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow); max-height: calc(100vh - 36px); overflow: auto; }
.dialog h2 { margin: 0 0 12px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: #1e2433; color: #fff; padding: 12px 16px; border-radius: 14px; opacity: 0; transform: translateY(8px); transition: 0.25s ease; z-index: 30; max-width: min(360px, calc(100% - 36px)); }
.toast.show { opacity: 1; transform: none; }
.loader { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,0.35); z-index: 40; }
.loader span { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(30,36,51,0.15); border-top-color: #1e2433; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.login-card, .shell { animation: rise 0.45s ease backwards; }
#view > * { animation: rise 0.4s ease backwards; }
#view .kpi { animation: rise 0.45s ease backwards; }
#view .kpis .kpi:nth-child(2) { animation-delay: 0.05s; }
#view .kpis .kpi:nth-child(3) { animation-delay: 0.1s; }
#view .kpis .kpi:nth-child(4) { animation-delay: 0.15s; }
#view .kpis .kpi:nth-child(5) { animation-delay: 0.2s; }
.kpi, .ticket, .task, .card, nav button, .btn, .live-person { transition: translate 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease; }
.kpi:hover, .ticket:hover { translate: 0 -3px; }
.task:hover { box-shadow: 0 8px 18px rgba(91, 33, 182, 0.1); }
.modal { animation: fade 0.2s ease; }
.dialog { animation: rise 0.28s ease backwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 210px 1fr; }
  .kpis, .kpis.five, .split, .board, .summary-grid, .quick, .well-grid, .member-stats, .report-setup { grid-template-columns: 1fr 1fr; }
  .report-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-3, .member-split { grid-template-columns: 1fr; }
  .op-week { grid-template-columns: repeat(7, minmax(108px, 1fr)); overflow: auto; }
  .search { min-width: 160px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; margin: 0; height: 100%; border-radius: 0; }
  aside {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); height: 100%; z-index: 15;
    transform: translateX(-105%); transition: 0.25s ease; background: #fff; box-shadow: var(--shadow);
  }
  .shell.nav-open aside { transform: none; }
  .shell.nav-open::before { content: ""; position: fixed; inset: 0; background: rgba(20,27,43,0.35); z-index: 14; }
  .icon-btn.menu { display: grid; }
  .top { align-items: flex-start; }
  .titles { flex: 1; }
  .titles h1 { font-size: 1.2rem; }
  .ranges { width: 100%; overflow: auto; order: 4; }
  .who { margin-left: auto; }
  .kpis, .kpis.five, .split, .board, .form-grid, .summary-grid, .hour-row, .day-stats, .well-grid, .member-stats, .member-split, .report-setup, .report-metrics { grid-template-columns: 1fr; }
  .report-add { flex-direction: column; align-items: stretch; }
  .well-save { flex-direction: column; align-items: stretch; }
  .well-save label { max-width: none; }
  .well-save .btn { margin-bottom: 0; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .week, .op-week { grid-template-columns: repeat(7, minmax(88px, 1fr)); overflow: auto; }
  .search { min-width: 0; width: 100%; order: 5; }
  .person-head { flex-wrap: wrap; }
  .person-head .btn { margin-left: 0; }
  .app-card { width: 100%; }
  .col { max-height: none; }
  table { min-width: 680px; }
  .file-row, .note { flex-wrap: wrap; }
  #view, .top { padding-left: 14px; padding-right: 14px; }
  .report-sticky { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 520px) {
  .kpi b { font-size: 1.3rem; }
  .who strong, .who span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dialog { border-radius: 18px; padding: 16px; }
}

html[data-theme="dark"] {
  --ink: #f5f3ff;
  --muted: #c4b5fd;
  --line: rgba(196, 181, 253, 0.18);
  --soft: #2a2340;
  --main-soft: #3b2764;
  --main-deep: #ddd6fe;
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(980px 620px at 0% 0%, rgba(59, 130, 246, 0.55), transparent 60%),
    radial-gradient(900px 640px at 100% 8%, rgba(139, 92, 246, 0.62), transparent 56%),
    radial-gradient(760px 540px at 70% 100%, rgba(56, 189, 248, 0.32), transparent 54%),
    #100c18;
}
html[data-theme="dark"] .shell {
  background: rgba(23, 18, 34, 0.72);
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.28), 0 24px 60px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] aside,
html[data-theme="dark"] .top { background: #14101e; border-color: rgba(196, 181, 253, 0.14); }
html[data-theme="dark"] .quick-btn,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .card.person-head { background: linear-gradient(115deg, #221b33 0%, #31245a 62%, #1e2a44 100%); }
html[data-theme="dark"] .person-head .mark.lg { box-shadow: 0 0 0 4px #221b33, 0 0 0 7px #7c3aed; }
html[data-theme="dark"] .role-pill { background: #3b2764; color: #ddd6fe; }
html[data-theme="dark"] .mail-chip { background: #3b2764; color: #ddd6fe; }
html[data-theme="dark"] .mail-chip button { background: #221b33; color: #ddd6fe; }
html[data-theme="dark"] .report-metrics span { background: #1e2433; border-color: #334155; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .dialog,
html[data-theme="dark"] .ticket,
html[data-theme="dark"] .chunk,
html[data-theme="dark"] .ranges,
html[data-theme="dark"] .search,
html[data-theme="dark"] .who,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .mark,
html[data-theme="dark"] .day-stats div,
html[data-theme="dark"] .hour-label,
html[data-theme="dark"] .no-shot,
html[data-theme="dark"] .col h3 em { background: #221b33; color: var(--ink); }
html[data-theme="dark"] .hour-label,
html[data-theme="dark"] .col h3 em { color: #ddd6fe; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .ranges input[type="date"] { background: #161222; color: #f5f3ff; }
html[data-theme="dark"] .search input { background: transparent; }
html[data-theme="dark"] nav button,
html[data-theme="dark"] .rail-out { color: #ddd6fe; }
html[data-theme="dark"] nav button:hover { background: rgba(139, 92, 246, 0.18); color: #fff; }
html[data-theme="dark"] nav button i { background: #2e2644; }
html[data-theme="dark"] .day-block,
html[data-theme="dark"] .shot-card,
html[data-theme="dark"] .report-sticky { background: linear-gradient(180deg, #161222 0%, #161222 72%, rgba(22, 18, 34, 0) 100%); }
html[data-theme="dark"] .col { background: #2a2340; }
html[data-theme="dark"] .op-day { background: color-mix(in srgb, var(--day, #94a3b8) 24%, #161222); }
html[data-theme="dark"] .op-day.weekend { background: color-mix(in srgb, var(--day, #94a3b8) 14%, #161222); }
html[data-theme="dark"] .col-soon { background: #3a2a22; }
html[data-theme="dark"] .col-progress { background: #163226; }
html[data-theme="dark"] .col-done { background: #22263a; }
html[data-theme="dark"] .task:nth-child(4n+1) { background: #3a2a22; }
html[data-theme="dark"] .task:nth-child(4n+2) { background: #1e2a44; }
html[data-theme="dark"] .task:nth-child(4n+3) { background: #32244a; }
html[data-theme="dark"] .task:nth-child(4n) { background: #163226; }
html[data-theme="dark"] .task.live,
html[data-theme="dark"] tr.live td,
html[data-theme="dark"] .live-person { background: #14532d; color: #bbf7d0; }
html[data-theme="dark"] tr.live .person,
html[data-theme="dark"] .task.live strong { color: #86efac; }
html[data-theme="dark"] tr.clickable:hover td,
html[data-theme="dark"] tr.live:hover td { background: #2a2340; }
html[data-theme="dark"] tr.live:hover td { background: #166534; }
html[data-theme="dark"] .bar,
html[data-theme="dark"] .meter i { background: #322848; }
html[data-theme="dark"] .switch i { background: #3b2764; }
html[data-theme="dark"] .switch input:checked + i { background: #7c3aed; }
html[data-theme="dark"] .pill { background: #322848; color: #f5f3ff; }
html[data-theme="dark"] .pill.ok { color: #bbf7d0; background: #14532d; }
html[data-theme="dark"] .pill.warn { color: #fed7aa; background: #7c2d12; }
html[data-theme="dark"] .pill.bad { color: #fecdd3; background: #881337; }
html[data-theme="dark"] .pill.info { color: #dbeafe; background: #1e3a8a; }
html[data-theme="dark"] .btn.ghost { background: #3b2764; color: #ddd6fe; }
html[data-theme="dark"] .btn.green { background: #14532d; color: #bbf7d0; }
html[data-theme="dark"] .btn.rose { background: #881337; color: #fecdd3; }
html[data-theme="dark"] .btn.blue { background: #1e3a8a; color: #dbeafe; }
html[data-theme="dark"] .modal { background: rgba(0, 0, 0, 0.62); }
html[data-theme="dark"] .op-name,
html[data-theme="dark"] .op-total { color: var(--day, #e2e8f0); }
html[data-theme="dark"] .app-card.on { border-color: #a78bfa; }
