/* ============================================================
   Business dashboard — page-specific styles
   ============================================================ */

.biz-main { padding: 28px 0 80px; }

/* role switcher (header context) */
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  font-size: 12px;
  font-weight: 600;
}
.role-pill .icon {
  width: 22px; height: 22px;
  border-radius: var(--r-pill);
  background: var(--signal);
  color: var(--signal-on);
  display: grid; place-items: center;
}
.role-pill .icon .ms { font-size: 14px; }
.role-pill .sep { color: rgba(247, 246, 242, 0.3); }
.role-pill .name { color: var(--signal); }

/* page head */
.biz-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: flex-end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.biz-head h1 {
  font-size: 36px;
  letter-spacing: -0.035em;
  line-height: 1.0;
  font-family: var(--font);
  font-weight: 600;
}
.biz-head h1 .day {
  color: var(--text-muted);
  font-weight: 500;
}
.biz-head .greet {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.biz-head .greet .shift {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--go-soft);
  color: var(--go);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.biz-head .greet .shift::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--go);
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.biz-head-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== KPI ROW ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi.dark {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
}
.kpi.signal {
  background: var(--signal);
  color: var(--signal-on);
  border-color: var(--signal);
}
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kpi.dark .kpi-label { color: rgba(247, 246, 242, 0.55); }
.kpi.signal .kpi-label { color: rgba(42, 35, 0, 0.6); }
.kpi-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: grid; place-items: center;
}
.kpi-icon .ms { font-size: 16px; color: var(--text); }
.kpi.dark .kpi-icon { background: rgba(247, 246, 242, 0.08); }
.kpi.dark .kpi-icon .ms { color: var(--signal); }
.kpi.signal .kpi-icon { background: rgba(42, 35, 0, 0.08); }
.kpi.signal .kpi-icon .ms { color: var(--signal-on); }

.kpi-value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-value .unit {
  font-size: 16px;
  margin-left: 2px;
  font-weight: 500;
}
.kpi-value .sub {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0;
}
.kpi.dark .kpi-value .sub { color: rgba(247, 246, 242, 0.55); }

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px 3px 6px;
  border-radius: var(--r-pill);
}
.kpi-delta.up { background: var(--go-soft); color: var(--go); }
.kpi-delta.down { background: var(--busy-soft); color: var(--busy); }
.kpi-delta.flat { background: var(--surface-3); color: var(--text-muted); }
.kpi-delta .ms { font-size: 14px; }
.kpi.dark .kpi-delta.up { background: rgba(46, 125, 99, 0.2); color: #6fcf97; }
.kpi.dark .kpi-delta.down { background: rgba(185, 28, 28, 0.2); color: #f87171; }

.kpi-trend {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.kpi.dark .kpi-trend { color: rgba(247, 246, 242, 0.4); }
.kpi.signal .kpi-trend { color: rgba(42, 35, 0, 0.55); }

/* mini sparkline as bars */
.kpi-spark {
  position: absolute;
  bottom: 0; right: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  width: 80px;
  padding: 4px;
  opacity: 0.5;
}
.kpi-spark span {
  flex: 1;
  background: currentColor;
  border-radius: 1px;
  display: block;
}
.kpi.dark .kpi-spark { color: var(--signal); opacity: 0.4; }

/* ===== SCHEDULE / POSTS LOAD ===== */
.schedule-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 28px;
}
.schedule-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.schedule-block-head h2 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
}
.schedule-block-head h2 .mono { color: var(--text-muted); font-size: 14px; margin-left: 8px; font-weight: 400; }
.schedule-block-head .meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.schedule-block-head .meta .item { display: inline-flex; align-items: center; gap: 5px; }
.schedule-block-head .meta .ms { font-size: 14px; }
.schedule-block-head .meta .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* time axis */
.time-axis {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  margin-bottom: 6px;
}
.time-axis .lab { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.time-marks {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.time-marks span { padding-left: 4px; }

/* post rows */
.post-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.post-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
}
.post-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.post-label .n {
  font-size: 13px;
  font-weight: 600;
}
.post-label .m {
  font-size: 11px;
  color: var(--text-muted);
}
.post-track {
  height: 40px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
}
.post-track::before {
  /* hour grid */
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 13 - 1px), rgba(15,17,21,0.05) calc(100% / 13 - 1px), rgba(15,17,21,0.05) calc(100% / 13));
  pointer-events: none;
}
.booking-bar {
  position: absolute;
  top: 4px; bottom: 4px;
  border-radius: var(--r-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.booking-bar:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.booking-bar .when {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  margin-right: 6px;
  opacity: 0.75;
}
.bar-info { background: var(--info-soft); color: var(--info); }
.bar-go { background: var(--go-soft); color: var(--go); }
.bar-wait { background: var(--wait-soft); color: var(--wait); }
.bar-busy { background: var(--busy-soft); color: var(--busy); }
.bar-signal { background: var(--signal); color: var(--signal-on); }
.bar-muted { background: var(--surface-3); color: var(--text-muted); }

.now-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--busy) 0 6px,
      var(--dark) 6px 12px
    );
  z-index: 5;
  pointer-events: none;
}
.now-line::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -4px;
  width: 10px; height: 10px;
  background: var(--busy);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
}
.now-line::after {
  content: 'СЕЙЧАС · 14:38';
  position: absolute;
  top: -24px;
  left: 8px;
  background: var(--busy);
  color: white;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.schedule-foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text-muted);
}
.schedule-foot-bar .stats {
  display: flex;
  gap: 24px;
}
.schedule-foot-bar .stats .item { display: inline-flex; gap: 6px; align-items: baseline; }
.schedule-foot-bar .stats .v { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--text); letter-spacing: -0.02em; }

