/* HEPTEN panel — tasarım token'ları docs/design/DESIGN_DECISIONS.md ile aynı */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  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 {
  --ink: #1F1B1A;
  --bronze: #A96F55;
  --bronze-deep: #885635;
  --bronze-pressed: #734629;
  --bronze-light: #D9B49A;
  --canvas: #FAF7F4;
  --cream: #EADFD6;
  --blush: #F6E7E5;
  --surface: #FFFFFF;
  --surface-variant: #F3ECE6;
  --muted: #6E6360;
  --outline: #D4C6BA;
  --divider: #E4D9D0;

  --success: #2F6B4F; --success-bg: #E5EFE8;
  --warning: #8A5300; --warning-bg: #FAEBD3;
  --error: #A3352B;   --error-bg: #F8E3E0;
  --info: #2D5B7B;    --info-bg: #E2ECF3;
  --neutral: #5F5552; --neutral-bg: #EFE8E2;

  --r-sm: 6px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px;
  --sidebar: 248px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--canvas); font-variant-numeric: tabular-nums; }
a { color: var(--bronze-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 18px; line-height: 26px; }
h3 { font-size: 15px; line-height: 22px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--bronze-deep); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Layout ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--divider); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { display: block; font-size: 15px; letter-spacing: .22em; font-weight: 600; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav { padding: 4px 12px 16px; flex: 1; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-md); color: var(--ink); font-weight: 500; min-height: 40px; }
.nav a:hover { background: var(--surface-variant); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--blush); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a .count { margin-left: auto; background: var(--surface-variant); border-radius: 999px; font-size: 12px; padding: 0 8px; line-height: 20px; color: var(--muted); }
.me { border-top: 1px solid var(--divider); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 12px; color: var(--muted); }
.me form { margin: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--divider); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.topbar .crumb { font-weight: 600; }
.topbar .spacer { flex: 1; }
.org-switch svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.org-switch span { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.org-switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--outline); border-radius: var(--r-md); padding: 6px 12px; color: var(--ink); background: var(--surface); }
.content { padding: 28px; display: flex; flex-direction: column; gap: 20px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 2px; }

