/* HKSI 帳號管理後台 — 延續刷題站設計語言 */
.admin-shell { min-height: 100vh; background: #f4f6f5; }

.admin-topbar {
  height: 68px; background: #fff; border-bottom: 1px solid #e3e9e6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand strong { display: block; font-size: 15px; color: #16332b; }
.admin-brand span:not(.brand-mark) { display: block; font-size: 12px; color: #7a8b85; margin-top: 2px; }
.admin-top-actions { display: flex; align-items: center; gap: 12px; }
.admin-who { font-size: 13px; color: #4a5c56; background: #eef4f1; padding: 6px 12px; border-radius: 20px; }

.admin-main { max-width: 1160px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-heading .eyebrow { font-size: 11px; letter-spacing: .14em; color: #8a9a94; font-weight: 700; }
.admin-heading h1 { margin: 6px 0 4px; font-size: 26px; color: #16332b; }
.admin-heading p { margin: 0; color: #7a8b85; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid #e3e9e6; border-radius: 12px; padding: 18px 20px; }
.stat-card span { display: block; font-size: 12px; color: #7a8b85; margin-bottom: 8px; }
.stat-card strong { font-size: 26px; color: #176a57; line-height: 1; }

.admin-panel { background: #fff; border: 1px solid #e3e9e6; border-radius: 12px; overflow: hidden; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #edf1ef; }
.search-box { display: flex; align-items: center; gap: 8px; background: #f6f8f7; border: 1px solid #e3e9e6; border-radius: 8px; padding: 0 12px; width: 320px; max-width: 100%; color: #8a9a94; }
.search-box input { border: 0; outline: 0; background: transparent; padding: 9px 0; width: 100%; font-size: 13px; color: #16332b; }
.result-count { font-size: 12px; color: #8a9a94; }

.table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th { text-align: left; padding: 12px 18px; background: #fafcfb; color: #7a8b85; font-weight: 600; font-size: 12px; border-bottom: 1px solid #edf1ef; white-space: nowrap; }
.user-table td { padding: 13px 18px; border-bottom: 1px solid #f0f3f1; color: #354a43; white-space: nowrap; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table tbody tr:hover { background: #fafcfb; }
.cell-id { color: #9aa8a3; width: 60px; }
.cell-date { color: #8a9a94; font-size: 12px; }
.cell-expired { color: #b34242; font-size: 12px; }
.cell-pending { color: #9a681b; font-size: 12px; }
.cell-actions { text-align: right; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; background: #eef4f1; color: #4a6a5f; }
.tag-admin { background: #fff2e6; color: #a8641c; }
.tag-active { background: #e7f5ee; color: #177052; }
.tag-disabled { background: #f3f4f4; color: #8a8f8d; }
.row-button { border: 1px solid #dce5e1; background: #fff; color: #3c5b50; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; margin-left: 6px; }
.row-button:hover { background: #f2f7f5; }
.row-button.danger { color: #b34242; border-color: #f0d9d9; }
.row-button.danger:hover { background: #fff5f5; }
.admin-empty { padding: 48px; text-align: center; color: #9aa8a3; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 40, 32, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 14px; width: 460px; max-width: 100%; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.18); max-height: 90vh; overflow-y: auto; }
.modal-card h2 { margin: 0 0 18px; font-size: 19px; color: #16332b; }
.modal-card label { display: block; font-size: 12px; color: #5c6f68; margin: 14px 0 6px; font-weight: 600; }
.modal-card label small { font-weight: 400; color: #9aa8a3; }
.modal-card input, .modal-card select { width: 100%; padding: 10px 12px; border: 1px solid #dce5e1; border-radius: 8px; font-size: 13px; color: #16332b; outline: none; background: #fff; }
.modal-card input:focus, .modal-card select:focus { border-color: #176a57; }
.modal-card input:disabled { background: #f5f7f6; color: #9aa8a3; }
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 14px; letter-spacing: .04em; }
.pw-btn { flex: 0 0 auto; padding: 0 12px; border: 1px solid #176a57; border-radius: 8px; background: #176a57; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pw-btn:hover { background: #105545; }
.pw-btn.ghost { background: #fff; color: #176a57; border-color: #cddbd5; }
.pw-btn.ghost:hover { background: #f2f7f5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.modal-actions button { min-width: 90px; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #16332b; color: #fff; padding: 11px 22px; border-radius: 8px; font-size: 13px; z-index: 80; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.error { background: #a83b3b; }

@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-heading { flex-direction: column; align-items: flex-start; }
  .search-box { width: 100%; }
  .admin-topbar { padding: 0 16px; }
  .admin-top-actions .secondary-button:first-child { display: none; }
}
