:root {
  --accent: #0d9488;
  --accent-soft: #ccfbf1;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e8eaed;
  --text: #111827;
  --muted: #6b7280;
  --soft: #f3f4f6;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; }
a { color: var(--accent); }

.app-shell { min-height: 100dvh; padding-bottom: 88px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }

.tabs {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.tab {
  min-height: 44px; min-width: 64px; padding: 10px 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer;
  box-shadow: var(--shadow);
}
.tab.active {
  background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: none;
}

.main { max-width: 920px; margin: 0 auto; padding: 16px 14px 32px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.card.soft { background: var(--soft); box-shadow: none; }
.section-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 140px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--soft); color: var(--text);
}
.field textarea { min-height: 80px; resize: vertical; }

.btn {
  min-height: 48px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; border-top: 3px solid var(--accent);
}
.kpi .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text);
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
}

.week {
  display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 6px; overflow-x: auto;
}
.day {
  min-height: 88px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; box-shadow: var(--shadow);
}
.day.today { background: var(--accent-soft); border-color: var(--accent); }
.day .wd { font-size: 11px; font-weight: 700; color: var(--muted); }
.day .dn { font-size: 16px; font-weight: 700; }
.day .jobbit {
  margin-top: 4px; font-size: 10px; color: var(--accent); background: var(--card);
  border-radius: 6px; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.goal { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.goal.done { background: var(--success-soft); }
.goal label { flex: 1; font-size: 15px; }
.warn { background: var(--danger-soft); border-color: #fecaca; }
.ok { background: var(--success-soft); border-color: #a7f3d0; }

.login-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.login-card { width: min(420px, 100%); }
.login-card h1 { margin: 0; font-size: 22px; }
.sync-bar {
  font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.online { background: var(--success); }
.dot.offline { background: #f59e0b; }
.hidden { display: none !important; }
.props { display: grid; gap: 6px; font-size: 14px; }
.props div { display: flex; justify-content: space-between; gap: 12px; }
.props span:first-child { color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.flow svg { width: 100%; height: auto; display: block; }
