/* Cabinet — hero screen */

.cab-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.cab-summary__item {
  background: var(--bg-elev);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cab-summary__label {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.cab-summary__value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  line-height: 1.15;
}
.cab-summary__item--danger .cab-summary__value { color: var(--danger); }
.cab-summary__item--warn .cab-summary__value { color: var(--warn); }
.cab-summary__item--brand .cab-summary__value { color: var(--brand); }
.cab-summary__hint { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

/* Filters */
.cab-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cab-filters__tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  padding: 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.cab-filters__tab {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-muted);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
}
.cab-filters__tab:hover { color: var(--ink); }
.cab-filters__tab.is-active {
  background: var(--ink);
  color: var(--bg-elev);
  font-weight: 500;
}
.cab-filters__count {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--bg-inset);
  color: var(--ink-muted);
}
.cab-filters__tab.is-active .cab-filters__count {
  background: rgba(255,255,255,0.12);
  color: var(--bg-elev);
}
.cab-filters__tools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cab-filters__search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  color: var(--ink-muted);
}
.cab-filters__search input {
  border: 0; outline: 0; background: transparent; width: 120px; font-size: 12px;
}
.cab-filters__search input::placeholder { color: var(--ink-faint); }

/* Grid */
.cab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.cab-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.cab-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.cab-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--viz-1);
  opacity: 0;
  transition: opacity 0.15s;
}
.cab-card:hover::before { opacity: 0.6; }
.cab-card--lvl-low::before, .cab-card--lvl-critical::before {
  background: var(--danger); opacity: 1;
}
.cab-card--lvl-expiring::before { background: var(--warn); opacity: 1; }

.cab-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cab-card__swatch {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--c) 16%, var(--bg-elev));
  color: var(--c);
  flex-shrink: 0;
}
.cab-card__swatch--sm { width: 22px; height: 22px; border-radius: 6px; }
.cab-card__meta { flex: 1; min-width: 0; }
.cab-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.cab-card__strength {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 1px;
}
.cab-card__flag { flex-shrink: 0; }

.cab-card__qty {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cab-card__qtyNum {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  line-height: 1;
}
.cab-card__qtyUnit {
  font-size: 12px;
  color: var(--ink-muted);
}

.cab-card__foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.cab-card__footLabel {
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.cab-card__footValue {
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  margin-top: 2px;
}
.cab-card__footValue.is-warn { color: var(--warn); }

/* Days bar */
.daysbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.daysbar__track {
  flex: 1;
  height: 6px;
  background: var(--bg-inset);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.daysbar__fill {
  height: 100%;
  background: var(--ok);
  border-radius: 3px;
  transition: width 0.3s;
}
.daysbar--low .daysbar__fill { background: var(--warn); }
.daysbar--critical .daysbar__fill { background: var(--danger); }
.daysbar__mark {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 1px;
  background: var(--ink-faint);
  opacity: 0.5;
}
.daysbar__label {
  font-size: 11px;
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 50px;
  justify-content: flex-end;
}
.daysbar__num {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.daysbar__unit { color: var(--ink-muted); font-size: 10px; }
.daysbar--low .daysbar__num { color: var(--warn); }
.daysbar--critical .daysbar__num { color: var(--danger); }

/* Table view */
.cab-table {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.cab-table__head, .cab-table__row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1.4fr 1fr 0.8fr 0.8fr;
  gap: 14px;
  padding: 10px 18px;
  align-items: center;
  font-size: 12px;
  text-align: left;
  width: 100%;
}
.cab-table__head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.cab-table__row {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.cab-table__row:last-child { border-bottom: 0; }
.cab-table__row:hover { background: var(--bg-inset); }
.cab-table__cellMed {
  display: flex; align-items: center; gap: 10px;
}

/* Shelf view */
.cab-shelf {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 20px 0 40px;
}
.cab-shelf__level {
  position: relative;
}
.cab-shelf__tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 12px;
}
.cab-shelf__bottles {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  min-height: 160px;
  padding: 0 4px;
}
.cab-shelf__line {
  height: 3px;
  background: linear-gradient(180deg, var(--border-strong), var(--border));
  border-radius: 1px;
  margin-top: 8px;
  box-shadow: 0 1px 0 var(--bg-inset);
}

.cab-bottle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s;
  width: 80px;
}
.cab-bottle:hover { transform: translateY(-3px); }
.cab-bottle__body {
  width: 46px;
  height: 110px;
  background: color-mix(in oklab, var(--c) 18%, var(--bg-elev));
  border: 1.5px solid color-mix(in oklab, var(--c) 50%, var(--bg-elev));
  border-radius: 8px 8px 6px 6px;
  position: relative;
  overflow: hidden;
}
.cab-bottle__fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--c);
  transition: height 0.4s;
}
.cab-bottle__cap {
  position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 8px;
  background: var(--ink-muted);
  border-radius: 3px 3px 2px 2px;
}
.cab-bottle--lvl-low .cab-bottle__body, .cab-bottle--lvl-critical .cab-bottle__body {
  border-color: var(--danger);
}
.cab-bottle__label { text-align: center; }
.cab-bottle__name {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cab-bottle__qty { font-size: 10px; color: var(--ink-muted); }

/* Detail drawer */
.cab-detail {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 10, 0.3);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  animation: fade-in 0.2s;
}
@keyframes fade-in { from { opacity: 0; } }
.cab-detail__panel {
  width: min(520px, 100%);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  animation: slide-in 0.2s;
  padding: 24px 28px 32px;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.cab-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.cab-detail__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}
.cab-detail__sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.cab-detail__hero {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg-inset);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.cab-detail__bigLabel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 4px;
}
.cab-detail__big {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  line-height: 1.1;
}
.cab-detail__big span {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 400;
  font-family: var(--font-sans);
  margin-left: 2px;
}
.cab-detail__big.is-warn { color: var(--warn); }
.cab-detail__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cab-detail__section { margin-top: 20px; }
.cab-detail__sectionTitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.cab-detail__prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cab-detail__price {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
}
.cab-detail__price.is-best {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.cab-detail__priceStore { flex: 1; font-size: 13px; }
.cab-detail__priceBody { text-align: right; }
