:root {
  color-scheme: dark;
  font-family: Inter, Geist, "Segoe UI", system-ui, sans-serif;
  --bg: #09090a;
  --sidebar: #101011;
  --panel: #121213;
  --field: #0c0c0d;
  --line: #2c292c;
  --light-line: #454347;
  --ink: #f8f6f7;
  --muted: #bab6ba;
  --subtle: #a3a0a4;
  --red: #ff5b61;
  --red-ink: #23080a;
  --red-surface: #2c181b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #ff9097; outline-offset: 3px; }
svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; min-width: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 32px;
  padding: 24px 15px 20px; background: var(--sidebar); border-right: 1px solid #2a292b;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; }
.brand strong { font-size: 1.12rem; letter-spacing: -.04em; }
.brand small, .profile small { display: block; margin-top: 3px; color: var(--subtle); font-size: .77rem; line-height: 1.4; }
.mark {
  display: grid; place-items: center; flex: none; width: 39px; height: 39px; border-radius: 10px;
  background: linear-gradient(155deg, #ff7c72, #db333d); color: #23080a; box-shadow: 0 0 17px #ff41433d;
}
.mark svg { width: 24px; height: 24px; stroke-width: 1.8; }
nav { display: grid; gap: 5px; }
.nav {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 45px;
  padding: 9px 11px; border: 1px solid transparent; border-radius: 8px; text-align: left;
  background: transparent; color: var(--muted); font-weight: 620; font-size: .9rem;
}
.nav:hover { background: #242325; color: var(--ink); }
.nav.active { background: var(--red-surface); border-color: #49282e; color: #ffadb3; }
.nav.active::before {
  position: absolute; left: -1px; width: 3px; height: 17px;
  border-radius: 1px 4px 4px 1px; background: var(--red); content: "";
}
.nav-count { margin-left: auto; border-radius: 5px; padding: 2px 5px; background: #29282a; color: #d6d1d5; font-size: .77rem; min-width: 22px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.profile {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 16px 8px 0;
  border-top: 1px solid #2a292b; overflow-wrap: anywhere;
}
.avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: #332126; color: #ffb9bf; font-size: .88rem; font-weight: 750; }
.profile strong { font-size: .9rem; }
.workspace {
  min-width: 0;
  background: radial-gradient(ellipse 39rem 17rem at 91% 0%, #271315 0, #130c0e 49%, transparent 100%);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 0 clamp(22px, 4vw, 54px);
  border-bottom: 1px solid #29282a; color: var(--muted); font-size: .89rem;
}
.topbar strong { color: var(--ink); font-weight: 660; }
.slash { margin: 0 7px; color: #807c80; }
.storage { display: inline-flex; align-items: center; gap: 6px; color: var(--subtle); font-size: .8rem; white-space: nowrap; }
.storage svg { width: 15px; height: 15px; }

main { width: 100%; max-width: 1512px; margin-inline: auto; padding: 29px clamp(22px, 4vw, 54px) 35px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.1; font-weight: 760; letter-spacing: -.055em; }
.page-heading p { color: var(--muted); margin-top: 7px; line-height: 1.45; }
.date-field {
  display: grid; gap: 5px; min-width: 150px; flex: none; color: var(--muted); font-size: .87rem; font-weight: 650;
}
.date-field input { border-color: #543436; background: #1c1416; color: var(--ink); }
.date-field input::-webkit-calendar-picker-indicator { cursor: pointer; }

.summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px;
}
.metric {
  --metric-line: #ff565e;
  --metric-tip: #ffd1cc;
  --metric-haze: #39191d82;
  min-width: 0; padding: 12px 15px 14px; border: 1px solid #34272a; border-radius: var(--radius);
  background: radial-gradient(ellipse at top right, var(--metric-haze), transparent 71%), #121213;
}
.metric-completed { --metric-line: #f56951; --metric-tip: #ffd5a8; --metric-haze: #3e241985; }
.metric-pending { --metric-line: #ec9a49; --metric-tip: #ffe2a7; --metric-haze: #38271a85; }
.metric-heading, .metric-detail { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-heading { color: #e3dcde; font-size: .9rem; font-weight: 610; }
.metric-icon {
  display: grid; place-items: center; flex: none; width: 29px; height: 29px; color: var(--metric-tip);
  border-radius: 7px; background: var(--metric-haze);
}
.metric-icon svg { width: 16px; height: 16px; }
.metric-detail { align-items: baseline; margin: 2px 0 12px; }
.metric-detail strong { font-variant-numeric: tabular-nums; font-size: 1.9rem; line-height: 1.05; letter-spacing: -.04em; }
#metric-reviewed { color: var(--muted); font-size: .84rem; }
.metric-track { height: 4px; border-radius: 20px; background: #30272a; }
.metric-track span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--metric-line), var(--metric-line) 76%, var(--metric-tip));
  box-shadow: 0 0 9px color-mix(in srgb, var(--metric-line), transparent 34%); transition: width 160ms ease;
}

.desk { display: grid; grid-template-columns: minmax(0, 1.11fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.desk:has(.update-list:empty) { align-items: stretch; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px #0003; }
.updates, .output { display: flex; flex-direction: column; }
.card-heading { display: flex; align-items: center; gap: 12px; padding: 19px 21px; border-bottom: 1px solid #2c2b2e; }
.card-icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 9px;
  background: #2b1a1d; border: 1px solid #4a272e; color: #ff8e97;
}
.card-heading h2, .dialog-heading h2 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -.032em; }
.card-heading p, .dialog-heading p { margin-top: 4px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.card-body, .report-body { flex: 1; padding: 18px 21px; }
.input-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.input-label { display: block; margin-bottom: 7px; color: #efedef; font-size: .91rem; font-weight: 650; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--light-line); border-radius: 8px;
  background: var(--field); color: var(--ink);
}
input:hover, select:hover, textarea:hover { border-color: #6e646b; }
textarea { display: block; resize: vertical; line-height: 1.52; }
textarea::placeholder { color: var(--subtle); opacity: 1; }
select {
  appearance: none; padding-right: 29px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23d1c9cd' stroke-width='1.4'/%3E%3C/svg%3E");
  background-position: right 10px center; background-repeat: no-repeat;
}
option { color: var(--ink); background: var(--field); }
#raw { min-height: 146px; }
.input-foot { display: flex; justify-content: flex-end; margin-top: 11px; }
.text-btn { border: 0; padding: 4px 0; background: none; color: #ffadb4; font-size: .87rem; text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: #ffd6d9; }
.btn, .icon-btn { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.btn {
  display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 13px;
  font-size: .88rem; line-height: 1.3; font-weight: 700; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.primary { background: var(--red); color: var(--red-ink); }
.primary:hover:not(:disabled) { background: #ff8c94; }
.primary:disabled { border-color: #624047; background: #40272c; color: #dfbfc5; }
.secondary { background: #222123; border-color: #413e41; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #2b292c; border-color: #625a61; }
.secondary:disabled { background: #1b1a1c; border-color: #343135; color: #a5a0a6; }
.save { border-color: #6f3c44; background: #301c21; color: #ffb3ba; }
.save:hover:not(:disabled) { border-color: #93545d; background: #46262d; }
.save:disabled { border-color: #3f3438; background: #211b1e; color: #ab9da3; }
.tips, .stale { margin-top: 12px; padding: 10px 12px; border: 1px solid #4e2e35; border-radius: 8px; background: var(--red-surface); color: #f1c8ce; font-size: .89rem; line-height: 1.48; }
.stale { background: #352717; border-color: #604a2d; color: #ffd59e; }
.empty-list {
  display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 53px; padding: 8px; margin-top: 14px;
  border: 1px dashed #454145; border-radius: 8px; color: var(--subtle); text-align: center; font-size: .875rem;
}
.mini-icon { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: #2c2226; color: #f9a1a9; }
.mini-icon svg { width: 13px; height: 13px; }
.update-list:not(:empty) { display: grid; gap: 12px; margin-top: 17px; }
.update { padding: 12px; border: 1px solid #3a373b; border-radius: 10px; background: #1c1b1d; }
.update textarea { padding: 8px 10px; }
.row-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 8px; margin-top: 8px; }
.row-options span { display: block; margin-bottom: 4px; font-size: .875rem; font-weight: 620; color: var(--muted); }
.row-options select { padding-block: 7px; font-size: .875rem; }
.status[data-status=completed] { color: #a5e0bb; border-color: #375d48; background-color: #1a3024; }
.status[data-status=pending] { color: #ffd397; border-color: #705531; background-color: #392b18; }
.icon-btn {
  display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #413e41; background: #262427; color: #dfd8dd;
}
.icon-btn:hover { border-color: #79505a; background: #38282d; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 67px; padding: 12px 21px; border-top: 1px solid #2d2b2e; color: var(--muted); font-size: .88rem; }
.report-actions { justify-content: flex-end; }

.tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 15px 21px 0;
  padding: 4px; border: 1px solid #353235; border-radius: 9px; background: #101011;
}
.tabs button {
  min-width: 0; min-height: 35px; padding: 6px 7px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: .89rem; font-weight: 670;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { border-color: #57343b; background: #302025; color: #ffbdc3; }
.report-body { display: flex; flex-direction: column; min-height: 267px; }
.to-line { display: flex; align-items: center; gap: 9px; min-height: 41px; padding-bottom: 12px; border-bottom: 1px solid #343034; font-size: .9rem; }
.to-line span { color: var(--subtle); }
.to-line strong { padding: 3px 8px; border-radius: 5px; background: #29272a; color: #f0e8ec; font-weight: 650; overflow-wrap: anywhere; }
.report-empty { display: flex; flex: 1; min-height: 185px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 15px; text-align: center; }
.empty-art {
  display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 7px; border: 1px solid #5b3037; border-radius: 13px;
  background: linear-gradient(145deg, #3b2026, #24191d); color: #ff8f99; box-shadow: 0 0 0 5px #ff68790c;
}
.empty-art svg { width: 27px; height: 27px; }
.report-empty h3 { font-size: 1.03rem; letter-spacing: -.02em; }
.report-empty p { color: var(--muted); font-size: .89rem; line-height: 1.45; }
#report-editor { padding-top: 15px; }
#subject { margin-bottom: 13px; }
#message { min-height: 230px; }
.bottom-note { margin-top: 16px; color: var(--subtle); font-size: .84rem; }

.history-card { padding: 7px 21px; }
.history-card .report-empty { min-height: 280px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row strong, .history-row small { display: block; }
.history-row small { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.notice {
  position: fixed; z-index: 3; right: 20px; bottom: 20px; max-width: calc(100% - 40px); padding: 12px 16px;
  border: 1px solid #74424c; border-radius: 10px; background: #352128; color: #fff0f2;
  box-shadow: 0 10px 32px #0008; font-size: .92rem;
}
dialog {
  width: min(540px, calc(100% - 30px)); max-height: calc(100% - 30px); padding: 24px;
  border: 1px solid #614049; border-radius: 15px; background: #19181a; color: var(--ink); box-shadow: 0 24px 90px #000a;
}
dialog::backdrop { background: #080609cb; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid label { display: block; font-size: .9rem; font-weight: 650; }
.form-grid input, .form-grid select { margin-top: 7px; font-weight: 450; }
.form-grid small { display: block; margin-top: 7px; color: var(--muted); font-size: .84rem; font-weight: 400; line-height: 1.45; }
.wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 186px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .desk { gap: 15px; }
  .card-heading, .card-body, .report-body, .card-foot { padding-inline: 16px; }
  .tabs { margin-inline: 16px; }
}
@media (max-width: 900px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; border-right: 0; border-bottom: 1px solid #2a292b; }
  .brand { padding: 0; }
  .brand small, .profile { display: none; }
  .mark { width: 34px; height: 34px; }
  nav { grid-row: 2; grid-column: 1 / -1; display: flex; }
  .nav { width: auto; min-height: 39px; padding: 7px 9px; }
  .topbar { min-height: 43px; padding-inline: 15px; }
  main { padding: 16px 14px 26px; }
  .page-heading { align-items: start; flex-wrap: wrap; gap: 13px; margin-bottom: 17px; }
  .page-heading p { font-size: .94rem; }
  .date-field { align-self: start; }
  .summary { gap: 7px; margin-bottom: 14px; }
  .metric { padding: 9px 8px 10px; }
  .metric-heading { align-items: start; min-height: 38px; line-height: 1.2; }
  .metric-icon { display: none; }
  .metric-detail { flex-wrap: wrap; align-content: start; min-height: 47px; gap: 3px; margin-bottom: 6px; }
  .metric-detail strong { font-size: 1.55rem; width: 100%; }
  #metric-reviewed { font-size: .8rem; }
  .desk { gap: 14px; }
  .card-foot { flex-wrap: wrap; }
  .storage { font-size: .75rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .row-options { grid-template-columns: minmax(0, 1fr) auto; }
  .row-options label:first-child { grid-column: 1 / -1; }
  .history-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .metric-track span { transition: none; }
}
