/* ============================================================
   Onlipr — Demo component styles
   BRAND.md §5 recipe'lerinin uygulaması.
   Token'lar shared/tokens-base.css + brands/onlipr/tokens.css.
   ============================================================ */

/* ───── Type utilities ───── */
.page-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.66rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}
.page-title {
  font-family: var(--f-display);
  font-size: 1.85rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink);
}
.page-sub {
  font-family: var(--f-body);
  font-size: 0.92rem; color: var(--text-dim);
  margin-top: 0.4rem;
}
.section-title {
  font-family: var(--f-display);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--f-display);
  font-size: 0.875rem; font-weight: 700;
  letter-spacing: -0.005em; line-height: 1.3;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow 0.16s var(--ease),
              filter 0.16s, background var(--dur-fast), border-color var(--dur-fast);
  white-space: nowrap;
  border: none;
}
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--y);
  color: var(--y-ink);
  box-shadow: var(--shadow-sm), inset 0 -1px 0 var(--y-deep);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow), inset 0 -1px 0 var(--y-deep);
  filter: brightness(1.03);
}

.btn--dark {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--dark:hover { background: var(--ink-lit); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-lit);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover {
  background: var(--hover);
  border-color: var(--border-deep);
}

.btn--danger {
  background: var(--err);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--danger:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn--sm { padding: 0.38rem 0.65rem; font-size: 0.82rem; }
.btn--icon { padding: 0.45rem; }

/* ───── Form ───── */
.form-row { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-label {
  font-family: var(--f-display);
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--f-body);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 213, 11, 0.35);
}
.form-help { font-size: 0.75rem; color: var(--text-dim); }
.form-error { font-size: 0.75rem; color: var(--err); }

/* ───── KPI card ───── */
.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
  animation: rise 0.45s var(--ease) both;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi__label {
  font-family: var(--f-mono);
  font-size: 0.66rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 0.35rem;
}
.kpi__value {
  font-family: var(--f-display);
  font-size: 1.7rem; font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1.05;
}
.kpi__sub {
  font-family: var(--f-mono);
  font-size: 0.74rem; color: var(--text-dim);
}
.kpi__sub--up   { color: var(--ok); }
.kpi__sub--down { color: var(--err); }

/* Focal: üst 3px sarı çubuk */
.kpi--focal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--y);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Staggered entry */
.kpi:nth-child(1) { animation-delay: 0.03s; }
.kpi:nth-child(2) { animation-delay: 0.06s; }
.kpi:nth-child(3) { animation-delay: 0.09s; }
.kpi:nth-child(4) { animation-delay: 0.12s; }
.kpi:nth-child(5) { animation-delay: 0.15s; }
.kpi:nth-child(6) { animation-delay: 0.18s; }

/* ───── Badge ───── */
.bdg {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-family: var(--f-mono);
  font-size: 0.68rem; font-weight: 400; letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.bdg::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.bdg--ok    { color: var(--ok);   background: var(--ok-soft);   border-color: color-mix(in oklab, var(--ok) 28%, transparent); }
.bdg--warn  { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 28%, transparent); }
.bdg--err   { color: var(--err);  background: var(--err-soft);  border-color: color-mix(in oklab, var(--err) 28%, transparent); }
.bdg--info  { color: var(--info); background: var(--info-soft); border-color: color-mix(in oklab, var(--info) 28%, transparent); }
.bdg--skip  { color: var(--skip); background: var(--surface-2); border-color: var(--border-lit); }
.bdg--brand { color: var(--y-ink); background: var(--y-soft); border-color: color-mix(in oklab, var(--y) 50%, transparent); }
.bdg--brand::before { background: var(--y-ink); }

