/**
 * Minibar — Zyareo Phase 5A
 * Stay charges / consumption (not payments). Prefixed .mb-*.
 */

body.mb {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--zy-font-sans);
  background: var(--zy-ivory);
  color: var(--zy-charcoal);
  overflow-x: hidden;
}

.mb-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zy-space-2);
  align-items: center;
  padding: var(--zy-space-3) var(--zy-space-4);
  padding-top: max(var(--zy-space-3), env(safe-area-inset-top));
  background: var(--zy-charcoal);
  color: var(--zy-ivory);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mb-identity {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zy-space-2);
  align-items: center;
  margin-right: auto;
  min-width: 0;
}
.mb-code {
  font-size: var(--zy-text-xs);
  color: rgba(243, 239, 230, 0.72);
}

.mb-pill {
  font-size: var(--zy-text-xs);
  font-weight: var(--zy-weight-semibold);
  padding: 0.3rem 0.55rem;
  border-radius: var(--zy-radius-sm);
  background: rgba(255, 255, 255, 0.12);
}
.mb-pill.ok {
  background: var(--zy-emerald);
  color: #fff;
}
.mb-pill.warn {
  background: var(--zy-gold);
  color: var(--zy-charcoal);
}
.mb-pill.bad {
  background: var(--zy-error);
  color: #fff;
}

.mb-prop {
  display: flex;
  gap: var(--zy-space-2);
  align-items: center;
  font-size: var(--zy-text-sm);
}
.mb-prop select {
  min-height: 2.75rem;
  border-radius: var(--zy-radius-md);
  border: 0;
  padding: 0.35rem 0.55rem;
  font: inherit;
  max-width: 11rem;
}

.mb-link {
  color: rgba(243, 239, 230, 0.85);
  text-decoration: none;
  font-size: var(--zy-text-sm);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.mb-nav {
  display: flex;
  gap: var(--zy-space-2);
  padding: var(--zy-space-2) var(--zy-space-4);
  background: var(--zy-paper);
  border-bottom: 1px solid var(--zy-border);
  overflow-x: auto;
}
.mb-nav button {
  border: 1px solid var(--zy-border);
  background: var(--zy-white);
  padding: 0.55rem 0.9rem;
  border-radius: var(--zy-radius-md);
  font-weight: var(--zy-weight-semibold);
  min-height: 2.75rem;
  cursor: pointer;
  font: inherit;
  color: var(--zy-charcoal);
  white-space: nowrap;
}
.mb-nav button.active {
  background: var(--zy-charcoal);
  color: #fff;
  border-color: var(--zy-charcoal);
}

.mb-banner {
  margin: var(--zy-space-3) var(--zy-space-4) 0;
  padding: var(--zy-space-3);
  border-radius: var(--zy-radius-md);
  font-size: var(--zy-text-sm);
}
.mb-banner.error {
  background: var(--zy-error-soft);
  color: var(--zy-error);
}
.mb-banner.ok {
  background: var(--zy-success-soft);
  color: var(--zy-success);
}
.mb-banner.setup {
  background: var(--zy-warning-soft);
  color: var(--zy-warning);
}
.mb-banner.warn {
  background: var(--zy-gold-soft);
  color: var(--zy-warning);
  border: 1px solid var(--zy-border);
}

.mb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zy-space-3);
  padding: var(--zy-space-3) var(--zy-space-4);
  align-items: flex-end;
}
.mb-filters label {
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-1);
  font-size: var(--zy-text-xs);
  font-weight: var(--zy-weight-semibold);
  color: var(--zy-text-muted);
}
.mb-filters label:has(input[type='checkbox']) {
  flex-direction: row;
  align-items: center;
  min-height: 2.75rem;
  gap: var(--zy-space-2);
  text-transform: none;
  font-size: var(--zy-text-sm);
  color: var(--zy-charcoal);
}
.mb-filters select,
.mb-filters input:not([type='checkbox']) {
  min-height: 2.75rem;
  min-width: min(100%, 10rem);
  border-radius: var(--zy-radius-md);
  border: 1px solid var(--zy-border);
  padding: 0.35rem 0.55rem;
  font: inherit;
  background: var(--zy-white);
  color: var(--zy-charcoal);
  font-weight: var(--zy-weight-regular);
}
.mb-filters input[type='checkbox'] {
  width: 1.15rem;
  height: 1.15rem;
}

