/* ==========================================================================
   KiyakEmlak SaaS — Tasarım Sistemi
   app.css : tokenlar, reset, tipografi, yardımcı sınıflar
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tasarım tokenları
   -------------------------------------------------------------------------- */
:root {
  /* Marka renkleri */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* Aksan (altın) */
  --accent-50:  #fffbeb;
  --accent-100: #fef3c7;
  --accent-300: #fcd34d;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;

  /* Durum renkleri */
  --success-50: #ecfdf5;  --success-100:#d1fae5; --success-500: #10b981; --success-600: #059669; --success-700:#047857;
  --danger-50:  #fef2f2;  --danger-100: #fee2e2; --danger-500:  #ef4444; --danger-600:  #dc2626; --danger-700: #b91c1c;
  --warning-50: #fffbeb;  --warning-100:#fef3c7; --warning-500: #f59e0b; --warning-600: #d97706; --warning-700:#b45309;
  --info-50:    #eff6ff;  --info-100:   #dbeafe; --info-500:    #3b82f6; --info-600:    #2563eb; --info-700:   #1d4ed8;
  --purple-50:  #faf5ff;  --purple-100: #f3e8ff; --purple-500:  #a855f7; --purple-600:  #9333ea;
  --teal-50:    #f0fdfa;  --teal-100:   #ccfbf1; --teal-500:    #14b8a6; --teal-600:    #0d9488;
  --pink-50:    #fdf2f8;  --pink-100:   #fce7f3; --pink-500:    #ec4899; --pink-600:    #db2777;

  /* Nötr ölçek */
  --gray-25:  #fcfcfd;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* Anlamsal (açık tema) */
  --bg-body:      #f4f6fb;
  --bg-surface:   #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-surface-3: #f1f5f9;
  --bg-inset:     #f8fafc;
  --bg-sidebar:   #0f172a;
  --bg-sidebar-hover: rgba(255,255,255,.06);
  --bg-sidebar-active: rgba(99,102,241,.16);
  --bg-overlay:   rgba(15,23,42,.55);

  --text-strong:  #0f172a;
  --text-body:    #334155;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;
  --text-invert:  #ffffff;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;

  --border:        #e2e8f0;
  --border-strong: #cbd5e1;
  --border-subtle: #eef2f6;
  --border-sidebar: rgba(255,255,255,.08);

  --ring: rgba(79,70,229,.35);

  /* Yarıçap */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 24px;
  --r-full: 999px;

  /* Gölge */
  --sh-xs: 0 1px 2px rgba(15,23,42,.05);
  --sh-sm: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  --sh-md: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --sh-lg: 0 12px 28px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.04);
  --sh-xl: 0 24px 48px rgba(15,23,42,.14), 0 8px 16px rgba(15,23,42,.06);
  --sh-brand: 0 6px 18px rgba(79,70,229,.28);

  /* Ölçüler */
  --sidebar-w: 268px;
  --sidebar-w-mini: 78px;
  --topbar-h: 64px;
  --page-pad: 24px;
  --content-max: 1600px;

  /* Tipografi */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Hareket */
  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 200ms cubic-bezier(.4,0,.2,1);
  --t-slow: 320ms cubic-bezier(.4,0,.2,1);

  /* Katmanlar */
  --z-sticky: 100;
  --z-sidebar: 300;
  --z-topbar: 200;
  --z-dropdown: 500;
  --z-overlay: 700;
  --z-modal: 800;
  --z-toast: 900;
  --z-tooltip: 1000;

  color-scheme: light;
}

/* Koyu tema */
html[data-theme="dark"] {
  --bg-body:      #0b1120;
  --bg-surface:   #111a2e;
  --bg-surface-2: #16203a;
  --bg-surface-3: #1c2743;
  --bg-inset:     #0d1526;
  --bg-sidebar:   #080d18;
  --bg-sidebar-hover: rgba(255,255,255,.05);
  --bg-sidebar-active: rgba(99,102,241,.22);
  --bg-overlay:   rgba(2,6,23,.72);

  --text-strong:  #f1f5f9;
  --text-body:    #cbd5e1;
  --text-muted:   #94a3b8;
  --text-subtle:  #64748b;
  --text-sidebar: #8b98ad;

  --border:        #1e293b;
  --border-strong: #2b3a52;
  --border-subtle: #16203a;
  --border-sidebar: rgba(255,255,255,.06);

  --sh-xs: 0 1px 2px rgba(0,0,0,.4);
  --sh-sm: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --sh-md: 0 4px 12px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3);
  --sh-lg: 0 12px 28px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.3);
  --sh-xl: 0 24px 48px rgba(0,0,0,.6), 0 8px 16px rgba(0,0,0,.35);

  --gray-50:  #16203a;
  --gray-100: #1c2743;
  --gray-200: #24314f;

  color-scheme: dark;
}

