/* =====================================================
   dashboard.css — Dashboard sekmesi + Stat Kartları
   ===================================================== */

/* ============================================
   Dashboard
   ============================================ */
.welcome-card {
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #fef5f5 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  overflow: hidden;
}

.welcome-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  z-index: 1;
}

.welcome-content { flex: 1; z-index: 1; }

.welcome-content h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.welcome-date {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.welcome-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.welcome-link:hover { text-decoration: underline; }

.welcome-blob {
  position: absolute;
  right: 200px;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(160, 30, 33, 0.18), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-rates {
  display: flex;
  gap: 10px;
  z-index: 1;
  flex-shrink: 0;
}
.rate-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(160,30,33,0.15);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 118px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rate-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
}
.rate-flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a01e21, #c9494c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.rate-flag-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
}
.rate-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.rate-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.rate-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1, #0f172a);
  white-space: nowrap;
}
.rate-change {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 6px;
}
.rate-change.up   { color: #047857; background: rgba(16,185,129,0.12); }
.rate-change.down { color: #b91c1c; background: rgba(220,38,38,0.10); }
.rate-chip.stale .rate-value { opacity: 0.55; }

@media (max-width: 1100px) {
  .welcome-rates { display: none; }
}

.welcome-illustration {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 120px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-illustration svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(160, 30, 33, 0.18));
}

@media (max-width: 720px) {
  .welcome-illustration { display: none; }
  .welcome-blob { display: none; }
}

.welcome-sync {
  z-index: 1;
  flex-shrink: 0;
}

.warning-banner {
  background: #fef9c3;
  border: 1px solid #fde68a;
  color: #713f12;
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.warn-icon { color: #ca8a04; flex-shrink: 0; padding-top: 2px; }
.warn-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.warn-text { font-size: 13px; line-height: 1.5; }

.section-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-right {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.section-title-right strong {
  color: var(--text);
  font-weight: 700;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

/* .filter-row input[type="date"] — global modern stil kullanılıyor */

.filter-sep {
  color: var(--muted);
  font-size: 13px;
}

.filter-row button {
  padding: 7px 12px;
  font-size: 12.5px;
}

.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.dash-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
}

.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.dash-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dash-card-value.blue { color: #2563eb; }
.dash-card-value.green { color: var(--success); }

.dash-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.dash-card-sub.small {
  font-size: 10.5px;
  line-height: 1.4;
}

.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .dash-charts { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.chart-wrap {
  flex: 1;
  position: relative;
  min-height: 250px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.rapor-grafik-card {
  margin-bottom: 18px;
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-card-clickable {
  cursor: pointer;
  user-select: none;
}
.stat-card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}
.stat-card-active {
  box-shadow: 0 0 0 2px var(--accent, var(--primary)) inset, 0 4px 12px rgba(15,23,42,0.08);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent, var(--primary));
}

.stat-card.stat-blue   { --accent: var(--c-blue); }
.stat-card.stat-yellow { --accent: var(--c-yellow); }
.stat-card.stat-green  { --accent: var(--c-green); }
.stat-card.stat-orange { --accent: var(--c-orange); }
.stat-card.stat-purple { --accent: var(--c-purple); }
.stat-card.stat-red    { --accent: var(--c-red); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Siparişler stat kartları (yan yana label-icon) */
.siparisler-stats { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1280px) {
  .siparisler-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
.siparis-stat {
  background: white;
  border: 1px solid var(--border);
  padding: 18px 22px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  user-select: none;
}
.siparis-stat:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.siparis-stat:active { transform: translateY(1px); }
.siparis-stat-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary) inset;
  background: #fafbff;
}
.siparis-stat::before { display: none; }
.ss-content { flex: 1; min-width: 0; }
.ss-label {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}
.ss-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ss-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ss-icon.icon-blue { background: #dbeafe; color: #2563eb; }
.ss-icon.icon-green { background: #dcfce7; color: #16a34a; }
.ss-icon.icon-yellow { background: #fef3c7; color: #b45309; }
.ss-icon.icon-red { background: #fee2e2; color: #dc2626; }
.ss-icon.icon-pink { background: #fce7f3; color: #be185d; }

/* Siparişler filtre satırı */
.siparisler-filtre {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r);
  flex-wrap: wrap;
}
.siparisler-filtre input[type="search"] {
  flex: 1;
  min-width: 280px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
/* .siparisler-filtre input[type="date"] — global modern stil kullanılıyor */
.siparisler-filtre select {
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  cursor: pointer;
}
.siparisler-filtre input:focus,
.siparisler-filtre select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.siparisler-filtre button {
  padding: 8px 20px;
  font-size: 13px;
}

/* Sipariş tablo durum badge'leri */
.durum-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.durum-badge svg { width: 12px; height: 12px; }
.durum-isleme {
  background: #fef3c7;
  color: #b45309;
}
.durum-kargoda {
  background: #fee2e2;
  color: #c2410c;
}
.durum-teslim {
  background: #dcfce7;
  color: #166534;
}
.durum-iade {
  background: #fce7f3;
  color: #be185d;
}

/* Canlı Performans stat kartları (kırmızı vurgulu) */
.canli-stat {
  background: white;
  border: 1px solid var(--border);
  padding: 18px 22px;
  position: relative;
}
.canli-stat::before { display: none; }
.canli-stat-label {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}
.canli-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.canli-stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Canlı tablosu */
#canliTablo tbody td:nth-child(1) {
  white-space: normal;
  word-break: break-word;
  min-width: 240px;
  max-width: 420px;
  line-height: 1.4;
}
#canliTablo thead th:nth-child(2),
#canliTablo thead th:nth-child(3),
#canliTablo thead th:nth-child(4),
#canliTablo thead th:nth-child(5),
#canliTablo thead th:nth-child(6),
#canliTablo thead th:nth-child(7),
#canliTablo tbody td:nth-child(2),
#canliTablo tbody td:nth-child(3),
#canliTablo tbody td:nth-child(4),
#canliTablo tbody td:nth-child(5),
#canliTablo tbody td:nth-child(6),
#canliTablo tbody td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#canliTablo .urun-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#canliTablo .urun-meta .marka-tag {
  font-weight: 600;
  color: var(--text-2);
}
#canliTablo .urun-meta .barkod-mono {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 11px;
  color: var(--muted);
}
