:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #6b766f;
  --line: #e5e9e6;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --green: #176c4c;
  --green-soft: #e7f4ed;
  --amber: #956114;
  --amber-soft: #fbf1d7;
  --red: #a33b35;
  --red-soft: #f9e7e4;
  --blue: #315c8a;
  --blue-soft: #e8f0f8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 22px; background: #12231c; color: #f4f7f5; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 30px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #d7f36c; color: #173125; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand span { color: #94a49c; font-size: 12px; margin-top: 3px; }
nav { display: grid; gap: 6px; }
.nav-item { border: 0; color: #aab7b0; background: transparent; border-radius: 10px; text-align: left; padding: 11px 12px; display: flex; gap: 11px; align-items: center; }
.nav-item span { width: 20px; text-align: center; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: #fff; background: #20362d; }
.sidebar-note { margin-top: auto; padding: 14px; display: flex; gap: 10px; border: 1px solid #2f463c; border-radius: 12px; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note p { margin: 4px 0 0; color: #93a39b; font-size: 11px; line-height: 1.5; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #b8df64; box-shadow: 0 0 0 4px #b8df6422; margin-top: 4px; }
main { padding: 38px clamp(24px, 4vw, 58px) 64px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin: 0 0 8px; }
h1 { font-family: ui-serif, Georgia, "Songti SC", serif; font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: -.04em; margin: 0; }
.subtitle { color: var(--muted); margin: 10px 0 0; }
.top-actions { display: flex; gap: 10px; }
.search { width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search input { border: 0; outline: 0; width: 100%; background: transparent; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; font-weight: 650; }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button.primary { background: var(--green); color: white; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(125px, 1fr)); gap: 12px; margin: 32px 0 22px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 17px; min-height: 112px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-family: ui-serif, Georgia, serif; font-size: 32px; margin-top: 17px; }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 4px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 7px 10px; font-size: 11px; }
.pill.active { background: #173125; color: white; border-color: #173125; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 820px; }
th { color: #7c8780; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 12px 22px; background: #fafbf9; }
td { border-top: 1px solid #edf0ee; padding: 15px 22px; font-size: 13px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: #f8faf7; }
.task-title { font-weight: 700; margin-bottom: 5px; }
.task-meta { color: var(--muted); font-size: 11px; }
.status { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.completed { color: var(--green); background: var(--green-soft); }
.status.needs_user, .status.failed { color: var(--red); background: var(--red-soft); }
.status.draft { color: var(--muted); background: #eff1f0; }
.status.pending, .status.sms_sent_waiting_reply { color: var(--blue); background: var(--blue-soft); }
.status.phone_escalation { color: var(--amber); background: var(--amber-soft); }
.status.cancelled { color: #6d6470; background: #f0edf1; }
.error-count { color: var(--red); font-size: 10px; display: block; margin-top: 5px; }
.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty div { font-weight: 700; color: var(--ink); }
.empty p { font-size: 12px; }
.backdrop { position: fixed; inset: 0; background: #0f1d17aa; z-index: 5; }
.detail-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 6; width: min(520px, 100vw); background: #fff; box-shadow: -20px 0 60px #0b16112e; padding: 30px; overflow-y: auto; transform: translateX(102%); transition: transform .2s ease; }
.detail-panel.open { transform: translateX(0); }
.icon-button { border: 0; background: #f1f3f1; border-radius: 50%; width: 34px; height: 34px; font-size: 22px; display: grid; place-items: center; }
.detail-panel > .icon-button { margin-left: auto; }
.detail-header { margin: 14px 0 24px; }
.detail-header h2 { font-family: ui-serif, Georgia, serif; font-size: 28px; margin: 8px 0; }
.detail-section { border-top: 1px solid var(--line); padding: 20px 0; }
.detail-section h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.definition-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; font-size: 13px; }
.definition-grid dt { color: var(--muted); }
.definition-grid dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 20px; border-left: 1px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 3px; width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.timeline li:last-child { border-left-color: transparent; }
.timeline strong { display: block; font-size: 12px; }
.timeline time, .timeline p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.detail-actions { display: flex; gap: 8px; }
dialog { width: min(610px, calc(100vw - 28px)); border: 0; border-radius: 15px; padding: 0; box-shadow: 0 24px 80px #0c171240; }
dialog::backdrop { background: #0f1d17aa; }
.dialog-form { padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; margin-bottom: 22px; }
.dialog-copy { color: var(--muted); font-size: 13px; line-height: 1.65; margin: -8px 0 18px; }
.dialog-form label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.dialog-form input, .dialog-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; color: var(--ink); outline: 0; resize: vertical; }
.dialog-form input:focus, .dialog-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #176c4c14; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.form-error { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 10px; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #173125; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 35px #0f1d1733; z-index: 20; font-size: 13px; }
@media (max-width: 1000px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .topbar { align-items: flex-start; flex-direction: column; } .top-actions { width: 100%; } .search { flex: 1; } }
@media (max-width: 720px) { .shell { display: block; } .sidebar { position: static; width: 100%; height: auto; padding: 16px; } .brand { padding-bottom: 14px; } nav { grid-template-columns: repeat(4, 1fr); } .nav-item { justify-content: center; font-size: 0; } .nav-item span { font-size: 15px; } .sidebar-note { display: none; } main { padding: 24px 14px 50px; } .metric-grid { grid-template-columns: repeat(2, 1fr); } .panel-heading { align-items: flex-start; flex-direction: column; } .filter-pills { justify-content: flex-start; } .form-grid { grid-template-columns: 1fr; } }
