:root {
  --bg: #f1f4f9;
  --surface: #ffffff;
  --border: #d8dee9;
  --text: #1c2430;
  --muted: #6b7683;
  --brand: #1a56b8;
  --brand-dark: #14448f;
  --danger: #c0392b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 20px; margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }
.strong { font-weight: 600; }
.muted { color: var(--muted); margin: 4px 0 0; }

/* ---------- layout ---------- */
.wrap { max-width: 1600px; margin: 24px auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 24px auto; padding: 0 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.btn-row { display: flex; gap: 8px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--brand);
  color: #fff;
  padding: 0 20px;
  height: 52px;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.topbar nav { display: flex; gap: 16px; margin-right: auto; }
.topbar nav a { color: rgba(255, 255, 255, .85); font-weight: 500; }
.topbar nav a:hover { color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; }
.whoami { color: rgba(255, 255, 255, .9); display: flex; align-items: center; gap: 8px; }
.role-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 999px;
}
.role-admin { background: #ffd54a; color: #4a3800; }
.role-general { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { background: #f6f8fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #e6bcb6; }
.btn-danger:hover { background: #fdf1ef; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(0, 0, 0, .06); }
.topbar .btn-ghost { color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.req { color: var(--danger); }

.input, .select,
input[type="text"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
.input:focus, .select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 86, 184, .15);
}
.help { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.error { color: var(--danger); font-size: 12px; margin: 5px 0 0; }
.field-error .input, .field-error .select, .field-error textarea { border-color: var(--danger); }

.form-card { padding: 24px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.notice {
  background: #fff8e6;
  border: 1px solid #f2e0a8;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 4px;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.filters .input { flex: 1 1 280px; width: auto; }
.filters .select { flex: 0 1 170px; width: auto; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.msg {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  font-size: 13px;
}
.msg-success { background: #e8f6ec; border-color: #b7e0c3; color: #1c6b34; }
.msg-error { background: #fdecea; border-color: #f2c1bb; color: #97271b; }
.msg-info, .msg-warning { background: #fff8e6; border-color: #f2e0a8; color: #7a5c00; }

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; padding: 0; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th {
  background: var(--brand);
  color: #fff;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.grid td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.grid tbody tr:hover { background: #f7f9fc; }
.grid .col-wide { min-width: 220px; }
.grid td:nth-child(5) { min-width: 130px; }
.grid .empty { text-align: center; color: var(--muted); padding: 36px 12px; }

/* Keep Edit/Delete reachable when the admin table scrolls sideways. */
.grid .col-actions {
  white-space: nowrap;
  text-align: right;
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -6px 0 6px -6px rgba(16, 24, 40, .25);
}
.grid th.col-actions { background: var(--brand); }
.grid tbody tr:hover .col-actions { background: #f7f9fc; }
.grid td.col-actions .btn + .btn { margin-left: 4px; }

/* ---------- status / action pills ---------- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
  color: #fff;
}
.action-new-booking { background: #157347; }
.action-change-booking { background: #c62828; }
.action-others { background: #1a73e8; }

.status-pending { background: #e0e4ea; color: #495563; }
.status-processing { background: #1a56b8; }
.status-completed { background: #6a3fb5; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------- detail ---------- */
.detail { display: grid; grid-template-columns: 160px 1fr; gap: 12px 20px; margin: 0; }
.detail dt { font-weight: 600; color: var(--muted); font-size: 13px; }
.detail dd { margin: 0; }

/* ---------- login ---------- */
.login-card { margin-top: 60px; padding: 28px; }
.login-title { margin-bottom: 4px; }
.login-card .muted { margin-bottom: 20px; }

@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; gap: 4px 0; }
  .detail dd { margin-bottom: 10px; }
  .topbar { gap: 12px; padding: 0 12px; }
  .whoami { display: none; }
}
