/* =============================================================
   Olytic Component Library — components.css
   v1.0.0
   Styles for all oly-* and rec-card components registered in
   components.js. Existing shell.css classes (kz-card, gate-item,
   feed-item, etc.) are NOT modified here — they live in shell.css.
   ============================================================= */

/* ─── Buttons ─────────────────────────────────────────────── */
.oly-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.oly-btn--primary {
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
}
.oly-btn--primary:hover { opacity: 0.88; }
.oly-btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border, #2a2a2a);
}
.oly-btn--ghost:hover { color: var(--text, #e5e5e5); border-color: var(--muted); }
.oly-btn--danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #f87171;
}
.oly-btn--danger:hover { background: rgba(248,113,113,0.1); }
.oly-btn:disabled { opacity: 0.45; pointer-events: none; }

/* ─── Badges ──────────────────────────────────────────────── */
.oly-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.oly-badge--teal    { background: rgba(13,107,110,0.18); color: var(--teal);    border-color: rgba(13,107,110,0.35); }
.oly-badge--gold    { background: rgba(200,169,110,0.18); color: var(--gold);   border-color: rgba(200,169,110,0.35); }
.oly-badge--muted   { background: rgba(102,112,133,0.15); color: var(--muted);  border-color: rgba(102,112,133,0.3); }
.oly-badge--error   { background: rgba(248,113,113,0.15); color: #f87171;       border-color: rgba(248,113,113,0.3); }
.oly-badge--warning { background: rgba(251,191,36,0.15);  color: #fbbf24;       border-color: rgba(251,191,36,0.3); }
.oly-badge--success { background: rgba(52,211,153,0.15);  color: #34d399;       border-color: rgba(52,211,153,0.3); }
.oly-badge--neutral { background: rgba(229,229,229,0.08); color: var(--text-secondary, #aaa); border-color: rgba(229,229,229,0.15); }
.oly-badge--sm { padding: 1px 5px; font-size: 9px; }

/* ─── Empty States ────────────────────────────────────────── */
.oly-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
}
.oly-empty__icon {
  font-size: 28px;
  opacity: 0.45;
  line-height: 1;
}
.oly-empty__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e5e5e5);
  margin: 0;
}
.oly-empty__message {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}
.oly-empty--loading .oly-empty__icon { animation: spin 1s linear infinite; }
.oly-empty--error .oly-empty__title  { color: #f87171; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Section Headers ─────────────────────────────────────── */
.oly-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  margin-bottom: 14px;
}
.oly-section-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.oly-section-header__title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.oly-section-header__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(102,112,133,0.15);
  padding: 1px 6px;
  border-radius: 99px;
}
.oly-section-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Stat Cards ──────────────────────────────────────────── */
.oly-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.oly-stat__value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text, #e5e5e5);
}
.oly-stat__value--teal    { color: var(--teal); }
.oly-stat__value--gold    { color: var(--gold); }
.oly-stat__value--caution { color: #fbbf24; }
.oly-stat__label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ─── Value Bars ──────────────────────────────────────────── */
.oly-value-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.oly-value-bar__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
}
.oly-value-bar__pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text, #e5e5e5);
}
.oly-value-bar__track {
  height: 4px;
  border-radius: 99px;
  background: rgba(102,112,133,0.2);
  overflow: hidden;
}
.oly-value-bar__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--teal);
  transition: width 0.4s ease;
}
.oly-value-bar__fill--teal  { background: var(--teal); }
.oly-value-bar__fill--gold  { background: var(--gold); }
.oly-value-bar__fill--muted { background: var(--muted); }

