/* BooxVPN panel - açık/koyu tema */
:root {
  --bg: #eef2f8;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #f7f9fd 0%, rgba(247,249,253,0) 60%),
             radial-gradient(900px 500px at 100% 0%, #e7eef8 0%, rgba(231,238,248,0) 60%);
  --card: rgba(255,255,255,.82);
  --card-solid: #ffffff;
  --line: #e3e9f1;
  --line-soft: #edf1f6;
  --title: #1d2b4f;
  --text: #2b3445;
  --muted: #7b8798;
  --primary: #1f2430;
  --primary-ink: #ffffff;
  --brand: #00c8dc;
  --brand-dark: #0096a6;
  --brand-soft: #e2f8fb;
  --c-blue: #6aaee8;
  --c-green: #5cc28c;
  --c-red: #e8737a;
  --c-orange: #f0a85a;
  --c-indigo: #6f72db;
  --ok: #1f9d55;
  --ok-soft: #e3f5ea;
  --err: #d64545;
  --err-soft: #fdecec;
  --warn: #b7791f;
  --warn-soft: #fff4de;
  --input: #ffffff;
  --input-line: #d6dde7;
  --hover: #f3f6fa;
  --shadow: 0 1px 2px rgba(20,34,66,.04), 0 8px 24px rgba(20,34,66,.05);
  --radius: 16px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d1219;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #141c27 0%, rgba(20,28,39,0) 60%),
             radial-gradient(900px 500px at 100% 0%, #101a26 0%, rgba(16,26,38,0) 60%);
  --card: rgba(22,29,39,.88);
  --card-solid: #161d27;
  --line: #243041;
  --line-soft: #1d2735;
  --title: #e8eef8;
  --text: #cfd8e5;
  --muted: #8794a8;
  --primary: #e8eef8;
  --primary-ink: #111722;
  --brand-soft: #0f2f35;
  --ok-soft: #12301f;
  --err-soft: #3a1a1c;
  --warn-soft: #3a2c12;
  --input: #111823;
  --input-line: #2a3647;
  --hover: #1c2532;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.55 "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text); background: var(--bg) var(--bg-grad) fixed; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration: none; }
[data-theme="dark"] a { color: var(--brand); }
a:hover { text-decoration: underline; }
h1, h2, .kpi-val, .stat .value, .big-amount, .gauge .val, .mainnav a, .btn, .seg button, .tabs a, .auth-card h1 {
  font-family: "Outfit", "Plus Jakarta Sans", "Segoe UI", sans-serif;
}
h1 { font-size: 30px; font-weight: 600; letter-spacing: -.015em; margin: 0; color: var(--title); line-height: 1.2; }
h1 small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 14px; color: var(--title); letter-spacing: -.005em; }
.sub { color: var(--muted); margin: 6px 0 0; }
.ic { width: 18px; height: 18px; flex: none; }

/* ------------------------------------------------ üst bar */
.topbar { display: flex; align-items: center; gap: 20px; padding: 22px 32px 0; max-width: 1680px; margin: 0 auto; }
.brand { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
.brand img { height: 34px; display: block; }
[data-theme="dark"] .brand img, [data-theme="dark"] .auth-card .logo { filter: invert(1) hue-rotate(180deg); }
.mainnav {
  flex: 0 1 auto; min-width: 0; display: flex; gap: 4px; padding: 6px; border-radius: 14px; overflow-x: auto;
  background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--shadow); scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px;
  color: var(--text); font-weight: 500; white-space: nowrap;
}
.mainnav a:hover { background: var(--hover); text-decoration: none; }
.mainnav a.active { background: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 12px rgba(20,30,50,.18); }
.tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex: 1 1 0; }
.iconbtn {
  height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--line-soft); background: var(--card); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; padding: 0 12px; font: inherit; list-style: none;
}
.iconbtn:hover { background: var(--hover); }
.iconbtn.sun { background: #fff8e6; color: #c98a12; border-color: #f5e6bf; }
[data-theme="dark"] .iconbtn.sun { background: #1f2735; color: #9fb3d9; border-color: var(--line); }
.usermenu { position: relative; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu {
  position: absolute; right: 0; top: 52px; min-width: 210px; z-index: 20; padding: 6px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(20,34,66,.16);
}
.usermenu .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.usermenu .menu-head b { display: block; color: var(--title); }
.usermenu .menu-head span { color: var(--muted); font-size: 12px; }
.usermenu .menu a, .usermenu .menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 8px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--hover); text-decoration: none; }
.usermenu form { margin: 0; }

/* ------------------------------------------------ içerik */
.container { max-width: 1680px; margin: 0 auto; padding: 34px 32px 60px; }
.pagehead, .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; min-height: 64px; }
.pagehead .sub, .head .sub { margin-top: 6px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ok); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: pulse 2s infinite; }
.live.off { color: var(--err); } .live.off i { background: var(--err); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.45); } 70% { box-shadow: 0 0 0 7px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px; min-width: 0; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.container > :where(.card, .grid, .kpis, .dash, details) + :where(.card, .grid, .kpis, .dash, details) { margin-top: 20px; }
.container > h2 { margin-top: 30px; }
.container > h2 + .sub { margin: -8px 0 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 16px; flex-wrap: wrap; min-height: 36px; }
.card-head h2 { margin: 0; }
.card-foot { border-top: 1px solid var(--line-soft); margin: 18px -22px -22px; padding: 14px 22px; color: var(--muted); font-size: 12.5px; }
.meta { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* KPI kartları */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.kpi { position: relative; padding: 22px 22px 34px; overflow: hidden; min-height: 136px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi .kpi-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.kpi .kpi-top span { font-size: 12px; font-weight: 600 !important; font-weight: 500; letter-spacing: .03em; color: var(--text); text-transform: uppercase; }
.kpi .kpi-top em { font-style: normal; font-size: 11.5px; color: var(--muted); text-align: right; }
.kpi .kpi-val { font-size: 32px; font-weight: 600; color: var(--title); margin-top: 14px; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .kpi-val small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 14px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent)); }
.kpi::before { content: ""; position: absolute; right: 16px; bottom: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.c-blue { --accent: var(--c-blue); } .c-green { --accent: var(--c-green); } .c-red { --accent: var(--c-red); }
.c-orange { --accent: var(--c-orange); } .c-indigo { --accent: var(--c-indigo); }

/* stat (diğer sayfalar) */
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 26px; font-weight: 600; color: var(--title); margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 12px; }
.bar { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* gösterge paneli yerleşimi */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr); gap: 20px; align-items: stretch; }
.dash > .card, .grid > .card { display: flex; flex-direction: column; }
.scroll-y { max-height: 300px; overflow-y: auto; flex: 1; }
.scroll-y thead th { position: sticky; top: 0; background: var(--card-solid); z-index: 1; }
.card-link, .meta-link { display: inline-block; font-weight: 600; font-size: 13px; }
.card-link { margin-top: auto; padding-top: 14px; }
.svc { margin-top: 18px; }
.svc td:last-child { text-align: right; }
.legend b { color: var(--title); font-weight: 600; margin-left: 2px; }
.side { display: grid; gap: 20px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--hover); }
.seg button { border: 0; background: none; font: inherit; font-weight: 500; font-size: 13px; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 10px rgba(20,30,50,.18); }
.chart { position: relative; height: 320px; flex: 1; min-height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 4 4; }
.chart .axis { fill: var(--muted); font-size: 12px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--card-solid); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -110%); display: none; }
.chart .tip b { color: var(--title); display: block; }
.chart-foot { display: flex; align-items: center; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.pill { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--title); padding: 6px 12px; border-radius: 10px; background: var(--card-solid); border: 1px solid var(--line); }
.big-amount { font-size: 30px; font-weight: 600; color: var(--title); letter-spacing: -.02em; }
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.gauge svg { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.gauge .track { stroke: var(--line); }
.gauge .val { font-size: 22px; font-weight: 600; fill: var(--title); }
.gauge .cap { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* tablolar */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table { font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; height: 40px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; height: 46px; }
th:first-child, td:first-child { padding-left: 4px; }
th:last-child, td:last-child { padding-right: 4px; }
tbody tr:hover td { background: var(--hover); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.url { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
td:first-child { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }

/* rozetler */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-soft); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
[data-theme="dark"] .badge.brand { color: var(--brand); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3cad2; margin-right: 7px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* formlar */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--title); }
.field { margin-bottom: 14px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: 10px; font: inherit; background: var(--input); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin: 0; flex: 1; min-width: 150px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; box-shadow: 0 4px 12px rgba(20,30,50,.12);
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn.sec { background: var(--card-solid); border-color: var(--input-line); color: var(--text); box-shadow: none; }
.btn.sec:hover { background: var(--hover); opacity: 1; }
.btn.danger { background: var(--card-solid); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err); box-shadow: none; }
.btn.danger:hover { background: var(--err-soft); opacity: 1; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { border: 1px dashed var(--input-line); background: var(--card-solid); color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }

/* bildirimler */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); font-weight: 500; }
.flash.error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }

