/* Extracted from index.css L2791-L2871: UI primitives and utility classes */

/* ============================================================
   Phase 6 — UI Primitives (appended to index.css)
   Utility classes replacing the most repeated inline styles.
   All names are prefixed to avoid clashing with existing rules.
   ============================================================ */

/* ── stat-card subtitle (third line, smaller) ─────────────── */
.stat-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── empty-state (already defined at line 951 for text-only  ─
   This variant supports an icon + message block)             */
.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* ── Colour utilities ────────────────────────────────────────
   Use instead of repeating style="color: var(--accent-*)"   */
.text-green  { color: var(--accent-green); }
.text-red    { color: var(--accent-red); }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ── Alignment utilities ─────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }

/* ── Spacing utilities ────────────────────────────────────── */
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }

/* ── Flex layout utilities ────────────────────────────────── */
.flex-row    { display: flex; align-items: center; }
.flex-row-gap-sm { display: flex; align-items: center; gap: 0.35rem; }
.flex-row-gap-md { display: flex; align-items: center; gap: 0.5rem; }
.flex-row-gap-lg { display: flex; align-items: center; gap: 1rem; }
.flex-1      { flex: 1; }
.flex-space-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Typography utilities ─────────────────────────────────── */
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-mono { font-family: 'JetBrains Mono', monospace; }

