/* ═══════════════════════════════════════════════════════════════════════════
 * styles/dashboard.css — Kurumsal Olgunluk Dashboard
 * ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --d-bg: #f8fafc;
  --d-surface: #fff;
  --d-text: #0b1220;
  --d-muted: #64748b;
  --d-border: #e2e8f0;
  --d-border-strong: #cbd5e1;

  --score-low: #ef4444;
  --score-mid: #f59e0b;
  --score-good: #10b981;
  --score-excel: #3b82f6;

  --c-capm: #c9960c;
  --c-pmp: #3b82f6;
  --c-adv: #a855f7;
  --c-rmp: #ef4444;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.dash-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-4);
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.dash-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.dash-sub {
  color: var(--d-muted);
  font-size: 14px;
  margin-top: var(--s-1);
}
.dash-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: transparent;
  border: 1px solid var(--d-border);
  color: var(--d-text);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.dash-back:hover {
  background: #f1f5f9;
}

/* ── Hero Row (gauge + radar) ────────────────────────────────────────────── */

.hero-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
@media (max-width: 880px) {
  .hero-row { grid-template-columns: 1fr; }
}

.card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--d-muted);
  margin-bottom: var(--s-3);
}
.card-large-num {
  font-size: 14px;
  color: var(--d-muted);
  margin-top: var(--s-2);
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}
.gauge-wrap svg { width: 100%; max-width: 220px; height: auto; }

.org-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--d-border);
}
.stat-item {
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--d-text);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12px;
  color: var(--d-muted);
  margin-top: 2px;
}

.radar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar-wrap svg { width: 100%; max-width: 320px; height: auto; }

/* ── RMP Area Cards ──────────────────────────────────────────────────────── */

.area-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
@media (max-width: 1024px) { .area-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .area-grid { grid-template-columns: 1fr; } }

.area-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms;
  text-align: left;
  font-family: inherit;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.area-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--d-border-strong);
}
.area-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--d-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.area-card-percent {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.area-card-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.area-card-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 400ms ease;
}
.area-card-meta {
  font-size: 11px;
  color: var(--d-muted);
}

/* ── Alarm Section ───────────────────────────────────────────────────────── */

.alarm-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.alarm-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid var(--score-low);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.alarm-icon { font-size: 16px; }
.alarm-label { font-weight: 600; }
.alarm-percent { font-weight: 700; color: var(--score-low); font-variant-numeric: tabular-nums; }
.alarm-meta { color: var(--d-muted); font-size: 12px; }

/* ── Hbar (drill-down sub-skill listesi) ─────────────────────────────────── */

.hbar {
  display: grid;
  grid-template-columns: 220px 1fr 60px;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-2) 0;
}
.hbar-label { font-size: 14px; font-weight: 500; }
.hbar-track {
  background: #e2e8f0;
  height: 14px;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 400ms ease;
}
.hbar-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.hbar-secondary {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--d-muted);
}

/* ── User Table ──────────────────────────────────────────────────────────── */

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.user-table th, .user-table td {
  padding: var(--s-3);
  text-align: left;
  border-bottom: 1px solid var(--d-border);
}
.user-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--d-muted);
  background: #f8fafc;
}
.user-table tr:hover { background: #f8fafc; }
.user-name { font-weight: 600; }
.user-email { font-size: 12px; color: var(--d-muted); }

.mini-bars-cell {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}
.mini-bar {
  width: 6px;
  border-radius: 2px;
  display: block;
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.progress-bar {
  width: 60px;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--score-good);
  border-radius: var(--r-pill);
}

.btn-karne {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  background: rgba(59, 130, 246, 0.1);
  color: var(--score-excel);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-karne:hover { background: rgba(59, 130, 246, 0.18); }

.score-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Empty / Loading ─────────────────────────────────────────────────────── */

.dash-empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--d-muted);
}
.dash-empty h2 { font-size: 18px; margin: 0 0 var(--s-2); color: var(--d-text); }
.dash-loading {
  text-align: center;
  padding: var(--s-12);
  color: var(--d-muted);
  font-size: 14px;
}
.dash-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--d-border);
  border-top-color: var(--score-excel);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin-right: var(--s-2);
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section spacing ─────────────────────────────────────────────────────── */
.section + .section { margin-top: var(--s-6); }
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 var(--s-3);
}
.section-sub {
  font-size: 13px;
  color: var(--d-muted);
  margin: 0 0 var(--s-4);
}
