/* ==========================================================================
   RSI MARBLE — KURUMSAL TASARIM SİSTEMİ & ANA STİLLER (RSI-BS-01)
   Aydınlık, Ferah, Minimalist & Prestijli Kurumsal Standart (Hasan Bey Doktrini)
   Resmi Fontlar: Outfit (Başlıklar & Marka) | Plus Jakarta Sans (Gövde & Tablolar)
   Kural: Rakamlarda noktalı sıfır ('0') içeren fontlar kesinlikle yasaktır!
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cinzel:wght@600;700;800&display=swap');

:root {
  /* Zemin & Yüzeyler (Aydınlık & Ferah Standart) */
  --bg-app: #F8FAFC;
  --bg-sidebar: #FFFFFF;
  --bg-header: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.95);

  /* Minimalist Kenarlıklar & Çizgiler */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-strong: #94A3B8;
  --border-hairline: #F1F5F9;
  --border-gold: #D97706;

  /* Kurumsal Metin & Kontrast */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  --text-white: #FFFFFF;

  /* RSI Kurumsal Renk Paleti (Aydınlık Mod Eşdeğerleri) */
  --rsi-slate-900: #0F172A;
  --rsi-slate-850: #1E293B;
  --rsi-slate-800: #334155;
  --rsi-slate-700: #475569;
  --rsi-slate-600: #64748B;
  --rsi-slate-500: #94A3B8;
  --rsi-slate-400: #64748B;
  --rsi-slate-300: #475569;
  --rsi-slate-200: #334155;
  --rsi-slate-100: #0F172A;

  --rsi-gold: #B45309;
  --rsi-gold-light: #D97706;
  --rsi-gold-dark: #78350F;
  --rsi-gold-glow: rgba(217, 119, 6, 0.15);
  --rsi-gold-subtle: #FEF3C7;

  --rsi-bej: #0F172A;
  --rsi-bej-dark: #334155;

  /* Operasyonel Süreç Kümeleri */
  --c-raw: #D97706;
  --c-raw-bg: #FEF3C7;
  --c-raw-border: #FDE68A;
  --c-raw-text: #92400E;

  --c-cut: #2563EB;
  --c-cut-bg: #EFF6FF;
  --c-cut-border: #BFDBFE;
  --c-cut-text: #1E40AF;

  --c-yield: #059669;
  --c-yield-bg: #ECFDF5;
  --c-yield-border: #A7F3D0;
  --c-yield-text: #065F46;

  --c-ship: #7C3AED;
  --c-ship-bg: #F5F3FF;
  --c-ship-border: #DDD6FE;
  --c-ship-text: #5B21B6;

  /* Durum Renkleri */
  --status-danger: #DC2626;
  --status-danger-bg: #FEF2F2;
  --status-danger-border: #FECACA;

  --status-warning: #D97706;
  --status-warning-bg: #FEF3C7;
  --status-warning-border: #FDE68A;

  --status-success: #059669;
  --status-success-bg: #ECFDF5;
  --status-success-border: #A7F3D0;

  --status-info: #2563EB;
  --status-info-bg: #EFF6FF;
  --status-info-border: #BFDBFE;

  /* Tipografi - KESİNLİKLE JETBRAINS MONO YOKTUR (Noktalı sıfır 8 ile karışmaz) */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  --font-mono: 'Plus Jakarta Sans', sans-serif; /* Açık oval sıfır */
  --font-numbers: 'Plus Jakarta Sans', sans-serif;

  /* Gölgeler */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-gold: 0 0 16px rgba(217, 119, 6, 0.15);

  /* Boyutlandırma & Geçişler */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --transition: all 0.15s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Rakamlarda noktasız açık sıfır ve sütun hizalaması (Hasan Bey Demir Kuralı) */
td, th, .stat-pill-value, .kpi-value, .stat-val, .metric-value, .badge, .mono, input, select, .pin-key-btn, .pin-input-big {
  font-variant-numeric: tabular-nums;
}

/* App Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR (SOL NAVİGASYON)
   ========================================================================== */
.app-sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.brand-logo-img {
  height: 42px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.2s ease;
}
.brand-logo-img:hover {
  transform: scale(1.02);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--c-gold-bg);
  color: var(--c-gold-text);
  border-color: var(--c-gold-border);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3.5px;
  background: var(--c-gold);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.nav-badge.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.nav-badge.gold {
  background: var(--c-gold-bg);
  color: var(--c-gold-text);
  border: 1px solid var(--c-gold-border);
}

.nav-badge.success {
  background: var(--c-yield-bg);
  color: var(--c-yield-text);
  border: 1px solid var(--c-yield-border);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #D97706;
  border: 1px solid #1E293B;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
}

.user-role {
  font-size: 0.7rem;
  color: var(--c-gold);
  font-weight: 600;
}

/* ==========================================================================
   HEADER (ÜST KONTROL ÇUBUĞU)
   ========================================================================== */
.app-header {
  grid-area: header;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.page-title-wrap {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-stats-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.stat-pill-label {
  color: var(--text-muted);
  font-weight: 600;
}

.stat-pill-value {
  font-family: var(--font-numbers);
  font-weight: 800;
}

.stat-pill-value.gold {
  color: var(--c-gold);
}

.stat-pill-value.danger {
  color: var(--status-danger);
}

.stat-pill-value.success {
  color: var(--status-success);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   MAIN CONTENT AREA (ANA İÇERİK)
   ========================================================================== */
.app-main {
  grid-area: main;
  background: var(--bg-app);
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
  display: block;
}

/* ==========================================================================
   ANİMASYONLAR & SCROLLBAR
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
