/* ============================================================
   Bespoke — Editorial Component Library
   Pass 1: bx-* components. Applied only where explicitly used.
   Existing pages are unaffected until Pass 2.
   ============================================================ */


/* ------------------------------------------------------------
   BUTTONS
   Editorial system: rectangles, uppercase caps, no radius.
   Depth is in weight and contrast, not shadow or rounding.
   ------------------------------------------------------------ */

.bx-button-primary,
.bx-button-ghost,
.bx-button-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 32px;
  border-radius: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.bx-button-primary {
  background: var(--color-ink);
  color: var(--color-cream);
}

.bx-button-primary:hover {
  opacity: 0.85;
  color: var(--color-cream);
  text-decoration: none;
}

.bx-button-ghost {
  background: transparent;
  color: var(--color-ink);
  border: 0.5px solid var(--color-ink);
}

.bx-button-ghost:hover {
  opacity: 0.70;
  color: var(--color-ink);
  text-decoration: none;
}

.bx-button-accent {
  background: var(--color-oxblood);
  color: var(--color-cream);
}

.bx-button-accent:hover {
  opacity: 0.85;
  color: var(--color-cream);
  text-decoration: none;
}

/* Small variant */
.bx-button-primary.bx-sm,
.bx-button-ghost.bx-sm,
.bx-button-accent.bx-sm {
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: 2px;
}


/* ------------------------------------------------------------
   CARD
   Cream-warm fill, 0.5px ink border, rectangle, no shadow.
   ------------------------------------------------------------ */

.bx-card {
  background: #FFFFFF;
  border: 0.5px solid rgba(10, 8, 8, 0.15);
  border-radius: 0;
  padding: 32px;
}

.bx-card + .bx-card {
  margin-top: 16px;
}

/* Card header — optional top section of a bx-card */
.bx-card-header {
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 0.5px solid rgba(10, 8, 8, 0.10);
}

.bx-card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text-primary);
  line-height: 1.2;
}


/* ------------------------------------------------------------
   TABLE
   Tight typography, generous row padding, row-only borders.
   No alternating row colors. Left accent line on hover.
   ------------------------------------------------------------ */

.bx-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
}

.bx-table thead tr {
  border-bottom: 0.5px solid rgba(10, 8, 8, 0.20);
}

.bx-table thead th {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(10, 8, 8, 0.38);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.bx-table tbody tr {
  border-bottom: 0.5px solid rgba(10, 8, 8, 0.07);
  position: relative;
  transition: none;
}

.bx-table tbody tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--color-oxblood);
  transition: width 0.15s ease;
}

.bx-table tbody tr:hover::before {
  width: 2px;
}

.bx-table tbody td {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(10, 8, 8, 0.75);
  padding: 16px 16px;
  vertical-align: middle;
}

.bx-table tbody td:first-child {
  padding-left: 16px;
}

.bx-table tbody td.td-primary {
  color: var(--color-text-primary);
  font-weight: 500;
}

.bx-table tbody td.td-muted {
  color: var(--color-text-tertiary);
}


/* ------------------------------------------------------------
   STAT CARD
   Dashboard hero stat. .t-number large, .t-label above,
   optional .t-body-small below.
   ------------------------------------------------------------ */

.bx-stat-card {
  background: #FFFFFF;
  border: 0.5px solid rgba(10, 8, 8, 0.12);
  border-radius: 0;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bx-stat-card .bx-stat-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(10, 8, 8, 0.38);
  line-height: 1;
}

.bx-stat-card .bx-stat-number {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: 52px;
  line-height: 1;
  color: var(--color-text-primary);
}

.bx-stat-card .bx-stat-number.bx-stat-accent {
  color: var(--color-oxblood);
}

.bx-stat-card .bx-stat-sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(10, 8, 8, 0.48);
  margin-top: 2px;
}

/* Stat grid — 4-up horizontal strip */
.bx-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: rgba(10, 8, 8, 0.10);  /* creates hairline between cards */
  margin-bottom: var(--space-2xl);
}

.bx-stat-row .bx-stat-card {
  background: #FFFFFF;
  border: none;
}


/* ------------------------------------------------------------
   SECTION HEADER
   Top of every admin page. Label + italic headline + border.
   ------------------------------------------------------------ */

.bx-section-header {
  padding-bottom: var(--space-lg);
  border-bottom: 0.5px solid rgba(10, 8, 8, 0.20);
  margin-bottom: var(--space-xl);
}

.bx-section-header .bx-section-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(10, 8, 8, 0.38);
  margin-bottom: 10px;
  display: block;
}

.bx-section-header .bx-section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.10;
  letter-spacing: -1px;
  color: var(--color-text-primary);
  margin: 0;
}

