/* ── Scoped to #pklts-app ── */

/* Reset & base */
#pklts-app *,
#pklts-app *::before,
#pklts-app *::after { box-sizing: border-box; }

#pklts-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #2d3748;
  line-height: 1.5;
}

.pc-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,.10);
  overflow: hidden;
}

/* ── Header ─────────────────────────────────── */
.pc-header {
  background: linear-gradient(135deg, #1a365d 0%, #2a547a 100%);
  padding: 22px 24px;
  color: #fff;
  text-align: center;
}
.pc-header-title {
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: .5px;
}
.pc-header-sub {
  font-size: .85em;
  color: #a8c4e0;
  margin-top: 4px;
}

/* ── Tabs ────────────────────────────────────── */
.pc-tabs {
  display: flex;
  background: #f0f4f8;
  border-bottom: 2px solid #e2e8f0;
}
.pc-tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: .9em;
  font-weight: 500;
  color: #718096;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: -2px;
}
.pc-tab:hover  { color: #2a547a; background: #e8eef5; }
.pc-tab.active { color: #1a365d; border-bottom-color: #1a365d; background: #fff; font-weight: 700; }

/* ── Body ────────────────────────────────────── */
.pc-body { padding: 20px; min-height: 280px; }

/* ── Progress bar ────────────────────────────── */
.pc-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-bottom: 6px;
}
.pc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a7cbf, #1a365d);
  border-radius: 3px;
  transition: width .4s;
}
.pc-progress-label { font-size: .8em; color: #718096; margin-bottom: 14px; }

/* ── Auth banner ─────────────────────────────── */
.pc-auth-banner {
  background: #ebf4ff;
  border: 1px solid #bee3f8;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: center;
}
.pc-auth-banner p { margin: 0 0 12px; }
.pc-auth-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.pc-my-booking {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  color: #276749;
  font-size: .9em;
  font-weight: 600;
}

/* ── Slot rows ───────────────────────────────── */
.pc-slots { display: flex; flex-direction: column; gap: 6px; }

.pc-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  transition: background .15s;
}
.pc-slot.open  { border-color: #bee3f8; background: #f7fbff; }
.pc-slot.taken { border-color: #e2e8f0; background: #fafafa; opacity: .75; }
.pc-slot.mine  { border-color: #9ae6b4; background: #f0fff4; }

.pc-slot-time { font-size: .88em; color: #4a5568; font-weight: 500; }
.pc-slot.mine .pc-slot-time  { color: #276749; }
.pc-slot.taken .pc-slot-time { color: #a0aec0; }
.pc-slot-name  { font-size: .88em; color: #2d7d46; font-weight: 600; }
.pc-slot-avail { font-size: .82em; color: #a0aec0; }

/* ── Schedule ────────────────────────────────── */
.pc-schedule {}
.pc-sched-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.pc-sched-count { font-size: .9em; color: #718096; }

.pc-srow {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 6px;
  margin-bottom: 4px;
  border: 1px solid #f0f0f0;
}
.pc-srow.booked { background: #fafafa; }
.pc-srow.mine   { background: #f0fff4; border-color: #9ae6b4; }
.pc-srow-time   { flex: 1; font-size: .88em; color: #4a5568; }
.pc-srow-name   { font-size: .88em; font-weight: 600; color: #2d3748; min-width: 120px; text-align: right; }
.pc-srow.mine .pc-srow-name { color: #276749; }

/* ── Admin ───────────────────────────────────── */
.pc-admin {}
.pc-admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}
.pc-admin-tab {
  padding: 9px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: .88em;
  font-weight: 500;
  color: #718096;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all .2s;
  border-radius: 4px 4px 0 0;
}
.pc-admin-tab:hover  { color: #1a365d; background: #f0f4f8; }
.pc-admin-tab.active { color: #1a365d; border-bottom-color: #1a365d; font-weight: 700; }

.pc-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f4f8;
}
.pc-section:last-child { border-bottom: none; }
.pc-section h3 { margin: 0 0 6px; font-size: 1em; color: #1a365d; }
.pc-section h4 { margin: 0 0 10px; font-size: .93em; color: #2d3748; }

/* ── Forms ───────────────────────────────────── */
.pc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.pc-form-grid label {
  display: flex;
  flex-direction: column;
  font-size: .85em;
  font-weight: 600;
  color: #4a5568;
  gap: 5px;
}
.pc-full-col { grid-column: 1 / -1; }

.pc-form-grid input,
.pc-form-grid select,
.pc-form-grid textarea {
  padding: 9px 12px;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  font-size: .92em;
  color: #2d3748;
  background: #fff;
  width: 100%;
  transition: border-color .2s;
}
.pc-form-grid input:focus,
.pc-form-grid select:focus { outline: none; border-color: #4a7cbf; box-shadow: 0 0 0 3px rgba(74,124,191,.15); }

.pc-inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.pc-inline-form-3 { flex-wrap: nowrap; }
.pc-inline-form input,
.pc-inline-form select {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  font-size: .9em;
}
.pc-inline-form input:focus,
.pc-inline-form select:focus { outline: none; border-color: #4a7cbf; }

/* ── Buttons ─────────────────────────────────── */
.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: .9em;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s;
  white-space: nowrap;
  text-decoration: none;
}
.pc-btn:disabled { opacity: .55; cursor: not-allowed; }

.pc-btn-primary { background: #1a365d; color: #fff; border-color: #1a365d; }
.pc-btn-primary:hover:not(:disabled) { background: #2a547a; border-color: #2a547a; }

.pc-btn-outline { background: #fff; color: #1a365d; border-color: #1a365d; }
.pc-btn-outline:hover:not(:disabled) { background: #ebf4ff; }

.pc-btn-ghost { background: none; color: #718096; border-color: transparent; }
.pc-btn-ghost:hover:not(:disabled) { background: #f0f4f8; }

.pc-slot-mine-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pc-btn-cancel {
  background: #fff;
  color: #c53030;
  border-color: #feb2b2;
  padding: 4px 10px;
  font-size: .78em;
}
.pc-btn-cancel:hover { background: #fff5f5; border-color: #c53030; }

.pc-btn-book { background: #2a7a3b; color: #fff; border-color: #2a7a3b; padding: 7px 14px; font-size: .82em; }
.pc-btn-book:hover { background: #236632; }

.pc-btn-danger { background: #c53030; color: #fff; border-color: #c53030; }
.pc-btn-danger:hover { background: #9b2c2c; }
.pc-btn-danger-outline { background: #fff; color: #c53030; border-color: #feb2b2; }
.pc-btn-danger-outline:hover { background: #fff5f5; border-color: #c53030; }

.pc-btn-xs { padding: 5px 11px; font-size: .82em; }

/* ── Signups table ───────────────────────────── */
.pc-signups-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pc-signups-bar input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  font-size: .9em;
}
.pc-signups-bar input:focus { outline: none; border-color: #4a7cbf; }
.pc-export-btns { display: flex; gap: 6px; }

.pc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pc-table { width: 100%; border-collapse: collapse; font-size: .88em; }
.pc-table th {
  background: #1a365d;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.pc-table td { padding: 9px 12px; border-bottom: 1px solid #e8edf2; }
.pc-table tr:last-child td { border-bottom: none; }
.pc-table tr:hover td { background: #f7fafc; }
.pc-email { color: #4a7cbf; font-size: .85em; }
.pc-actions { white-space: nowrap; display: flex; gap: 6px; }
.pc-empty-row { text-align: center; color: #a0aec0; padding: 20px !important; }

textarea#pc-remind-msg {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  font-size: .9em;
  resize: vertical;
  margin-bottom: 10px;
  font-family: inherit;
}
textarea#pc-remind-msg:focus { outline: none; border-color: #4a7cbf; }

/* ── Danger zone ─────────────────────────────── */
.pc-danger-zone { background: #fff5f5; border-radius: 8px; padding: 16px; border: 1px solid #fed7d7; }
.pc-danger-zone h3 { color: #c53030; }
.pc-danger-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Empty / loading states ──────────────────── */
.pc-empty {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}
.pc-empty-icon { font-size: 2.5em; margin-bottom: 12px; }
.pc-empty p { margin: 4px 0; }
.pc-muted { color: #a0aec0; font-size: .9em; }
.pc-loading-msg { padding: 24px; text-align: center; color: #a0aec0; }

.pklts-init-loading {
  text-align: center;
  padding: 60px 20px;
  color: #a0aec0;
  font-size: .95em;
}

/* ── Modal ───────────────────────────────────── */
.pc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}
.pc-modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  animation: pc-modal-in .2s ease;
}
.pc-modal-sm { max-width: 360px; }
.pc-modal h3 { margin: 0 0 6px; color: #1a365d; font-size: 1.1em; }
.pc-modal p  { margin: 0 0 18px; color: #4a5568; font-size: .93em; }
.pc-modal-time { color: #4a7cbf; font-weight: 700; font-size: .95em; margin-bottom: 16px !important; }
.pc-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none; border: none;
  font-size: 1.1em; color: #a0aec0;
  cursor: pointer; line-height: 1; padding: 4px;
}
.pc-modal-close:hover { color: #2d3748; }
.pc-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pc-modal .pc-form-grid { margin-bottom: 0; }

@keyframes pc-modal-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Toast ───────────────────────────────────── */
#pc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2d3748;
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: .9em;
  font-weight: 500;
  z-index: 100000;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  white-space: nowrap;
}
#pc-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#pc-toast.pc-toast-success { background: #276749; }
#pc-toast.pc-toast-error   { background: #c53030; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 560px) {
  .pc-body { padding: 14px; }
  .pc-tab  { font-size: .8em; padding: 10px 4px; }
  .pc-form-grid { grid-template-columns: 1fr; }
  .pc-inline-form-3 { flex-wrap: wrap; }
  .pc-modal { padding: 20px 16px 18px; }
  .pc-table th, .pc-table td { padding: 7px 8px; }
  .pc-actions { flex-direction: column; gap: 4px; }
  .pc-slot-time { font-size: .82em; }
}
