:root {
  --bg: #0e0f11;
  --panel: #16181c;
  --panel-2: #1d2025;
  --line: #2a2e35;
  --text: #f4f5f7;
  --muted: #9aa1ad;
  --accent: #ffffff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --demo: #a78bfa;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* --- yerleşim --- */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { font-weight: 700; font-size: 26px; letter-spacing: -0.5px; color: #fff; text-transform: none; padding: 4px 10px 2px; display: block; text-decoration: none; }
.logo-sub { color: var(--muted); font-size: 12px; padding: 0 10px 16px; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.side-foot { margin-top: 18px; padding: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.content { min-width: 0; }
.main { padding: 20px 28px 60px; min-width: 0; }
.topbar { display: none; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- demo uyarısı --- */
.demo-banner { border: 1px solid var(--demo); color: #ddd6fe; background: rgba(167, 139, 250, .08); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.demo { border-color: var(--demo); color: var(--demo); }
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.badge.bad { border-color: var(--bad); color: var(--bad); }

/* --- kartlar --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- form --- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #fff3; border-color: #fff6; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .f { flex: 1 1 180px; }
.btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: #fff5; }
.btn.primary { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.sectors { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin: 10px 0; }
.check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; margin: 0; }
.check:has(input:checked) { border-color: #fff8; background: var(--panel-2); }
.check input { width: 16px; height: 16px; accent-color: #fff; }

/* --- ilerleme --- */
.progress { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; }

/* --- tablo --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--panel); white-space: nowrap; }
th.sort { cursor: pointer; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel); }
td.num, th.num { text-align: right; }
.nowrap { white-space: nowrap; }

/* --- kanban --- */
.kanban { display: grid; grid-template-columns: repeat(7, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 200px; }
.col.over { border-color: #fff8; }
.col h3 { font-size: 13px; margin: 2px 4px 8px; display: flex; justify-content: space-between; }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; cursor: grab; font-size: 13px; }
.kcard .t { font-weight: 600; cursor: pointer; }
.kcard select { margin-top: 6px; padding: 4px; font-size: 12px; }

/* --- detay paneli --- */
.drawer-bg { position: fixed; inset: 0; background: #0009; z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); border-left: 1px solid var(--line); z-index: 21; overflow-y: auto; padding: 18px 20px 60px; }
.drawer .close { float: right; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 4px 0 10px 12px; font-size: 14px; }
.timeline .when { color: var(--muted); font-size: 12px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; z-index: 40; max-width: 92vw; font-size: 14px; }
.toast.err { background: var(--bad); color: #000; }
.task { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .p { width: 70px; flex: none; }
.task .body { flex: 1; min-width: 0; }

/* --- giriş --- */
.login { max-width: 360px; margin: 12vh auto; padding: 0 16px; }
.login .logo { font-size: 44px; padding: 0 0 4px; }
.login form { display: grid; gap: 12px; margin-top: 20px; }

/* --- mobil --- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .15s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
  .topbar .logo { font-size: 22px; padding: 0; }
  .main { padding: 14px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv div:nth-child(odd) { margin-top: 6px; }
  .kanban { grid-template-columns: repeat(7, 78vw); }
  .cards { grid-template-columns: 1fr 1fr; }
  .hide-m { display: none; }
}
