/* ─────────────────────────────────────────────────────────────
   Template preview qatı — Agent.Designer/templates
   Yalnız tokens/tokens.css-dəki 38 semantik token üzərində qurulub.
   Sərt kodlanmış rəng YOXDUR — skin dəyişəndə hər şey dəyişir.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-display); line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight); margin: 0; font-weight: var(--weight-semibold); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
img { max-width: 100%; display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: var(--size-xs); }
.nowrap { white-space: nowrap; }

/* ── Skin çubuğu (yalnız preview üçün) ───────────────────── */
.skinbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: var(--size-xs);
}
.skinbar .grow { flex: 1; }
.skinbar label { color: var(--text-muted); }
.skinbar select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2);
}
.skinbar a { color: var(--text-muted); }

/* ── Düymələr ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: var(--size-sm); font-weight: var(--weight-medium); line-height: 1.2;
  white-space: nowrap; cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out-quart),
              border-color var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart);
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { background: var(--primary-active); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--hover-veil); }
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--hover-veil); color: var(--text); }
.btn--danger { background: var(--danger); color: var(--on-danger); }
.btn--sm { padding: var(--space-1) var(--space-3); font-size: var(--size-xs); }
.btn--lg { padding: var(--space-3) var(--space-6); font-size: var(--size-md); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { background: var(--hover-veil); color: var(--text); }

/* ── Nişanlar / status ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.125rem var(--space-2); border-radius: var(--radius-full);
  font-size: var(--size-2xs); font-weight: var(--weight-medium); white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge--success { background: var(--success-subtle); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-subtle); color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-subtle);  color: var(--danger);  border-color: transparent; }
.badge--info    { background: var(--info-subtle);    color: var(--info);    border-color: transparent; }
.badge--primary { background: var(--primary-subtle); color: var(--primary); border-color: transparent; }
.badge .dot { width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }

/* ── Səthlər ─────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.panel__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: var(--size-sm); font-weight: var(--weight-semibold);
}
.panel__body { padding: var(--space-4); }

/* ── Formalar ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field > label { font-size: var(--size-xs); font-weight: var(--weight-medium); color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; padding: var(--space-2) var(--space-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-size: var(--size-sm);
  transition: border-color var(--duration-fast) var(--ease-out-quart);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field__error { font-size: var(--size-2xs); color: var(--danger); }
.field__hint  { font-size: var(--size-2xs); color: var(--text-subtle); }
.textarea { min-height: 6rem; resize: vertical; }
.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--size-sm); }
.checkbox input { accent-color: var(--primary); width: 1rem; height: 1rem; }

/* ── Cədvəl ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--size-sm); }
table.data thead th {
  text-align: left; padding: var(--space-3) var(--space-4);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: var(--size-2xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted);
  white-space: nowrap;
}
table.data td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--hover-veil); }
table.data tbody tr[aria-selected="true"] { background: var(--selected); }
table.data td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Vəziyyətlər ─────────────────────────────────────────── */
.state {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-12) var(--space-6); text-align: center;
}
.state__icon {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-subtle); font-size: 1.25rem;
}
.state__title { font-size: var(--size-md); font-weight: var(--weight-semibold); }
.state__desc { font-size: var(--size-sm); color: var(--text-muted); max-width: 34ch; }
.state--error .state__icon { background: var(--danger-subtle); color: var(--danger); }
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); animation: pulse 1.4s var(--ease-in-out) infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ── Tətbiq qabığı ───────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }
.shell__side {
  width: 15rem; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.shell__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 3.5rem; flex-shrink: 0; display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); background: var(--surface); border-bottom: 1px solid var(--border);
}
.cmdbar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-2) var(--space-4); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.content { flex: 1; overflow: auto; padding: var(--space-5); }
.brand { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4); border-bottom: 1px solid var(--border); }
.brand__mark { width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: var(--weight-bold); font-size: var(--size-xs); }
.brand__name { font-weight: var(--weight-semibold); font-size: var(--size-sm); }
.nav { flex: 1; overflow: auto; padding: var(--space-2); }
.nav__group { font-size: var(--size-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-subtle); padding: var(--space-3) var(--space-3) var(--space-1); }
.nav__item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--size-sm); color: var(--text-muted);
  background: transparent; border: 0; border-left: 2px solid transparent; cursor: pointer; text-align: left;
}
.nav__item:hover { background: var(--hover-veil); color: var(--text); text-decoration: none; }
.nav__item[aria-current="page"] { background: var(--primary-subtle); color: var(--primary); border-left-color: var(--primary); font-weight: var(--weight-medium); }
.nav__item .ico { width: 1rem; text-align: center; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--border); }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); display: grid; place-items: center; font-size: var(--size-2xs); font-weight: var(--weight-semibold); flex-shrink: 0; }

