:root {
  --bg: #0c1018;
  --panel: rgba(18, 24, 35, 0.82);
  --panel-strong: #151c28;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f3ee;
  --muted: #929aaa;
  --accent: #ff9066;
  --accent-soft: rgba(255, 144, 102, 0.13);
  --green: #6dd6ad;
  --yellow: #f3c96b;
  --red: #ff7d83;
  --radius: 22px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(95, 71, 154, 0.2), transparent 34rem),
    radial-gradient(circle at 100% 20%, rgba(180, 91, 70, 0.14), transparent 30rem),
    var(--bg);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}
.ambient-one { top: 8rem; left: -12rem; background: #ff8060; }
.ambient-two { right: -14rem; bottom: 5rem; background: #8970ff; }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.hidden { display: none !important; }

.topbar {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  min-height: 88px;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 144, 102, 0.48);
  border-radius: 13px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(255, 144, 102, 0.18), rgba(255, 255, 255, 0.03));
  font-family: Georgia, serif;
  font-size: 24px;
}
.brand strong { display: block; letter-spacing: 0.03em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

.topbar-actions { display: flex; align-items: center; justify-self: end; gap: 10px; }
.sync-state { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; color: var(--muted); font-size: 13px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 14px currentColor; }
.sync-state.online i { background: var(--green); }
.sync-state.error i { background: var(--red); }
.user-badge { max-width: 180px; overflow: hidden; padding: 7px 10px; color: var(--accent); border: 1px solid rgba(255, 144, 102, 0.2); border-radius: 99px; background: var(--accent-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.ghost-button, .primary-button, .tab {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.ghost-button { padding: 9px 13px; color: var(--muted); background: rgba(255,255,255,0.05); }
.ghost-button:hover, .tab:hover { color: var(--text); background: rgba(255,255,255,0.09); }
.primary-button { padding: 12px 22px; color: #1a1210; background: var(--accent); font-weight: 700; }
.primary-button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: 0.62; transform: none !important; }

.login-panel {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 480px);
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 180px);
}
.login-copy h1 { margin: 10px 0 16px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 6vw, 76px); font-weight: 400; line-height: 0.98; }
.login-copy p { max-width: 680px; color: var(--muted); line-height: 1.7; }
.inline-link { color: var(--accent); text-decoration: none; }
.inline-link:hover { text-decoration: underline; }
.login-form { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(22px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,0.14); }
.auth-tab { padding: 10px; color: var(--muted); border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.auth-tab.active { color: var(--text); background: rgba(255,255,255,0.08); }
.auth-form { display: grid; gap: 17px; }
.field label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.field input { width: 100%; min-width: 0; padding: 12px 14px; color: var(--text); border: 1px solid var(--line); border-radius: 12px; outline: none; background: rgba(0,0,0,0.18); }
.field input:focus { border-color: rgba(255, 144, 102, 0.65); box-shadow: 0 0 0 3px var(--accent-soft); }
.field small { display: block; margin-top: 7px; color: #747d8d; font-size: 11px; line-height: 1.45; }
.auth-submit { width: 100%; margin-top: 2px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }

.eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; }
.tabs { display: flex; justify-self: center; gap: 4px; overflow-x: auto; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.025); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 9px 13px; color: var(--muted); background: transparent; font-size: 13px; }
.tab.active { color: var(--text); background: var(--panel-strong); box-shadow: 0 8px 24px rgba(0,0,0,0.16); }

.panel { display: none; padding: 32px 0 20px; }
.panel.active { display: block; animation: rise 260ms ease both; }
.benefits-dashboard { padding: 46px 0 20px; }
.benefits-heading { margin-top: 0; }
.benefits-heading h1 { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 6vw, 70px); font-weight: 400; line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 28px; font-family: Georgia, serif; font-size: 42px; font-weight: 400; }
.metric-card small { color: var(--muted); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 46px 0 18px; }
.section-heading h2 { margin: 7px 0 0; font-size: 25px; font-weight: 600; }
.section-heading h3 { margin: 7px 0 0; font-size: 21px; font-weight: 600; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.embedded-section { margin-top: 46px; padding-top: 1px; border-top: 1px solid var(--line); }
.embedded-section .section-heading { margin-top: 30px; }
.subheading { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

.task-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.task-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.025); }
.task-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-card h3 { margin: 0; font-size: 15px; }
.task-card dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; margin: 22px 0 0; font-size: 12px; }
.task-card dt { color: var(--muted); }
.task-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,0.06); font-size: 11px; }
.badge.good { color: var(--green); background: rgba(109,214,173,0.1); }
.badge.warn { color: var(--yellow); background: rgba(243,201,107,0.1); }
.badge.bad { color: var(--red); background: rgba(255,125,131,0.1); }

