/* Research Lab: lacivert kenar cubugu, acik calisma yuzeyi, durum renkleri. */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }

:root {
  --c-blue: #2f6bff; --c-purple: #8b5cf6; --c-pink: #ec4899; --c-orange: #f08c00;
  --c-teal: #12b5ab; --c-indigo: #4f56e0; --c-green: #17a34a; --c-red: #e5484d; --c-gray: #7c8499;
  --navy: #151b45; --navy-2: #232f8a;
  --bg: #f3f5fb; --surface: #ffffff; --surface-2: #f7f8fd;
  --ink: #151b45; --muted: #5d6585; --line: #dfe3f0;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1030; --surface: #161b47; --surface-2: #1b2154;
    --ink: #eef0fb; --muted: #a3aacb; --line: #2b3270;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.icon { display: inline-flex; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.strong { font-weight: 600; }
.center { text-align: center; padding: 28px 0; }
.grow { flex: 1 1 0; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.right { text-align: right; }
.pre { white-space: pre-wrap; }
.error { color: var(--c-red); font-weight: 500; min-height: 0; overflow-wrap: anywhere; }
.error:empty { display: none; }
.warn { color: color-mix(in srgb, var(--c-orange) 80%, var(--ink)); font-weight: 500; }

.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.bottom { align-items: flex-end; }
.row.pad, .pad { padding: 10px 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---- Parcalar */
.tile {
  display: inline-grid; place-items: center; flex: none; color: #fff; border-radius: 28%;
  background: linear-gradient(160deg, var(--tile), color-mix(in srgb, var(--tile) 72%, #000));
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap; max-width: 100%;
  background: color-mix(in srgb, var(--b) 16%, transparent);
  color: color-mix(in srgb, var(--b) 72%, var(--ink));
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 6px; }
.dot.big { width: 12px; height: 12px; margin: 0; }
.count {
  font-size: 0.75rem; font-weight: 600; padding: 0 7px; border-radius: 99px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.btn {
  --btn: var(--c-indigo);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--btn) 55%, var(--line)); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--btn) 88%, #000); }
.btn.danger { background: var(--c-red); border-color: var(--c-red); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--ink); }
.btn.ghost.on { color: var(--c-orange); }
.btn.ghost.on svg { fill: currentColor; }
.btn.square { padding: 7px; }
.btn.small { padding: 4px; }
.btn.wide { width: 100%; }
.only-mobile { display: none; }
.linklike { background: none; border: 0; padding: 0; color: var(--c-blue); cursor: pointer; font-size: 0.82rem; text-decoration: underline; }

.input {
  width: 100%; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); min-width: 0;
}
textarea.input { resize: none; display: block; line-height: 1.45; }
select.input, .input.date { width: auto; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input.plain { border-color: transparent; background: transparent; padding: 3px 6px; margin-left: -6px; }
.input.plain:hover { border-color: var(--line); }
.input.plain:focus { background: var(--surface); border-color: var(--line); }
.input.title { font-size: 1.4rem; font-weight: 700; border-color: transparent; background: transparent; padding: 2px 6px; }
.input.title:hover, .input.title:focus { border-color: var(--line); }
.input.big { padding: 12px 14px; font-size: 1rem; }
.input.code { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
label { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
label.block { display: flex; flex-direction: column; gap: 4px; }
label.block .input { color: var(--ink); font-size: 15px; font-weight: 400; }
label.block .input.strong { font-weight: 600; }
.check-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 0.92rem; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--c-indigo); flex: none; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.card.row { flex-direction: row; }
.card > .btn { align-self: flex-start; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 14%, transparent); flex-wrap: wrap; }
.segmented button {
  --seg: var(--c-indigo);
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 11px; border-radius: 8px; font-weight: 500; color: var(--muted);
}
.segmented button.active { background: var(--seg); color: #fff; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--c-purple); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: grid; place-items: center; gap: 12px; padding: 60px 20px; text-align: center; color: var(--muted); align-content: center; height: 100%; }
.progress { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--bar) 18%, transparent); position: relative; overflow: hidden; }
.progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--bar); border-radius: 99px; }
.progress.tall { height: 8px; }

