/* HBA Panel */
@font-face { font-family: "Montserrat"; src: url("montserrat.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --navy: #042248; --navy-deep: #021631; --navy-2: #0b3a72;
  --gold: #D39A2B; --gold-2: #EDB64B; --gold-ink: #99690A;
  --gold-grad: linear-gradient(90deg, #BE840F, #EDB64B 55%, #C68A14);
  --bg: #F2F5FA; --surface: #FFFFFF; --ink: #042248; --text: #33445E; --muted: #5A6A82; --faint: #8C9AB0; --line: #DDE4EE;
  --good: #1F7A4D; --bad: #B4322B;
  --radius: 14px; --shadow: 0 1px 2px rgba(4,34,72,.05), 0 10px 28px -14px rgba(4,34,72,.18);
  --side: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 500; font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.boot-msg { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- giriş / kurulum ---------- */
.auth { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 600px at 15% -10%, rgba(11,58,114,.9), transparent 65%), linear-gradient(180deg, var(--navy), var(--navy-deep)); }
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; border-radius: 20px; background: var(--surface); box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); }
.auth-logo { display: grid; place-items: center; margin: -36px -32px 28px; padding: 28px; border-radius: 20px 20px 0 0; background: var(--navy); }
.auth-logo img { width: 210px; height: auto; display: block; }
.auth h1 { font-size: 22px; font-weight: 800; color: var(--ink); }
.auth .sub { margin-top: 6px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-top: 18px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input, .select { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; }
.input:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,154,43,.2); }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--faint); }
.error { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #FBECEA; color: var(--bad); font-size: 14px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s; }
.btn-gold { background: var(--gold-grad); color: var(--navy); }
.btn-gold:hover { transform: translateY(-1px); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--gold); }
.btn-danger { background: var(--surface); border-color: #E7C4C1; color: var(--bad); }
.btn-danger:hover { background: #FBECEA; }
.btn-block { width: 100%; margin-top: 24px; min-height: 48px; font-size: 15px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- iskelet ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: #B9C5D8; }
.side-logo img { width: 176px; height: auto; display: block; margin: 4px 8px 6px; }
.side-tag { margin: 0 8px 26px; font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); }
.nav { display: grid; gap: 4px; }
.nav .nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-weight: 600; font-size: 14.5px; text-align: left; transition: background-color .15s, color .15s; }
.nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav .nav-item[aria-current="page"] { background: rgba(211,154,43,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold-2); }
.nav-ic { display: grid; place-items: center; flex: none; }
.nav-ic svg { width: 19px; height: 19px; display: block; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gold-2); color: var(--navy); font-size: 12px; font-weight: 800; text-align: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.side-foot .who { min-width: 0; }
.side-foot b { display: block; color: #fff; font-weight: 700; overflow-wrap: anywhere; }
.side-foot button { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--gold-2); font-weight: 700; font-size: 13px; }
.side-foot button:hover { text-decoration: underline; }

.main-col { min-width: 0; }
.main { min-width: 0; max-width: 1280px; padding: 30px clamp(18px, 3vw, 40px) 60px; }
.topbar, .tabbar { display: none; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.head h1 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.head p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters .select { width: auto; min-width: 190px; min-height: 42px; }
.seg { display: inline-flex; padding: 4px; border-radius: 11px; background: #E4EAF3; }
.seg button { padding: 7px 15px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(4,34,72,.16); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { font-size: 15px; font-weight: 800; color: var(--ink); }
.card-title small { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.link { padding: 0; border: 0; background: none; color: var(--gold-ink); font-weight: 700; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- özet kutuları ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { position: relative; padding: 20px 22px; overflow: hidden; }
.k-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(211,154,43,.13); border: 1px solid rgba(211,154,43,.36); color: var(--gold-ink); }
.k-icon svg { width: 19px; height: 19px; display: block; }
.kpi.hero { background: linear-gradient(140deg, var(--navy-2), var(--navy) 55%, var(--navy-deep)); border-color: var(--navy); color: #B9C5D8; }
.kpi.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold-grad); }
.kpi.hero .k-label, .kpi.hero .k-sub, .kpi.hero .k-unit { color: #B9C5D8; }
.kpi.hero .k-value { color: #fff; }
.kpi.hero .k-icon { background: rgba(237,182,75,.16); border-color: rgba(237,182,75,.45); color: var(--gold-2); }
.kpi.hero .delta.up { color: #7FD9A8; }
.kpi.hero .delta.down { color: #FF9C94; }
.kpi .k-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .k-value { margin-top: 6px; font-size: clamp(30px, 3.4vw, 40px); font-weight: 800; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .k-unit { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.kpi .k-sub { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.delta { font-weight: 700; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ---------- grafik ---------- */
.chart-wrap { position: relative; }
.chart { display: block; max-width: 100%; }
.chart-wrap { min-height: 230px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-weight: 600; font-family: inherit; }
.chart .bar { fill: var(--navy); transition: fill .12s; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .bar.on { fill: var(--gold); }
.tip { position: absolute; z-index: 5; pointer-events: none; width: 168px; padding: 10px 12px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 12.5px; box-shadow: 0 12px 24px -10px rgba(0,0,0,.5); transform: translate(-50%, -100%); }
.tip b { display: block; font-size: 12px; color: var(--gold-2); margin-bottom: 4px; }
.tip span { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; }
.note { margin-top: 12px; font-size: 12.5px; color: var(--faint); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 10px; text-align: right; border-top: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { border-top: 0; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.table-scroll { max-height: 360px; overflow: auto; }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.rows li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; overflow: hidden; }
.rows li + li { margin-top: 4px; }
.rows .meter { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: rgba(4,34,72,.07); }
.rows .r-label { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.rows .r-val { position: relative; flex: none; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rows .r-val small { color: var(--faint); font-weight: 600; margin-left: 6px; }

/* ---------- mesajlar ---------- */
.inbox { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-list { max-height: calc(100vh - 190px); overflow: auto; }
.msg-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: #F7F9FC; }
.msg-item[aria-current="true"] { background: #FDF7EA; box-shadow: inset 3px 0 0 var(--gold); }
.msg-main { display: block; min-width: 0; }
.msg-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--faint); }
.msg-name { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 15px; color: var(--ink); font-weight: 600; }
.msg-item.unread .msg-name { font-weight: 800; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.msg-prev { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: rgba(4,34,72,.06); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.detail h2 { font-size: 20px; font-weight: 800; color: var(--ink); }
.detail .meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.msg-body { margin-top: 20px; padding: 18px 20px; border-radius: 12px; background: var(--bg); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }

/* ---------- siteler ---------- */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.site h2 { font-size: 18px; font-weight: 800; color: var(--ink); }
.site .domain { color: var(--gold-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.site dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.site dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.site dd { margin-top: 2px; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--good); }
.status.wait { color: var(--gold-ink); }
.site .actions { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.form-grid .field { margin-top: 0; }
pre.code { margin: 12px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--navy-deep); color: #D7E0EE; font: 500 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; }
.steps { margin-top: 12px; padding-left: 20px; list-style: decimal; display: grid; gap: 8px; font-size: 14px; }
.section-gap { margin-top: 16px; }

/* ---------- ortak küçük parçalar ---------- */
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: var(--navy); font-weight: 800; font-size: 16px; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; background: rgba(4,34,72,.08); color: var(--ink); }
.unread .avatar.sm { background: var(--navy); color: var(--gold-2); }
.avatar.sq { width: 46px; height: 46px; border-radius: 13px; background: var(--navy); color: var(--gold-2); font-size: 19px; }
.btn-ic { display: grid; place-items: center; }
.btn-ic svg { width: 16px; height: 16px; display: block; }
.empty-ic { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: rgba(4,34,72,.06); color: var(--muted); }
.empty-ic svg { width: 24px; height: 24px; }
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-head h2 { overflow-wrap: anywhere; }
.site-head { display: flex; align-items: center; gap: 14px; }
.site-head h2 { line-height: 1.25; }
.site .domain { overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -6px 0 10px; padding: 8px 12px 8px 4px; border: 0; background: none; color: var(--ink); font-weight: 700; font-size: 15px; }
.back svg { width: 20px; height: 20px; display: block; }

.recent li + li { border-top: 1px solid var(--line); }
.recent button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 4px; border: 0; background: none; text-align: left; border-radius: 8px; }
.recent button:hover { background: #F7F9FC; }
.r-main { min-width: 0; }
.r-main b { display: block; color: var(--ink); font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .unread .r-main b { font-weight: 800; }
.r-main small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-when { flex: none; color: var(--faint); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ---------- orta genişlik ---------- */
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- telefon ve tablet: üst bar + alt sekme çubuğu ---------- */
@media (max-width: 900px) {
  .shell { display: block; min-height: 100vh; min-height: 100dvh; }
  .side { display: none; }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top); box-sizing: content-box; background: var(--navy); }
  .topbar img { width: 132px; height: auto; display: block; }
  .topbar-out { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; font-weight: 700; font-size: 13px; }
  .topbar-out svg { width: 16px; height: 16px; display: block; color: var(--gold-2); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(4,34,72,.25); }
  .tabbar .nav-item { position: relative; display: grid; justify-items: center; gap: 3px; min-height: 52px; padding: 6px 4px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 700; font-size: 11.5px; }
  .tabbar .nav-ic svg { width: 22px; height: 22px; }
  .tabbar .nav-item[aria-current="page"] { color: var(--navy); background: rgba(211,154,43,.14); }
  .tabbar .nav-item[aria-current="page"] .nav-ic { color: var(--gold-ink); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 19px; padding: 0 5px; font-size: 11px; line-height: 19px; margin: 0; background: var(--gold); color: var(--navy); border: 2px solid var(--surface); box-sizing: content-box; }

  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .head { margin-bottom: 16px; gap: 12px; }
  .head h1 { font-size: 22px; }
  .filters { width: 100%; }
  .filters .select { flex: 1 1 100%; min-width: 0; min-height: 46px; }
  .seg { width: 100%; }
  .seg button { flex: 1; min-height: 40px; padding: 8px 6px; }
  .check { min-height: 44px; }
  .input, .select { font-size: 16px; } /* iOS'ta odaklanınca yakınlaştırmasın */
  .btn { min-height: 46px; }

  /* özet: Bugün tam genişlik, diğer ikisi yan yana */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
  .kpi.hero { grid-column: 1 / -1; }
  .kpi { padding: 16px; }
  .kpi:not(.hero) .k-value { font-size: 26px; }
  .kpi:not(.hero) .k-unit { display: block; margin: 2px 0 0; font-size: 12.5px; }
  .kpi:not(.hero) .k-icon { width: 32px; height: 32px; border-radius: 9px; }
  .kpi:not(.hero) .k-icon svg { width: 16px; height: 16px; }
  .kpi:not(.hero) .k-prev { display: none; }
  .k-label { font-size: 11px; }

  .card-pad { padding: 16px; }
  .card-title { align-items: flex-start; }
  .cols { gap: 12px; margin-top: 12px; }
  .section-gap { margin-top: 12px; }
  .note { font-size: 12px; }

  .msg-list { max-height: none; }
  .msg-item { padding: 14px; min-height: 64px; }
  .detail .contact-row .btn, .detail .actions .btn { flex: 1 1 100%; }
  .msg-body { padding: 16px; }

  .sites { grid-template-columns: 1fr; gap: 12px; }
  .site .actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .btn { width: 100%; }
  pre.code { font-size: 11.5px; }

  .auth { padding: 16px; align-items: start; padding-top: max(24px, 8vh); }
  .auth-card { padding: 28px 22px; }
  .auth-logo { margin: -28px -22px 24px; padding: 24px; }
}
@media (max-width: 360px) {
  .kpis { grid-template-columns: 1fr; }
  .k-sub { font-size: 12.5px; }
}
.chart .bar { pointer-events: none; }

/* kartlar içerik yüzünden genişlemesin */
.card { min-width: 0; }
.card-title > div { min-width: 0; }
.rows li { min-width: 0; }

/* seçim kutusu: her tarayıcıda aynı görünüm */
.select { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6A82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.link { white-space: nowrap; min-height: 32px; }
.card-title { flex-wrap: wrap; }
.card-title h2 { line-height: 1.3; }
.card-title small { display: block; margin-top: 2px; }