/* Marka rengi varyantları (Ayarlar > Görünüm) */
html[data-accent="emerald"] { --brand-500:#10b981; --brand-600:#059669; --brand-700:#047857; --brand-50:#ecfdf5; --brand-100:#d1fae5; --brand-200:#a7f3d0; --ring:rgba(5,150,105,.35); --sh-brand:0 6px 18px rgba(5,150,105,.28); }
html[data-accent="blue"]    { --brand-500:#3b82f6; --brand-600:#2563eb; --brand-700:#1d4ed8; --brand-50:#eff6ff; --brand-100:#dbeafe; --brand-200:#bfdbfe; --ring:rgba(37,99,235,.35);  --sh-brand:0 6px 18px rgba(37,99,235,.28); }
html[data-accent="amber"]   { --brand-500:#f59e0b; --brand-600:#d97706; --brand-700:#b45309; --brand-50:#fffbeb; --brand-100:#fef3c7; --brand-200:#fde68a; --ring:rgba(217,119,6,.35);  --sh-brand:0 6px 18px rgba(217,119,6,.28); }
html[data-accent="rose"]    { --brand-500:#f43f5e; --brand-600:#e11d48; --brand-700:#be123c; --brand-50:#fff1f2; --brand-100:#ffe4e6; --brand-200:#fecdd3; --ring:rgba(225,29,72,.35);  --sh-brand:0 6px 18px rgba(225,29,72,.28); }
html[data-accent="teal"]    { --brand-500:#14b8a6; --brand-600:#0d9488; --brand-700:#0f766e; --brand-50:#f0fdfa; --brand-100:#ccfbf1; --brand-200:#99f6e4; --ring:rgba(13,148,136,.35); --sh-brand:0 6px 18px rgba(13,148,136,.28); }

/* Kompakt yoğunluk */
html[data-density="compact"] { --page-pad: 16px; --topbar-h: 56px; }

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  min-height: 100vh;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
h1,h2,h3,h4,h5,h6 { color: var(--text-strong); font-weight: 650; line-height: 1.3; letter-spacing: -.011em; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
h4 { font-size: 15px; } h5 { font-size: 14px; } h6 { font-size: 13px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--brand-200); color: var(--brand-900); }

/* İnce kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   3. Tipografi yardımcıları
   -------------------------------------------------------------------------- */
.t-display { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--text-strong); }
.t-h1 { font-size: 26px; font-weight: 660; letter-spacing: -.015em; color: var(--text-strong); }
.t-h2 { font-size: 21px; font-weight: 650; letter-spacing: -.012em; color: var(--text-strong); }
.t-h3 { font-size: 17px; font-weight: 640; color: var(--text-strong); }
.t-h4 { font-size: 15px; font-weight: 620; color: var(--text-strong); }
.t-body { font-size: 14px; color: var(--text-body); }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-2xs { font-size: 11px; }
.t-mono { font-family: var(--font-mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.t-num { font-variant-numeric: tabular-nums; }
.t-muted { color: var(--text-muted); }
.t-subtle { color: var(--text-subtle); }
.t-strong { color: var(--text-strong); }
.t-brand { color: var(--brand-600); }
.t-success { color: var(--success-600); }
.t-danger { color: var(--danger-600); }
.t-warning { color: var(--warning-600); }
.t-info { color: var(--info-600); }
.t-w400 { font-weight: 400; } .t-w500 { font-weight: 500; }
.t-w600 { font-weight: 600; } .t-w700 { font-weight: 700; }
.t-upper { text-transform: uppercase; letter-spacing: .06em; }
.t-center { text-align: center; } .t-right { text-align: right; } .t-left { text-align: left; }
.t-nowrap { white-space: nowrap; }
.t-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-clamp-1, .t-clamp-2, .t-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.t-clamp-1 { -webkit-line-clamp: 1; } .t-clamp-2 { -webkit-line-clamp: 2; } .t-clamp-3 { -webkit-line-clamp: 3; }
.t-label { font-size: 11px; font-weight: 620; text-transform: uppercase; letter-spacing: .07em; color: var(--text-subtle); }
.t-through { text-decoration: line-through; }

/* --------------------------------------------------------------------------
   4. Düzen yardımcıları
   -------------------------------------------------------------------------- */
.flex { display: flex; } .iflex { display: inline-flex; }
.grid { display: grid; } .block { display: block; } .inline { display: inline; }
.hidden { display: none !important; }
.col { flex-direction: column; } .row { flex-direction: row; }
.wrap { flex-wrap: wrap; } .nowrap-f { flex-wrap: nowrap; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.items-end { align-items: flex-end; } .items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; } .justify-start { justify-content: flex-start; }
.justify-around { justify-content: space-around; }
.self-center { align-self: center; } .self-start { align-self: flex-start; } .self-end { align-self: flex-end; }
.flex-1 { flex: 1 1 0%; min-width: 0; } .flex-auto { flex: 1 1 auto; min-width: 0; }
.flex-none { flex: none; } .grow { flex-grow: 1; } .shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; } .w-full { width: 100%; } .h-full { height: 100%; }
.relative { position: relative; } .absolute { position: absolute; }
.fixed { position: fixed; } .sticky { position: sticky; }
.inset-0 { inset: 0; }
.overflow-hidden { overflow: hidden; } .overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; } .overflow-y-auto { overflow-y: auto; }
.pointer-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; } .cursor-grab { cursor: grab; }

.gap-0 { gap: 0; }   .gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.gap-10 { gap: 40px; }

.mt-0{margin-top:0}   .mt-1{margin-top:4px}   .mt-2{margin-top:8px}   .mt-3{margin-top:12px}
.mt-4{margin-top:16px} .mt-5{margin-top:20px} .mt-6{margin-top:24px}  .mt-8{margin-top:32px}
.mb-0{margin-bottom:0} .mb-1{margin-bottom:4px} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px}
.mb-4{margin-bottom:16px} .mb-5{margin-bottom:20px} .mb-6{margin-bottom:24px} .mb-8{margin-bottom:32px}
.ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; } .mx-auto { margin-inline: auto; }
.p-0{padding:0} .p-2{padding:8px} .p-3{padding:12px} .p-4{padding:16px} .p-5{padding:20px} .p-6{padding:24px}
.px-4 { padding-inline: 16px; } .py-2 { padding-block: 8px; } .py-3 { padding-block: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); }
.grid-auto-220 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
.grid-auto-260 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); }
.grid-auto-300 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); }
.grid-auto-340 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }

