/* ==========================================================================
   Page-specific layouts
   ========================================================================== */

/* ----- Dashboard ----- */
.hg-dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.hg-schedule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.hg-request-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hg-border);
}
.hg-request-item:last-child { border-bottom: none; }
.hg-request-item .body { flex: 1; min-width: 0; }
.hg-request-item .name { font-weight: 700; font-size: 14px; }
.hg-request-item .msg { font-size: 13px; color: var(--hg-gray-600); margin: 2px 0; }
.hg-request-item .meta { font-size: 11px; color: var(--hg-gray-400); }
.hg-live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--hg-green-text);
}
.hg-live-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hg-green-500);
}

/* ----- Calendar ----- */
.hg-cal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hg-cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-top: 1px solid var(--hg-border);
  border-left: 1px solid var(--hg-border);
}
.hg-cal-daylabel {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hg-gray-500);
  text-align: center;
  border-right: 1px solid var(--hg-border);
  border-bottom: 1px solid var(--hg-border);
}
.hg-cal-daylabel .num {
  font-size: 15px;
  color: var(--hg-gray-900);
  margin-top: 2px;
}
.hg-cal-daylabel.today .num {
  display: inline-flex;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--hg-navy-950);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.hg-cal-timelabel {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--hg-gray-400);
  border-right: 1px solid var(--hg-border);
  border-bottom: 1px solid var(--hg-border);
  text-align: right;
}
.hg-cal-cell {
  min-height: 52px;
  border-right: 1px solid var(--hg-border);
  border-bottom: 1px solid var(--hg-border);
  position: relative;
  padding: 3px;
}
.hg-cal-event {
  border-radius: 6px;
  border-left: 3px solid;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.3;
}
.hg-cal-event .t { font-weight: 700; }
.hg-event-blue   { background: var(--hg-blue-50);   border-color: var(--hg-blue-500); }
.hg-event-purple { background: var(--hg-purple-50); border-color: var(--hg-purple-500); }
.hg-event-teal   { background: var(--hg-teal-50);   border-color: var(--hg-teal-500); }
.hg-event-orange { background: var(--hg-orange-50); border-color: var(--hg-orange-500); }

/* ----- WhatsApp ----- */
.hg-wa-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.hg-phone {
  width: 320px;
  margin: 16px auto 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--hg-border);
}
.hg-phone-head {
  background: #0b5c4c;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hg-phone-head .av { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.hg-phone-body {
  background: #ece5da;
  padding: 14px;
  min-height: 260px;
}
.hg-bubble {
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  max-width: 85%;
  margin-bottom: 8px;
  box-shadow: var(--hg-shadow-sm);
}
.hg-bubble .time { font-size: 10px; color: var(--hg-gray-400); text-align: right; margin-top: 2px; }
.hg-phone-choices { display: flex; flex-direction: column; gap: 1px; background: var(--hg-border); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.hg-phone-choices button { background: #fff; border: none; padding: 10px; font-size: 13px; font-weight: 600; color: #0b5c4c; text-align: left; display: flex; justify-content: space-between; }
.hg-phone-hint { text-align: center; font-size: 11px; color: var(--hg-gray-500); margin: 8px 0; }
.hg-phone-input {
  background: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
}
.hg-phone-input input { flex: 1; border: none; background: transparent; font-size: 13px; }
.hg-phone-input .send { width: 30px; height: 30px; border-radius: 50%; background: #0b5c4c; color: #fff; display: flex; align-items: center; justify-content: center; }

.hg-flow-steps { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hg-gray-500); margin-bottom: 6px; flex-wrap: wrap; }
.hg-flow-steps .step { display: flex; align-items: center; gap: 6px; }
.hg-flow-steps .n {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--hg-gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.hg-flow-steps .step.active .n { background: var(--hg-navy-950); color: #fff; }
.hg-flow-steps .step.active { color: var(--hg-gray-900); font-weight: 700; }

.hg-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--hg-border);
}
.hg-list-row:last-child { border-bottom: none; }
.hg-list-row .title { font-weight: 700; font-size: 14px; }
.hg-list-row .sub { font-size: 12px; color: var(--hg-gray-500); }

/* ----- Availability ----- */
.hg-avail-grid {
  display: grid;
  grid-template-columns: 90px repeat(5, 1fr);
  border-top: 1px solid var(--hg-border);
  border-left: 1px solid var(--hg-border);
  margin-top: 12px;
}
.hg-avail-cell {
  border-right: 1px solid var(--hg-border);
  border-bottom: 1px solid var(--hg-border);
  padding: 6px;
}
.hg-avail-cell.head {
  font-size: 12px; font-weight: 700; text-align: center; padding: 10px;
}
.hg-avail-cell.time { font-size: 12px; color: var(--hg-gray-500); display: flex; align-items: center; justify-content: center; }
.hg-slot {
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
}
.hg-slot-open { background: var(--hg-green-50); color: var(--hg-green-text); }
.hg-slot-booked { background: var(--hg-blue-50); color: var(--hg-blue-500); }
.hg-slot-blocked { background: var(--hg-gray-100); color: var(--hg-gray-400); border: 1px dashed var(--hg-gray-300); }

.hg-kv-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--hg-border);
  font-size: 13px;
}
.hg-kv-row:last-child { border-bottom: none; }
.hg-kv-row .k { color: var(--hg-gray-500); }
.hg-kv-row .v { font-weight: 700; }