.bx-section-header .bx-section-sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  color: rgba(10, 8, 8, 0.48);
  margin-top: 8px;
  line-height: 1.5;
}

/* With actions — flex wrapper to put a button on the right */
.bx-section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.bx-section-header-row .bx-section-header {
  flex: 1;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.bx-section-header-row + * {
  border-top: 0.5px solid rgba(10, 8, 8, 0.20);
  padding-top: var(--space-xl);
  margin-top: var(--space-lg);
}


/* ------------------------------------------------------------
   EMPTY STATE
   Italic Playfair, centered. No illustration. Just words.
   ------------------------------------------------------------ */

.bx-empty-state {
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.bx-empty-state .bx-empty-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.35;
  color: rgba(10, 8, 8, 0.32);
  max-width: 480px;
}

.bx-empty-state .bx-empty-action {
  margin-top: var(--space-lg);
}


/* ------------------------------------------------------------
   KANBAN COLUMN (editorial override for pipeline board)
   ------------------------------------------------------------ */

.bx-kanban-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-lg);
}

.bx-kanban {
  display: flex;
  gap: 1px;
  min-width: max-content;
  background: rgba(10, 8, 8, 0.10);
}

.bx-kanban-col {
  width: 200px;
  flex-shrink: 0;
  background: var(--color-cream);
  padding: 20px 20px 24px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.bx-kanban-col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stage-color, var(--color-champagne));
}

.bx-kanban-col:hover {
  background: rgba(201,169,97,0.06);
}

.bx-kanban-col .bx-kanban-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(10, 8, 8, 0.50);
  margin-bottom: 8px;
}

.bx-kanban-col .bx-kanban-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-feature-settings: "lnum" 1;
  font-size: 44px;
  line-height: 1;
  color: var(--stage-color, var(--color-ink));
  margin-bottom: 4px;
}

.bx-kanban-col .bx-kanban-label {
  font-family: var(--font-sans);
  font-size: 11px;
  color: rgba(10, 8, 8, 0.35);
}

.bx-kanban-col .bx-kanban-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(10, 8, 8, 0.42);
  margin-top: 12px;
  min-height: 36px;
}


/* ------------------------------------------------------------
   ACTIVITY FEED
   ------------------------------------------------------------ */

.bx-feed {
  border-top: 0.5px solid rgba(10, 8, 8, 0.12);
}

.bx-feed-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 0.5px solid rgba(10, 8, 8, 0.06);
}

.bx-feed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-oxblood);
  margin-top: 5px;
  flex-shrink: 0;
}

.bx-feed-text {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(10, 8, 8, 0.65);
  flex: 1;
}

.bx-feed-time {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: rgba(10, 8, 8, 0.30);
  white-space: nowrap;
  margin-top: 2px;
}

.bx-feed-empty {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: rgba(10, 8, 8, 0.28);
  padding: var(--space-xl) 0;
}


/* ------------------------------------------------------------
   DRAWER / PANEL
   ------------------------------------------------------------ */

.bx-drawer {
  background: var(--color-cream);
  border: 0.5px solid rgba(10, 8, 8, 0.15);
  padding: 28px 32px;
  margin-top: 1px;
}

.bx-drawer-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bx-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(10, 8, 8, 0.32);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}

.bx-drawer-close:hover {
  color: var(--color-ink);
}


/* ------------------------------------------------------------
   SECTION DIVIDER
   ------------------------------------------------------------ */

.bx-divider {
  border: none;
  border-top: 0.5px solid rgba(10, 8, 8, 0.12);
  margin: var(--space-xl) 0;
}

.bx-divider-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: var(--space-xl) 0;
}

.bx-divider-label::before,
.bx-divider-label::after {
  content: '';
  flex: 1;
  border-top: 0.5px solid rgba(10, 8, 8, 0.12);
}

.bx-divider-label span {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(10, 8, 8, 0.32);
  white-space: nowrap;
}


/* ------------------------------------------------------------
   TAG / BADGE
   ------------------------------------------------------------ */

.bx-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  background: rgba(10, 8, 8, 0.06);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.bx-tag.bx-tag-accent {
  background: rgba(139, 46, 42, 0.10);
  color: var(--color-oxblood);
}

.bx-tag.bx-tag-green {
  background: rgba(74, 122, 90, 0.10);
  color: #3D6B4A;
}


/* ------------------------------------------------------------
   RESPONSIVE HELPERS
   ------------------------------------------------------------ */

@media (max-width: 768px) {
  .bx-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .bx-section-header .bx-section-title {
    font-size: 28px;
  }

  .bx-card {
    padding: 20px;
  }

  .bx-button-primary,
  .bx-button-ghost,
  .bx-button-accent {
    padding: 14px 22px;
  }
}
