/* ═══════════════════════════════════════════════════════════════════════════
   AI FOREX OS — ORTAQ DİZAYN QATI (app.css) · 14.09.2026
   ───────────────────────────────────────────────────────────────────────────
   Bu fayl BÜTÜN səhifələrdə birinci yüklənir: tokenlər + ortaq komponentlər.
   Səhifənin öz CSS-i (terminal.css və ya səhifədaxili <style>) SONRA gəlir,
   yəni mövcud görünüş üstün qalır — bu qat heç nəyi zorla dəyişmir.

   TOKEN QAYDASI: adlar vahidləşdirilib (--color-*, --space-*, --text-*),
   DƏYƏRLƏR isə panelin mövcud palitrasındandır. Yalnız kontrastdan keçməyən
   rəng dəyişdirilib: köhnə --text-dim #6c6454 (3,46:1) → #8d9388 (6,4:1 AA).
   Beləliklə «vahid dizayn sistemi» tələbi görünüşü dağıtmadan yerinə yetirilir.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;                    /* panel qəsdən yalnız tünd temadır */

  /* ── fon və səthlər ── */
  --color-bg: #070608;
  --color-bg-elevated: #0e0c09;
  --color-surface: #15120b;
  --color-surface-2: #14110b;
  --color-surface-3: #100e09;

  /* ── mətn (fon #070608 üzərində kontrast) ── */
  --color-text: #f6f2e8;              /* 18,1:1 */
  --color-text-soft: #d8d1c2;         /* 13,4:1 */
  --color-muted: #a89e88;             /*  7,6:1 */
  --color-muted-2: #8d9388;           /*  6,4:1 — köhnə #6c6454 (3,46:1) əvəzi */

  /* ── sərhədlər ── */
  --color-border: rgba(54, 224, 200, .12);
  --color-border-strong: rgba(54, 224, 200, .26);
  --color-border-neutral: rgba(255, 255, 255, .10);

  /* ── semantik rənglər ── */
  --color-accent: #36e0c8;            /* panelin əsas firuzəyi rəngi */
  --color-accent-dim: #178b7d;
  --color-success: #2fd08a;
  --color-danger: #f0524c;
  --color-warning: #facc15;
  --color-info: #5b9dff;

  /* ── tipoqrafiya ── */
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  --text-xs: 11px;      /* ən kiçik icazəli ölçü — yalnız etiket/nişan */
  --text-sm: 12px;      /* əsas UI mətninin minimumu */
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --line-tight: 1.2;
  --line-normal: 1.45;

  /* ── boşluq və künc ── */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 6px; --radius-md: 9px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-panel: 0 2px 20px rgba(0, 0, 0, .35);
}

/* ═══ BAZA ƏLÇATANLIQ ═══ */

/* Klaviatura ilə gəzən istifadəçi harada olduğunu görsün (WCAG 2.4.7). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Hərəkəti azaltmaq istəyən istifadəçi üçün animasiyalar dayandırılır. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ ORTAQ KOMPONENTLƏR ═══
   Adlar CEO sənədindəki kimidir. Mövcud klasslar (.card, .btn, .pill, .empty,
   .tbl-wrap) toxunulmayıb — bunlar onların YANINDA işləyir və səhifələr
   mərhələli keçid edir. */

/* ── cədvəl: üfüqi sürüşmə YALNIZ cədvəlin öz qabında olmalıdır ── */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th, .data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table th {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.data-table td { color: var(--color-text-soft); font-family: var(--font-mono); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(54, 224, 200, .03); }

/* ── vəziyyət nişanları ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}
.status-success { color: var(--color-success); background: rgba(47, 208, 138, .10); border-color: rgba(47, 208, 138, .28); }
.status-warning { color: var(--color-warning); background: rgba(250, 204, 21, .10); border-color: rgba(250, 204, 21, .28); }
.status-danger  { color: var(--color-danger);  background: rgba(240, 82, 76, .10);  border-color: rgba(240, 82, 76, .30); }
.status-muted   { color: var(--color-muted);   background: rgba(255, 255, 255, .04); border-color: var(--color-border-neutral); }

/* ── boş / yüklənir / xəta: üç vəziyyət eyni dildə danışır ── */
.empty-state, .loading-state, .error-state {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: var(--space-3);
  border: 1px dashed var(--color-border-neutral);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .02);
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-align: center;
}
.error-state { color: var(--color-danger); border-color: rgba(240, 82, 76, .3); }

/* ── rəqəm: yenilənəndə sətir tullanmasın (CLS) ── */
.metric-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  min-height: 22px;
  display: block;
}
.u-tabular { font-variant-numeric: tabular-nums; }
.u-nowrap { white-space: nowrap; }
.u-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── forma sahələri ── */
.form-field { display: grid; gap: var(--space-1); }
.form-label {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── düymələr: təhlükəli əməliyyat gözlə seçilməlidir ── */
.btn-primary { background: linear-gradient(160deg, var(--color-accent), var(--color-accent-dim)); border-color: transparent; color: #06121a; font-weight: 800; }
.btn-secondary { color: var(--color-accent); border-color: var(--color-border-strong); background: rgba(54, 224, 200, .06); }
.btn-danger { color: var(--color-danger); border-color: rgba(240, 82, 76, .45); background: rgba(240, 82, 76, .08); font-weight: 800; }
.btn-ghost { background: transparent; }

/* ═══ STANDART SINIQ NÖQTƏLƏRİ (480 / 768 / 1024 / 1280) ═══
   Qeyd: qabıq menyusunun mobil rejimə keçidi terminal.css-də 860px-dədir və
   QƏSDƏN dəyişdirilməyib — onu 768-ə çəkmək 768–860 aralığında naviqasiyanı
   dəyişərdi. Yeni şəbəkə klassları isə standart pillələrlə işləyir. */
.page-shell { width: min(100%, 1440px); margin: 0 auto; padding: var(--space-4); }
.grid-auto { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .page-shell { padding: var(--space-3); } .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 480px)  { .page-shell { padding: var(--space-2); } }