/* ---- Giris */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 10%, color-mix(in srgb, var(--c-indigo) 55%, transparent), transparent 60%),
    radial-gradient(800px 520px at 90% 95%, color-mix(in srgb, var(--c-teal) 50%, transparent), transparent 60%),
    var(--navy);
}
.login-card {
  width: min(400px, 100%); background: var(--surface); border-radius: 22px; padding: 30px 28px;
  display: flex; flex-direction: column; gap: 12px; text-align: center;
  box-shadow: 0 30px 80px rgba(5, 8, 40, 0.5);
}
.login-logo { margin: -78px auto 0; filter: drop-shadow(0 10px 18px rgba(5, 8, 40, 0.45)); }
.login-card .hint { font-size: 0.8rem; color: var(--muted); }
.login-card .btn.primary { padding: 12px; font-size: 1rem; background: linear-gradient(120deg, var(--c-indigo), var(--c-teal)); border: 0; }

/* ---- Kabuk */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100dvh; }
.side {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; color: #e9ecff;
  background: linear-gradient(175deg, var(--navy) 30%, var(--navy-2) 130%);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; padding: 2px 6px 12px; }
.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0;
  background: transparent; color: inherit; cursor: pointer; text-align: left; font-weight: 500;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.menu-item.active { background: rgba(255, 255, 255, 0.16); font-weight: 600; }
.menu-label { flex: 1; }
.side :focus-visible { outline-color: #fff; }
.side-foot { display: flex; flex-direction: column; gap: 8px; }
.month { display: flex; flex-direction: column; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.month .muted { color: #b9c0ee; }
.month strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.side .btn.ghost { color: #cfd4f7; }
.side .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.main { overflow: auto; min-width: 0; }

.page { max-width: 980px; margin: 0 auto; padding: 22px 22px 60px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- Liste ve detay */
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; }
.pane-list { border-right: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.list { overflow: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 10px 10px 10px 14px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  position: relative;
}
.list-item::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--bar); }
.list-item:hover { background: color-mix(in srgb, var(--muted) 9%, transparent); }
.list-item.active { background: var(--surface); border-color: var(--line); box-shadow: 0 2px 8px rgba(21, 27, 69, 0.08); }
.detail { overflow: auto; padding: 18px 22px 50px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fields { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.fields label { display: flex; flex-direction: column; gap: 3px; }
.fields .input { color: var(--ink); font-size: 0.92rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; cursor: pointer; padding: 9px 12px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--c-indigo); }
.tab-body { display: flex; flex-direction: column; gap: 10px; }

.task { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.task.done .input.strong { text-decoration: line-through; color: var(--muted); }
.check { border: 0; background: none; cursor: pointer; padding: 2px; color: var(--muted); display: inline-flex; border-radius: 50%; }
.task.done .check { color: var(--c-green); }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.task-side .input.date { padding: 3px 6px; font-size: 0.8rem; }
.overdue .input.date { border-color: var(--c-red); color: var(--c-red); }

.notes { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
.note-list { display: flex; flex-direction: column; gap: 4px; }
.note-name { display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.note-name:hover { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.note-name.active { background: color-mix(in srgb, var(--c-indigo) 14%, transparent); }
.note-editor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.note-body { min-height: 340px; resize: vertical !important; font-size: 0.95rem; }

.link-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.answer { white-space: pre-wrap; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--c-purple) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-purple) 30%, var(--line)); }
.usage-row { display: flex; align-items: center; gap: 4px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.usage-row:last-child { border-bottom: 0; }

/* ---- Fikirler */
.composer { gap: 8px; }
.idea { border-left: 4px solid var(--c-orange); }
.idea.linked { border-left-color: var(--c-green); }

/* ---- Beyin firtinasi */
.detail.chat { overflow: hidden; height: 100%; padding-bottom: 14px; }
.stream { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding-right: 4px; }
.thought {
  padding: 9px 12px 10px 14px; border-radius: 12px; border: 1.5px solid transparent;
  background: color-mix(in srgb, var(--k) 8%, var(--surface)); border-left: 4px solid var(--k);
  display: flex; flex-direction: column; gap: 5px;
}
.thought.starred { border-color: color-mix(in srgb, var(--c-orange) 70%, transparent); border-left-color: var(--k); background: color-mix(in srgb, var(--k) 14%, var(--surface)); }
.thought-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.spark { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c-orange) 15%, var(--surface)); color: var(--ink); flex-wrap: wrap; }
.spark > .icon { color: var(--c-orange); }

/* ---- Planlayici */
.stage { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px 5px 5px; border-radius: 99px; font-weight: 500; color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.stage b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 25%, transparent); font-size: 0.8rem; }
.stage.active { color: #fff; background: linear-gradient(100deg, var(--c-purple), var(--c-indigo)); }
.stage.active b { background: rgba(255, 255, 255, 0.25); }
.stage-sep { width: 18px; height: 2px; background: var(--line); border-radius: 2px; }
.question { color: color-mix(in srgb, var(--c-purple) 70%, var(--ink)); font-size: 0.98rem; font-weight: 600; }
.step { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.step.off { opacity: 0.45; }
.step > input { margin-top: 4px; }
.stepnum { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--c-purple); color: #fff; font-size: 0.8rem; font-weight: 700; }
.step-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.risks { padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--c-orange) 11%, var(--surface)); display: flex; flex-direction: column; gap: 6px; }
.risks h3 .icon { color: var(--c-orange); }

/* ---- Harcamalar */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; align-items: center; gap: 11px; padding: 13px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--s) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--s) 20%, var(--surface)), color-mix(in srgb, var(--s) 5%, var(--surface))); }
.stat div { display: flex; flex-direction: column; min-width: 0; }
.stat strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 6px; overflow-x: auto; }
.bar-col { flex: 1 0 44px; max-width: 90px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar { width: 100%; flex: none; display: flex; flex-direction: column-reverse; border-radius: 7px 7px 3px 3px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.8rem; padding: 4px 8px 4px 0; }
td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; white-space: nowrap; }
td.num.muted { color: var(--muted); }

