:root {
  --ink: #1c1c1c;
  --sidebar: #1f1f1f;
  --sidebar-hover: #2c2c2c;
  --sidebar-active: #3a3a3a;
  --muted: #6b6b6b;
  --line: #ececec;
  --page: #f6f6f6;
  --card: #ffffff;
  --accent: #2f6fed;
  --ok: #22a06b;
  --warn: #e07a2f;
  --dot-a: #22a06b;
  --dot-b: #3b82f6;
  --dot-c: #e07a2f;
  --dot-d: #8b5cf6;
  --radius: 12px;
  --sidebar-w: 232px;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
}

.login-body {
  min-height: 100%;
  display: grid;
  place-items: center;
  background: #efefef;
  padding: 32px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 36px 32px;
}

.login-mark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 28px;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.login-card p.lede {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 15px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="email"] {
  width: 100%;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  background: #fff;
}

input[type="email"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #000; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid #ddd;
}
.btn-ghost:hover { background: #f4f4f4; }

.hint {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.sent h1 { margin-bottom: 8px; }
.sent p { color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.sent .email-pill {
  display: inline-block;
  background: #f3f3f3;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  margin: 4px 0 20px;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100%;
}

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 12px 28px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cfcfcf;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; }

.sidebar-foot {
  margin-top: auto;
  padding: 16px 12px 4px;
  font-size: 12px;
  color: #9a9a9a;
}
.sidebar-foot a { color: #cfcfcf; }

.main {
  padding: 36px 40px 48px;
  max-width: 1080px;
}

.page-kicker {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1.page-title {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.page-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.card h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 16px;
}

.status-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.status-row:first-of-type { border-top: 0; padding-top: 4px; }
.status-row .name { font-weight: 500; }
.status-row .state { color: var(--muted); }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-a { background: var(--dot-a); }
.dot-b { background: var(--dot-b); }
.dot-c { background: var(--dot-c); }
.dot-d { background: var(--dot-d); }

.bill-label { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.bill-amount {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.bill-meta {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.bill-meta strong { color: var(--ink); font-weight: 600; }
.example-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #9a9a9a;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head h2 { margin: 0; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button {
  width: 28px; height: 28px;
  border: 0; background: transparent;
  cursor: pointer; font-size: 16px; color: var(--muted);
  border-radius: 6px;
}
.cal-nav button:hover { background: #f0f0f0; color: var(--ink); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 12px;
}
.cal-dow { color: var(--muted); padding: 6px 0 8px; font-size: 11px; font-weight: 600; }
.cal-day {
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
}
.cal-day.out { color: #ccc; }
.cal-day.mark {
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.stack { display: grid; gap: 16px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.drop {
  border: 1.5px dashed #d0d0d0;
  border-radius: 12px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  background: #fafafa;
  cursor: pointer;
}
.drop.drag { border-color: var(--ink); background: #fff; }
.drop strong { color: var(--ink); display: block; margin-bottom: 4px; }
.drop input { display: none; }

.file-list { list-style: none; margin: 16px 0 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.file-list li:first-child { border-top: 0; }
.file-ico { color: var(--muted); }

.event-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.event-row:first-of-type { border-top: 0; }
.event-row .when { color: var(--muted); }

.bill-lines { width: 100%; }
.bill-lines .row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.bill-lines .row:first-child { border-top: 0; }
.bill-lines .row.total { font-weight: 650; font-size: 16px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 16px; gap: 12px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 24px 20px 40px; }
}

.timeline { display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  padding: 0 0 8px;
}
.step-rail { position: relative; }
.step-rail::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: -8px;
  width: 2px;
  background: #e5e5e5;
}
.step:last-child .step-rail::before { display: none; }
.step-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #bbb;
  background: #fff;
  margin-top: 2px;
}
.step.done .step-dot { background: var(--ink); border-color: var(--ink); }
.step.now .step-dot { background: #fff; border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--ink); }
.step-body { padding-bottom: 22px; }
.step h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.step .when { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.step .note { margin: 0; font-size: 14px; color: var(--ink); }
.factory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.factory {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
}
.factory h4 { margin: 0 0 4px; font-size: 14px; font-weight: 650; }
.factory p { margin: 0; font-size: 13px; color: var(--muted); }
.factory .st { font-size: 12px; font-weight: 600; margin-top: 8px; }
.st-done { color: var(--ok); }
.st-now { color: var(--warn); }
.st-wait { color: var(--muted); }
.folder-map { font-size: 12px; color: #9a9a9a; margin-top: 6px; }

.auth-error {
  margin: 14px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
