/* SoundBot Panel — v2 profesyonel SaaS tema. Tüm sınıf adları eski markup ile birebir uyumlu;
   tema token'ları: light (bare :root) + dark (prefers-color-scheme + [data-theme]). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f6f9; --bg-soft: #eef0f5; --panel: #ffffff; --panel-2: #fbfbfd;
  --text: #15171e; --muted: #68708a; --border: #e6e8f0; --border-soft: #eef0f6;
  --accent: #6366f1; --accent-hover: #4f46e5; --accent-soft: rgba(99,102,241,.10); --accent-ring: rgba(99,102,241,.28);
  --ok: #15a34a; --err: #dc2626; --warn: #d97706;
  --sidebar-bg: #14161f; --sidebar-bg2: #1b1e2a; --sidebar-text: #aeb4c6; --sidebar-active: #818cf8;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 30px rgba(16,24,40,.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e13; --bg-soft: #111420; --panel: #15181f; --panel-2: #191d26;
    --text: #e8eaf0; --muted: #98a0b4; --border: #262a35; --border-soft: #20242e;
    --accent: #818cf8; --accent-hover: #6366f1; --accent-soft: rgba(129,140,248,.14); --accent-ring: rgba(129,140,248,.30);
    --sidebar-bg: #0b0d12; --sidebar-bg2: #12151d; --sidebar-text: #aab0c2;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e13; --bg-soft: #111420; --panel: #15181f; --panel-2: #191d26;
  --text: #e8eaf0; --muted: #98a0b4; --border: #262a35; --border-soft: #20242e;
  --accent: #818cf8; --accent-hover: #6366f1; --accent-soft: rgba(129,140,248,.14); --accent-ring: rgba(129,140,248,.30);
  --sidebar-bg: #0b0d12; --sidebar-bg2: #12151d; --sidebar-text: #aab0c2;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; opacity: .88; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; color: var(--sidebar-text); display: flex; flex-direction: column;
  padding: 20px 14px; background: linear-gradient(180deg, var(--sidebar-bg2), var(--sidebar-bg));
  position: sticky; top: 0; height: 100vh; }
.brand { padding: 2px 10px 22px; }
.brand img { max-width: 170px; width: 100%; height: auto; display: block; }
.brand-sub { font-size: 11px; font-weight: 500; color: #828aa0; margin-top: 3px; letter-spacing: 0; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--sidebar-text);
  border-radius: 9px; font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s; }
.sidebar nav a .ic { display: inline-flex; width: 18px; justify-content: center; font-size: 15px; opacity: .9; }
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.active { background: var(--accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-active); }
.sidebar .foot { padding-top: 14px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 9px; }
.whoami { font-size: 12.5px; color: #c3c8d6; display: flex; align-items: center; gap: 7px; font-weight: 600; }
.whoami::before { content: ""; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7); }
.role-badge { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.role-admin { background: #7c3aed33; color: #c4b5fd; }
.role-reseller { background: #0ea5e933; color: #7dd3fc; }
.role-user { background: #16a34a33; color: #86efac; }
.theme-toggle { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text);
  padding: 8px 11px; border-radius: 9px; cursor: pointer; text-align: left; font-size: 12.5px; font-family: inherit; transition: background .15s; }
.theme-toggle:hover { background: rgba(255,255,255,.09); }
.sidebar .foot > a { color: #c3c8d6; font-size: 12.5px; padding: 7px 11px; border-radius: 9px; }
.sidebar .foot > a:hover { background: rgba(255,255,255,.05); color: #fff; }

.main { flex: 1; min-width: 0; padding: 30px 38px; max-width: 1180px; }
h1 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 22px; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 26px 0 12px; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card h2:first-child, .card h2[style*="margin-top:0"] { margin-top: 0; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-soft); }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 14px; }
.form-row label, label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font-size: 13.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 600;
  font-family: inherit; transition: transform .12s, box-shadow .15s, background .15s, filter .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--accent-ring); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

/* ---------- Flash / badges ---------- */
.flash { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.flash.ok { background: #16a34a1a; color: var(--ok); border-color: #16a34a40; }
.flash.err, .flash.error { background: #dc26261a; color: var(--err); border-color: #dc262640; }
.err, .error { color: var(--err); }
.lock-badge { display: inline-block; font-size: 11px; color: var(--warn); margin-left: 8px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.online { background: #16a34a1a; color: var(--ok); }
.badge.offline { background: #6b72801a; color: var(--muted); }
.badge.error { background: #dc26261a; color: var(--err); }
.badge.provisioning, .badge.suspended, .badge.pending { background: #d977061a; color: var(--warn); }

/* ---------- Stat tiles ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), #a855f7); }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 9px 15px; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs a.active { background: var(--panel); color: var(--accent); border: 1px solid var(--border); border-bottom-color: var(--panel); margin-bottom: -1px; }

/* ---------- Mono / install command ---------- */
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--bg-soft); padding: 1px 6px; border-radius: 5px; }
.install-cmd { background: #0b0d12; color: #86efac; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto;
  border: 1px solid #1f2430; font-size: 12.5px; line-height: 1.6; }
.muted { color: var(--muted); font-size: 12.5px; }
.small { font-size: 12px; }

/* ---------- Auth (login / register) ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 36px 32px; width: 370px; max-width: 100%; box-shadow: var(--shadow-lg); }
.login-card h1 { text-align: center; font-size: 24px; margin: 0 0 6px; }
.login-card h1::before { content: ""; display: block; width: 58px; height: 58px; margin: 0 auto 14px;
  background: url("/assets/brand/logo-mark.png") center/contain no-repeat; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 14px; }
  .brand { padding: 0; margin-right: auto; }
  .brand img { max-width: 130px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; gap: 4px; order: 3; }
  .sidebar nav a { padding: 8px 11px; }
  .sidebar .foot { flex-direction: row; align-items: center; flex-wrap: wrap; border-top: none; margin-top: 0; padding-top: 0; }
  .main { padding: 20px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ===== v2.1 topbar + user menu + SVG nav icons ===== */
.sidebar nav a .ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .95; }
.sidebar nav a .ic svg { width: 18px; height: 18px; }
.main { padding: 0; max-width: none; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 32px; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.balance-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 22px; background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.balance-chip .ic svg { width: 16px; height: 16px; color: var(--accent); }
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border); border-radius: 30px;
  padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text); font-family: inherit; }
.usermenu-btn:hover { background: var(--bg-soft); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.usermenu-name { font-weight: 600; font-size: 13px; }
.usermenu-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.usermenu-drop a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; color: var(--text); font-size: 13.5px; font-weight: 500; }
.usermenu-drop a:hover { background: var(--bg-soft); }
.usermenu-drop a .ic svg { width: 16px; height: 16px; color: var(--muted); }
.usermenu-drop a.danger-link { color: var(--err); margin-top: 2px; border-top: 1px solid var(--border-soft); border-radius: 0 0 9px 9px; }
.content { padding: 28px 32px; width: 100%; max-width: 1180px; }
@media (max-width: 860px) {
  .topbar { padding: 11px 16px; flex-wrap: wrap; }
  .usermenu-name { display: none; }
  .content { padding: 20px 16px; }
  .balance-chip { font-size: 12.5px; padding: 6px 11px; }
}

.usermenu-drop[hidden] { display: none; }

/* ===== 2026-11-09 müşteri paneli: bildirim, destek, hizmetler, güvenlik ===== */
.flash.warn { background: #d977061a; color: var(--warn); border-color: #d9770640; }
.flash.warn a, .flash.ok a { font-weight: 700; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; color: var(--text); background: var(--panel-2); }
.bell-btn:hover { background: var(--bg-soft); }
.bell-btn .ic svg { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--panel); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 12.5px; font-weight: 600; background: var(--panel); }
.chips a.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap table { min-width: 560px; }
.badge.answered { background: #16a34a1a; color: var(--ok); }
.badge.open, .badge.customer_reply { background: #d977061a; color: var(--warn); }
.badge.closed { background: #6b72801a; color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--panel-2); max-width: 820px; min-width: 0; }
.msg.staff { border-color: var(--accent-ring); background: var(--accent-soft); margin-left: auto; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg-head b { color: var(--text); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.notif-list li:last-child { border-bottom: none; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; margin-top: 6px; flex-shrink: 0; }
.notif-list li.unread .notif-dot { background: var(--accent); }
.notif-list li.unread .notif-title { font-weight: 700; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; color: var(--text); }
.notif-body { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notif-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.svc { display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.svc:hover { border-color: var(--accent); }
.svc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.svc-name { font-weight: 700; font-size: 16px; }
.meter { height: 8px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--border-soft); }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #a855f7); }
.meter.warn > span { background: var(--warn); }
.meter.err > span { background: var(--err); }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-row { margin-bottom: 0; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.switch-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }
.switch-row label { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 500; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.codes code { display: block; text-align: center; padding: 8px; font-size: 14px; letter-spacing: .06em; }
.qrbox { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; border: 1px solid var(--border); }
.qrbox img, .qrbox svg { display: block; width: 180px; height: 180px; }
.login-card .muted a { font-weight: 600; }
.tk-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) {
  .bell-btn { width: 34px; height: 34px; }
  .tk-layout { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
