:root {
  --ink: #182225;
  --muted: #68767c;
  --line: #dce5e8;
  --bg: #f4f7f6;
  --card: #ffffff;
  --brand: #14705b;
  --brand-dark: #10272b;
  --accent: #d97706;
  --ok: #15803d;
  --warn: #a16207;
  --danger: #b42318;
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  background: #e9f4f1;
  color: var(--brand);
  border: 1px solid #bad8d0;
}

button.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #efbbb5;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(rgba(16, 39, 43, 0.78), rgba(20, 112, 91, 0.68)),
    url("https://images.unsplash.com/photo-1540555700478-4be289fbecef?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.login-card {
  width: min(100%, 380px);
  display: grid;
  gap: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  padding: 26px;
  box-shadow: 0 18px 40px rgba(16, 39, 43, 0.22);
}

.app-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--brand-dark);
  font-weight: 900;
}

.login-card h1 {
  margin: 4px 0 0;
}

.login-card p,
.login-card small {
  color: var(--muted);
  line-height: 1.6;
}

.auth-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.app-screen {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 88px;
  background: var(--bg);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px 16px;
}

.app-header span {
  color: var(--muted);
  font-size: 13px;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 23px;
}

.app-header button {
  width: 44px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.privacy-strip {
  display: grid;
  gap: 4px;
  border: 1px solid #b7d7cf;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #eef8f4;
  padding: 11px;
  margin-bottom: 12px;
}

.privacy-strip span {
  color: #496760;
  font-size: 13px;
  line-height: 1.5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-grid article,
.panel,
.job-card,
.notice-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.summary-grid article {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.summary-grid span,
.mini {
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong {
  font-size: 20px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.tabbar button {
  min-height: 48px;
  background: white;
  color: var(--muted);
  border: 1px solid transparent;
}

.tabbar button.active {
  background: var(--brand);
  color: white;
}

.content {
  display: grid;
  gap: 12px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 13px;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-card {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.job-card.active {
  border-color: #e4ad5e;
  background: #fffaf2;
}

.job-top,
.job-actions,
.record-line,
.pay-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.job-actions {
  flex-wrap: wrap;
}

.job-actions button {
  flex: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef3f0;
  color: #255b4f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.ok {
  background: #dcfce7;
  color: #166534;
}

.status.warn {
  background: #fef3c7;
  color: #92400e;
}

.status.danger {
  background: #fee2e2;
  color: #991b1b;
}

.note-form {
  display: grid;
  gap: 11px;
}

.record-list,
.notice-list,
.pay-list {
  display: grid;
  gap: 9px;
}

.record-line,
.pay-line,
.notice-card {
  padding: 11px;
  background: white;
}

.notice-card {
  display: grid;
  gap: 6px;
}

@media (max-width: 390px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .job-top,
  .record-line,
  .pay-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