/* giriş ekranları */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card-solid); border: 1px solid var(--line-soft); border-radius: 20px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(20,34,66,.12); }
.auth-card.wide { max-width: 460px; }
.auth-card .logo { height: 40px; display: block; margin: 0 auto 26px; }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; margin: 0 0 22px; }
.auth-card .btn { width: 100%; margin-top: 4px; padding: 12px; }
.auth-card .back { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.code-input { text-align: center; font-size: 26px !important; letter-spacing: .4em; font-variant-numeric: tabular-nums; padding: 12px !important; }
.qr { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 10px; width: 210px; margin: 0 auto 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--hover); border-radius: 10px; padding: 9px; margin-bottom: 18px; word-break: break-all; color: var(--title); }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--text); font-size: 13px; }
.steps li { margin-bottom: 4px; }
.theme-float { position: fixed; top: 18px; right: 18px; }

/* diğer */
.creds { font-family: ui-monospace, Consolas, monospace; background: var(--hover); border: 1px solid var(--line); border-radius: 12px; padding: 16px; white-space: pre-wrap; font-size: 13px; color: var(--title); }
.hbar { display: grid; grid-template-columns: 130px 1fr 86px; gap: 12px; align-items: center; padding: 6px 0; }
.hbar .track { background: var(--line-soft); border-radius: 6px; height: 10px; overflow: hidden; }
.hbar .fill { background: linear-gradient(90deg, var(--c-indigo), var(--brand)); height: 100%; border-radius: 6px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.cols { display: flex; align-items: flex-end; gap: 5px; height: 180px; padding-top: 10px; }
.cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.cols .col span { width: 100%; background: linear-gradient(180deg, var(--c-indigo), color-mix(in srgb, var(--c-indigo) 45%, transparent)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.cols .col small { color: var(--muted); font-size: 10px; margin-top: 5px; white-space: nowrap; }
.tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.tabs a { padding: 7px 14px; color: var(--muted); border-radius: 9px; font-weight: 500; }
.tabs a:hover { text-decoration: none; background: var(--hover); }
.tabs a.on { background: var(--primary); color: var(--primary-ink); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
details summary { cursor: pointer; font-weight: 600; color: var(--title); }
.logo-preview { background: var(--hover); border: 1px dashed var(--input-line); border-radius: 12px; padding: 18px; display: grid; place-items: center; margin-bottom: 14px; }
.logo-preview img { max-height: 54px; max-width: 100%; }

@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
  .dash { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .mainnav { order: 3; flex: 1 1 100%; }
  .brand { margin-right: auto; }
}
@media (max-width: 760px) {
  .topbar { padding: 14px 16px 0; gap: 12px; }
  .container { padding: 22px 16px 40px; }
  .kpis, .g4, .g2 { grid-template-columns: 1fr; }
  h1 { font-size: 24px; } h1 small { display: block; margin: 4px 0 0; }
  .iconbtn.wide span { display: none; }
  .chart { height: 260px; }
  .hbar { grid-template-columns: 90px 1fr 70px; }
}

/* cihaz kurulumu */
.setup .seg.platform { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 0 20px; }
.setup .seg.platform button { flex: 1; min-width: 90px; }
.setup .pf .btn { width: 100%; margin-bottom: 14px; }
.setup .steps { margin-top: 4px; }
.kv { font-size: 13px; }
.kv td { padding: 7px 6px; border-bottom: 1px solid var(--line-soft); white-space: normal !important; }
.kv td:first-child { color: var(--muted); width: 42%; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
.cred { display: flex; gap: 18px; align-items: center; margin: 0 !important; }
.cred .qr { width: 160px; flex: none; margin: 0; }
.cred-info { flex: 1; min-width: 0; }
.cred-info .creds { word-break: break-all; }
.setup-card { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.setup-card .qr { width: 170px; margin: 0; flex: none; }
@media (max-width: 760px) { .cred-grid { grid-template-columns: 1fr; } .cred { flex-direction: column; } }
@media print {
  .topbar, .head .actions, .cred button, .flash { display: none !important; }
  body { background: #fff; } .container { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