.radius-sm { border-radius: var(--r-sm); } .radius-md { border-radius: var(--r-md); }
.radius-lg { border-radius: var(--r-lg); } .radius-full { border-radius: var(--r-full); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.bg-surface { background: var(--bg-surface); }
.bg-surface-2 { background: var(--bg-surface-2); }
.bg-inset { background: var(--bg-inset); }
.shadow-sm { box-shadow: var(--sh-sm); } .shadow-md { box-shadow: var(--sh-md); }
.shadow-lg { box-shadow: var(--sh-lg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Duyarlı görünürlük */
@media (max-width: 1279px) { .hide-lg { display: none !important; } }
@media (max-width: 1023px) { .hide-md { display: none !important; } .grid-5,.grid-6 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 767px)  { .hide-sm { display: none !important; } .grid-2,.grid-3,.grid-4,.grid-5,.grid-6 { grid-template-columns: 1fr; } }
@media (min-width: 768px)  { .only-sm { display: none !important; } }
@media (min-width: 1024px) { .only-md { display: none !important; } }

/* --------------------------------------------------------------------------
   5. Animasyonlar
   -------------------------------------------------------------------------- */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseSoft { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes ping { 75%,100% { transform: scale(2); opacity: 0; } }
@keyframes progressBar { from { width: 0; } }

.anim-fade    { animation: fadeIn var(--t-base) both; }
.anim-up      { animation: fadeUp var(--t-slow) both; }
.anim-scale   { animation: scaleIn var(--t-base) both; }
.anim-stagger > * { animation: fadeUp var(--t-slow) both; }
.anim-stagger > *:nth-child(1) { animation-delay: 20ms; }
.anim-stagger > *:nth-child(2) { animation-delay: 55ms; }
.anim-stagger > *:nth-child(3) { animation-delay: 90ms; }
.anim-stagger > *:nth-child(4) { animation-delay: 125ms; }
.anim-stagger > *:nth-child(5) { animation-delay: 160ms; }
.anim-stagger > *:nth-child(6) { animation-delay: 195ms; }
.anim-stagger > *:nth-child(7) { animation-delay: 230ms; }
.anim-stagger > *:nth-child(8) { animation-delay: 265ms; }

/* İskelet yükleme */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg-surface-3); border-radius: var(--r-sm);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 1.4s infinite;
}
html[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }

/* Yazdırma */
@media print {
  .app-sidebar, .app-topbar, .page-actions, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
