/* Auralix — premium tema (açık/koyu otomatik) */
:root {
  --ink: #0a1a15; --ink-2: #10271f; --ink-line: rgba(255,255,255,.08); --ink-text: #cfe3da; --ink-muted: #7fa394;
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f1f4f3; --border: #e3e8e6; --border-strong: #cfd8d4;
  --text: #14211c; --muted: #637570;
  --brand: #0c9467; --brand-600: #0a7f58; --brand-300: #4fd1a1; --brand-ink: #ffffff; --brand-soft: #e2f6ee;
  --gold: #c9a24b;
  --danger: #c0392b; --danger-soft: #fdeceb; --warn: #a96b0b; --warn-soft: #fcf2dc; --info: #1f5fa8; --info-soft: #e7f0fb;
  --in-bubble: #ffffff; --out-bubble: #d6f3e5; --chat-bg: #eef2f0;
  --shadow-sm: 0 1px 2px rgba(10,26,21,.05);
  --shadow: 0 1px 2px rgba(10,26,21,.04), 0 4px 14px rgba(10,26,21,.06);
  --shadow-lg: 0 10px 40px rgba(10,26,21,.18);
  --radius: 14px; --radius-sm: 9px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #07130f; --ink-2: #0c1f18;
    --bg: #0b1210; --surface: #121c18; --surface-2: #18251f; --border: #223029; --border-strong: #2f4238;
    --text: #e7f0ec; --muted: #8fa59c;
    --brand: #2fc08a; --brand-600: #27a877; --brand-300: #7fe0bb; --brand-ink: #03130c; --brand-soft: #123327;
    --danger: #f08577; --danger-soft: #3a1d1a; --warn: #e6b862; --warn-soft: #3a2f14; --info: #84b4ee; --info-soft: #14283f;
    --in-bubble: #1b2822; --out-bubble: #14452f; --chat-bg: #0e1713;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .hidden { display: none !important; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ===== Düzen ===== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: var(--ink-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--ink-line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; padding: 4px 10px 20px; color: #fff; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #17c58a, #0a7f58); box-shadow: 0 4px 14px rgba(23,197,138,.35), inset 0 1px 0 rgba(255,255,255,.25); }
.logo svg { width: 18px; height: 18px; fill: #fff; }
.brand small { display: block; font-weight: 500; font-size: .7rem; color: var(--ink-muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-text); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(23,197,138,.22), rgba(23,197,138,.06)); color: #fff; box-shadow: inset 2px 0 0 var(--brand-300); }
.nav a.active svg { opacity: 1; stroke: var(--brand-300); }
.nav .sec { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); padding: 14px 12px 6px; }
.side .foot { margin-top: auto; padding: 12px; border: 1px solid var(--ink-line); border-radius: 12px; background: rgba(255,255,255,.03); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1fc890, #0a7f58); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.side .foot .who { min-width: 0; flex: 1; } .side .foot .who b { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .foot .who span { color: var(--ink-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.side .foot button { background: transparent; border: 1px solid var(--ink-line); color: var(--ink-text); border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: .78rem; }
.side .foot button:hover { background: rgba(255,255,255,.08); }
.main { padding: 32px clamp(18px, 3vw, 44px); min-width: 0; max-width: 1280px; width: 100%; }
.topbar { display: none; }

/* ===== Bileşenler ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-bottom: 14px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(closest-side, var(--brand-soft), transparent); }
.stat .k { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stat .v { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; position: relative; z-index: 1; }
.stat .v small { font-size: 1rem; color: var(--muted); font-weight: 500; }

.btn { border: 1px solid var(--border-strong); background: var(--surface); padding: 9px 16px; border-radius: 10px; cursor: pointer; min-height: 40px; font-weight: 550; transition: transform .06s, background .15s, box-shadow .15s, border-color .15s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #12ad79, var(--brand-600)); color: #fff; border-color: var(--brand-600); box-shadow: 0 2px 8px rgba(12,148,103,.28), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); } .btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: .86rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input, select, textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 92px; }
.field + .field { margin-top: 14px; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.ok { background: var(--brand-soft); color: var(--brand-600); } .badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--info); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.ok { color: var(--brand); } }
.alert { padding: 12px 15px; border-radius: 11px; background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.bad { background: var(--danger-soft); color: var(--danger); }
.tablewrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; white-space: nowrap; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--surface-2); } tbody tr:last-child td { border-bottom: 0; }
.copy { display: flex; gap: 8px; } .copy input { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .82rem; background: var(--surface-2); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; background: linear-gradient(90deg, var(--brand-300), var(--brand)); border-radius: 99px; transition: width .4s; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.modal-bg { position: fixed; inset: 0; background: rgba(6,16,12,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; width: min(580px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal h2 { font-size: 1.25rem; margin-bottom: 16px; }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 30; max-width: 90vw; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.bad { background: #b3261e; }

/* ===== Giriş ===== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero { background: radial-gradient(1200px 600px at 10% -10%, #14a074 0%, transparent 55%), radial-gradient(900px 500px at 100% 110%, #0b6b4b 0%, transparent 60%), linear-gradient(160deg, #0a1a15, #0d2a20); color: #e7f5ee; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 30%, #000, transparent 70%); }
.login-hero > * { position: relative; }
.login-hero h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; color: #fff; max-width: 14ch; }
.login-hero ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; color: #bfe0d2; }
.login-hero li { display: flex; gap: 10px; align-items: flex-start; } .login-hero li::before { content: "✓"; color: var(--brand-300); font-weight: 800; }
.login-form { display: grid; place-items: center; padding: 28px; background: var(--bg); }
.login-form .box { width: min(400px, 100%); } .login-form h1 { font-size: 1.7rem; margin-bottom: 6px; }

/* ===== Gelen kutusu ===== */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 150px); min-height: 440px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.convs { border-right: 1px solid var(--border); overflow-y: auto; }
.conv { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; transition: background .12s; }
.conv:hover { background: var(--surface-2); } .conv.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.conv .name { font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.conv .prev { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.msgs { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 8px; background: var(--chat-bg); }
.bubble { max-width: min(560px, 78%); padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--in-bubble); box-shadow: var(--shadow-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.out { align-self: flex-end; background: var(--out-bubble); border-radius: 14px 14px 4px 14px; }
.bubble .meta { font-size: .7rem; color: var(--muted); margin-top: 4px; text-align: right; }
.composer { padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.back { display: none; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; } .login-hero { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 22% 0 0; z-index: 10; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
  .topbar .btn { background: transparent; color: #fff; border-color: var(--ink-line); }
  .main { padding: 18px 16px 28px; max-width: 100vw; } .two { grid-template-columns: 1fr; } .page-head > .row, .page-head > .btn { width: 100%; } td[style*="min-width"] { min-width: 150px !important; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .inbox.in-thread .convs { display: none; } .inbox:not(.in-thread) .thread { display: none; } .back { display: inline-block; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Sol şerit bölümleri: WhatsApp Business / WhatsApp ===== */
.nav .grp { margin: 3px 0; }
.grp-h { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-text); cursor: pointer; background: transparent; border: 0; text-align: left; font: inherit; transition: background .15s; }
.grp-h:hover { background: rgba(255,255,255,.06); }
.grp.open > .grp-h { background: rgba(255,255,255,.06); }
.grp-h .gi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.07); flex: none; }
.grp-h .gi svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.grp[data-g="bs"] .gi { color: var(--brand-300); background: rgba(79,209,161,.14); }
.grp[data-g="wa"] .gi { color: #e6b862; background: rgba(230,184,98,.14); }
.grp-h .gt { flex: 1; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.grp-h .gt b { color: #fff; font-weight: 650; }
.grp-h .gt small { color: var(--ink-muted); font-size: .72rem; margin-top: 2px; }
.grp-h .chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.grp.open .chev { transform: rotate(-135deg); }
.grp-b { display: none; padding: 4px 0 6px 6px; margin: 2px 0 4px 26px; border-left: 1px solid var(--ink-line); }
.grp.open .grp-b { display: block; }
.grp-b a { padding: 8px 10px; font-size: .92rem; }
.grp-empty { font-size: .8rem; color: var(--ink-muted); padding: 8px 10px; line-height: 1.5; }
.grp-h .gt b { white-space: nowrap; font-size: .93rem; }
.grp-h { gap: 9px; padding: 9px 10px; }
