:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #17202b;
  --muted: #5d6877;
  --faint: #8a94a3;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --good: #1a7f4b;
  --good-soft: #e5f4ec;
  --warn: #9a6200;
  --warn-soft: #fdf3e1;
  --bad: #c0362c;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --sidebar: 248px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- layout */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: #101826; color: #c9d1dc; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 18px 18px 10px; font-weight: 700; color: #fff; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #2f81f7, #22c3a6); }
.brand small { display: block; font-weight: 400; color: #8a97a8; font-size: 11px; }
.org-switch { margin: 6px 14px 12px; }
.org-switch select { width: 100%; background: #1a2433; color: #e6ebf2; border: 1px solid #2a3647; border-radius: 8px; padding: 8px; font-size: 13px; }
.nav { list-style: none; margin: 0; padding: 4px 8px 16px; }
.nav li a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: #c9d1dc; font-size: 14px;
}
.nav li a:hover { background: #1a2433; text-decoration: none; color: #fff; }
.nav li a.active { background: #22324a; color: #fff; }
.nav .tag { margin-left: auto; font-size: 10px; color: #8a97a8; border: 1px solid #2a3647; border-radius: 99px; padding: 0 6px; }
.nav-sep { height: 1px; background: #1f2a3a; margin: 8px 10px; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.sidebar-foot { margin-top: auto; padding: 12px 18px 18px; font-size: 12px; color: #8a97a8; border-top: 1px solid #1f2a3a; }
.sidebar-foot button { margin-top: 8px; }

.main { min-width: 0; }
.topbar {
  display: none; align-items: center; gap: 12px; padding: 10px 14px; background: #101826; color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
.content { padding: 28px 32px 60px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 720px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { display: flex; }
  .content { padding: 18px 14px 50px; }
}

/* ---------- components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.kpi .value.na { color: var(--faint); }
.kpi .hint { color: var(--faint); font-size: 12px; margin-top: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--good); background: var(--good-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.bad { color: var(--bad); background: var(--bad-soft); }
.badge.muted { color: var(--muted); background: var(--surface-2); }
.badge.info { color: var(--accent); background: var(--accent-soft); }

.notice { border-radius: 8px; padding: 12px 14px; font-size: 14px; border: 1px solid; }
.notice.info { background: var(--accent-soft); border-color: #c8dafc; color: #163a7a; }
.notice.warn { background: var(--warn-soft); border-color: #f0dbb1; color: #6b4600; }
.notice.bad { background: var(--bad-soft); border-color: #f2c6c0; color: #7d2019; }
.notice strong { display: block; margin-bottom: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.list .meta { color: var(--muted); font-size: 13px; }

.empty { text-align: center; padding: 36px 16px; }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty .icon svg { width: 22px; height: 22px; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 560px; margin: 0 auto 10px; }
.empty ul { text-align: left; display: inline-block; color: var(--muted); margin: 6px 0 0; padding-left: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* ---------- forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 8px 14px; font-size: 14px; font-weight: 550; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #1a5fd0; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=time], select, textarea {
  width: 100%; border: 1px solid #cfd5dd; border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid #9cc0fa; outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.hours { display: grid; grid-template-columns: 90px 70px 1fr 1fr; gap: 6px 10px; align-items: center; font-size: 14px; }
.hours input[type=time] { padding: 6px 8px; }
@media (max-width: 480px) { .hours { grid-template-columns: 70px 60px 1fr 1fr; } }

.copy { display: flex; gap: 6px; align-items: center; }
.copy code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; overflow-x: auto; white-space: nowrap; flex: 1; }

/* ---------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand small { color: var(--muted); }
.auth-alt { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(16, 24, 38, .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #17202b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); max-width: 360px; }
.toast.bad { background: var(--bad); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.steps li:first-child { border-top: 0; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; background: var(--surface-2); color: var(--muted); }
.steps .dot.done { background: var(--good); color: #fff; }
.biz-sites { margin-top: 10px; }
.pill { display: inline-block; background: var(--surface-2); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); }
.mb { margin-bottom: 8px; }
.grid > .card + .card { margin-top: 0; }
.nav .tag { white-space: nowrap; }
.nav li a { line-height: 1.3; }
.shell.nav-open .main::after { content: ""; position: fixed; inset: 0; background: rgba(16, 24, 38, .45); z-index: 30; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select { width: auto; min-width: 150px; }
.check.inline { margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
table.visits td { font-size: 13px; }
table.visits .badge { margin-top: 3px; }
table.kv th { text-transform: none; letter-spacing: 0; font-size: 13px; width: 45%; color: var(--muted); font-weight: 500; }
table.kv th, table.kv td { padding: 6px 8px; }
.warn-text { color: var(--warn) !important; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 6px 0 6px 16px; font-size: 14px; display: flex; gap: 10px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.timeline li.tl-strong::before { background: var(--good); }
.timeline li.tl-strong { font-weight: 600; }
.tl-time { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); min-width: 64px; }
.modal.wide { max-width: 860px; }
pre.code { background: #0f1722; color: #e6edf3; border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; margin: 0 0 8px; }
.mt-s { margin-top: 6px; }
.mode-list { display: grid; gap: 8px; }
.mode-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.mode-item input { margin-top: 4px; }
.mode-item.locked { opacity: .6; cursor: not-allowed; }
.mode-title { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table.matrix td.ok { color: var(--good); font-weight: 700; text-align: center; }
table.matrix td.no { color: var(--faint); text-align: center; }
table.matrix th { text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }

/* v0.4: Google Ads raporları */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line, #e5e7eb); margin-bottom: 12px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; opacity: .75; }
.tab.active { border-bottom-color: #2563eb; opacity: 1; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 8px; }
.bars .bar { flex: 1; background: #2563eb; opacity: .75; border-radius: 2px 2px 0 0; min-width: 2px; }
.bars .bar:hover { opacity: 1; }
table.heat td { text-align: center; font-size: 11px; padding: 4px 2px; min-width: 22px; }
table.heat th { font-size: 11px; padding: 4px 2px; }
td.right, th.right { text-align: right; white-space: nowrap; }
details > summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
