:root {
  --bg: #f5f6f9;
  --bg-accent: #eef1f8;
  --surface: #ffffff;
  --text: #14171c;
  --muted: #6b7280;
  --border: #e6e9ee;
  --accent: #4f46e5;
  --accent-2: #7c6cf6;
  --accent-soft: #eef0fe;
  --accent-contrast: #ffffff;
  --error: #c0362c;
  --error-soft: #fdeceb;
  --ok: #0f7a52;
  --ok-soft: #e7f6ef;
  --warn: #9a6b00;
  --warn-soft: #fbf1d9;
  --badge: #eef0fe;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px rgba(79,70,229,.10), 0 3px 8px rgba(16,24,40,.06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11; --bg-accent: #12151c; --surface: #15181e; --text: #e7e9ee; --muted: #98a1ad;
    --border: #262b33; --accent: #818cf8; --accent-2: #a78bfa; --accent-soft: #1b2030;
    --accent-contrast: #0b0d11; --error: #f07167; --error-soft: #2a1715; --ok: #4ad3a0; --ok-soft: #10231c;
    --warn: #e6b450; --warn-soft: #231d10; --badge: #1b2030;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 10px 30px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d11; --bg-accent: #12151c; --surface: #15181e; --text: #e7e9ee; --muted: #98a1ad;
  --border: #262b33; --accent: #818cf8; --accent-2: #a78bfa; --accent-soft: #1b2030;
  --accent-contrast: #0b0d11; --error: #f07167; --error-soft: #2a1715; --ok: #4ad3a0; --ok-soft: #10231c;
  --warn: #e6b450; --warn-soft: #231d10; --badge: #1b2030;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 10px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); }

/* Animasyonlar */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.fade-in { animation: fadeInUp .4s cubic-bezier(.2,.8,.2,1) both; }

/* Üst bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 26px; background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 2px 6px rgba(79,70,229,.3);
  position: relative; transition: transform .2s ease;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: var(--surface); opacity: .92; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
.who strong { color: var(--text); font-weight: 600; }
.inline { display: inline; margin: 0; }

/* Yerleşim — full width */
.wrap { display: flex; gap: 0; align-items: flex-start; width: 100%; flex: 1; }
.sidebar {
  width: 260px; flex-shrink: 0; padding: 22px 14px; border-right: 1px solid var(--border);
  align-self: stretch; position: sticky; top: 55px; max-height: calc(100vh - 55px); overflow-y: auto;
}
.nav-group { margin-bottom: 22px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 10px 8px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 2px;
  border: 1px solid transparent; transition: background .14s ease, color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.nav-text { flex: 1; min-width: 0; }
.nav-item:hover { background: var(--accent-soft); color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.nav-item.locked { opacity: .62; }
.nav-item.locked:hover { opacity: 1; }
.nav-item .lock { font-size: 12px; }
.content { flex: 1; padding: 28px clamp(16px, 4vw, 48px); min-width: 0; }

/* Kartlar */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border-color: transparent; }
.hero h1 { font-size: 26px; }
.card.login { max-width: 400px; margin: 7vh auto; box-shadow: var(--shadow-md); padding: 34px; animation: fadeInUp .4s ease both; }
.card.login:hover { box-shadow: var(--shadow-md); }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .brand-mark { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 14px; animation: pop .5s ease both; }
.login-head h1 { font-size: 21px; }
.login-head p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

h1 { font-size: 22px; margin: 0 0 8px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
.muted { color: var(--muted); }
.error { color: var(--error); font-weight: 500; background: var(--error-soft); padding: 10px 13px; border-radius: 10px; font-size: 14px; }
.ok { color: var(--ok); font-weight: 500; background: var(--ok-soft); padding: 10px 13px; border-radius: 10px; font-size: 14px; animation: fadeInUp .3s ease both; }
.row { display: flex; align-items: center; gap: 12px; }

/* İlerleme çubuğu */
.progress { height: 12px; background: var(--bg-accent); border-radius: 999px; overflow: hidden; margin: 16px 0 10px; }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); background-size: 200% 100%;
  transition: width .7s cubic-bezier(.2,.8,.2,1); animation: shimmer 2.5s linear infinite;
}

/* Kilit kartı */
.lock-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 52px 32px; text-align: center; box-shadow: var(--shadow-sm);
  max-width: 580px; margin: 5vh auto; animation: fadeInUp .4s ease both;
}
.lock-emoji { font-size: 58px; display: inline-block; animation: floaty 3.2s ease-in-out infinite; }
.lock-card h1 { margin: 14px 0 8px; }
.lock-card p { color: var(--muted); max-width: 440px; margin: 0 auto 22px; }

/* Form */
label { display: block; margin: 0 0 14px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
  font-family: inherit; transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast); border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .1s ease, filter .14s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.04); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; text-decoration: none; padding: 4px 2px; font-weight: 500; transition: opacity .12s ease; }
.btn-link:hover { text-decoration: underline; opacity: .8; }
.login .btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 14px; align-items: end; }
.form-grid .btn { height: 42px; }
.form-grid label:has(textarea) { grid-column: 1 / -1; }

/* Aksiyonlar */
.actions { white-space: nowrap; }
.actions .inline { margin-right: 10px; }
.pw-input { display: inline-block; width: 140px; margin: 0 6px 0 0; padding: 7px 10px; font-size: 13px; vertical-align: middle; }

/* Tablolar */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--bg-accent); }
.tbl td a { font-weight: 600; text-decoration: none; }
.tbl td a:hover { text-decoration: underline; }

/* Rozetler */
.badge { display: inline-block; background: var(--badge); color: var(--accent); padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--error-soft); color: var(--error); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* Doküman */
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 40px; box-shadow: var(--shadow-sm); max-width: 900px; }
.doc > *:first-child { margin-top: 0; }
.doc h1 { font-size: 26px; } .doc h2 { font-size: 20px; margin-top: 30px; } .doc h3 { font-size: 16px; margin-top: 22px; }
.doc p, .doc li { line-height: 1.75; }
.doc table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--accent-soft); font-weight: 600; }
.doc code { background: var(--badge); padding: 1px 6px; border-radius: 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.doc pre { background: var(--bg-accent); padding: 16px; border-radius: 12px; overflow: auto; border: 1px solid var(--border); }
.doc pre code { background: none; padding: 0; }
.doc blockquote { border-left: 4px solid var(--accent); margin: 16px 0; padding: 8px 18px; color: var(--muted); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.doc a { text-decoration: none; } .doc a:hover { text-decoration: underline; }

/* Logo + istatistikler */
.logo-chip { display: inline-flex; align-items: center; justify-content: center; background: #15171b; border-radius: 12px; padding: 10px 18px; box-shadow: var(--shadow-sm); }
.logo-chip img { display: block; }
.login-head .logo-chip { margin: 0 auto 14px; animation: pop .5s ease both; }
.footer .logo-chip { padding: 6px 12px; border-radius: 9px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.stat { flex: 1; min-width: 130px; background: var(--bg-accent); border-radius: 14px; padding: 18px; text-align: center; transition: transform .15s ease; }
.stat:hover { transform: translateY(-3px); }
.stat-num { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 5px; }

/* Footer */
.footer {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); background: var(--surface);
}
.footer .brand-mark { width: 18px; height: 18px; border-radius: 5px; }

/* Duyarlı */
@media (max-width: 860px) {
  .wrap { flex-direction: column; }
  .sidebar { width: 100%; position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .doc { padding: 24px 18px; }
  .topbar { padding: 12px 16px; }
  .actions { white-space: normal; }
  .pw-input { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
