:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #f0fdfa;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
.hidden { display: none !important; }

/* 页头 */
.page-header {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  padding: 28px 16px 22px;
  text-align: center;
}
.page-header h1 { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.page-header p { margin-top: 6px; font-size: 14px; opacity: 0.92; }
.admin-header { padding: 16px; }
.admin-header .header-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; text-align: left;
}
.admin-header h1 { font-size: 20px; }
.header-actions { display: flex; gap: 10px; }

.container { max-width: 720px; margin: 0 auto; padding: 18px 16px 60px; }
.container.wide { max-width: 1080px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--primary-dark); display: flex; align-items: center; gap: 6px; }
.card-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); display: inline-block; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 7px; }
.req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.field-error.show { display: block; }
.field.has-error input { border-color: var(--danger); }

.btn-submit {
  width: 100%; padding: 14px; font-size: 18px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  transition: transform 0.1s, opacity 0.15s; font-family: inherit;
}
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  padding: 10px 18px; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--primary); border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; text-align: center;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary {
  padding: 10px 18px; font-size: 15px; font-weight: 500; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-family: inherit;
}
.btn-secondary:active { background: #f8fafc; }
.btn-danger {
  padding: 6px 12px; font-size: 13px; color: var(--danger);
  background: var(--danger-bg); border: 1px solid #fecaca; border-radius: 8px;
  cursor: pointer; font-family: inherit;
}
.btn-danger:active { background: #fecaca; }

.form-tip { text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; }

/* 警告条 */
.warn-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}

/* 签到主页 */
.greet { text-align: center; margin-bottom: 18px; }
.greet .name { font-size: 22px; font-weight: 700; }
.greet .phone { color: var(--muted); font-size: 14px; margin-top: 4px; }

.checkin-big {
  display: block; width: 100%; padding: 26px 16px; font-size: 20px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  border: none; border-radius: 16px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3); font-family: inherit;
  margin-bottom: 14px;
}
.checkin-big:active { transform: scale(0.98); }
.checkin-big:disabled { opacity: 0.6; cursor: not-allowed; }

.status-ok {
  text-align: center; background: var(--success-bg); color: #14532d;
  border-radius: 14px; padding: 20px 16px; margin-bottom: 16px;
}
.status-ok .big { font-size: 22px; font-weight: 700; }
.status-ok .sub { margin-top: 6px; font-size: 15px; color: #166534; }
.status-ok .loc { margin-top: 10px; font-size: 13px; color: #166534; word-break: break-all; }

.detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row .v { font-weight: 500; text-align: right; }

/* 登录页 */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .muted { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.login-card .field { text-align: left; }
.error-text { color: var(--danger); font-size: 14px; margin-top: 12px; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.toolbar label { font-size: 15px; font-weight: 500; }
.toolbar input[type="date"] { padding: 9px 12px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; color: var(--text); }
.summary-bar { color: var(--muted); font-size: 14px; margin: 4px 2px 14px; }

/* 表格 */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead th {
  background: #f8fafc; color: var(--muted); font-size: 13px; font-weight: 600;
  text-align: left; padding: 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tr.total-foot td { background: var(--success-bg); color: #14532d; font-weight: 700; font-size: 15px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.map-link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); }
.absent-box { background: var(--danger-bg); border: 1px solid #fecaca; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.absent-title { font-size: 16px; font-weight: 700; color: var(--danger); margin-bottom: 10px; }
.absent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.absent-chip { background: #fff; border: 1px solid #fecaca; color: #7f1d1d; border-radius: 20px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.all-ok { background: var(--success-bg); color: #14532d; border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-weight: 600; }
.absent3-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.absent3-title { font-size: 16px; font-weight: 700; color: #b45309; margin-bottom: 10px; }
.absent3-chip { background: #fff; border: 1px solid #fde68a; color: #92400e; }
.absent3-chip small { color: #a16207; font-size: 12px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-content { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25); }
.modal-content h2 { font-size: 18px; margin-bottom: 4px; }
.modal-content .muted { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.modal-content img { width: 240px; height: 240px; margin-bottom: 12px; }
.qr-url { font-size: 13px; color: var(--muted); word-break: break-all; margin-bottom: 16px; background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: 1; }

.page-footer { text-align: center; padding: 20px 16px 32px; color: var(--muted); font-size: 13px; }

/* 下班打卡按钮（区别于上班的青色，用蓝色） */
.checkin-big.alt { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3); }
.page-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--muted); }
