/* APPOINTMENT HISTORY */
.history-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-date {
  font-size: 11px; color: var(--text-dim);
  min-width: 60px; flex-shrink: 0; padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.history-service { font-size: 13.5px; font-weight: 500; color: var(--text); }
.history-detail  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.history-price   { font-family: var(--serif); font-size: 14px; color: var(--forest); font-weight: 500; margin-left: auto; flex-shrink: 0; padding-top: 2px; }
.history-badge   { display: inline-flex; align-items: center; font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 500; margin-left: 6px; }
.history-badge.listo    { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.history-badge.pendiente{ background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); }
.history-badge.cancelado{ background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.history-stat { text-align: center; padding: 1rem; }
.history-stat-val { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--forest); }
.history-stat-lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 2px; }


/* CONFIG */
.cfg-dia-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2); color: var(--text-muted);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all var(--t); user-select: none;
}
.cfg-dia-btn:has(input:checked) {
  background: var(--forest); color: #fff; border-color: var(--forest);
}
.cfg-dia-btn input { display: none; }


/* ═══════════════════════════════════════
   DARK MODE
═══════════════════════════════════════ */
body.dark-mode {
  --bg:       #0D1208;
  --surface:  #141A0C;
  --surface2: #1A2210;
  --surface3: #202A14;
  --border:   rgba(237,232,220,0.10);
  --border2:  rgba(237,232,220,0.16);
  --text:       #EDE8DC;
  --text-muted: #8A8070;
  --text-dim:   #4A4438;
  background: #0D1208;
  color: #EDE8DC;
}
body.dark-mode .card,
body.dark-mode .metric,
body.dark-mode .appt-block,
body.dark-mode .service-stripe,
body.dark-mode .customers-table { box-shadow: none; }
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea { background: #1A2210; color: #EDE8DC; border-color: rgba(237,232,220,0.12); }
body.dark-mode .nav { background: #111608; border-bottom-color: rgba(237,232,220,0.08); }
body.dark-mode .auth-card { background: #141A0C; }
body.dark-mode .modal { background: #141A0C; }
body.dark-mode .modal-body .ob-input,
body.dark-mode .modal-body .ob-select { background: #1A2210; color: #EDE8DC; }
body.dark-mode .photo-upload-area { background: #1A2210; border-color: rgba(237,232,220,0.12); }
body.dark-mode .dog-photo-placeholder { background: #1A2210; }
body.dark-mode .phone-screen { background: #0D1208; }
body.dark-mode .todo-row { border-bottom-color: rgba(237,232,220,0.08); }
body.dark-mode .faq-item { border-bottom-color: rgba(237,232,220,0.08); }
body.dark-mode .pricing-card { background: #141A0C; }

/* Dark mode toggle switch */
.dark-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.dark-toggle-label { font-size: 13.5px; color: var(--text); font-weight: 500; }
.dark-toggle-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 99px;
  cursor: pointer; transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
}
.toggle-switch input:checked + .toggle-track { background: var(--forest); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }


/* BEFORE/AFTER GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.gallery-item {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}
.gallery-item:hover { transform: scale(1.03); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.gallery-item-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 9px; font-weight: 500;
  padding: 3px 5px; line-height: 1.3;
  letter-spacing: 0.02em;
}
.gallery-add {
  aspect-ratio: 1;
  border: 2px dashed var(--border2);
  border-radius: var(--r-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  background: var(--surface2);
  transition: all 0.15s;
  position: relative;
}
.gallery-add:hover { border-color: var(--yellow); background: var(--yellow-bg); }
.gallery-add i { font-size: 20px; color: var(--text-dim); }
.gallery-add span { font-size: 9px; color: var(--text-dim); text-align: center; line-height: 1.3; }
.gallery-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.90);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 100%; max-height: 75vh;
  border-radius: var(--r);
  object-fit: contain;
}
.lightbox-meta {
  color: rgba(255,255,255,0.70);
  font-size: 13px; margin-top: 12px;
  text-align: center; line-height: 1.6;
}
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font-size: 16px;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
.lightbox-del {
  margin-top: 12px;
  padding: 6px 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--r-sm);
  font-size: 12px; cursor: pointer; font-family: var(--sans);
  transition: all 0.15s;
}
.lightbox-del:hover { background: var(--danger); color: #fff; }


/* INSTALL PROMPT */
.install-banner {
  position:fixed;bottom:0;left:0;right:0;z-index:300;
  background:var(--forest);border-top:1px solid rgba(255,255,255,0.12);
  padding:14px 16px;display:flex;align-items:center;gap:12px;
  box-shadow:0 -4px 24px rgba(0,0,0,0.20);
  animation:slideUpIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.install-banner.hidden{display:none;}
@keyframes slideUpIn{from{transform:translateY(100%)}to{transform:translateY(0)}}
.install-icon{width:44px;height:44px;flex-shrink:0;background:var(--orange);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:22px;}
.install-text{flex:1;min-width:0;}
.install-title{font-size:13px;font-weight:600;color:#fff;margin-bottom:2px;}
.install-sub{font-size:11.5px;color:rgba(255,255,255,0.60);line-height:1.4;}
.install-sub strong{color:rgba(255,255,255,0.85);}
.install-close{width:28px;height:28px;flex-shrink:0;background:rgba(255,255,255,0.10);border:1px solid rgba(255,255,255,0.15);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;color:rgba(255,255,255,0.70);font-size:16px;transition:background 0.15s;}
.install-close:hover{background:rgba(255,255,255,0.20);}

/* OFFLINE INDICATOR */
.offline-banner {
  position:fixed;top:0;left:0;right:0;z-index:500;
  background:#B83020;padding:8px 16px;
  display:flex;align-items:center;justify-content:center;gap:8px;
  font-size:13px;font-weight:500;color:#fff;
  transform:translateY(-100%);transition:transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.offline-banner.visible{transform:translateY(0);}
.offline-dot{width:8px;height:8px;background:#fff;border-radius:50%;flex-shrink:0;animation:pulse 1.5s infinite;}


/* PAYWALL STATS */
.paywall-stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px;
  margin: 1rem 0 1.25rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.paywall-stat { text-align: center; }
.paywall-stat-n { display:block; font-family:var(--serif); font-size:22px; font-weight:500; color:var(--forest); }
.paywall-stat-l { display:block; font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; margin-top:2px; }
.paywall-msg { font-size:13px; color:var(--text-muted); line-height:1.6; margin-bottom:1rem; text-align:center; }
.paywall-msg strong { color:var(--forest); }

/* ANNOUNCEMENT BANNER */
.announce-banner {
  display:none; background:linear-gradient(90deg,var(--forest) 0%,var(--yellow) 100%);
  padding:10px 1.5rem; align-items:center; gap:12px; position:relative; z-index:40;
}
.announce-banner.show { display:flex; }
.announce-icon { font-size:18px; flex-shrink:0; }
.announce-text { flex:1; font-size:13px; color:rgba(255,255,255,0.90); line-height:1.4; }
.announce-text strong { color:#fff; }
.announce-close {
  width:24px; height:24px; flex-shrink:0; background:rgba(255,255,255,0.15);
  border:none; border-radius:50%; color:#fff; font-size:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:background 0.15s; font-family:var(--sans);
}
.announce-close:hover { background:rgba(255,255,255,0.25); }

/* OVERDUE ALERT */
.overdue-alert {
  background:rgba(212,105,42,0.10); border:1px solid rgba(212,105,42,0.25);
  border-radius:8px; padding:10px 12px; margin-bottom:10px;
  display:flex; align-items:center; gap:10px; cursor:pointer;
}
.overdue-alert:hover { background:rgba(212,105,42,0.16); }
.overdue-dot { width:8px; height:8px; background:var(--orange); border-radius:50%; flex-shrink:0; }
.overdue-info { flex:1; font-size:13px; color:var(--text); }
.overdue-info strong { color:var(--orange); }


/* PASSWORD TOGGLE */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 4px; font-size: 16px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--text-muted); }


/* NOTES HISTORY */
.notes-history { margin-top: 10px; }
.notes-add {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.notes-add input {
  flex: 1; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12.5px; font-family: var(--sans);
  background: var(--surface2); color: var(--text);
}
.notes-add input:focus { outline: none; border-color: var(--yellow); }
.notes-add button {
  padding: 7px 12px; background: var(--forest);
  color: #fff; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
}
.notes-add button:hover { background: var(--yellow); }
.note-entry {
  padding: 7px 0; border-bottom: 1px solid var(--border2);
  display: flex; gap: 8px; align-items: flex-start;
}
.note-entry:last-child { border-bottom: none; }
.note-meta {
  font-size: 10px; color: var(--text-dim);
  white-space: nowrap; flex-shrink: 0; padding-top: 2px;
  min-width: 72px;
}
.note-text { font-size: 12.5px; color: var(--text-muted); flex: 1; line-height: 1.5; }
.note-del {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 12px; padding: 2px 4px;
  flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s;
}
.note-del:hover { opacity: 1; color: var(--danger); }

/* LOADING OVERLAY */
.loading-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.loading-overlay.hidden { display: none; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text-muted); font-family: var(--serif); letter-spacing: 0.10em; }

/* SKELETON LOADING STATE — shown in list containers while the first
   Firestore snapshot is still pending, so a mid-load tab doesn't read as
   a genuinely empty list. */
.skeleton-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 10px; }
.skeleton-line { height: 12px; border-radius: 4px; background: var(--border); margin-bottom: 8px; position: relative; overflow: hidden; }
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short { width: 35%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.long { width: 85%; }
.skeleton-line::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }
