/* ============================================================================
   XenForo Mobile — Müşteri Paneli · Tasarım Sistemi
   Açık, modern SaaS estetiği (coral vurgu, sol menü, beyaz kartlar).
   Değişken adları korunur; inline <style>'lar da bunları kullandığından tüm
   sayfalar tek kaynaktan güncellenir.
   ============================================================================ */
:root {
  /* Yüzeyler & metin */
  --bg: #ebedf0;
  --panel: #ffffff;
  --panel2: #f4f5f7;
  --line: #e5e8ec;
  --line-soft: #eef0f3;
  --txt: #1a1f26;
  --muted: #6a7482;

  /* Marka (coral) */
  --brand: #ef5a2a;
  --brand2: #f6774f;
  --brand-grad: linear-gradient(135deg, #f0562e 0%, #f97b4f 100%);
  --brand-tint: rgba(239, 90, 42, .10);

  /* Anlamsal durum */
  --ok: #16a34a;
  --off: #dc2626;
  --wait: #d97706;

  /* Şekil & derinlik */
  --radius: 16px;
  --radius-sm: 11px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px -14px rgba(16, 24, 40, .14);
  --shadow-pop: 0 24px 48px -20px rgba(16, 24, 40, .25);
  --ring: 0 0 0 4px rgba(239, 90, 42, .18);

  --font: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand2); }

code {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: .86em;
  color: #b0491f;
}

::selection { background: rgba(239, 90, 42, .18); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* =============================================================== App shell */
.shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  font-size: 1.06rem;
  letter-spacing: -.02em;
  color: var(--txt);
  padding: 4px 6px 18px;
}
.sidebar .brand::before {
  content: "";
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px -5px rgba(239, 90, 42, .7), inset 0 0 0 1px rgba(255, 255, 255, .25);
  flex: 0 0 auto;
}
.sidebar .brand span {
  font-weight: 650;
  font-size: .72rem;
  color: var(--brand);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
}

.nav-section {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}
.side-nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #465061;
  font-size: .92rem;
  font-weight: 600;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: var(--panel2); color: var(--txt); }
.nav-item .ni-ic { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; }
.nav-item .ni-ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(239, 90, 42, .7);
}
.nav-item.active:hover { color: #fff; }
.nav-item.ghost { color: var(--muted); }
.nav-item.ghost:hover { color: var(--off); background: rgba(220, 38, 38, .08); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--panel2);
}
.su-av {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: .85rem;
  text-transform: uppercase;
}
.su-name { font-size: .84rem; font-weight: 600; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ Layout */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 34px 34px 64px; }
.wrap-auth {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
h1 { font-size: 1.7rem; font-weight: 750; letter-spacing: -.025em; margin: 0 0 22px; line-height: 1.18; }
h2 { font-size: 1.16rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 14px; }
p { margin: 0 0 12px; }

/* ------------------------------------------------------------------- Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.card.auth {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 30px;
}
.card.auth h1 { margin-bottom: 6px; font-size: 1.5rem; }
.card.empty { text-align: center; padding: 48px 28px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--muted); }

/* --------------------------------------------------------------- Forms */
label { display: block; margin: 15px 0 0; font-size: .82rem; font-weight: 650; color: #47505f; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #9aa4b2; }
input:hover, select:hover, textarea:hover { border-color: #cfd5dd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

/* Butonlar */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 650;
  font-size: .93rem;
  cursor: pointer;
  box-shadow: 0 8px 18px -9px rgba(239, 90, 42, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, .btn:hover { filter: brightness(1.05); box-shadow: 0 12px 24px -10px rgba(239, 90, 42, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.25); }
button.mini { padding: 6px 12px; font-size: .8rem; font-weight: 600; border-radius: 8px; }
form button { margin-top: 12px; }

/* İkincil / hayalet buton (buton veya <a>) */
.btn-ghost, button.ghost-btn, .btn-secondary {
  background: var(--panel);
  color: var(--txt);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover, button.ghost-btn:hover, .btn-secondary:hover {
  filter: none;
  border-color: var(--brand);
  color: var(--brand);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------- Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.4;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok { background: rgba(22, 163, 74, .12); color: var(--ok); }
.badge.off { background: rgba(220, 38, 38, .11); color: var(--off); }
.badge.wait { background: rgba(217, 119, 6, .13); color: var(--wait); }

/* --------------------------------------------------------- Anahtar/değer */
dl.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
dl.kv dt {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
  padding: 11px 15px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}
dl.kv dd { margin: 0; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: .92rem; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }

/* ------------------------------------------------------------------ Flash */
.flash {
  position: relative;
  padding: 13px 16px 13px 44px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: .92rem;
  font-weight: 550;
  border: 1px solid transparent;
}
.flash::before {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: .74rem; font-weight: 800;
}
.flash-success { background: rgba(22, 163, 74, .09); color: #15803d; border-color: rgba(22, 163, 74, .25); }
.flash-success::before { content: "✓"; background: rgba(22, 163, 74, .18); color: var(--ok); }
.flash-error { background: rgba(220, 38, 38, .08); color: #b91c1c; border-color: rgba(220, 38, 38, .24); }
.flash-error::before { content: "!"; background: rgba(220, 38, 38, .16); color: var(--off); }
.flash-info { background: var(--brand-tint); color: #c2451e; border-color: rgba(239, 90, 42, .24); }
.flash-info::before { content: "i"; background: rgba(239, 90, 42, .18); color: var(--brand); }

/* ------------------------------------------------------------------ Tables */
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 12px;
  font-size: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
table.grid th, table.grid td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.grid thead th {
  color: var(--muted);
  font-weight: 650;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--panel2);
}
table.grid tbody tr { transition: background .12s ease; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid tbody tr:last-child td { border-bottom: 0; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
form.inline button { margin: 0; }
form.lic-form { display: flex; gap: 6px; align-items: center; margin: 0; }
form.lic-form input { width: auto; margin: 0; padding: 7px 10px; font-size: .84rem; }
form.lic-form button { margin: 0; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .sidebar .brand { padding: 0 6px 0 0; font-size: 1rem; }
  .sidebar .brand::before { width: 28px; height: 28px; border-radius: 9px; }
  .nav-section { display: none; }
  .side-nav { flex-direction: row; gap: 4px; }
  .nav-item { padding: 8px 11px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding-top: 0; }
  .side-user { display: none; }
  .wrap { padding: 22px 18px 48px; }
  h1 { font-size: 1.42rem; }
  .card { padding: 18px; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 2px; }
  table.grid { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
