/* =========================================================================
   SLC · Muhasebe Operasyonları Takip Sistemi — app.css
   Operasyon Merkezi · SLC Design V2 (light-only / indigo-slate ERP)
   Anayasa Madde 11: dark theme yasak · IBM Plex Sans + IBM Plex Mono
   ========================================================================= */

/* === DESIGN TOKENS ======================================================= */
:root {
  /* Brand — Lacivert/Indigo (Anayasa Madde 11 + DESIGN_FREEZE) */
  --brand-900: #0F2540;
  --brand-700: #1E3A5F;
  --brand-500: #3B5F8A;
  --brand-300: #A8BBD3;
  --brand-100: #E8EEF6;

  /* Aksent — Altın (sınırlı kullanım) */
  --accent-500: #D4A93C;
  --accent-100: #FAF1D6;

  /* Nötr */
  --neutral-0:   #FFFFFF;
  --neutral-50:  #F8F9FA;
  --neutral-100: #F1F3F5;
  --neutral-200: #E5E7EB;
  --neutral-400: #9CA3AF;
  --neutral-600: #4B5563;
  --neutral-900: #1A1A1A;

  /* Semantic — yalnız status/badge */
  --success-500: #16A34A; --success-100: #DCFCE7;
  --warning-500: #F59E0B; --warning-100: #FEF3C7;
  --danger-500:  #DC2626; --danger-100:  #FEE2E2;
  --info-500:    #2563EB; --info-100:    #DBEAFE;
  --orange-500:  #F97316; --orange-100:  #FFEDD5;
  --purple-500:  #7C3AED; --purple-100:  #EDE9FE;

  /* Typography */
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Spacing — 4px base */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radius */
  --r-sm: 6px;  --r-md: 8px;  --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 2px 6px rgba(15,37,64,0.06);
  --shadow-md: 0 6px 16px rgba(15,37,64,0.10);
  --shadow-lg: 0 16px 32px rgba(15,37,64,0.16);
}

/* === RESET ============================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-900);
  background: var(--neutral-50);
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--brand-900); margin: 0 0 12px; font-weight: 700; }
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 20px; line-height: 28px; }
h3 { font-size: 18px; line-height: 26px; font-weight: 600; }
h4 { font-size: 16px; line-height: 24px; font-weight: 600; }
small, .caption { font-size: 12px; color: var(--neutral-600); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--neutral-400); }
.text-danger { color: var(--danger-500); }
.text-success { color: var(--success-500); }

/* === LAYOUT ============================================================= */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px; background: var(--neutral-0);
  border-bottom: 1px solid var(--neutral-200);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
/* SLC monogram block — topbar */
.topbar .brand-block {
  display: flex; align-items: center; gap: 12px;
}
.topbar .brand-mono {
  width: 36px; height: 36px; border-radius: var(--r-md);
  background: var(--brand-900); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800; font-size: 13px; letter-spacing: 0.04em;
}
.topbar .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.topbar .brand-name { font-size: 13px; font-weight: 700; color: var(--brand-900); }
.topbar .brand-sub {
  font-size: 10px; font-weight: 700; color: var(--neutral-600);
  letter-spacing: 0.10em; text-transform: uppercase;
}

