:root {
  --bg: #f5f6f8; --card: #fff; --line: #e2e5ea; --text: #1d2330; --muted: #6b7385; --accent: #2f6fed;
  --accent-soft: #e8f0ff; --custom: #0d8a5f; --custom-soft: #e5f6ef; --edit: #b26a00; --edit-soft: #fff4e0; --bad: #c62828; --bad-soft: #fdecea;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; color: var(--text); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.ghost { background: transparent; }
button.danger { color: var(--bad); }
input, select, textarea { font: inherit; color: var(--text); }
a { color: var(--accent); }
code { font-size: 12px; background: #eef0f4; padding: 1px 5px; border-radius: 4px; }

/* giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 340px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.login-card button { padding: 10px; }
.err { color: var(--bad); margin: 0; font-size: 13px; }

/* üst çubuk */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .3px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { font-weight: 500; color: var(--muted); }
.brand.big { font-size: 22px; text-align: center; margin-bottom: 6px; }
.proj { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 600; }
.status { flex: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.bad { color: var(--bad); }
.actions { display: flex; gap: 8px; align-items: center; }
.who { color: var(--muted); font-size: 13px; margin-left: 8px; }

.tabs { display: flex; gap: 4px; padding: 8px 20px 0; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 53px; z-index: 4; overflow-x: auto; }
.tabs a { border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a.right { margin-left: auto; }
.dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--edit-soft); color: var(--edit); font-size: 11px; font-weight: 700; text-align: center; }

main { max-width: 1180px; margin: 0 auto; padding: 20px; }
h2 { font-size: 16px; margin: 26px 0 10px; text-transform: none; }
h2:first-child { margin-top: 0; }
.note { color: var(--muted); margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.formula { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; line-height: 1.7; margin-bottom: 16px; }

/* proje seçimi */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--text); border-top: 4px solid var(--accent); transition: box-shadow .15s; }
.pcard:hover { box-shadow: 0 6px 20px rgba(20, 30, 60, .08); }
.pcard b { font-size: 17px; display: block; margin-bottom: 4px; }
.pcard small { display: block; color: var(--muted); }
.pcard .tags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { font-size: 12px; font-weight: 600; color: var(--muted); }
table.grid th small { display: block; font-weight: 400; }
table.grid td.name { font-weight: 600; white-space: nowrap; }
.na { color: var(--muted); }
.wide { overflow-x: auto; }

.num { width: 92px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: right; }
.num.custom { border-color: var(--custom); background: var(--custom-soft); }
.num.edited { border-color: var(--edit); background: var(--edit-soft); }
.num.bad { border-color: var(--bad); color: var(--bad); }
.cell { display: inline-flex; align-items: center; gap: 3px; }
.reset { border: 0; background: none; padding: 0 3px; color: var(--muted); visibility: hidden; }
.cell:hover .reset.show { visibility: visible; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field .lbl { flex: 1; min-width: 0; }
.field .lbl b { display: block; font-weight: 600; font-size: 13px; }
.field .lbl small { display: block; color: var(--muted); font-size: 12px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; border: 1px solid; }
.legend .c { background: var(--custom-soft); border-color: var(--custom); }
.legend .e { background: var(--edit-soft); border-color: var(--edit); }

.calc { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.calc label.chk { flex-direction: row; align-items: center; gap: 6px; padding-top: 18px; }
.calc input[type=number], .calc select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.out td { font-variant-numeric: tabular-nums; }
.out td.v { font-weight: 700; font-size: 15px; }
.out td.why { color: var(--muted); font-size: 12px; font-family: ui-monospace, Consolas, monospace; }

.files { max-height: 480px; overflow: auto; }
.files td.size { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.files img { width: 32px; height: 32px; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 10px 10px; border-radius: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input[type=text] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 220px; }
textarea.code { width: 100%; min-height: 340px; font: 12px/1.5 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--custom-soft); color: var(--custom); white-space: nowrap; }
.pill.off { background: var(--bad-soft); color: var(--bad); }
.pill.new { background: var(--edit-soft); color: var(--edit); }
.pill.mute { background: #eef0f4; color: var(--muted); }

.log td { font-size: 13px; }
.log td.t { color: var(--muted); white-space: nowrap; }
.log td.d { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 80vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10; }
.toast.bad { background: var(--bad); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .status { order: 5; flex-basis: 100%; }
  .tabs { top: 0; position: static; padding: 4px 12px 0; }
  main { padding: 12px; }
  .fields { grid-template-columns: 1fr; }
}
