/* Dostlar Community paneli - Dostlar STUDIO tasarim dili: yesil / krem / murekkep, sifir kose,
   Bricolage Grotesque + Instrument Sans (kendi sunucumuzdan). Tum renkler CSS degiskeni. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/bricolage-grotesque-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/bricolage-grotesque-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/instrument-sans-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/instrument-sans-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #fbfaf7; --surface: #ffffff; --surface2: #eef3e6; --line: #e3e0d7;
  --text: #1c231c; --muted: #6b6f66; --primary: #2f6b3a; --primary-d: #255a2f; --primary-c: #ffffff; --accent: #c9a13b;
  --ok: #2f6b3a; --warn: #c9a13b; --bad: #b3402c; --soft: #78b783;
  --ink: #1c231c; --ink-line: #2c352c; --ink-text: #b8bdb2; --cream: #fbfaf7;
  --border: 1px solid var(--line);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", var(--font);
  --font-mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary); color: var(--primary-c); }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0; font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .16em; color: var(--primary); }
.eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; background: currentColor; margin-right: 8px; vertical-align: 1px; }

/* ---------- giris ---------- */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; }
.login-card { background: var(--surface); border: var(--border); border-left: 6px solid var(--primary); padding: 40px 40px 28px; max-width: 440px; }
.login-logo { display: block; margin-bottom: 20px; }
.login-card h1 { margin: 6px 0 8px; font-size: 30px; line-height: 1.1; }
.login-card p { margin: 6px 0; }
.login-card small { color: var(--muted); font: 12px var(--font-mono); }
.err { color: var(--bad); font-weight: 600; }
.login-card .back { display: block; margin-top: 16px; color: var(--primary); font-weight: 600; font-size: 13px; }
.login-card .login-legal { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.login-legal a { color: inherit; }
.login-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* ---------- dil secici (giris: acik zemin, panel: koyu cekmece) ---------- */
.langs { display: inline-flex; flex: none; border: 1px solid var(--line); }
.langs a { padding: 4px 8px; font: 600 11.5px/1.2 var(--font); letter-spacing: .06em; color: var(--muted); text-decoration: none; }
.langs a + a { border-left: 1px solid var(--line); }
.langs a:hover { color: var(--text); background: var(--surface2); }
.langs a[aria-current] { background: var(--primary); color: #fff; }
.drawer-langs { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--ink-line); font-size: 12px; }
.drawer-langs .langs { border-color: var(--ink-line); }
.drawer-langs .langs a { color: var(--ink-text); }
.drawer-langs .langs a + a { border-left-color: var(--ink-line); }
.drawer-langs .langs a:hover { background: var(--ink-line); color: var(--cream); }
.drawer-langs .langs a[aria-current] { background: var(--primary); color: #fff; }

/* ---------- dugmeler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; font: 600 14px var(--font); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-c); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.discord { background: #5865f2; border-color: #5865f2; margin-top: 16px; }
.btn.discord:hover { background: #4752c4; border-color: #4752c4; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.ghost:hover { background: rgba(127, 127, 127, .15); }
.btn.small { padding: 5px 10px; font-size: 12.5px; background: var(--surface2); color: var(--text); border-color: var(--line); }
.btn.small:hover { background: var(--line); }
.btn.small.danger { color: var(--bad); }
.btn.danger:not(.small) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:not(.small):hover { background: #8f3323; border-color: #8f3323; }
.danger-zone { border-left: 4px solid var(--bad); }
.acts { display: inline-flex; gap: 6px; }

/* ---------- yerlesim ---------- */
body.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
#drawer { background: var(--ink); color: var(--ink-text); border-right: 1px solid var(--ink-line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.drawer-head { display: flex; gap: 12px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--ink-line); }
.drawer-head .display { color: var(--cream); font-size: 16px; line-height: 1.15; }
.drawer-sub { font-size: 12px; margin-top: 2px; }
#nav { flex: 1; overflow: auto; padding: 10px 8px; }
.nav-group { margin: 12px 12px 4px; font: 600 10.5px var(--font); letter-spacing: .16em; text-transform: uppercase; color: #7d8478; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; margin: 1px 0; color: var(--ink-text); font: 600 13.5px var(--font); background: transparent; border: 0; cursor: pointer; }
.nav-item:hover { background: var(--ink-line); color: var(--cream); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .pip { width: 8px; height: 8px; background: var(--soft); flex: none; }
.nav-item .pip.off { background: transparent; border: 1px solid #5d6459; }
.nav-item.active .pip { background: #fff; }
.nav-item.active .pip.off { background: transparent; border-color: #fff; }
.guild-pick { padding: 10px 16px 12px; border-bottom: 1px solid var(--ink-line); }
.guild-pick label { display: block; font-size: 12px; margin-bottom: 4px; }
.guild-pick select { width: 100%; background: #232b23; color: var(--cream); border: 1px solid var(--ink-line); padding: 6px 8px; font: 600 13.5px var(--font); }
.nav-item .count { margin-left: auto; min-width: 20px; padding: 0 6px; background: var(--accent); color: var(--ink); font: 700 11.5px/18px var(--font); text-align: center; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--ink-line); font-size: 13px; }
.drawer-foot #userName { color: var(--cream); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-foot a { color: var(--ink-text); }
.drawer-foot a:hover { color: var(--cream); }

#main { padding: 28px 32px 96px; min-width: 0; max-width: 1180px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 6px 0 4px; font-size: 30px; line-height: 1.1; }
.page-head p.muted { margin: 0; max-width: 70ch; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: var(--border); margin-bottom: 18px; }
.kpi { background: var(--surface); padding: 14px 16px; min-width: 0; }
.kpi .label { font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font: 800 28px/1.1 var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .sub { font: 12px var(--font-mono); margin-top: 3px; color: var(--muted); }

/* ---------- kart ---------- */
.cards { display: grid; gap: 18px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: var(--border); padding: 18px 20px; min-width: 0; }
.card > h2 { margin: 0 0 4px; font-size: 17px; }
.card > .lead { margin: 0 0 14px; color: var(--muted); font-size: 13px; max-width: 70ch; }
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: var(--border); border-left: 6px solid var(--accent); padding: 12px 16px; margin-bottom: 18px; }
.banner span { flex: 1; min-width: 200px; }

/* ---------- form ---------- */
.field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 6px 20px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field .name { font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.field.stack { grid-template-columns: 1fr; }
.field .ctl { justify-self: end; width: 100%; display: flex; justify-content: flex-end; }
.field.stack .ctl { justify-content: flex-start; }
input[type=text], input[type=number], select, textarea { width: 100%; background: var(--bg); color: var(--text); border: var(--border); border-radius: 0; padding: 7px 10px; font: 14px var(--font); }
input[type=number] { font-family: var(--font-mono); max-width: 140px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: #c9c5b8; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface2); border: var(--border); transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 10px; border: var(--border); background: var(--surface2); font: 600 13px var(--font); }
.chip i { width: 9px; height: 9px; background: var(--muted); flex: none; }
.chip button { border: 0; background: transparent; cursor: pointer; font: 600 15px/1 var(--font); color: var(--muted); padding: 2px 5px; }
.chip button:hover { color: var(--bad); }
.chips select { width: auto; max-width: 220px; }

.rows { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.row .unit { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.row .unit input { max-width: 96px; }

/* ---------- tablo ---------- */
.tbl-wrap { overflow-x: auto; border: var(--border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface); white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.nowrap { white-space: nowrap; }
.tbl a { color: var(--primary); font-weight: 600; }
.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }
.tag { display: inline-block; padding: 1px 8px; font: 600 11.5px var(--font); border: 1px solid var(--line); background: var(--surface2); white-space: nowrap; }
.tag.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.tag.warn { background: var(--warn); color: #1a1a1a; border-color: var(--warn); }
.tag.off { color: var(--muted); }
.bar { display: inline-block; width: 90px; height: 8px; border: 1px solid var(--line); background: var(--surface2); vertical-align: middle; margin-right: 8px; }
.bar i { display: block; height: 100%; background: var(--primary); }

.modlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: var(--border); }
.mod { background: var(--surface); padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.mod b { display: block; font: 700 15px var(--font-display); }
.mod span.d { color: var(--muted); font-size: 12.5px; }
.tips { margin: 0; padding-left: 18px; }
.tips li { margin: 6px 0; font-size: 13px; color: var(--muted); }
.tips li b { color: var(--text); }
.preview { border: var(--border); border-left: 4px solid var(--primary); background: var(--bg); padding: 10px 14px; white-space: pre-wrap; margin-top: 8px; }

/* ---------- kaydet cubugu + bildirim ---------- */
#savebar { position: fixed; left: 248px; right: 0; bottom: 0; background: var(--ink); color: var(--cream); padding: 12px 32px; display: flex; align-items: center; gap: 12px; border-top: 4px solid var(--accent); z-index: 20; }
#savebar span { flex: 1; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: var(--cream); border-left: 6px solid var(--soft); padding: 10px 16px; font-size: 13.5px; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-left-color: var(--bad); }

@media (max-width: 1180px) {
  .cards.two { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .modlist { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; }
  #drawer { position: static; height: auto; }
  #nav { display: flex; overflow-x: auto; padding: 6px 8px; }
  .nav-group { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  #main { padding: 20px 16px 110px; }
  #savebar { left: 0; padding: 10px 16px; }
  .field { grid-template-columns: 1fr; }
  .field .ctl { justify-content: flex-start; }
  .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