/* ===== TWO COLUMN: QUEUE + INBOX ===== */
.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-head h2 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.panel-head h2 .count {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  font-weight: 600;
}
.panel-head h2 .count.warn { background: var(--wait); }

/* queue rows */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 120ms ease;
}
.queue-row:hover { border-color: var(--text); }
.queue-row.urgent {
  background: var(--wait-soft);
  border-color: #e8a83c;
}
.q-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.q-icon .ms { font-size: 20px; color: var(--text); }
.q-info {}
.q-info .n {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.q-info .s {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.q-info .s .mono { color: var(--text-muted); }
.q-info .s .dot { color: var(--text-faint); }
.q-amount {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}
.q-amount .when {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--wait);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}
.q-amount .when .ms { font-size: 13px; }
.q-actions { display: flex; gap: 6px; }
.q-actions button {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-family: inherit;
  transition: all 120ms ease;
}
.q-actions button:hover { background: var(--surface-3); color: var(--text); }
.q-actions .accept {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--text-on-dark);
}
.q-actions .accept:hover { background: var(--dark-2); border-color: var(--dark-2); }
.q-actions .decline:hover { color: var(--busy); border-color: var(--busy); background: var(--busy-soft); }

/* inbox */
.inbox-list { display: flex; flex-direction: column; gap: 4px; }
.inbox-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease;
  border-bottom: 1px solid var(--line);
}
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-row.unread .n { font-weight: 600; }
.inbox-row.unread::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 100%;
  background: var(--signal);
  border-radius: 4px;
  margin-left: -8px;
}

.inbox-row .av {
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.inbox-row .ct { min-width: 0; }
.inbox-row .ct .n { font-size: 13px; line-height: 1.3; }
.inbox-row .ct .p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-row .right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.inbox-row .time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.inbox-row .unread-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal);
}

/* ===== quick actions ===== */
.quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 120ms ease, transform 120ms ease;
}
.quick-card:hover { border-color: var(--text); transform: translateY(-1px); }
.quick-card .ic {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--text);
}
.quick-card .ic .ms { font-size: 22px; }
.quick-card .body { flex: 1; }
.quick-card .body .n { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.quick-card .body .s { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.quick-card .arrow { color: var(--text-muted); }
