:root {
  --bg: #f4f6fa; --card: #fff; --text: #1b2330; --muted: #6b7686; --border: #e3e7ee;
  --primary: #1f4fd1; --primary-d: #183fa8; --danger: #d32f2f; --ok: #2e7d32; --warn: #ef6c00;
  --side: #121a2b; --side-text: #c8d0de;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
a { color: var(--primary); cursor: pointer; }
h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--side); color: var(--side-text); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.sidebar nav a { color: var(--side-text); padding: 9px 12px; border-radius: 8px; text-decoration: none; }
.sidebar nav a:hover { background: #1d2740; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #fff; padding: 0 8px; }
.brand.big { color: var(--text); font-size: 22px; justify-content: center; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 800; }
main { flex: 1; padding: 26px 30px; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.btn { border: 1px solid var(--border); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { border-color: #c3cad6; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; color: var(--side-text); border-color: #2a3550; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

label { display: block; font-weight: 500; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
input[type=checkbox] { display: inline; width: auto; margin: 0 6px 0 0; }
input[type=color] { padding: 2px; height: 36px; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; font-weight: 500; margin-bottom: 10px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row > .auto { flex: 0 0 auto; min-width: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; margin: 0; }
.toolbar .grow { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; text-align: right; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: #e8ecf2; display: block; }
.title-cell { max-width: 460px; }
.title-cell b { display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #eef1f6; color: var(--muted); margin-right: 4px; }
.badge.red { background: #fde8e8; color: var(--danger); }
.badge.blue { background: #e7eefc; color: var(--primary); }
.badge.green { background: #e6f4e7; color: var(--ok); }
.badge.orange { background: #fff1e3; color: var(--warn); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: #fff4e5; border: 1px solid #ffd59e; color: #8a4b00; }
.alert.info { background: #e9f1ff; border-color: #bcd3ff; color: #1b3f8f; }
.error { color: var(--danger); min-height: 20px; margin-bottom: 8px; }

.switch-card { display: flex; gap: 16px; align-items: flex-start; }
.switch-card .body { flex: 1; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #c5ccd8; border-radius: 26px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }

.editor-tools { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; background: #f8f9fc; }
.editor-tools button { border: 1px solid transparent; background: none; padding: 4px 9px; border-radius: 6px; cursor: pointer; font: inherit; }
.editor-tools button:hover { background: #e9edf4; }
.rich { min-height: 260px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 12px; background: #fff; outline: none; }
.rich img { max-width: 100%; }
.preview-img { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; display: block; }

.bars .bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bars .bar .name { width: 110px; font-size: 13px; }
.bars .bar .track { flex: 1; height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.bars .bar .fill { height: 100%; border-radius: 6px; }
.bars .bar .val { width: 44px; text-align: right; font-size: 12px; color: var(--muted); }

.phone { width: 260px; border: 8px solid #1b2330; border-radius: 26px; padding: 12px; background: #fff; }
.phone .n-app { font-size: 11px; color: var(--muted); }
.phone .n-title { font-weight: 700; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card label { text-align: left; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: #1b2330; color: #fff; padding: 10px 18px; border-radius: 10px; transition: .25s; z-index: 50; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(15, 22, 36, .5); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal-box { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* İstatistik grafikleri */
.chart-card h2 { margin-bottom: 8px; }
.chart-card h2 .muted { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .mark { fill: var(--primary); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--primary); opacity: .08; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .dot { fill: var(--primary); stroke: var(--card); stroke-width: 2; opacity: 0; }
.chart.hovering .guide, .chart.hovering .dot.on { opacity: 1; }
.chart .mark.dim { opacity: .45; }
.tip { position: fixed; pointer-events: none; background: #1b2330; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; z-index: 60; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { font-size: 14px; }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 7px 14px; cursor: pointer; font: inherit; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--primary); color: #fff; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
details summary { cursor: pointer; color: var(--primary); margin-top: 10px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  main { padding: 16px; }
  .grid.two { grid-template-columns: 1fr; }
  .hide-m { display: none; }
}
