:root {
  --primary: #2f7d4f;
  --primary-dark: #245f3c;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #6b7b72;
  --border: #e2e8e4;
  --approved: #2f7d4f;
  --pending: #d99a18;
  --rejected: #c2453d;
  --cancelled: #9aa6a0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.btn { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 14px; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #eef2f0; color: var(--text); }
.btn.danger { background: var(--rejected); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--text);
}
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

/* layout */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #fff; border-right: 1px solid var(--border); padding: 18px 0; flex-shrink: 0; }
.brand { padding: 0 20px 16px; font-weight: 700; color: var(--primary-dark); font-size: 15px; line-height: 1.4; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.nav a { display: block; padding: 11px 20px; color: var(--text); font-size: 14px; }
.nav a:hover { background: #f0f4f1; }
.nav a.active { background: var(--primary); color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topbar .who { color: var(--muted); font-size: 13px; }
.content { padding: 24px; overflow: auto; }
h2.page { margin: 0 0 18px; font-size: 20px; }

/* cards / tables */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: #fafbfa; }
tr:hover td { background: #fafbfa; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; color: #fff; }
.tag.approved, .tag.已通过 { background: var(--approved); }
.tag.pending, .tag.待审批 { background: var(--pending); }
.tag.rejected, .tag.已拒绝 { background: var(--rejected); }
.tag.cancelled, .tag.已取消 { background: var(--cancelled); }

/* login */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#2f7d4f,#1f5a3a); }
.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; width: 340px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; color: var(--primary-dark); }
.login-card .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.login-err { color: var(--rejected); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 460px; max-width: 92vw; max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* timeline */
.timeline { position: relative; height: 44px; background: #f6f8f7; border-radius: 8px; margin-top: 8px; overflow: hidden; }
.tl-block { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; color: #fff; font-size: 11px; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.tl-hour { position: absolute; top: 0; bottom: 0; border-left: 1px solid #e7ecea; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2a24; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* sidebar footer: version + android download */
.sidefoot { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid var(--border); font-size: 12px; }
.sidefoot .ver { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dl-link { display: inline-block; margin-top: 8px; font-size: 12px; }
.dl-linkbox { margin-top: 6px; }
.dl-linkbox code { display: block; font-size: 11px; word-break: break-all; background: #f3f6f4; padding: 6px 8px; border-radius: 6px; color: var(--muted); }
.qr { width: 100%; max-width: 180px; height: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 4px; background: #fff; }