/* SLC monogram block — sidenav header */
.sidenav-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 14px; margin-bottom: 6px;
  border-bottom: 1px solid var(--neutral-200);
}
.sidenav-brand .brand-mono-sm {
  width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--brand-900); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800; font-size: 12px; letter-spacing: 0.04em;
  flex-shrink: 0;
}
.sidenav-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidenav-brand-name {
  font-size: 12px; font-weight: 700; color: var(--brand-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidenav-brand-sub {
  font-size: 10px; font-weight: 700; color: var(--neutral-600);
  letter-spacing: 0.10em; text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.topbar .topbar-action {
  height: 36px; min-width: 36px; padding: 0 12px;
  border: 1px solid var(--neutral-200); border-radius: var(--r-md);
  background: var(--neutral-0); color: var(--neutral-600);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer;
}
.topbar .topbar-action:hover { background: var(--neutral-50); }
.topbar .topbar-action.cta {
  background: var(--accent-500); color: var(--brand-900); border-color: var(--accent-500); font-weight: 600;
}

.app-body { display: flex; flex: 1; min-height: 0; }

.sidenav {
  width: 240px; background: var(--neutral-0);
  border-right: 1px solid var(--neutral-200); padding: 16px 12px;
  overflow-y: auto; flex-shrink: 0;
}
.sidenav .nav-group-title {
  font-size: 10px; font-weight: 700; color: var(--neutral-400);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 8px;
}
.sidenav .nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--neutral-900); font-size: 13px; text-decoration: none;
  margin-bottom: 2px;
}
.sidenav .nav-item:hover { background: var(--neutral-100); text-decoration: none; }
.sidenav .nav-item.active { background: var(--brand-100); color: var(--brand-700); font-weight: 600; }

.main-content {
  flex: 1; padding: 24px; overflow-y: auto; min-width: 0; max-width: 1440px;
}

/* === CARD =============================================================== */
.card {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--brand-900); }
.kpi-card .kpi-label {
  font-size: 11px; font-weight: 700; color: var(--neutral-600);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.kpi-card .kpi-value {
  font-size: 24px; font-weight: 800; color: var(--brand-900);
  margin-top: 8px; font-family: var(--font-mono);
}
.kpi-card .kpi-hint { font-size: 12px; color: var(--neutral-600); margin-top: 4px; }

.risk-card { border-left: 4px solid var(--danger-500); }
.risk-card.warning { border-left-color: var(--warning-500); }
.risk-card.orange { border-left-color: var(--orange-500); }

/* === BUTTON ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }
.btn-primary:hover { background: var(--brand-900); }
.btn-secondary { background: #fff; color: var(--brand-700); border-color: var(--brand-700); }
.btn-secondary:hover { background: var(--brand-100); }
.btn-ghost { background: transparent; color: var(--neutral-600); }
.btn-danger { background: var(--danger-500); color: #fff; border-color: var(--danger-500); }
.btn-success { background: var(--success-500); color: #fff; border-color: var(--success-500); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 14px; }

/* === FORM =============================================================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: var(--neutral-600); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; height: 40px;
  padding: 0 12px;
  font-family: var(--font-sans); font-size: 14px;
  color: var(--neutral-900);
  background: #fff;
  border: 1px solid var(--neutral-200); border-radius: var(--r-md);
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-500); outline-offset: 2px;
  border-color: var(--brand-500);
}
.form-hint { font-size: 12px; color: var(--neutral-600); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger-500); margin-top: 4px; font-weight: 600; }

/* === STATUS BADGE / PILL ================================================= */
.status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.status-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: var(--r-full);
  background: currentColor;
}
.status-tag.success { background: var(--success-100); color: var(--success-500); }
.status-tag.warning { background: var(--warning-100); color: var(--warning-500); }
.status-tag.orange  { background: var(--orange-100);  color: var(--orange-500);  }
.status-tag.danger  { background: var(--danger-100);  color: var(--danger-500);  }
.status-tag.info    { background: var(--info-100);    color: var(--info-500);    }
.status-tag.neutral { background: var(--neutral-100); color: var(--neutral-600); }
.status-tag.purple  { background: var(--purple-100);  color: var(--purple-500);  }

/* === TABLE ============================================================== */
.kmt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kmt-table thead th {
  background: var(--neutral-100); padding: 10px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--neutral-600);
  text-align: left; border-bottom: 1px solid var(--neutral-200);
}
.kmt-table tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--neutral-200);
  color: var(--neutral-900);
}
.kmt-table tbody tr:hover { background: var(--neutral-50); }
.kmt-table .num { font-family: var(--font-mono); text-align: right; }

/* === GRID ============================================================== */
.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* === MESSAGES =========================================================== */
.alert {
  padding: 12px 16px; border-radius: var(--r-md);
  border-left: 4px solid var(--info-500); background: var(--info-100);
  color: var(--info-500); margin-bottom: 12px;
}
.alert.success { border-color: var(--success-500); background: var(--success-100); color: var(--success-500); }
.alert.warning { border-color: var(--warning-500); background: var(--warning-100); color: var(--warning-500); }
.alert.danger  { border-color: var(--danger-500);  background: var(--danger-100);  color: var(--danger-500);  }

/* === EMPTY STATE ======================================================== */
.empty-state {
  text-align: center; padding: 48px 24px;
  border: 1px dashed var(--neutral-200); border-radius: var(--r-lg);
  background: var(--neutral-0);
}
.empty-state .empty-icon {
  width: 48px; height: 48px; border-radius: var(--r-full);
  background: var(--brand-100); color: var(--brand-500);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

/* === CHAT WIDGET PLACEHOLDER ============================================ */
.chat-widget {
  position: fixed; right: 16px; bottom: 16px;
  width: 56px; height: 56px; border-radius: var(--r-full);
  background: var(--brand-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); cursor: pointer;
  font-size: 20px; z-index: 1100;
}
.chat-widget .chat-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger-500); color: #fff;
  border: 2px solid #fff;
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* === LOGIN PAGE ========================================================= */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-100), var(--neutral-50));
}
.login-card {
  width: 420px; max-width: 92vw;
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 40px 32px;
}
.login-card h1 { text-align: center; margin-bottom: 8px; }
.login-card .login-sub {
  text-align: center; color: var(--neutral-600);
  font-size: 13px; margin-bottom: 24px;
}

/* === MOBILE — Anayasa 11.6 (input ≥16px) + 11.7 (touch ≥44px) =========== */
@media (max-width: 768px) {
  .app-body { flex-direction: column; }
  .sidenav { width: 100%; border-right: none; border-bottom: 1px solid var(--neutral-200); }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 16px; }
  /* Touch target */
  .btn, .topbar-action, .nav-item { min-height: 44px; }
  /* Input zoom-prevention */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], select, textarea {
    font-size: 16px;  /* iOS auto-zoom önleme — Anayasa 11.6 */
  }
  /* Tablo kart akışına dönüş ipucu — modüllerde uygulanır */
  .kmt-table.responsive thead { display: none; }
  .kmt-table.responsive tbody td { display: block; }
}

/* === ACCESSIBILITY ====================================================== */
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* DARK MODE: yasak — Anayasa Madde 11.1 */
/* @media (prefers-color-scheme: dark) {} ← KULLANILMAZ */