.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.02); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 14px 18px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 500; white-space: nowrap; }
td { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.055); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.muted { color: var(--muted); }

.split-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; }
.message-list { display: grid; gap: 10px; }
.message-item { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,0.025); }
.message-item header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.message-item p { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }

.kpl-layout { display: grid; grid-template-columns: minmax(280px, 0.8fr) 1.2fr; gap: 18px; }
.kpl-summary, .kpl-tasks { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.kpl-summary h3 { margin: 16px 0 10px; font-family: Georgia, serif; font-size: 32px; font-weight: 400; }
.kpl-summary p { color: var(--muted); line-height: 1.65; }
.kpl-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.kpl-points div { padding: 14px; border-radius: 14px; background: rgba(255,255,255,0.04); }
.kpl-points span { display: block; color: var(--muted); font-size: 10px; }
.kpl-points strong { display: block; margin-top: 7px; font-size: 22px; }
.task-step { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.task-step:last-child { border-bottom: 0; }

.activity-heading { margin-top: 58px; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.activity-empty { grid-column: 1 / -1; }
.activity-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.activity-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); background: #111720; }
.activity-body { padding: 20px; }
.activity-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.activity-status { color: var(--muted); font-size: 12px; }
.activity-status.current {
  padding: 5px 9px;
  border: 1px solid rgba(91, 218, 171, 0.28);
  border-radius: 99px;
  color: #7ee0ba;
  background: rgba(91, 218, 171, 0.1);
}
.activity-body h3 { margin: 14px 0 5px; font-size: 18px; }
.activity-body .group { color: var(--muted); font-size: 12px; }
.technician-account { margin-top: 5px; font-size: 12px; }
.technician-account a { color: var(--accent); text-decoration: none; }
.activity-price { margin-top: 12px; color: var(--accent); font-size: 12px; }
.activity-service { max-height: 230px; overflow: auto; margin: 18px 0; padding: 14px; border-radius: 14px; color: #d5d8df; background: rgba(0,0,0,0.18); white-space: pre-wrap; line-height: 1.55; font-size: 12px; }
.activity-foot { display: flex; justify-content: space-between; gap: 14px; align-items: center; color: var(--muted); font-size: 11px; }
.activity-foot a { color: var(--accent); text-decoration: none; }
.vip-button { padding: 8px 12px; font-size: 12px; }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 64px; padding: 24px 0 36px; color: #626b7a; border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 1320px) {
  .topbar { grid-template-columns: 1fr auto; padding-top: 14px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-self: stretch; margin-bottom: 14px; }
}

@media (max-width: 1050px) {
  .metric-grid, .task-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid, .kpl-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 1440px); }
  .topbar { min-height: 74px; gap: 10px; }
  .sync-state span { display: none; }
  .user-badge { max-width: 96px; }
  .ghost-button { padding: 8px 10px; }
  .login-panel { grid-template-columns: 1fr; gap: 26px; align-content: center; }
  .tab { padding: 9px 12px; }
  .metric-grid, .task-grid, .activity-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 10px; }
  .kpl-points { grid-template-columns: 1fr; }
  footer { display: block; line-height: 1.8; }
}
