* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: #f4f5f7;
  color: #333;
}

.topbar {
  background: #1f2430;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-size: 18px; font-weight: 600; }
.user { color: #cfd3dc; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.user button { background: none; border: 1px solid #555b6b; color: #cfd3dc; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.user button:hover { background: #2c313f; }

.login-wrap {
  display: none;
  min-height: calc(100vh - 50px);
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  width: 320px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.login-card h2 { margin: 0 0 20px; font-size: 17px; text-align: center; color: #333; }

.layout { display: flex; min-height: calc(100vh - 50px); }

.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.nav-item {
  border: none;
  background: none;
  text-align: left;
  padding: 14px 20px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
  border-bottom: 1px solid #f0f1f3;
}
.nav-item:hover { background: #f0f3ff; }
.nav-item.active { background: #4a6cf7; color: #fff; }

.content { flex: 1; padding: 24px; }

.card {
  background: #fff;
  border-radius: 6px;
  padding: 20px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h2 { margin: 0; font-size: 18px; color: #6b46c1; }

.btn {
  background: #4a6cf7;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: #3c58d0; }
.btn.secondary { background: #e5e7eb; color: #333; }
.btn.danger { background: #e5484d; }
.btn.small { padding: 4px 10px; font-size: 12px; margin-right: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: center; border-bottom: 1px solid #f0f1f3; }
th { color: #444; font-weight: 600; background: #fafbfc; }
tbody tr:hover { background: #f8f9fc; }

.empty-row { color: #4a6cf7; padding: 24px; text-align: center; }
.footer-note { text-align: right; color: #888; font-size: 13px; margin-top: 10px; }

.placeholder {
  color: #999;
  text-align: center;
  padding: 60px 0;
  font-size: 15px;
}

.profit-pos { color: #16a34a; font-weight: 600; }
.profit-neg { color: #dc2626; font-weight: 600; }

.clock-panel { text-align: center; padding: 30px 0 10px; }
.clock-time { font-size: 40px; font-weight: 700; color: #1f2430; margin-bottom: 6px; }
.clock-date { color: #888; margin-bottom: 24px; }
.clock-btn {
  font-size: 18px;
  padding: 18px 48px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
}
.clock-btn.in { background: #16a34a; }
.clock-btn.out { background: #e5484d; }
.clock-status { margin-top: 16px; min-height: 20px; font-size: 14px; }
.badge { padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge.in { background: #dcfce7; color: #16a34a; }
.badge.out { background: #fee2e2; color: #dc2626; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
}
.modal h3 { margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 4px;
  font-size: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.error-text { color: #dc2626; font-size: 13px; margin-top: 8px; }

.badge-count {
  background: #e5484d;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: 6px;
}

.task-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f1f3; }
.task-row.done .task-name { text-decoration: line-through; color: #999; }
.task-row .task-name { flex: 1; }

.notice-item { border-bottom: 1px solid #f0f1f3; padding: 14px 0; }
.notice-item:last-child { border-bottom: none; }
.notice-title { font-weight: 600; margin-bottom: 4px; }
.notice-title.unread::before { content: "●"; color: #e5484d; font-size: 10px; margin-right: 6px; vertical-align: middle; }
.notice-meta { color: #999; font-size: 12px; margin-bottom: 6px; }
.notice-body { color: #444; font-size: 14px; white-space: pre-wrap; }