/* ---- Components ---- */
.card { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-xl); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--divider); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: 1.6fr 1fr; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-weight: 500; font-size: 13px; }
.kpi .value { font-size: 26px; line-height: 34px; font-weight: 600; margin-top: 6px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-md); border: 0; font: 600 14px/20px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--bronze-deep); color: #fff; }
.btn-primary:hover { background: var(--bronze-pressed); }
.btn-secondary { background: var(--surface); color: var(--bronze-deep); box-shadow: inset 0 0 0 1.5px var(--bronze-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-variant); }
.btn-danger { background: var(--error); color: #fff; }
.btn-block { width: 100%; min-height: 48px; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--cream); color: var(--muted); box-shadow: none; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--error); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-md); font: 400 14px/20px var(--font); background: var(--surface); color: var(--ink); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 2px solid var(--bronze-deep); outline-offset: 0; border-color: var(--bronze-deep); }
.input[aria-invalid="true"] { border-color: var(--error); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.error { color: var(--error); background: var(--error-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.neutral { color: var(--neutral); background: var(--neutral-bg); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); font-weight: 500; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.success { color: var(--success); background: var(--success-bg); }
.alert.warning { color: var(--warning); background: var(--warning-bg); }
.alert.error { color: var(--error); background: var(--error-bg); }
.alert.info { color: var(--info); background: var(--info-bg); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: var(--surface-variant); padding: 10px 16px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 40px; height: 40px; color: var(--bronze); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* ---- Auth / install ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--divider); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand b { font-size: 18px; letter-spacing: .24em; font-weight: 500; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--outline); border-radius: var(--r-lg); background: var(--surface); font: 500 14px/20px var(--font); cursor: pointer; color: var(--ink); }
.choice button:hover { border-color: var(--bronze-deep); background: var(--canvas); }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: center; }
.check-list .ok { color: var(--success); font-weight: 700; }
.check-list .fail { color: var(--error); font-weight: 700; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre.code { background: var(--surface-variant); border-radius: var(--r-md); padding: 12px; overflow-x: auto; margin: 0; }

/* ---- Responsive: 1024 resepsiyon tableti ---- */
@media (max-width: 1180px) {
  :root { --sidebar: 72px; }
  .brand div, .nav-group, .nav a span.label, .nav a .count, .me .who, .me form { display: none; }
  .brand { justify-content: center; padding: 18px 0; }
  .nav a { justify-content: center; padding: 10px; }
  .me { justify-content: center; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .nav { display: flex; padding: 8px; gap: 4px; }
  .me { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---- Form/aksiyon yardımcıları ---- */
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--bronze-deep); flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 600; background: var(--surface); border: 1px solid var(--divider); }
.tabs a[aria-current="page"] { background: var(--blush); border-color: var(--bronze-light); }
.tabs a:hover { text-decoration: none; background: var(--surface-variant); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { min-width: 160px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: var(--warning-bg); padding: 10px 14px; border-radius: var(--r-md); display: inline-block; letter-spacing: .04em; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.msg { padding: 12px 14px; border-radius: var(--r-lg); max-width: 640px; }
.msg.customer { background: var(--surface-variant); }
.msg.support { background: var(--blush); margin-left: auto; }
.cal { display: grid; gap: 1px; background: var(--divider); border: 1px solid var(--divider); border-radius: var(--r-lg); overflow: hidden; }
.cal > div { background: var(--surface); padding: 8px; min-height: 40px; font-size: 12px; }
.cal .head { background: var(--surface-variant); font-weight: 700; text-align: center; }
.cal .time { background: var(--surface-variant); font-weight: 600; color: var(--muted); }
.cal .slot-full { background: var(--blush); }
.cal .slot-some { background: #FBF3EE; }
.cal .slot-closed { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-variant) 6px, var(--surface-variant) 12px); color: var(--muted); }
.scan { position: relative; background: #141110; border-radius: var(--r-xl); min-height: 360px; display: grid; place-items: center; overflow: hidden; color: #EADFD6; }
.scan video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.scan .frame { width: 220px; height: 220px; border: 2px solid var(--bronze-light); border-radius: 20px; position: relative; z-index: 1; }
.scan .label { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 13px; z-index: 1; }
.code-input { font-family: ui-monospace, Menlo, monospace; font-size: 24px; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
@media (max-width: 1180px) { .grid.three { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Markdown düzenleyici (md-editor.js) */
.md-editor { border: 1px solid var(--outline); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.md-editor:focus-within { border-color: var(--bronze-deep); box-shadow: 0 0 0 1px var(--bronze-deep); }
.md-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border-bottom: 1px solid var(--divider); background: var(--surface-variant); }
.md-btn { min-height: 34px; padding: 4px 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; font: 600 13px/1 var(--font); color: var(--ink); cursor: pointer; }
.md-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--outline); }
.md-btn:disabled { opacity: .45; cursor: not-allowed; }
.md-btn-primary { background: var(--bronze-deep); color: #fff; }
.md-btn-primary:hover:not(:disabled) { background: var(--bronze-pressed); border-color: var(--bronze-pressed); }
.md-spacer { flex: 1; }
.md-modes { display: inline-flex; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-sm); overflow: hidden; }
.md-modes button { min-height: 32px; padding: 4px 10px; border: 0; background: transparent; font: 600 12px/1 var(--font); color: var(--muted); cursor: pointer; }
.md-modes button[aria-selected="true"] { background: var(--blush); color: var(--ink); }
.md-body { display: grid; grid-template-columns: 1fr; }
.md-split .md-body { grid-template-columns: 1fr 1fr; }
.md-split .md-preview { border-left: 1px solid var(--divider); }
.md-body textarea.input { border: 0; border-radius: 0; min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 20px; }
.md-body textarea.input:focus { outline: none; }
.md-preview { padding: 14px 16px; min-height: 260px; max-height: 70vh; overflow: auto; font-size: 15px; line-height: 23px; }
.md-preview p { margin: 0 0 12px; }
.md-preview h3 { font-size: 19px; margin: 12px 0 8px; }
.md-preview h4 { font-size: 16px; margin: 12px 0 8px; }
.md-li { display: flex; gap: 8px; margin: 0 0 8px 4px; }
.md-link { color: var(--bronze-deep); text-decoration: underline; font-weight: 600; }
.md-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--blush); color: var(--muted); font-size: 10px; line-height: 16px; font-weight: 600; text-decoration: none; vertical-align: 1px; }
.md-bad { color: var(--error); text-decoration: line-through; }
.md-help { padding: 6px 10px; border-top: 1px solid var(--divider); background: var(--surface-variant); }
.md-dialog { width: min(560px, 94vw); padding: 0; border: 1px solid var(--outline); border-radius: var(--r-xl); }
.md-dialog::backdrop { background: rgba(31, 27, 26, .35); }
.md-dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--divider); }
.md-dialog .md-tabs { display: flex; gap: 4px; padding: 10px 12px 0; }
.md-dialog .md-tabs button { min-height: 34px; padding: 4px 12px; border: 1px solid var(--outline); border-radius: 999px; background: var(--surface); font: 600 13px/1 var(--font); cursor: pointer; }
.md-dialog .md-tabs button[aria-selected="true"] { background: var(--blush); border-color: var(--bronze-light); }
.md-dialog .md-q { margin: 10px 12px; width: calc(100% - 24px); }
.md-results { max-height: 50vh; overflow: auto; padding: 0 6px; }
.md-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: var(--r-md); background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.md-item:hover, .md-item:focus-visible { background: var(--surface-variant); }
.md-item img, .md-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--blush); flex: none; }
.md-item span:not(.badge):not(.md-ph) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.md-item small { color: var(--muted); }
.md-hint { padding: 8px 16px 14px; margin: 0; }
@media (max-width: 760px) { .md-split .md-body { grid-template-columns: 1fr; } .md-split .md-preview { border-left: 0; border-top: 1px solid var(--divider); } }
