* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f6f9;
  color: #1a2233;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent, #1f6feb); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 24px; margin: 16px 0; }
h2 { font-size: 17px; margin: 0 0 12px; }

.muted { color: #6b7688; }

/* ---- top bar ---- */
.topbar { background: #fff; border-bottom: 1px solid #e3e8ef; }
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 56px;
}
.brand { font-weight: 700; font-size: 17px; color: #1a2233; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 28px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: #445; }
.topbar nav a:hover { background: #eef2f7; text-decoration: none; }
.logout-form { display: flex; align-items: center; gap: 12px; }
.whoami { color: #6b7688; font-size: 13px; }

/* ---- layout ---- */
.container { max-width: 1040px; margin: 0 auto; padding: 8px 20px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; }

.card {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  padding: 20px; margin: 16px 0;
}
.form-card { max-width: 560px; }
.highlight-card { border-color: var(--accent, #1f6feb); border-width: 2px; }

.stat-row { display: flex; gap: 16px; margin: 16px 0; }
.stat-card {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  padding: 20px 28px; min-width: 180px;
}
.stat-value { font-size: 36px; font-weight: 700; color: var(--accent, #1f6feb); }
.stat-label { color: #6b7688; margin-bottom: 8px; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7688; padding: 8px 12px; border-bottom: 2px solid #e3e8ef; }
td { padding: 10px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.row-inactive td { opacity: 0.55; }

/* ---- chips ---- */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.chip-pending { background: #fff4d6; color: #8a6100; }
.chip-approved { background: #dcf5e3; color: #1a7f37; }
.chip-denied { background: #fde2e2; color: #c62828; }
.chip-cancelled { background: #e8eaf0; color: #5a6472; }

/* ---- forms ---- */
label { display: block; margin: 14px 0; font-weight: 600; }
label .muted { font-weight: 400; font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 12px;
  border: 1px solid #cdd5e0; border-radius: 8px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent, #1f6feb); outline-offset: 0; border-color: transparent;
}
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }

.pin-row { display: flex; gap: 8px; margin-top: 6px; }
.pin-row input { margin-top: 0; }

.filter-bar {
  display: flex; gap: 16px; align-items: end; flex-wrap: wrap;
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 12px 16px;
}
.filter-bar label { margin: 0; font-size: 13px; }
.filter-bar input, .filter-bar select { width: auto; min-width: 130px; }

.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form input { margin: 0; width: auto; flex: 1; max-width: 320px; }

/* ---- buttons ---- */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid #cdd5e0;
  background: #fff; color: #1a2233; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #f0f3f8; text-decoration: none; }
.btn-primary { background: var(--accent, #1f6feb); border-color: var(--accent, #1f6feb); color: #fff; }
.btn-primary:hover { filter: brightness(0.92); background: var(--accent, #1f6feb); }
.btn-approve { background: #1a7f37; border-color: #1a7f37; color: #fff; }
.btn-deny { background: #c62828; border-color: #c62828; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent, #1f6feb); padding: 4px 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; }

/* ---- pagination & row actions ---- */
.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0 4px; }
.actions-cell { display: flex; gap: 12px; align-items: center; }
.actions-cell form { margin: 0; }
.btn-ghost-danger {
  background: transparent; border: none; color: #c62828; font: inherit; font-weight: 600;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.btn-ghost-danger:hover { background: #fde2e2; }
.rename-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.mini-input {
  padding: 6px 10px; border: 1px solid #cdd5e0; border-radius: 6px; font: inherit; width: 160px;
}

/* ---- flash ---- */
.flash { padding: 12px 16px; border-radius: 8px; margin: 12px 0; }
.flash-info { background: #e1efff; color: #1b4d8f; }
.flash-error { background: #fde2e2; color: #c62828; }

/* ---- detail ---- */
.detail-flex { display: flex; gap: 24px; align-items: flex-start; }
.avatar-figure { margin: 0; text-align: center; flex-shrink: 0; }
.avatar-figure figcaption { font-size: 12px; margin-top: 4px; }
.avatar-circle {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent, #1f6feb); display: block;
}
.avatar-empty {
  background: #eef1f5; color: #99a3b3; font-size: 13px;
  display: flex; align-items: center; justify-content: center; border-color: #dde3ec;
}
.detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; flex: 1; }
.detail-grid dt { color: #6b7688; }
.detail-grid dd { margin: 0; }

/* ---- auth ---- */
.auth-card {
  max-width: 380px; margin: 10vh auto 0; background: #fff;
  border: 1px solid #e3e8ef; border-radius: 12px; padding: 32px; text-align: center;
}
.auth-card h1 { margin-top: 0; }
.auth-card form { text-align: left; }
.auth-logo { max-height: 72px; max-width: 200px; margin-bottom: 8px; }

/* ---- kiosk code ---- */
.big-code {
  font-size: 48px; font-weight: 800; letter-spacing: 0.2em;
  color: var(--accent, #1f6feb); margin: 8px 0;
}