/* ── Table utilities ──────────────────────────────────────── */
.tbl-full {
  width: 100%;
  border-collapse: collapse;
}
.tbl-full th,
.tbl-full td {
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.tbl-full th {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
}
.tbl-full td.num,
.tbl-full th.num {
  text-align: right;
}

/* ── Cursor utility ───────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }

/* ── Task 7.4: ASB transaction row hover (replaces inline onmouseover/onmouseout) ── */
.asb-tx-row:hover { background: rgba(255,255,255,0.03); }

/* ── Shell layout utilities (extracted from index.html inline styles) ───────── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-sm  { max-width: 500px; margin: 2rem; }
.modal-md  { max-width: 600px; margin: 2rem; max-height: 90vh; overflow-y: auto; }

.btn-icon-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-icon-close:hover { color: var(--text-primary); }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.view-header-sm {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-heading { margin-bottom: 2rem; color: var(--text-primary); }
.section-subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }

.btn-row { display: flex; gap: 1rem; margin-top: 1.5rem; }
.btn-row-sm { display: flex; gap: 1rem; }

.text-primary { color: var(--text-primary); }
.text-xs      { font-size: 0.75rem; }
.pad-sm       { padding: 0.5rem; }
.hidden       { display: none; }

.label-xs {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* ── Button colour variants ─────────────────────────────────────────────────── */
.btn-blue {
  background: linear-gradient(180deg, #4aa3f5 0%, #1976d2 50%, #1565c0 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255,255,255,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(25,118,210,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-green {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255,255,255,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(34,197,94,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-danger {
  background: linear-gradient(180deg, #ff4444 0%, #dc2626 50%, #b91c1c 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255,255,255,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(220,38,38,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-danger.flex-1 { flex: 1; }

/* ── Misc repeated patterns ──────────────────────────────────────────────────── */
.field-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.text-accent-red   { color: var(--accent-red); }
.drop-option       { padding: 0.6rem 0.75rem; text-align: left; color: var(--text-muted); font-size: 0.75rem; }
.inline-badge      { background: var(--bg-card); padding: 0.25rem 0.5rem; border-radius: 4px; }
.flex-row-wrap     { display: flex; gap: 1rem; flex-wrap: wrap; }
.flex-row-center   { display: flex; gap: 1rem; align-items: center; }
.heading-lg        { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.heading-md        { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.subheading        { font-weight: 600; margin-bottom: 0.5rem; }
.text-xs-label     { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.mt-sm             { margin-top: 1rem; }
.mb-xs             { margin: 0 0 0.5rem; }
.w-200             { width: 200px; }
.font-sm           { font-size: 0.8rem; }

/* ── Render-file inline style replacements ──────────────────────────────────── */
.tbl-cell         { padding: 0.75rem; }
.tbl-cell-left    { text-align: left; padding: 0.75rem; }
.tbl-cell-right   { text-align: right; padding: 0.75rem; }
.tbl-cell-sm      { padding: 0.5rem; }
.tbl-cell-sm-left { padding: 0.5rem; text-align: left; }
.tbl-cell-sm-right{ padding: 0.5rem; text-align: right; }

.col-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}
.col-label-sm {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.input-narrow {
  width: 120px;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
}
.text-secondary-sm { color: var(--text-secondary); font-size: 0.875rem; }

/* Settings backup panel */
.backup-progress-wrap { padding: 1.5rem; text-align: center; }
.backup-progress-label { color: var(--text-muted); font-size: 0.85rem; }
.backup-latest-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-green-dim);
  color: var(--accent-green);
  margin-left: 0.5rem;
}

/* Import service panels */
.alert-red   { background: var(--accent-red-dim); border-left: 3px solid var(--accent-red); padding: 1rem; border-radius: 6px; }
.alert-green { background: var(--accent-green-dim); border-left: 3px solid var(--accent-green); padding: 1rem; border-radius: 6px; }
.text-error  { color: var(--accent-red); }
.text-error-dark { color: #7F1D1D; }
.text-success { color: var(--accent-green); }

/* Autocomplete item */
.autocomplete-item {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}
.autocomplete-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.desc-ac-active { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.flex-col { display: flex; flex-direction: column; }

/* ── High-frequency render-file patterns ────────────────────────────────────── */
.text-right      { text-align: right; }
.text-left       { text-align: left; }
.text-center-pad { text-align: center; padding: 3rem; color: var(--text-secondary); }
.tbl-cell-right  { text-align: right; padding: 0.6rem 0.75rem; color: var(--text-muted); font-size: 0.75rem; }
.tbl-header-cell { padding: 0.6rem 0.75rem; text-align: left; color: var(--text-muted); font-size: 0.75rem; }
.tbl-full-width  { width: 100%; border-collapse: collapse; }
.tbl-full-width-sm { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.text-muted-sm   { color: var(--text-secondary); font-size: 0.85rem; }
.text-muted-xs   { color: var(--text-secondary); font-size: 0.75rem; margin-top: 0.5rem; }
.text-muted-fade { font-size: 0.875rem; opacity: 0.8; }
.text-muted-tiny { font-size: 0.75rem; opacity: 0.7; }
.text-yellow     { color: var(--accent-yellow); }
.text-green      { color: var(--accent-green); }

.col-label-xs {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.col-label-green {
  font-size: 0.875rem;
  color: #064E3B;
  text-transform: uppercase;
  font-weight: 600;
}

.pad-md          { padding: 0.5rem 1rem; }
.pad-cell        { padding: 0.6rem 0.75rem; }
.pad-cell-sm     { padding: 0.5rem; }
.cursor-pointer  { cursor: pointer; }
.ws-nowrap       { white-space: nowrap; }
.mb-lg2          { margin-bottom: 1.5rem; }
.mb-xl           { margin-bottom: 2rem; }
.mt-md2          { margin-top: 1.5rem; }
.bg-secondary    { background: var(--bg-secondary); }

.dot-orange {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent-orange);
  border-radius: 50%;
}
.pill-small {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
}
.flex-gap-xs     { display: flex; align-items: center; gap: 0.35rem; }
.flex-gap-md-cur { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.flex-mb-lg      { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.grid-auto-fill  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.font-2xl        { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.font-xl         { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }  
.font-stat       { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }

.border-l-green  { border-left-color: var(--accent-green); }
.border-l-orange { border-left-color: var(--accent-orange); }
.border-l-purple { border-left-color: var(--accent-purple); }

.mono-right      { font-family: 'JetBrains Mono', monospace; text-align: right; }

.overflow-hidden { overflow: hidden; }
.w-full          { width: 100%; }
.h-100           { height: 100px; }
.mb-md2          { margin-bottom: 1.25rem; }
.mt-xl           { margin-top: 2rem; }
.mb-xl           { margin-bottom: 2rem; }
.text-center     { text-align: center; }
.card-secondary  { background: var(--bg-secondary); padding: 1rem; border-radius: 8px; }
.font-semibold   { font-weight: 600; }