/* ----- Placeholder / setup pages (Team, Services, Locations, Reports, Settings) ----- */
.hg-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.hg-setup-card .index {
  display: inline-block;
  background: var(--hg-gray-100);
  color: var(--hg-gray-600);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--hg-radius-sm);
  margin-bottom: 14px;
}
.hg-setup-card .kicker { font-size: 13px; color: var(--hg-gray-500); margin-bottom: 6px; }
.hg-setup-card .big { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.hg-setup-card .desc { font-size: 13px; color: var(--hg-gray-500); }

.hg-checklist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hg-border);
}
.hg-checklist-row:last-child { border-bottom: none; }
.hg-checklist-row .dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.hg-checklist-row .dot.done { background: var(--hg-green-50); color: var(--hg-green-text); }
.hg-checklist-row .dot.todo { border: 2px solid var(--hg-gray-300); }
.hg-checklist-row .label { flex: 1; font-weight: 600; font-size: 14px; }
.hg-checklist-row .review { font-size: 13px; font-weight: 700; color: var(--hg-blue-500); }

/* ----- Reports ----- */
.hg-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 160px;
  padding-top: 10px;
}
.hg-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 8px;
}
.hg-bar-col .bar {
  width: 100%;
  max-width: 46px;
  background: var(--hg-teal-500);
  border-radius: 6px 6px 0 0;
}
.hg-bar-col .val { font-size: 12px; font-weight: 700; }
.hg-bar-col .lbl { font-size: 11px; color: var(--hg-gray-500); }

.hg-hbar-row { margin-bottom: 14px; }
.hg-hbar-row:last-child { margin-bottom: 0; }
.hg-hbar-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.hg-hbar-row .top .n { font-weight: 700; }
.hg-hbar-track { height: 8px; background: var(--hg-gray-100); border-radius: 999px; overflow: hidden; }
.hg-hbar-fill { height: 100%; border-radius: 999px; }

.hg-retention-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}
.hg-retention-legend { display: flex; gap: 18px; font-size: 12px; color: var(--hg-gray-600); }
.hg-retention-legend .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

@media (max-width: 1100px) {
  .hg-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hg-dash-grid { grid-template-columns: 1fr; }
  .hg-wa-grid { grid-template-columns: 1fr; }
  .hg-setup-grid { grid-template-columns: 1fr; }
}
