/* hallpass.css — Hall Pass UI styles */

/* ── Layout ───────────────────────────────────────────────────────────────── */

.hp-view {
  padding: 0;
}

.hp-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hp-view-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text, #10203f);
  margin: 0;
}

.hp-loading, .hp-disabled, .hp-error {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted, #5d7398);
  font-size: 0.95rem;
}

.hp-disabled-icon { font-size: 2.5rem; margin-bottom: 12px; }
.hp-disabled h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text, #10203f); }

.hp-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted, #5d7398);
  font-size: 0.9rem;
  background: var(--surface-subtle, #f8fafc);
  border-radius: 10px;
  border: 1px dashed var(--border, rgba(18,52,120,.12));
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.hp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border, rgba(18,52,120,.12));
  margin-bottom: 20px;
}

.hp-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted, #5d7398);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.hp-tab:hover { color: var(--blue, #1b5fe4); background: var(--blue-soft, #eff6ff); }
.hp-tab.is-active { color: var(--blue, #1b5fe4); border-bottom-color: var(--blue, #1b5fe4); font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.hp-btn--primary { background: var(--blue, #1b5fe4); color: #fff; }
.hp-btn--primary:hover { background: var(--blue-dark, #1048c0); }
.hp-btn--secondary { background: var(--surface-subtle, #f1f5f9); color: var(--text, #10203f); border: 1px solid var(--border, rgba(18,52,120,.12)); }
.hp-btn--secondary:hover { background: var(--border, rgba(18,52,120,.12)); }
.hp-btn--danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.hp-btn--danger:hover { background: #fee2e2; }

.hp-action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s;
}

.hp-action--approve  { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.hp-action--approve:hover  { background: #dcfce7; }
.hp-action--deny     { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.hp-action--deny:hover     { background: #fee2e2; }
.hp-action--arrived  { background: #eff6ff; color: #1b5fe4; border-color: #bfdbfe; }
.hp-action--arrived:hover  { background: #dbeafe; }
.hp-action--returned { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.hp-action--returned:hover { background: #dcfce7; }
.hp-action--cancel   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.hp-action--cancel:hover   { background: #ffedd5; }
.hp-action--send-back { background: #faf5ff; color: #7c3aed; border-color: #ddd6fe; }
.hp-action--send-back:hover { background: #ede9fe; }
.hp-action--temp-receive { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.hp-action--temp-receive:hover { background: #ffedd5; }

/* ── Pass cards ───────────────────────────────────────────────────────────── */

.hp-pass-card {
  background: #fff;
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}

.hp-pass-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.hp-pass--active  { border-left: 4px solid #1b5fe4; }
.hp-pass--arrived { border-left: 4px solid #16a34a; }
.hp-pass--pending { border-left: 4px solid #f59e0b; }
.hp-pass--incoming { border-left: 4px solid #8b5cf6; }
.hp-pass--held     { border-left: 4px solid #16a34a; background: #f0fdf4; }
.hp-pass--returning { border-left: 4px solid #f59e0b; }

.hp-pass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hp-pass-student {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text, #10203f);
}

.hp-pass-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--muted, #5d7398);
  margin-bottom: 10px;
}

.hp-pass-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */

.hp-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hp-badge--info             { background: #eff6ff; color: #1b5fe4; }
.hp-badge--success          { background: #f0fdf4; color: #16a34a; }
.hp-badge--warning          { background: #fffbeb; color: #92400e; }
.hp-badge--neutral          { background: #f1f5f9; color: #64748b; }
.hp-badge--danger           { background: #fef2f2; color: #dc2626; }
.hp-badge--returning        { background: #f5f3ff; color: #7c3aed; }
.hp-badge--warning-overdue  { background: #fef9c3; color: #854d0e; }
.hp-badge--overdue          { background: #fef2f2; color: #b91c1c; font-weight: 700; }
.hp-badge--escalated        { background: #dc2626; color: #fff;    font-weight: 700; animation: hp-pulse 1s ease-in-out infinite; }
.hp-badge--abuse            { background: #fff7ed; color: #c2410c; }

/* Escalation card accents */
.hp-pass--warning   { border-left: 3px solid #eab308; }
.hp-pass--overdue   { border-left: 3px solid #dc2626; background: #fffef0; }
.hp-pass--escalated { border-left: 3px solid #dc2626; background: #fff0f0; box-shadow: 0 0 0 1px #fca5a5; }

@keyframes hp-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ── Timer ────────────────────────────────────────────────────────────────── */

.hp-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--blue, #1b5fe4);
  background: var(--blue-soft, #eff6ff);
  padding: 2px 7px;
  border-radius: 6px;
}

.hp-timer--warning { color: #c2410c; background: #fff7ed; }
.hp-timer--expired { color: #dc2626; background: #fef2f2; }
.hp-timer--late {
  color: #fff;
  background: #dc2626;
  animation: hp-timer-pulse 1.4s ease-in-out infinite;
}
@keyframes hp-timer-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Stats grid ───────────────────────────────────────────────────────────── */

.hp-admin-stats { margin-bottom: 20px; }

.hp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.hp-stat-card {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.hp-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue, #1b5fe4);
  line-height: 1.1;
  margin-bottom: 4px;
}

.hp-stat-label {
  font-size: 0.78rem;
  color: var(--muted, #5d7398);
  font-weight: 500;
}

.hp-stats-loading, .hp-stats-error {
  font-size: 0.85rem;
  color: var(--muted, #5d7398);
  padding: 12px 0;
}

/* ── History table ────────────────────────────────────────────────────────── */

.hp-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.hp-history-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #5d7398);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border, rgba(18,52,120,.12));
}

.hp-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(18,52,120,.12));
  color: var(--text, #10203f);
}

.hp-history-table tr:last-child td { border-bottom: none; }
.hp-history-table tr:hover td { background: var(--surface-subtle, #f8fafc); }

/* ── Destination picker ───────────────────────────────────────────────────── */

.hp-dest-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.hp-dest-btn {
  padding: 7px 14px;
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text, #10203f);
  transition: all 0.12s;
}

.hp-dest-btn:hover { border-color: var(--blue, #1b5fe4); color: var(--blue, #1b5fe4); background: var(--blue-soft, #eff6ff); }
.hp-dest-btn.is-selected { border-color: var(--blue, #1b5fe4); background: var(--blue, #1b5fe4); color: #fff; }

/* ── Student picker ───────────────────────────────────────────────────────── */

.hp-student-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 8px;
  color: var(--text, #10203f);
  background: #fff;
}

.hp-student-search:focus { outline: none; border-color: var(--blue, #1b5fe4); box-shadow: 0 0 0 3px rgba(27,95,228,.1); }

.hp-student-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 8px;
  background: #fff;
}

.hp-student-btn {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: none;
  background: none;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text, #10203f);
  border-bottom: 1px solid var(--border, rgba(18,52,120,.08));
  transition: background 0.1s;
}

.hp-student-btn:last-child { border-bottom: none; }
.hp-student-btn:hover { background: var(--blue-soft, #eff6ff); color: var(--blue, #1b5fe4); }
.hp-student-btn.is-selected { background: var(--blue, #1b5fe4); color: #fff; }

/* ── Destination manager ──────────────────────────────────────────────────── */

.hp-dest-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(18,52,120,.08));
  font-size: 0.875rem;
  color: var(--text, #10203f);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hp-dest-row:last-child { border-bottom: none; }

.hp-dest-form {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.hp-dest-form-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.hp-dest-form-field label { font-size: 0.78rem; font-weight: 600; color: var(--muted, #5d7398); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Form inputs shared ───────────────────────────────────────────────────── */

.hp-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, rgba(18,52,120,.12));
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text, #10203f);
  background: #fff;
}

.hp-input:focus { outline: none; border-color: var(--blue, #1b5fe4); box-shadow: 0 0 0 3px rgba(27,95,228,.1); }

.hp-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #5d7398);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  margin-top: 14px;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */

.hp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.hp-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.hp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.hp-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #10203f);
  margin: 0;
}

.hp-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted, #5d7398);
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
}

.hp-modal-close:hover { background: var(--surface-subtle, #f1f5f9); color: var(--text, #10203f); }

.hp-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.hp-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border, rgba(18,52,120,.12));
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Kiosk view ───────────────────────────────────────────────────────────── */

.hp-kiosk-view {
  min-height: 100vh;
  background: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.hp-kiosk-header { text-align: center; margin-bottom: 40px; }
.hp-kiosk-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.hp-kiosk-dest { font-size: 1.1rem; color: rgba(255,255,255,.6); }
.hp-kiosk-footer { margin-top: auto; text-align: center; color: rgba(255,255,255,.4); font-size: 0.875rem; }

/* ── Upgrade prompt banner ─────────────────────────────────────────────────── */

.hp-upgrade-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  border: 1px solid;
}
.hp-upgrade-banner--soft    { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.hp-upgrade-banner--nudge   { background: #fefce8; border-color: #fde68a; color: #854d0e; }
.hp-upgrade-banner--hard    { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.hp-upgrade-banner--success { background: #f0fdf4; border-color: #86efac; color: #166534; padding: 10px 14px; border-radius: 10px; font-size: 0.875rem; }
.hp-upgrade-icon { font-size: 1.1rem; flex-shrink: 0; }
.hp-upgrade-msg  { flex: 1; }
.hp-upgrade-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.hp-upgrade-trial-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 6px;
  padding: 4px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.hp-upgrade-trial-btn:hover { background: #1d4ed8; }
.hp-upgrade-trial-btn:disabled { opacity: .6; cursor: default; }
.hp-upgrade-dismiss {
  background: none; border: none; cursor: pointer; opacity: .5; font-size: 1rem; padding: 0 2px;
}
.hp-upgrade-dismiss:hover { opacity: 1; }