.mb-main {
  padding: var(--zy-space-3) var(--zy-space-4);
  padding-bottom: max(var(--zy-space-6), env(safe-area-inset-bottom));
  max-width: 56rem;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}

.mb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  gap: var(--zy-space-2);
  margin-bottom: var(--zy-space-4);
}
.mb-stat {
  background: var(--zy-white);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-lg);
  padding: var(--zy-space-3);
  box-shadow: var(--zy-shadow-sm);
}
.mb-stat strong {
  display: block;
  font-size: var(--zy-text-2xl);
  color: var(--zy-emerald-deep);
}
.mb-stat span {
  font-size: var(--zy-text-xs);
  color: var(--zy-text-muted);
}

.mb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-2);
}
.mb-list li {
  background: var(--zy-white);
  border-radius: var(--zy-radius-lg);
  padding: var(--zy-space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--zy-space-2);
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--zy-border);
  border-left: 4px solid var(--zy-emerald);
  cursor: pointer;
  box-shadow: var(--zy-shadow-sm);
  min-height: 3.75rem;
}
.mb-list li.rooms {
  border-left-color: var(--zy-emerald);
}
.mb-list li.in_progress {
  border-left-color: var(--zy-info);
}
.mb-list li.completed {
  border-left-color: var(--zy-success);
}
.mb-list .muted {
  color: var(--zy-text-muted);
  font-size: var(--zy-text-sm);
}

.mb-btn {
  border: 1px solid transparent;
  border-radius: var(--zy-radius-md);
  padding: 0.7rem 1rem;
  font-weight: var(--zy-weight-semibold);
  min-height: 2.75rem;
  cursor: pointer;
  font: inherit;
}
.mb-btn.primary {
  background: var(--zy-emerald);
  color: #fff;
}
.mb-btn.ghost {
  background: var(--zy-paper);
  color: var(--zy-charcoal);
  border-color: var(--zy-border);
}
.mb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mb-dialog {
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-lg);
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  max-height: min(90dvh, 40rem);
  overflow: auto;
  background: var(--zy-white);
}
.mb-dialog-body {
  padding: var(--zy-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-3);
}
.mb-dialog-body h3 {
  margin: var(--zy-space-2) 0 0;
  font-size: var(--zy-text-sm);
  letter-spacing: var(--zy-tracking-wide);
  text-transform: uppercase;
  color: var(--zy-text-muted);
}
.mb-dialog-body label {
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-1);
  font-size: var(--zy-text-sm);
  font-weight: var(--zy-weight-semibold);
}
.mb-dialog-body input,
.mb-dialog-body select,
.mb-dialog-body textarea {
  min-height: 2.75rem;
  border-radius: var(--zy-radius-md);
  border: 1px solid var(--zy-border);
  padding: 0.45rem 0.65rem;
  font: inherit;
  background: var(--zy-white);
  font-weight: var(--zy-weight-regular);
}
.mb-meta {
  color: var(--zy-text-muted);
  margin: 0;
  font-size: var(--zy-text-sm);
}
.mb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zy-space-2);
}
.mb-actions .mb-btn {
  flex: 1 1 auto;
  min-width: 6.5rem;
}

.mb-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-2);
}
.mb-mini-list li {
  background: var(--zy-ivory);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  padding: var(--zy-space-2) var(--zy-space-3);
  font-size: var(--zy-text-sm);
}

@media (prefers-reduced-motion: reduce) {
  body.mb *,
  body.mb *::before,
  body.mb *::after {
    animation: none !important;
    transition: none !important;
  }
}