/* ─── Toolbar ─────────────────────────────────────────────── */
.oly-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.oly-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.oly-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.oly-toolbar__search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #2a2a2a);
  background: var(--surface-raised, #222);
  color: var(--text, #e5e5e5);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.oly-toolbar__search:focus { border-color: var(--teal); }
.oly-toolbar__search::placeholder { color: var(--muted); }
.oly-toolbar__sep {
  width: 1px;
  height: 16px;
  background: var(--border, #2a2a2a);
  margin: 0 2px;
}

/* ─── Filter Pills ────────────────────────────────────────── */
.oly-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border, #2a2a2a);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.oly-filter-pill:hover { color: var(--text, #e5e5e5); border-color: var(--muted); }
.oly-filter-pill--active {
  background: rgba(13,107,110,0.18);
  color: var(--teal);
  border-color: rgba(13,107,110,0.5);
}
.oly-filter-pill--sort   { border-style: dashed; }
.oly-filter-pill--group  { border-style: dashed; }
.oly-filter-pill--high   { background: rgba(13,107,110,0.12);  color: var(--teal); border-color: rgba(13,107,110,0.35); }
.oly-filter-pill--medium { background: rgba(200,169,110,0.12); color: var(--gold); border-color: rgba(200,169,110,0.35); }
.oly-filter-pill--low    { background: rgba(102,112,133,0.12); color: var(--muted); border-color: rgba(102,112,133,0.3); }
.oly-filter-pill__count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(102,112,133,0.2);
  padding: 0 4px;
  border-radius: 99px;
  line-height: 1.6;
}
.oly-filter-pill--active .oly-filter-pill__count {
  background: rgba(13,107,110,0.3);
  color: var(--teal);
}

/* ─── List View (Salesforce-style sortable table) ─────────── */
.oly-list-view {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a2a);
}
.oly-list-view__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 12px;
}
.oly-list-view__header-row {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.oly-list-view__th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}
.oly-list-view__th:hover { color: var(--text, #e5e5e5); }
.oly-list-view__th[data-sorted="asc"]::after  { content: ' ↑'; opacity: 0.7; }
.oly-list-view__th[data-sorted="desc"]::after { content: ' ↓'; opacity: 0.7; }
.oly-list-view__tr {
  border-bottom: 1px solid var(--border, #2a2a2a);
  transition: background 0.12s;
  cursor: pointer;
}
.oly-list-view__tr:last-child { border-bottom: none; }
.oly-list-view__tr:hover { background: rgba(255,255,255,0.03); }
.oly-list-view__td {
  padding: 10px 12px;
  color: var(--text, #e5e5e5);
  vertical-align: middle;
}
.oly-list-view__td:first-child { font-weight: 500; }
.oly-list-view__empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ─── Related List (child records below a detail panel) ────── */
.oly-related-list {
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  overflow: hidden;
}
.oly-related-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.oly-related-list__title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e5e5e5);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.oly-related-list__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(102,112,133,0.18);
  padding: 1px 5px;
  border-radius: 99px;
}
.oly-related-list__view-all {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--teal);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.12s;
}
.oly-related-list__view-all:hover { opacity: 0.75; }
.oly-related-list__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 12px;
}
.oly-related-list__th {
  padding: 7px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border, #2a2a2a);
  white-space: nowrap;
}
.oly-related-list__tr {
  border-bottom: 1px solid var(--border, #2a2a2a);
  transition: background 0.12s;
  cursor: pointer;
}
.oly-related-list__tr:last-child { border-bottom: none; }
.oly-related-list__tr:hover { background: rgba(255,255,255,0.03); }
.oly-related-list__td {
  padding: 8px 14px;
  color: var(--text, #e5e5e5);
  vertical-align: middle;
}
.oly-related-list__empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ─── Card Grid ───────────────────────────────────────────── */
.oly-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.oly-card-grid--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* ─── Record Card ─────────────────────────────────────────── */
.rec-card {
  display: flex;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a2a);
  background: var(--surface-raised, #1e1e1e);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.rec-card:hover {
  border-color: var(--muted);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.rec-card__accent {
  width: 4px;
  flex-shrink: 0;
  background: var(--teal);
}
.rec-card__body {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rec-card__title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e5e5e5);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-card__subtitle {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}
.rec-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rec-card__meta-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rec-card__meta-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text, #e5e5e5);
}
.rec-card__meta-value--teal { color: var(--teal); }
.rec-card__meta-value--gold { color: var(--gold); }
.rec-card__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
  margin-right: 4px;
}
.rec-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.rec-card__badge {
  /* Uses oly-badge styles; this class is a semantic alias */
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: rgba(102,112,133,0.15);
  color: var(--muted);
  border: 1px solid rgba(102,112,133,0.3);
}

/* Record card pipeline progress track */
.rec-card__pipeline {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}
.rec-card__pip {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(102,112,133,0.2);
  position: relative;
  transition: background 0.2s;
}
.rec-card__pip--teal   { background: var(--teal); }
.rec-card__pip--gold   { background: var(--gold); }
.rec-card__pip--clear  { background: rgba(102,112,133,0.2); }
.rec-card__pip--warn   { background: #fbbf24; }
.rec-card__pip--active {
  background: var(--teal);
  box-shadow: 0 0 6px rgba(13,107,110,0.6);
}
.rec-card__pip-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border, #2a2a2a);
  flex-shrink: 0;
}
.rec-card__pip-icon {
  font-size: 10px;
  line-height: 1;
}
.rec-card__arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
}
.rec-card:hover .rec-card__arrow { opacity: 1; }
