* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  background: #f3f5f8;
  color: #222;
}
#app, #admin-app { max-width: 1100px; margin: 0 auto; padding: 16px; }
header h1 { margin: 8px 0 12px; font-size: 22px; }
.banner { color: #555; font-size: 14px; margin-bottom: 8px; }
.clock { font-size: 28px; font-weight: 600; margin: 4px 0 12px; color: #1b4e91; }

.card {
  background: #fff; padding: 20px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; }
.card label { display: block; margin: 8px 0 4px; font-size: 14px; color: #555; }
.card input, .card select {
  width: 100%; padding: 10px; border: 1px solid #cfd6df;
  border-radius: 6px; font-size: 16px; background: #fff;
}
.card button, .filter-bar button, .panel-header button {
  margin-top: 10px; padding: 10px 16px; font-size: 15px;
  border: none; border-radius: 6px; background: #1b4e91; color: #fff; cursor: pointer;
}
.card button:hover { background: #153e74; }
button.link { background: none; color: #1b4e91; text-decoration: underline; padding: 4px 8px; }
button.primary { background: #1b4e91; color: #fff; }
button.muted-btn { background: #e3e8ef; color: #333; }

.panel-header { display: flex; justify-content: space-between; align-items: center; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-top: 12px;
}
.grid .emp {
  padding: 18px 8px; border: 2px solid #cfd6df; border-radius: 10px;
  background: #fff; font-size: 18px; text-align: center; cursor: pointer;
  transition: all .15s;
}
.grid .emp:hover { border-color: #1b4e91; background: #f0f5ff; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal-body {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 320px; max-width: 92vw;
}
.pin-display { margin: 12px 0; }
.pin-display input {
  width: 100%; padding: 14px; font-size: 26px; text-align: center;
  letter-spacing: 16px; border: 1px solid #cfd6df; border-radius: 8px;
}
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-pad button {
  padding: 14px 0; font-size: 20px; border: 1px solid #cfd6df;
  border-radius: 8px; background: #fff; cursor: pointer;
}
.pin-pad button.primary { background: #1b4e91; color: #fff; border-color: #1b4e91; }
.pin-pad button.muted-btn { background: #e3e8ef; }

.msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
.msg.ok { color: #1a7a34; }
.msg.err { color: #b52820; }
.muted { color: #777; }
.center { text-align: center; }
.hidden { display: none !important; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #cfd6df; margin-bottom: 14px; }
.tab { border: none; background: none; padding: 10px 14px; cursor: pointer; color: #555; font-size: 15px; }
.tab.active { color: #1b4e91; border-bottom: 2px solid #1b4e91; font-weight: 600; }
.tab.right { margin-left: auto; }

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.filter-bar label { display: flex; flex-direction: column; font-size: 13px; color: #555; }
.filter-bar select, .filter-bar input {
  padding: 6px 8px; border: 1px solid #cfd6df; border-radius: 5px; font-size: 14px;
}

.table-wrap { overflow-x: auto; background: #fff; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eef0f3; }
th { background: #f7f9fc; position: sticky; top: 0; }
td.action-cell { white-space: nowrap; }
td button { padding: 4px 10px; margin-right: 4px; font-size: 12px; border: 1px solid #cfd6df; border-radius: 4px; background: #fff; cursor: pointer; }
td button.danger { border-color: #c13a30; color: #c13a30; }
td button.primary { background: #1b4e91; color: #fff; border-color: #1b4e91; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.ok { background: #e2f6e7; color: #1a7a34; }
.tag.warn { background: #fff4cc; color: #8a6a00; }
.tag.err { background: #fde2df; color: #b52820; }

footer { margin-top: 24px; padding-top: 12px; font-size: 13px; border-top: 1px solid #e5e9ef; }
footer a { color: #1b4e91; text-decoration: none; }
