:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6573;
  --line: #e2e5ea;
  --accent: #1f4fd8;
  --accent-text: #ffffff;
  --side: #101828;
  --side-text: #e6e9f0;
  --side-muted: #8b95a7;
  --side-hover: #1b2740;
  --danger: #b42318;
  --danger-bg: #fef3f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f16;
    --surface: #151a24;
    --text: #e9ecf2;
    --muted: #9aa3b2;
    --line: #262d3b;
    --accent: #6c93ff;
    --accent-text: #0c0f16;
    --side: #0a0d14;
    --side-hover: #161d2c;
    --danger: #ffb4ab;
    --danger-bg: #3a1a17;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text);
  font-weight: 700; font-size: 18px;
}
.brand-name { font-weight: 650; line-height: 1.2; }
.brand-sub { font-size: 12px; opacity: .7; }

button {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px;
  padding: 10px 14px; background: var(--accent); color: var(--accent-text); font-weight: 600;
}
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .85; }

/* Giriş */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px;
}
.login-card h1 { font-size: 20px; margin: 22px 0 14px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.login-card button { width: 100%; margin-top: 22px; }
.error { color: var(--danger); background: var(--danger-bg); border-radius: 8px; padding: 0; font-size: 14px; }
.error:not(:empty) { padding: 10px 12px; }

/* Ana yerleşim */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-text);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 0 6px; }
#menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-group {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--side-muted); padding: 14px 8px 6px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px;
  color: inherit; text-decoration: none;
}
a.menu-item:hover { background: var(--side-hover); }
.menu-item.disabled { color: var(--side-muted); }
.logout .ghost { width: 100%; color: var(--side-text); }

.chip {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: hsl(var(--h) 60% 42%); color: #fff;
}

.content { padding: 28px clamp(16px, 4vw, 40px); max-width: 1100px; }
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 24px; margin: 0; }
.menu-toggle { display: none; color: var(--text); }
.lead { color: var(--muted); margin: 6px 0 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; color: inherit; text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
}
a.card:hover { border-color: var(--accent); }
.card.disabled { opacity: .7; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card h2 { font-size: 16px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card-foot { font-size: 13px; font-weight: 600; color: var(--accent); }
.card.disabled .card-foot { color: var(--muted); font-weight: 500; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; position: static; height: auto; }
  .sidebar.open { display: flex; }
  .menu-toggle { display: inline-block; }
}
