:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #e8ecf4;
  --text: #0f172a;
  --muted: #64748b;
  --primary-soft: #eef4ff;
  --success-soft: #ecfdf3;
  --warning-soft: #fff8e6;
  --danger-soft: #fef2f2;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #4f46e5);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.18);
}

.nav-link.tab-link {
  color: #475569;
  font-weight: 500;
  border-radius: 10px;
  padding: .6rem .9rem;
  transition: all .2s ease;
  white-space: nowrap;
}

.nav-link.tab-link:hover,
.nav-link.tab-link.active {
  color: #111827;
  background: var(--primary-soft);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 0;
}

.soft-card,
.card {
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .04);
}

.metric-card {
  min-height: 138px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.bg-soft-primary { background: var(--primary-soft); }
.bg-soft-success { background: var(--success-soft); }
.bg-soft-warning { background: var(--warning-soft); }
.bg-soft-danger { background: var(--danger-soft); }

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.metric-label,
.table-hint,
.form-text,
.small-muted {
  color: var(--muted);
}

.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: .04em;
  border-bottom-width: 1px;
  background: #fbfcfe;
}

.table td,
.table th {
  vertical-align: middle;
}

.badge-soft {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--border);
}

.status-badge {
  border-radius: 999px;
  padding: .45rem .7rem;
  font-weight: 600;
  font-size: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.status-confirmed { background: #ecfdf3; color: #166534; }
.status-pending   { background: #fff7ed; color: #9a3412; }
.status-cancelled { background: #fef2f2; color: #b91c1c; }
.status-paid      { background: #eef4ff; color: #1d4ed8; }

.content-wrap {
  padding: 1.5rem 0 2rem;
}

.toolbar {
  gap: .75rem;
}

/* ---- Week calendar: hours on the Y axis, weekdays on the X axis ---- */

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.cal-title {
  font-weight: 600;
  min-width: 15rem;
  text-align: center;
}

/* Grows with the grid so the card background still sits under the whole
   calendar once it exceeds the viewport width and the page scrolls sideways. */
.cal-card {
  min-width: 100%;
  width: fit-content;
}

.cal {
  --cal-row-h: 112px;
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(120px, 1fr));
  grid-template-rows: auto calc(var(--cal-hours) * var(--cal-row-h));
  min-width: 900px;
}

.cal-corner {
  border-bottom: 1px solid var(--border);
}

.cal-dayname {
  padding: .5rem .25rem .75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.cal-dayname-label {
  display: block;
  font-weight: 600;
}

.cal-dayname-date {
  display: block;
  font-size: .8rem;
  color: #64748b;
}

.cal-dayname.is-today .cal-dayname-label,
.cal-dayname.is-today .cal-dayname-date {
  color: #2563eb;
}

.cal-axis {
  position: relative;
}

.cal-hour {
  position: absolute;
  right: .5rem;
  transform: translateY(-50%);
  font-size: .75rem;
  color: #64748b;
  white-space: nowrap;
}

.cal-col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0,
    var(--border) 1px,
    transparent 1px,
    transparent var(--cal-row-h)
  );
}

.cal-col.is-today {
  background-color: rgba(37, 99, 235, .04);
}

.cal-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 50;
}

.cal-now::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.cal-ev {
  position: absolute;
  overflow: hidden;
  /* A 15-minute booking is only ~2% of the grid, far too small to read, so
     blocks get a pixel floor and may extend past their slot. */
  min-height: 54px;
  padding: .3rem .45rem;
  border-radius: 8px;
  border-left: 4px solid rgba(0, 0, 0, .25);
  color: #fff;
  font-size: .75rem;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
}

/* Short blocks overlap what follows them, so lift the hovered one clear. */
.cal-ev:hover {
  z-index: 60;
}

.cal-ev-time {
  font-weight: 600;
}

.cal-ev-line {
  opacity: .92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* An appointment crossing midnight renders as two segments in adjacent day
   columns; flatten the touching edges so they read as one booking. */
.cal-ev--spills {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 2px dashed rgba(255, 255, 255, .55);
}

.cal-ev--continues {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 2px dashed rgba(255, 255, 255, .55);
}

.cal-ev--0 { background: #3b82f6; }
.cal-ev--1 { background: #22c55e; }
.cal-ev--2 { background: #f59e0b; }
.cal-ev--3 { background: #ef4444; }
.cal-ev--4 { background: #8b5cf6; }
.cal-ev--5 { background: #06b6d4; }
.cal-ev--6 { background: #ec4899; }
.cal-ev--7 { background: #475569; }

.service-thumb,
.shop-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.page-header {
  margin-bottom: 1.25rem;
}

.chart-box {
  height: 320px;
  position: relative;
}

.chart-box-sm {
  height: 260px;
  position: relative;
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

.btn-service-dropdown,
.btn-service-dropdown:hover,
.btn-service-dropdown:focus,
.btn-service-dropdown:active,
.btn-service-dropdown.show {
  background-color: transparent;
  color: #000;
  border: 1px solid #ced4da;
  box-shadow: none;
}

@media (max-width: 991.98px) {
  .navbar-nav-scroll {
    max-width: 100%;
  }
  /* A time-axis grid does not collapse to one column. It keeps its full
     height and minimum width; the page scrolls to reach the rest. */
  .cal-title {
    min-width: 0;
    font-size: .9rem;
  }
}
