/* ============ 考勤管理（行政管理 > 考勤管理） ============ */

.page-attendance {
  padding: 18px 20px;
}

.page-attendance .page-header {
  margin-bottom: 16px;
}
.page-attendance .page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1f2937;
}
.page-attendance .page-subtitle {
  font-size: 13px;
  color: #6b7280;
}

/* ============ Tabs ============ */
.tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 18px;
}
.tab-item {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  font-family: inherit;
}
.tab-item:hover { color: #3b82f6; }
.tab-item.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

/* ============ Tab 工具栏 ============ */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.tab-toolbar-info {
  color: #6b7280;
  font-size: 13px;
}

/* ============ 筛选条 ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #f9fafb;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.filter-item label {
  font-size: 12px;
  color: #6b7280;
}
.filter-item .form-control {
  height: 32px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.filter-actions {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}
.filter-actions .btn-sm {
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============ 数据表 ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.data-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 12px;
  white-space: nowrap;
}
.data-table tr:hover td { background: #fafbfc; }
.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }
.data-table .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

.text-danger { color: #ef4444; }
.text-danger:hover { color: #dc2626; }

/* ============ Badge ============ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #4b5563;
  white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #e5e7eb; color: #4b5563; }

/* ============ Empty state ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: #374151; }
.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
}
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.form-row label {
  flex: 0 0 130px;
  font-size: 13px;
  color: #374151;
  text-align: right;
}
.form-row .form-control {
  flex: 1;
  height: 34px;
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.form-row .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============ 顶栏考勤/在线下拉 ============ */
.topbar-attendance-btn,
.topbar-online-btn {
  position: relative;
}
.topbar-attendance-btn .btn-ico,
.topbar-online-btn .btn-ico {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
}
.topbar-online-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  border-radius: 8px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
}

.topbar-popover {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 220px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.topbar-popover-inner {
  padding: 4px 0;
}
.topbar-popover-title {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #f0f0f0;
}
.topbar-popover-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  color: #1f2937;
  cursor: pointer;
  font-family: inherit;
}
.topbar-popover-item:hover { background: #f3f4f6; }
.topbar-popover-foot {
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  text-align: right;
}
.topbar-popover-foot a {
  color: #3b82f6;
  text-decoration: none;
}
.topbar-popover-foot a:hover { text-decoration: underline; }
.topbar-popover-empty {
  padding: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.topbar-online-list {
  min-width: 260px;
  max-height: 360px;
  overflow-y: auto;
}
.topbar-online-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f9fafb;
}
.topbar-online-row:last-child { border-bottom: none; }
.topbar-online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16,185,129,.15);
}
.topbar-online-name {
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
}
.topbar-online-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* ============ 登录打卡成功弹窗（中央） ============ */
.punch-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity .25s;
  cursor: pointer;
}
.punch-popup-overlay.punch-popup-fade { opacity: 0; }
.punch-popup-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  min-width: 360px;
  max-width: 90vw;
  animation: punchPopupIn .35s ease-out;
}
@keyframes punchPopupIn {
  0% { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.punch-popup-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.punch-popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 14px;
}
.punch-popup-time {
  font-size: 26px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #3b82f6;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.punch-popup-shift {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}
.punch-popup-late {
  font-size: 13px;
  color: #ef4444;
  margin-top: 4px;
  font-weight: 500;
}
.punch-popup-foot {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 16px;
}

/* ============ 在线状态卡片 ============ */
.online-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.online-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  transition: all .15s;
}
.online-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.online-card .online-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.online-card-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}
.online-card-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* ============ 占位（工资考核第 2 期） ============ */
.placeholder-state {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
}
.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.placeholder-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}
.placeholder-text {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 24px;
}
.placeholder-list {
  text-align: left;
  display: inline-block;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.9;
  background: #f9fafb;
  padding: 16px 24px;
  border-radius: 8px;
}