/* ───── Card (generic) ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
}
.card__title {
  font-family: var(--f-display);
  font-size: 0.95rem; font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.card__sub {
  font-size: 0.82rem; color: var(--text-dim);
  margin-bottom: 0.9rem;
}

/* ───── Table ───── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-card__title {
  font-family: var(--f-display);
  font-size: 0.95rem; font-weight: 700;
  color: var(--ink);
}
.table-card__toolbar {
  display: flex; align-items: center; gap: 0.5rem;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table thead th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-family: var(--f-mono);
  font-weight: 400; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 0.7rem 1rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .td-strong { color: var(--ink); font-weight: 700; }
.table .td-num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
}
.table .td-meta {
  font-size: 0.78rem; color: var(--text-faint);
  margin-top: 0.15rem;
}

/* ───── Toast ───── */
.toast {
  display: inline-block;
  min-width: 240px; max-width: 380px;
  padding: 0.7rem 0.95rem 0.7rem 1.6rem;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  position: relative;
  animation: rise 0.22s var(--ease) both;
}
.toast::before {
  content: ''; position: absolute; left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--y);
}
.toast--success::before { background: var(--ok); }
.toast--err::before     { background: var(--err); }
.toast--info::before    { background: var(--info); }

/* ───── Sidebar nav ───── */
.nav {
  position: relative;
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.92rem; font-weight: 400;
  transition: color var(--dur-fast), background var(--dur-fast);
  cursor: pointer;
}
.nav svg, .nav .nav-ico {
  width: 17px; height: 17px;
  color: var(--text-faint); flex-shrink: 0;
  transition: color var(--dur-fast);
}
.nav:hover { color: var(--ink); background: var(--surface-2); }
.nav:hover svg, .nav:hover .nav-ico { color: var(--text-dim); }
.nav--on { color: var(--ink); background: var(--surface-2); font-weight: 700; }
.nav--on svg, .nav--on .nav-ico { color: var(--ink); }
.nav--on::before {
  content: '';
  position: absolute; left: -0.85rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--y);
  border-radius: 0 2px 2px 0;
}

/* ───── Modal ───── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,20,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; animation: fade 0.16s var(--ease) both;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px;
  padding: 1.4rem;
  animation: rise 0.18s var(--ease) both;
}
.modal__title {
  font-family: var(--f-display);
  font-size: 1.1rem; font-weight: 700;
  color: var(--ink); margin-bottom: 0.4rem;
}
.modal__body { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1.2rem; }
.modal__footer {
  display: flex; gap: 0.5rem; justify-content: flex-end;
}

/* ───── Public share top bar ───── */
.public-share-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 1.6rem;
  position: relative;
}
.public-share-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--y) 0%, var(--y-deep) 65%, var(--ink) 100%);
}

/* ───── Demo layout (sadece demo HTML için) ───── */
.demo-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2.25rem 4rem;
}
.demo-header { margin-bottom: 2.5rem; animation: rise 0.45s var(--ease) both; }
.demo-section { margin-bottom: 3rem; animation: rise 0.45s var(--ease) both; }
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.demo-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
.demo-stack { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.demo-swatch {
  width: 100%; height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.45rem;
}
.demo-swatch-label {
  font-family: var(--f-mono); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim);
}
.demo-swatch-hex {
  font-family: var(--f-mono); font-size: 0.7rem;
  color: var(--text-faint);
}

/* ───── Dashboard shell ───── */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.sidebar__brand { padding: 0 0.25rem 0.25rem; }
.sidebar__group { display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar__group-title {
  font-family: var(--f-mono); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint);
  padding: 0 0.7rem 0.5rem;
}
.main { padding: 2rem 2.25rem 3rem; }
.main-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1rem;
}

/* ───── Chart (basit SVG line) ───── */
.chart-card { padding: 1.1rem; }
.chart-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.85rem;
}
.chart-card__title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.chart-card__meta { font-family: var(--f-mono); font-size: 0.74rem; color: var(--text-faint); }
.chart-svg {
  width: 100%; height: 200px;
  display: block;
}
.chart-grid line { stroke: var(--border); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.chart-area { fill: rgba(255, 213, 11, 0.18); }
.chart-point { fill: var(--y); stroke: var(--ink); stroke-width: 1; }
.chart-axis text {
  font-family: var(--f-mono); font-size: 9px; fill: var(--text-faint);
}

/* ───── Responsive ───── */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 1.25rem 1rem 2rem; }
  .split-grid { grid-template-columns: 1fr; }
  .demo-page { padding: 1.25rem 1rem 2rem; }
}
