/* ============================================================
   Day Accounting — Shared component styles
   ============================================================ */

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
  text-decoration: none;
}
.btn:active { transform: translateY(0.5px) scale(0.99); }

.btn--sm { height: 34px; padding: 7px 14px; font-size: 13px; gap: 7px; }
.btn--md { height: 42px; padding: 10px 20px; font-size: 14px; gap: 8px; }
.btn--lg { height: 50px; padding: 13px 26px; font-size: 15px; gap: 10px; }

.btn--primary {
  background: var(--brand);
  color: var(--text-on-brand);
  border: 1.5px solid var(--brand);
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  text-decoration: none;
}

.btn--secondary {
  background: transparent;
  color: var(--brand-strong);
  border: 1.5px solid var(--brand);
}
.btn--secondary:hover {
  background: var(--brand-tint);
  border-color: var(--brand);
  text-decoration: none;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.badge--brand { background: var(--sage-100); color: var(--sage-700); }
.badge--brand .badge__dot { background: var(--sage-600); }

.badge--neutral { background: var(--bg-well); color: var(--text-body); }
.badge--neutral .badge__dot { background: var(--neutral-500); }

/* --- Avatar --- */
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sage-100);
  color: var(--sage-700);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.02em;
  overflow: hidden;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(12, 50, 71, 0.06);
}

/* --- Card --- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--framed {
  border: 1.5px solid var(--keyline);
  box-shadow: none;
}
.card--interactive {
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-standard);
}
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--sage-50);
  border: 1.5px solid var(--sage-100);
  margin-bottom: 18px;
  color: var(--brand);
}
.card__icon--sm { width: 44px; height: 44px; margin-bottom: 16px; }
.card__icon svg { width: 22px; height: 22px; }
.card__icon--sm svg { width: 20px; height: 20px; }

.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.card__body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}
.card__meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 14px 0 0;
}
.card__meta b { color: var(--text-body); }

/* --- Divider (with center label) --- */
.divider-label {
  display: flex;
  align-items: center;
  gap: 16px;
}
.divider-label__line { flex: 1; height: 1.5px; background: var(--keyline); }
.divider-label__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  white-space: nowrap;
}

/* --- Eyebrow --- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  line-height: 1.2;
  display: block;
}
.eyebrow--on-dark { color: var(--sage-300); }

/* --- StatCard --- */
.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-card__value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.stat-card__row { display: flex; align-items: center; gap: 8px; }
.stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-text);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-700);
}
.stat-card__delta svg { width: 12px; height: 12px; }
.stat-card__caption {
  font-family: var(--font-text);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--border-hairline);
}
.tabs__btn {
  position: relative;
  appearance: none;
  background: none;
  border: none;
  padding: 10px 14px 12px;
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-standard);
}
.tabs__btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1.5px;
  height: 2.5px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background var(--duration-fast) var(--ease-standard);
}
.tabs__btn[aria-selected="true"] {
  font-weight: 700;
  color: var(--brand-strong);
}
.tabs__btn[aria-selected="true"]::after { background: var(--keyline); }

/* --- Alert --- */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}
.alert[hidden] { display: none; }
.alert svg { flex: none; margin-top: 1px; width: 18px; height: 18px; }
.alert__body { display: flex; flex-direction: column; gap: 2px; }
.alert__title { font-family: var(--font-text); font-weight: 700; font-size: 14px; }
.alert__text { font-family: var(--font-text); font-size: 13.5px; line-height: 1.5; color: var(--text-body); }

.alert--info { background: var(--sage-50); }
.alert--info svg { stroke: var(--sage-600); }
.alert--info .alert__title { color: var(--sage-800); }

.alert--success { background: var(--green-100); }
.alert--success svg { stroke: var(--green-500); }
.alert--success .alert__title { color: var(--green-700); }

/* --- Form controls --- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 0.01em;
}
.field__label .req { color: var(--red-500); margin-left: 3px; }
.field__hint { font-family: var(--font-text); font-size: 12px; line-height: 1.4; color: var(--text-muted); }

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-text);
  color: var(--text-strong);
  background: var(--surface-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.input, .select { height: 42px; padding: 0 13px; font-size: 14px; }
.textarea { padding: 10px 14px; font-size: 15px; line-height: 1.5; resize: vertical; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: var(--ring-focus);
}

.select-wrap { position: relative; display: flex; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
}
.select-wrap svg {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 16px; height: 16px;
  stroke: var(--text-muted);
}
