/* ============================================================
   OnyİK Design System — Core Tokens
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* === Brand === */
  --onysoft-navy: #1E3A5F;

  /* === Indigo (primary action) === */
  --indigo-50:  #EEF2FF;
  --indigo-100: #E0E7FF;
  --indigo-200: #C7D2FE;
  --indigo-300: #A5B4FC;
  --indigo-400: #818CF8;
  --indigo-500: #6366F1;
  --indigo-600: #4F46E5;
  --indigo-700: #4338CA;
  --indigo-800: #3730A3;
  --indigo-900: #312E81;

  /* === Semantic === */
  --success-500: #10B981;
  --success-bg:  #D1FAE5;
  --success-fg:  #065F46;

  --warning-500: #F59E0B;
  --warning-bg:  #FEF3C7;
  --warning-fg:  #92400E;

  --danger-500: #EF4444;
  --danger-bg:  #FEE2E2;
  --danger-fg:  #991B1B;

  --info-500: #6366F1;

  /* === Role accents === */
  --role-superadmin: #8B5CF6;
  --role-bayi: #1E3A5F;
  --role-hr: #14B8A6;
  --role-personel: #71717A;

  /* === Light surfaces (default) === */
  --bg-page:     #FAFAFA;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F4F4F5;
  --border:      rgba(10, 10, 15, 0.08);
  --border-emph: rgba(10, 10, 15, 0.12);
  --text-primary:   #0A0A0F;
  --text-secondary: rgba(10, 10, 15, 0.65);
  --text-muted:     rgba(10, 10, 15, 0.45);

  /* === Shadows === */
  --shadow-soft: 0 1px 2px rgba(10,10,15,0.04), 0 1px 3px rgba(10,10,15,0.06);
  --shadow-medium: 0 4px 12px rgba(10,10,15,0.08), 0 2px 4px rgba(10,10,15,0.04);
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.25);

  /* === Radii === */
  --r-tight: 4px;
  --r-std:   8px;
  --r-comf:  12px;
  --r-roomy: 16px;
  --r-pill:  999px;

  /* === Type families === */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-ui:      'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg-page:     #0A0A0F;
  --bg-card:     #15151B;
  --bg-subtle:   #1F1F28;
  --border:      rgba(255, 255, 255, 0.10);
  --border-emph: rgba(255, 255, 255, 0.14);
  --text-primary:   #FAFAFA;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted:     rgba(255, 255, 255, 0.45);

  --shadow-soft: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-medium: 0 4px 12px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3);
}

/* === Responsive design tokens (referans — @media query'lerde sabit kullanılır) ===
   --bp-sm:  360px   small phone
   --bp-md:  768px   tablet portrait
   --bp-lg: 1024px   small desktop
   --bp-xl: 1440px   large desktop
   touch-min: 44px (interaktif min boyut, iOS HIG/Material)
*/
:root {
  --touch-min: 44px;
  --gap-mobile: 12px;
  --gap-tablet: 16px;
  --gap-desktop: 24px;
}

/* === Base reset === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  /* Mobile default 16px — iOS Safari input focus zoom'u önler.
     Tablet+'da daha kompakt 14px'e dönülür. */
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 768px) {
  body { font-size: 14px; }
}

/* === Mobile-first table-to-card pattern ===
   Tabloların mobile'da kart formuna dönüşmesi için kullanılır.
   View'larda hem <table class="tbl"> hem ardından <div class="rc-only-mobile">
   ile kart listesi olur — CSS hangi viewport'ta hangisini gösterir.
*/
.row-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row-card:last-child { margin-bottom: 0; }
.rc-cell {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}
.rc-key {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 90px;
}
.rc-val {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}
.rc-only-mobile { display: block; }
@media (min-width: 768px) {
  .rc-only-mobile { display: none; }
}

/* === Touch target enforcement === */
.touch, button.touch, a.touch {
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === Type utilities === */
.t-display-1 { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; }
.t-display-2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.3; }
.t-h1 { font-family: var(--font-ui); font-weight: 600; font-size: 20px; line-height: 1.4; }
.t-h2 { font-family: var(--font-ui); font-weight: 600; font-size: 16px; line-height: 1.4; }
.t-h3 { font-family: var(--font-ui); font-weight: 500; font-size: 14px; line-height: 1.4; }
.t-body-lg { font-family: var(--font-ui); font-weight: 400; font-size: 15px; line-height: 1.6; }
.t-body { font-family: var(--font-ui); font-weight: 400; font-size: 14px; line-height: 1.5; }
.t-small { font-family: var(--font-ui); font-weight: 400; font-size: 13px; line-height: 1.5; }
.t-tiny { font-family: var(--font-ui); font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; }
.t-mono { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* === Shared chrome === */
.ds-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.ds-nav {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.ds-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.ds-nav-brand img { width: 36px; height: 36px; object-fit: contain; }
.ds-nav-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.ds-nav-brand .sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px;}

.ds-nav-section { font-family: var(--font-ui); font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 16px 8px 8px; }

.ds-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.ds-nav a:hover { background: var(--bg-subtle); color: var(--text-primary); }
.ds-nav a.active { background: var(--indigo-50); color: var(--indigo-700); }
[data-theme="dark"] .ds-nav a.active { background: rgba(99,102,241,0.15); color: var(--indigo-300); }
.ds-nav a .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.5; }

.ds-content {
  padding: 48px 64px 96px;
  max-width: 1280px;
  width: 100%;
}

.ds-hero {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.ds-hero .eyebrow {
  font-family: var(--font-ui); font-weight: 500; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--indigo-600); margin-bottom: 12px;
}
.ds-hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 40px;
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px;
}
.ds-hero p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin: 0; max-width: 680px; }

.ds-section { margin-bottom: 64px; }
.ds-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ds-section-head h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  margin: 0; letter-spacing: -0.01em;
}
.ds-section-head .meta { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

.ds-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.ds-grid { display: grid; gap: 16px; }
.ds-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ds-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ds-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Theme toggle (floating) */
.ds-theme-toggle {
  position: fixed; top: 20px; right: 24px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px 6px 8px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; box-shadow: var(--shadow-soft);
}
.ds-theme-toggle:hover { color: var(--text-primary); }
.ds-theme-toggle .icon { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--bg-subtle); }

/* tiny utility */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.code-inline { font-family: var(--font-mono); font-size: 12px; background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; color: var(--text-secondary); }
