/* ══ PetBizManager 3.0 — Complete Stylesheet ══════════════════════════ */
:root {
  --pbm-primary: #1e3a5f;
  --pbm-accent:  #2563eb;
  --pbm-success: #16a34a;
  --pbm-warning: #d97706;
  --pbm-danger:  #dc2626;
  --pbm-purple:  #7c3aed;
  --pbm-pink:    #db2777;
  --pbm-grey:    #6b7280;
  --pbm-light:   #f8fafc;
  --pbm-border:  #e2e8f0;
  --pbm-radius:  10px;
  --pbm-shadow:  0 2px 12px rgba(0,0,0,.08);
  --pbm-font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────── */
.pbm-wrap * { box-sizing: border-box; }
.pbm-wrap, .pbm-widget { font-family: var(--pbm-font); font-size: 14px; color: #1e293b; }

/* ── Layout helpers ─────────────────────────────────────────────────── */
.pbm-flex { display: flex; gap: 12px; }
.pbm-flex-1 { flex: 1; }
.pbm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pbm-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.pbm-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.pbm-card {
  background: white; border-radius: var(--pbm-radius);
  border: 1px solid var(--pbm-border); padding: 20px;
  box-shadow: var(--pbm-shadow);
}
.pbm-card-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--pbm-primary); }
.pbm-card-sm { padding: 14px; border-radius: 8px; }
.pbm-stat-card { text-align: center; padding: 18px 14px; }
.pbm-stat-n { font-size: 32px; font-weight: 700; line-height: 1; }
.pbm-stat-l { font-size: 12px; color: var(--pbm-grey); margin-top: 4px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.pbm-tabs-nav { display: flex; border-bottom: 2px solid var(--pbm-border); gap: 2px; overflow-x: auto; scrollbar-width: none; }
.pbm-tabs-nav::-webkit-scrollbar { display: none; }
.pbm-tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: none; color: var(--pbm-grey);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s; white-space: nowrap;
}
.pbm-tab-btn:hover { color: var(--pbm-accent); }
.pbm-tab-btn.active { color: var(--pbm-accent); border-bottom-color: var(--pbm-accent); }
.pbm-tab-panel { display: none; padding: 18px 0; }
.pbm-tab-panel.active { display: block; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.pbm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.pbm-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.pbm-form-full { grid-column: 1 / -1; }
.pbm-label { display: block; font-size: 12px; font-weight: 600; color: var(--pbm-grey); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.pbm-input, .pbm-select, .pbm-textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--pbm-border);
  border-radius: 7px; font-size: 14px; transition: border-color .15s;
  font-family: var(--pbm-font); background: white;
}
.pbm-input:focus, .pbm-select:focus, .pbm-textarea:focus { outline: none; border-color: var(--pbm-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pbm-textarea { resize: vertical; min-height: 90px; }
.pbm-field-error { border-color: var(--pbm-danger) !important; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.pbm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; text-decoration: none;
}
.pbm-btn:disabled { opacity: .5; cursor: not-allowed; }
.pbm-btn-primary { background: var(--pbm-accent); color: white; }
.pbm-btn-primary:hover { background: #1d4ed8; }
.pbm-btn-success { background: var(--pbm-success); color: white; }
.pbm-btn-success:hover { background: #15803d; }
.pbm-btn-danger  { background: var(--pbm-danger); color: white; }
.pbm-btn-danger:hover  { background: #b91c1c; }
.pbm-btn-outline { background: white; color: var(--pbm-accent); border: 1.5px solid var(--pbm-accent); }
.pbm-btn-outline:hover { background: #eff6ff; }
.pbm-btn-ghost   { background: none; color: var(--pbm-grey); border: 1px solid var(--pbm-border); }
.pbm-btn-ghost:hover { background: var(--pbm-light); }
.pbm-btn-sm { padding: 5px 12px; font-size: 12px; }
.pbm-btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.pbm-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.pbm-badge-success, .pbm-badge-approved, .pbm-badge-completed { background: #dcfce7; color: #166534; }
.pbm-badge-warning, .pbm-badge-pending { background: #fef3c7; color: #92400e; }
.pbm-badge-danger, .pbm-badge-critical { background: #fee2e2; color: #991b1b; }
.pbm-badge-info, .pbm-badge-booking, .pbm-badge-grooming { background: #dbeafe; color: #1e40af; }
.pbm-badge-grey, .pbm-badge-config { background: #f1f5f9; color: #475569; }
.pbm-badge-purple, .pbm-badge-boarding { background: #ede9fe; color: #5b21b6; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.pbm-alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.pbm-alert-info     { background: #eff6ff; border-left: 3px solid var(--pbm-accent); }
.pbm-alert-critical { background: #fef2f2; border-left: 3px solid var(--pbm-danger); }
.pbm-alert-badge { background: var(--pbm-danger); color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── Toast notifications ────────────────────────────────────────────── */
.pbm-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  padding: 12px 20px; border-radius: 9px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.18); transform: translateY(20px);
  opacity: 0; transition: all .25s; pointer-events: none; max-width: 360px;
}
.pbm-toast-show { transform: translateY(0); opacity: 1; }
.pbm-toast-success { background: #1e3a5f; color: white; }
.pbm-toast-error   { background: var(--pbm-danger); color: white; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.pbm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pbm-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--pbm-grey); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--pbm-border); background: var(--pbm-light); }
.pbm-table td { padding: 10px 12px; border-bottom: 1px solid var(--pbm-border); vertical-align: middle; }
.pbm-table tr:hover td { background: var(--pbm-light); }
.pbm-table tr:last-child td { border-bottom: none; }

/* ── Stat row ───────────────────────────────────────────────────────── */
.pbm-stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }

/* ── Progress bar ───────────────────────────────────────────────────── */
.pbm-progress-wrap { background: var(--pbm-border); border-radius: 6px; overflow: hidden; height: 8px; }
.pbm-progress-bar  { height: 100%; border-radius: 6px; background: var(--pbm-accent); transition: width .4s; }

/* ── Wizard ─────────────────────────────────────────────────────────── */
.pbm-wizard-progress { display: flex; justify-content: center; gap: 0; margin-bottom: 28px; }
.pbm-wizard-progress-step {
  display: flex; align-items: center; gap: 8px; padding: 8px 18px;
  font-size: 12px; font-weight: 600; color: var(--pbm-grey);
  border-bottom: 2px solid var(--pbm-border);
}
.pbm-wizard-progress-step.active { color: var(--pbm-accent); border-bottom-color: var(--pbm-accent); }
.pbm-wizard-progress-step.done   { color: var(--pbm-success); }
.pbm-wizard-step { display: none; }
.pbm-wizard-nav  { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ── Signature pad ──────────────────────────────────────────────────── */
.pbm-sig-wrap   { border: 2px dashed var(--pbm-border); border-radius: 8px; overflow: hidden; }
#pbm-sig-canvas { display: block; cursor: crosshair; touch-action: none; width: 100%; height: 150px; }

/* ── Calendar ───────────────────────────────────────────────────────── */
.pbm-cal-header { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.pbm-cal-title  { flex: 1; text-align: center; font-weight: 600; font-size: 15px; }
.pbm-cal-grid   { border: 1px solid var(--pbm-border); border-radius: 8px; overflow: auto; background: white; }
.pbm-cal-day-header { padding: 8px 6px; font-size: 12px; font-weight: 700; text-align: center; background: var(--pbm-light); border-bottom: 1px solid var(--pbm-border); position: relative; }
.pbm-cal-today-col { background: #eff6ff; }
.pbm-cal-time-label { font-size: 11px; color: var(--pbm-grey); text-align: right; padding: 2px 6px; border-right: 1px solid var(--pbm-border); min-height: 48px; display: flex; align-items: flex-start; justify-content: flex-end; }
.pbm-cal-time-gutter { border-right: 1px solid var(--pbm-border); }
.pbm-cal-cell { border-right: 1px solid var(--pbm-border); border-bottom: 1px solid #f1f5f9; min-height: 48px; padding: 2px; position: relative; transition: background .1s; }
.pbm-cal-cell:hover { background: #f8fbff; }
.pbm-cal-drop-target { background: #dbeafe !important; }
.pbm-cal-event { margin: 1px; font-size: 11px; padding: 3px 5px; border-radius: 4px; color: white; cursor: grab; user-select: none; }
.pbm-cal-event:active { cursor: grabbing; }
.pbm-cal-add-block { position: absolute; right: 2px; top: 2px; background: none; border: none; cursor: pointer; font-size: 14px; opacity: 0; transition: opacity .15s; }
.pbm-cal-day-header:hover .pbm-cal-add-block { opacity: 0.6; }

/* ── Groomer calendar ───────────────────────────────────────────────── */
.pbm-grm-header   { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.pbm-grm-grid     { border: 1px solid var(--pbm-border); border-radius: 8px; overflow: auto; background: white; }
.pbm-grm-day-hd   { padding: 8px 4px; font-size: 11px; font-weight: 700; text-align: center; background: var(--pbm-light); border-bottom: 1px solid var(--pbm-border); }
.pbm-grm-time     { font-size: 10px; color: var(--pbm-grey); text-align: right; padding: 2px 4px; border-right: 1px solid var(--pbm-border); min-height: 32px; line-height: 32px; }
.pbm-grm-cell     { border-right: 1px solid var(--pbm-border); border-bottom: 1px solid #f1f5f9; min-height: 32px; position: relative; }
.pbm-grm-cell.grm-drop { background: #dbeafe; }
.pbm-grm-appt     { user-select: none; }

/* ── Check-in board ─────────────────────────────────────────────────── */
.pbm-checkin-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pbm-checkin-card  { background: white; border-radius: 9px; border: 1.5px solid var(--pbm-border); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--pbm-shadow); }
.pbm-checkin-card.pbm-status-in_progress { border-color: var(--pbm-success); background: #f0fdf4; }
.pbm-dog-thumb { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; align-self: center; }
.pbm-dog-thumb-placeholder { width: 60px; height: 60px; background: var(--pbm-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; align-self: center; }
.pbm-checkin-info strong { font-size: 14px; }
.pbm-checkin-info span   { font-size: 12px; color: var(--pbm-grey); }

/* ── Dog profile cards ──────────────────────────────────────────────── */
.pbm-dog-card     { background: white; border-radius: 10px; border: 1px solid var(--pbm-border); overflow: hidden; }
.pbm-dog-card-hd  { background: var(--pbm-primary); color: white; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.pbm-dog-avatar   { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.4); }
.pbm-dog-card-body{ padding: 16px 18px; }
.pbm-hold-banner  { background: #fef2f2; border-left: 3px solid var(--pbm-danger); padding: 8px 12px; border-radius: 0 6px 6px 0; font-size: 12px; font-weight: 600; color: var(--pbm-danger); margin-bottom: 10px; }

/* ── Pickup people ──────────────────────────────────────────────────── */
.pbm-pickup-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pbm-pickup-card  { border: 1.5px solid var(--pbm-border); border-radius: 9px; padding: 14px; text-align: center; position: relative; }
.pbm-pickup-photo { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pbm-border); margin-bottom: 8px; }
.pbm-pickup-name  { font-weight: 700; font-size: 14px; }
.pbm-pickup-rel   { font-size: 12px; color: var(--pbm-grey); }

/* ── POS ────────────────────────────────────────────────────────────── */
.pbm-pos-wrap     { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.pbm-pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pbm-pos-product  { border: 1px solid var(--pbm-border); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; transition: border-color .15s; }
.pbm-pos-product:hover { border-color: var(--pbm-accent); background: #eff6ff; }
.pbm-pos-product-name  { font-size: 13px; font-weight: 600; }
.pbm-pos-product-price { font-size: 15px; font-weight: 700; color: var(--pbm-accent); }
.pbm-pos-cart-wrap { background: var(--pbm-light); border-radius: 10px; padding: 16px; }
.pbm-pos-total    { font-size: 20px; font-weight: 700; color: var(--pbm-primary); text-align: right; margin-bottom: 14px; }

/* ── Compliance ─────────────────────────────────────────────────────── */
.pbm-waiver-text  { max-height: 320px; overflow-y: auto; background: var(--pbm-light); border: 1px solid var(--pbm-border); border-radius: 8px; padding: 16px; font-size: 13px; line-height: 1.7; }
.pbm-waiver-checkboxes { padding: 12px 0; }
.pbm-waiver-checkboxes label { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-size: 13px; line-height: 1.4; }
.pbm-consent-row  { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--pbm-border); }
.pbm-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.pbm-toggle input { opacity: 0; width: 0; height: 0; }
.pbm-slider { position: absolute; inset: 0; background: var(--pbm-border); border-radius: 24px; cursor: pointer; transition: .2s; }
.pbm-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
input:checked + .pbm-slider { background: var(--pbm-success); }
input:checked + .pbm-slider:before { transform: translateX(20px); }

/* ── Report card ────────────────────────────────────────────────────── */
.pbm-rc-stars     { display: flex; gap: 4px; }
.pbm-rc-star      { font-size: 20px; cursor: pointer; color: var(--pbm-border); transition: color .1s; }
.pbm-rc-star.lit  { color: #f59e0b; }

/* ── Staff status ───────────────────────────────────────────────────── */
.pbm-status-in    { color: var(--pbm-success); font-weight: 700; }
.pbm-status-out   { color: var(--pbm-grey); }
.pbm-clock-display{ font-size: 28px; font-weight: 300; letter-spacing: 2px; font-variant-numeric: tabular-nums; }

/* ── Completion meter ───────────────────────────────────────────────── */
.pbm-completion-wrap { display: flex; align-items: center; gap: 12px; background: var(--pbm-light); border-radius: 8px; padding: 12px 16px; }
.pbm-completion-pct  { font-size: 20px; font-weight: 700; color: var(--pbm-primary); min-width: 52px; }

/* ── Admin sidebar (WP) ─────────────────────────────────────────────── */
.pbm-admin-wrap   { display: flex; gap: 24px; align-items: flex-start; }
.pbm-admin-sidebar{ width: 200px; flex-shrink: 0; }
.pbm-admin-nav a  { display: block; padding: 9px 14px; border-radius: 7px; color: var(--pbm-grey); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.pbm-admin-nav a:hover, .pbm-admin-nav a.active { background: var(--pbm-accent); color: white; }
.pbm-admin-content{ flex: 1; }
.pbm-admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid var(--pbm-border); padding-bottom: 14px; }
.pbm-admin-title  { font-size: 20px; font-weight: 600; color: var(--pbm-primary); margin: 0; }

/* ── Availability indicator ─────────────────────────────────────────── */
.pbm-avail-yes { color: var(--pbm-success); font-weight: 600; }
.pbm-avail-no  { color: var(--pbm-danger); }

/* ── Incident badge ─────────────────────────────────────────────────── */
.pbm-severity-low      { color: var(--pbm-success); }
.pbm-severity-medium   { color: var(--pbm-warning); }
.pbm-severity-high     { color: var(--pbm-danger); }
.pbm-severity-critical { color: var(--pbm-danger); font-weight: 800; }

/* ── Kennel map ─────────────────────────────────────────────────────── */
.pbm-kennel-map   { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: 8px; }
.pbm-kennel-btn   { padding: 14px 10px; border-radius: 8px; border: 2px solid var(--pbm-border); background: white; cursor: pointer; font-size: 12px; font-weight: 600; text-align: center; transition: all .15s; }
.pbm-kennel-btn:hover { border-color: var(--pbm-accent); background: #eff6ff; }
.pbm-kennel-occupied  { background: #fef2f2; border-color: var(--pbm-danger); cursor: default; }
.pbm-kennel-assign    { cursor: pointer; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pbm-grid-2, .pbm-grid-3, .pbm-grid-4 { grid-template-columns: 1fr; }
  .pbm-form-row, .pbm-form-row-3 { grid-template-columns: 1fr; }
  .pbm-pos-wrap     { grid-template-columns: 1fr; }
  .pbm-admin-wrap   { flex-direction: column; }
  .pbm-admin-sidebar{ width: 100%; }
  .pbm-wizard-progress { flex-wrap: wrap; }
  .pbm-cal-grid { max-height: 400px; }
}