/* ---- Ayarlar */
.provider { border-left: 4px solid var(--bar); }
.provider .input[type="number"] { width: 100px; }

/* ---- Pencere ve bildirim */
.overlay { position: fixed; inset: 0; background: rgba(8, 11, 40, 0.55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.dialog { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 70px rgba(5, 8, 40, 0.45); }
.dialog h3 { font-size: 1.1rem; }
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: min(520px, 92vw);
  transition: opacity 0.18s, transform 0.18s; box-shadow: 0 10px 30px rgba(5, 8, 40, 0.35); border: 1px solid rgba(255, 255, 255, 0.15);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--c-red); }

/* ---- Dar ekran (telefon) */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .side { order: 2; flex-direction: row; align-items: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .brand, .month, .menu-label, .side .count, .side-foot .btn span:not(.icon) { display: none; }
  .menu { flex-direction: row; justify-content: space-around; }
  .menu-item { padding: 7px; }
  .side-foot .btn { font-size: 0; gap: 0; padding: 9px; width: auto; }
  .split { grid-template-columns: 1fr; }
  .split .detail { display: none; }
  .split.show-detail .pane-list { display: none; }
  .split.show-detail .detail { display: flex; }
  .pane-list { border-right: 0; }
  .only-mobile { display: inline-flex; }
  .detail { padding: 14px 14px 40px; }
  .page { padding: 16px 14px 40px; }
  .stats, .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .notes { grid-template-columns: 1fr; }
  .input.title { font-size: 1.15rem; }
  .task { flex-wrap: wrap; }
  .task-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; padding-left: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition: none !important; }
}
