:root {
  --brand: #E11D2E;
  --brand-dark: #B5121F;
  --brand-soft: #FFECEE;
  --ink: #15151A;
  --ink-2: #5D5D6B;
  --muted: #9A9AA8;
  --line: #ECECF0;
  --bg: #F7F7F8;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(27, 27, 47, .06), 0 1px 2px rgba(27, 27, 47, .04);
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-weight: 800; letter-spacing: -.02em; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.text-muted { color: var(--ink-2) !important; }
.text-primary { color: var(--brand) !important; }

/* Menü: oturum açıkken solda dikey kenar çubuğu, giriş sayfasında yalnızca logo */
.app-nav { background: #fff; border-bottom: 1px solid var(--line); }
.sidebar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink); text-decoration: none; line-height: 1.15; }
.sidebar-brand:hover { color: var(--ink); }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 2px 6px rgba(199, 7, 36, .25); }
.login-logo { border-radius: 50%; box-shadow: 0 10px 30px rgba(199, 7, 36, .25); }

.app-sidebar { background: #fff; border-bottom: 1px solid var(--line); padding: .85rem 1rem; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; }
.sidebar-body { flex-direction: column; padding-top: .75rem; }
.app-sidebar .nav-link { color: var(--ink-2); font-weight: 600; border-radius: 10px; padding: .55rem .8rem; display: flex; align-items: center; justify-content: space-between; }
.app-sidebar .nav-link:hover { color: var(--ink); background: var(--bg); }
.app-sidebar .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.app-main { padding: 1.5rem 1rem 0; }

@media (min-width: 768px) {
  .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; display: flex; flex-direction: column; border-bottom: 0; border-right: 1px solid var(--line); padding: 1.25rem 1rem; overflow-y: auto; z-index: 1030; }
  .sidebar-body { flex: 1; padding-top: 1.5rem; }
  .sidebar-user { margin-top: auto; }
  .app-main { margin-left: 240px; padding: 2rem 2rem 0; max-width: 1600px; }
}

/* Kartlar */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table { margin-bottom: 0; }
.stat { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }

/* Butonlar */
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.form-control, .form-select { border-radius: 12px; border-color: var(--line); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(225, 29, 46, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }

/* Tablolar */
.table > :not(caption) > * > * { padding: .8rem .75rem; border-bottom-color: var(--line); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom-width: 1px; }
table td { vertical-align: middle; }

/* Rozetler (Bootstrap 5.1'de text-bg-* yok) */
.badge { font-weight: 700; border-radius: 999px; padding: .4em .75em; }
.text-bg-primary { background: var(--brand) !important; color: #fff !important; }
.text-bg-secondary { background: #E9E9EE !important; color: var(--ink-2) !important; }
.text-bg-success { background: #E6F7EF !important; color: #12A36B !important; }
.text-bg-warning { background: #FFF4DE !important; color: #B26B00 !important; }
.text-bg-danger { background: var(--brand-soft) !important; color: var(--brand) !important; }
.text-bg-dark { background: var(--ink) !important; color: #fff !important; }
.text-bg-light { background: #fff !important; color: var(--ink) !important; }
.badge-new { background: #FFF4DE; color: #8A5400; border: 1px solid #FFE2A8; }
.badge-existing { background: #E6F7EF; color: #0E7A50; border: 1px solid #C3EBD7; }

/* Uyarılar */
.alert { border: 0; border-radius: 12px; }
.alert-success { background: #E6F7EF; color: #0E7A50; }
.alert-danger { background: var(--brand-soft); color: var(--brand-dark); }
.alert-warning { background: #FFF4DE; color: #8A5400; }

/* Görseller */
.thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; background: #eee; }
.thumb-sm { display: inline-flex; width: 36px; height: 36px; object-fit: cover; border-radius: 8px; background: #eee; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: #888; font-size: 12px; text-align: center; background: #f1f3f5; border: 1px dashed #ccc; }
.thumb-lg { width: 100%; height: 100%; min-height: 160px; max-height: 240px; object-fit: cover; border-radius: 12px; background: #eee; }
.step-photo { object-fit: cover; border-radius: 10px; background: #eee; }
.candidate.dim { opacity: .55; }
.prompt-examples button { margin: 0 .25rem .35rem 0; border-radius: 999px; }
.sticky-top { backdrop-filter: blur(8px); background: rgba(255, 255, 255, .92); }

/* FLUX.1 görsel prompt'ları */
.flux-prompt { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .65rem; white-space: pre-wrap; word-break: break-word; }

/* Panel grafikleri */
.chart-box { position: relative; height: 260px; }
details > summary { cursor: pointer; }

/* Sunucu durumu */
.usage-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.usage-bar > div { height: 100%; width: 0; border-radius: 4px; background: var(--ink-2); transition: width .4s ease; }
.usage-bar.warn > div { background: #D97706; }
.usage-bar.crit > div { background: var(--brand); }
.status-chip { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; }
.status-chip.ok { color: #047857; background: #ECFDF5; }
.status-chip.warn { color: #B45309; background: #FFFBEB; }
.status-chip.crit { color: var(--brand-dark); background: var(--brand-soft); }
.log-table td { vertical-align: top; }
.log-summary { list-style: none; cursor: pointer; }
.log-summary::-webkit-details-marker { display: none; }
.log-pre { font-size: .78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