/* ── Səhifə başlığı ──────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head h1 { font-size: var(--size-xl); }
.page-head .lede { font-size: var(--size-sm); color: var(--text-muted); margin-top: var(--space-1); }
.crumbs { display: flex; gap: var(--space-2); font-size: var(--size-xs); color: var(--text-subtle); margin-bottom: var(--space-2); }

/* ── Şəbəkələr ───────────────────────────────────────────── */
.grid { display: grid; gap: var(--space-4); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--space-5); }
.row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* ── Stat kartı ──────────────────────────────────────────── */
.stat__label { font-size: var(--size-xs); color: var(--text-muted); }
.stat__value { font-size: var(--size-2xl); font-weight: var(--weight-semibold); font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: var(--space-1); letter-spacing: var(--tracking-tight); }
.stat__delta { font-size: var(--size-2xs); margin-top: var(--space-1); }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }

/* ── Filtr tabları ───────────────────────────────────────── */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tabs button {
  padding: var(--space-2) var(--space-3); background: transparent; border: 0;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  font-size: var(--size-sm); cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: var(--weight-medium); }

/* ── Modal ───────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; background: var(--overlay); opacity: .45; z-index: var(--z-modal-backdrop); }
.modal {
  position: fixed; z-index: var(--z-modal); inset: 0; display: grid; place-items: center; padding: var(--space-4);
  pointer-events: none;
}
.modal__box {
  pointer-events: auto; width: min(34rem, 100%); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: var(--size-md); flex: 1; }
.modal__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-top: 1px solid var(--border); }

/* ── Lövhə (kanban) ──────────────────────────────────────── */
.board { display: flex; gap: var(--space-4); align-items: flex-start; overflow-x: auto; padding-bottom: var(--space-4); }
.column { width: 18rem; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.column__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); font-size: var(--size-sm); font-weight: var(--weight-semibold); border-bottom: 1px solid var(--border); }
.column__count { margin-left: auto; font-size: var(--size-2xs); color: var(--text-subtle); font-family: var(--font-mono); }
.column__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); min-height: 4rem; }
.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); cursor: grab; }
.task:hover { border-color: var(--border-strong); }
.task__title { font-size: var(--size-sm); font-weight: var(--weight-medium); }
.task__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

/* ── Marketinq (landing) ─────────────────────────────────── */
.site { max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--space-5); }
.site-head { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--border); }
.site-head .site { display: flex; align-items: center; gap: var(--space-5); height: 3.75rem; }
.site-nav { display: flex; gap: var(--space-4); font-size: var(--size-sm); }
.site-nav a { color: var(--text-muted); }
.hero { padding: var(--space-20) 0 var(--space-16); background: var(--bg); border-bottom: 1px solid var(--border); }
.hero__eyebrow { display: inline-flex; margin-bottom: var(--space-4); }
.hero h1 { font-size: var(--size-4xl); max-width: 18ch; text-wrap: balance; }
.hero p.lede { font-size: var(--size-md); color: var(--text-muted); max-width: 56ch; margin-top: var(--space-4); text-wrap: pretty; }
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.section { padding: var(--space-16) 0; }
.section--alt { background: var(--bg); border-block: 1px solid var(--border); }
.section__head { max-width: 52ch; margin-bottom: var(--space-8); }
.section__head h2 { font-size: var(--size-2xl); }
.section__head p { color: var(--text-muted); margin-top: var(--space-2); }
.feature__icon { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-md); background: var(--primary-subtle); color: var(--primary); display: grid; place-items: center; margin-bottom: var(--space-3); }
.price { display: flex; align-items: baseline; gap: var(--space-1); margin: var(--space-3) 0; }
.price__num { font-size: var(--size-3xl); font-weight: var(--weight-bold); font-family: var(--font-mono); letter-spacing: var(--tracking-tight); }
.price__per { color: var(--text-muted); font-size: var(--size-sm); }
.plan--featured { border-color: var(--primary); }
.checklist { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--size-sm); color: var(--text-muted); }
.checklist li::before { content: "✓"; color: var(--success); margin-right: var(--space-2); font-weight: var(--weight-bold); }
.site-foot { background: var(--surface-2); border-top: 1px solid var(--border); padding: var(--space-10) 0; font-size: var(--size-sm); color: var(--text-muted); }

/* ── Auth ────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6); }
.auth__box { width: min(24rem, 100%); }
.auth__head { text-align: center; margin-bottom: var(--space-6); }
.auth__head h1 { font-size: var(--size-xl); }
.auth__head p { color: var(--text-muted); font-size: var(--size-sm); margin-top: var(--space-1); }
.divider { display: flex; align-items: center; gap: var(--space-3); color: var(--text-subtle); font-size: var(--size-2xs); margin: var(--space-4) 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Kiçik ekran ─────────────────────────────────────────── */
@media (max-width: 64rem) {
  .shell__side { position: fixed; inset: 0 auto 0 0; z-index: var(--z-dropdown); transform: translateX(-100%); }
  .shell__side[data-open="true"] { transform: none; }
  .content { padding: var(--space-4); }
  .hero { padding: var(--space-12) 0 var(--space-10); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
