/*
  Chatmail — panel stil dosyası (assets/css/panel.css)
  Müşteri paneli (panel/, admin/) ve giriş/kayıt sayfalarındaki uyarı kutuları için.
  Site ile aynı tasarım dili: yeşil #0F7A44, Bricolage Grotesque + Manrope, tek easing.
  Yapı: 1 değişkenler · 2 yerleşim (yan menü, üst çubuk) · 3 bileşenler (kart, buton, form, tablo,
  rozet, uyarı) · 4 sayfaya özel (istatistik, sihirbaz, önizleme) · 5 mobil.
  Yan menü mobilde çekmece olur; hareketler yalnızca transform/opacity, reduced-motion'a saygılı.
*/

/* 1. Değişkenler */
:root {
  --ink: #0B1220; --paper: #fff; --soft: #F4F6F9; --line: #E5E7EB; --line-soft: #F3F4F6;
  --muted: #4B5563; --text2: #1F2937;
  --green: #0F7A44; --green-dark: #0B5C33; --green-bright: #3DDC84; --green-tint: #E6F6EE;
  --blue: #1F5FD6; --blue-tint: #E8EFFC; --amber: #92400E; --amber-tint: #FEF3C7;
  --red: #B42318; --red-tint: #FDECEA;
  --font-display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side-w: 248px;
}

/* 2. Yerleşim */
body.app { margin: 0; font-family: var(--font-body); background: var(--soft); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.app *, body.app *::before, body.app *::after { box-sizing: border-box; }
body.app a { color: var(--green); }
body.app a:hover { color: var(--green-dark); }
body.app h1, body.app h2, body.app h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; }
body.app :focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--ink); color: #CBD5E1; display: flex; flex-direction: column; padding: 20px 14px; z-index: 40; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 22px; font: 800 22px/1 var(--font-display); color: #fff; letter-spacing: -.03em; }
body.app .side-brand:hover { color: #fff; }
.side-brand em { font-style: normal; color: var(--green-bright); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
body.app .side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #CBD5E1; text-decoration: none; font-weight: 600; font-size: 15px; transition: background .2s var(--ease), color .2s var(--ease); }
body.app .side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
body.app .side-nav a.is-active { background: rgba(61,220,132,.14); color: #fff; }
body.app .side-nav a.is-active svg { color: var(--green-bright); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 18px; }
.tenant-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 14px; }
.tenant-card strong { color: #fff; font-size: 14px; word-break: break-word; }
.tenant-card small { color: #94A3B8; font-size: 12px; }
.side-logout { width: 100%; min-height: 40px; background: transparent; border: 1px solid rgba(255,255,255,.18); color: #CBD5E1; border-radius: 10px; font: 600 14px var(--font-body); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.side-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { margin-left: var(--side-w); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: rgba(244,246,249,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-title { font-size: 22px; font-weight: 800; }
.top-user { margin-left: auto; font-size: 14px; color: var(--muted); font-weight: 600; }
.content { padding: 28px; max-width: 1180px; display: flex; flex-direction: column; gap: 20px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.menu-btn span:nth-child(1) { top: 15px; } .menu-btn span:nth-child(2) { top: 21px; } .menu-btn span:nth-child(3) { top: 27px; }
.menu-btn.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.side-scrim { position: fixed; inset: 0; background: rgba(11,18,32,.5); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); z-index: 30; }
.side-scrim.is-open { opacity: 1; pointer-events: auto; }

/* 3. Bileşenler */
.p-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.p-card h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.p-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.p-card + .p-card { margin-top: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.hint { font-weight: 500; color: var(--muted); font-size: 13px; }

.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 700 14px var(--font-body); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease); white-space: nowrap; }
body.app a.p-btn { color: var(--ink); }
.p-btn:hover { transform: translateY(-1px); border-color: #9CA3AF; }
.p-btn:active { transform: scale(.98); }
.p-btn-primary, body.app a.p-btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.p-btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.p-btn-danger, body.app a.p-btn-danger { color: var(--red); border-color: #F3C4BF; }
.p-btn-danger:hover { background: var(--red-tint); border-color: var(--red); }
.p-btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.p-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .p-label { font-size: 14px; font-weight: 700; }
.p-input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid #D1D5DB; border-radius: 10px; background: #fff; font: 500 15px var(--font-body); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
textarea.p-input { min-height: 120px; resize: vertical; line-height: 1.5; }
.p-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,122,68,.15); }
.p-input[hidden] { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.choice { display: flex; gap: 12px; flex-wrap: wrap; }
.choice label { flex: 1 1 200px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.choice label:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.choice input { accent-color: var(--green); margin-top: 3px; }
.choice strong { display: block; }
.choice span { font-size: 13px; color: var(--muted); }
form [hidden] { display: none !important; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FAFBFC; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a.name { font-weight: 700; color: var(--ink); text-decoration: none; }
.tbl a.name:hover { color: var(--green); }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.badge-green { background: var(--green-tint); color: var(--green-dark); }
.badge-blue { background: var(--blue-tint); color: var(--blue); }
.badge-amber { background: var(--amber-tint); color: var(--amber); }
.badge-red { background: var(--red-tint); color: var(--red); }
.badge-gray { background: var(--line-soft); color: var(--muted); }
.tag { display: inline-block; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 12px; margin: 0 4px 2px 0; color: var(--text2); }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; border: 1px solid; }
.alert-ok { background: var(--green-tint); color: var(--green-dark); border-color: #BFE6D1; }
.alert-error { background: var(--red-tint); color: var(--red); border-color: #F3C4BF; }
.alert-warn { background: var(--amber-tint); color: var(--amber); border-color: #F6DE9B; }
.auth-box .alert { margin: 0; }

.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink); padding: 0 8px; }
.pager a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 800 18px var(--font-display); margin-bottom: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .p-input { width: auto; min-width: 180px; }

/* 4. Sayfaya özel */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; animation: rise .5s var(--ease) both; }
.stat:nth-child(2) { animation-delay: .05s; } .stat:nth-child(3) { animation-delay: .1s; } .stat:nth-child(4) { animation-delay: .15s; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat .v { font: 800 30px/1.1 var(--font-display); letter-spacing: -.03em; margin-top: 4px; }
.stat .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bar { height: 8px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transform-origin: left; animation: grow .8s var(--ease) both; }
.bar.blue > i { background: var(--blue); }
.funnel { display: flex; flex-direction: column; gap: 14px; }
.funnel .fl { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.steps-list { display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps-list li { list-style: none; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; }
.steps-list li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.steps-list li.done::before { content: "✓"; background: var(--green); color: #fff; }
.steps-list a { margin-left: auto; font-size: 13px; }
.steps-list { padding: 0; margin: 0; }
.var-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.var-row .p-input { flex: 1 1 160px; width: auto; }
.var-tag { font: 700 13px ui-monospace, monospace; background: var(--soft); border-radius: 6px; padding: 4px 8px; }
.tpl-body { white-space: pre-wrap; background: #DCF8C6; border-radius: 12px 12px 12px 2px; padding: 12px 14px; font-size: 14px; max-width: 420px; margin-top: 8px; min-height: 20px; }
.tpl-body:empty { display: none; }
#mailPreview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.code { font: 600 13px ui-monospace, SFMono-Regular, monospace; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; display: block; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .code { flex: 1; }
.filebox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filebox input[type=file] { font: 500 14px var(--font-body); }
.mapgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: center; }
.errlist { font-size: 13px; color: var(--red); margin: 8px 0 0; padding-left: 18px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; font-weight: 600; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Giriş/kayıt sayfalarında panel.css yalnızca uyarıları kullanır */
.auth-box .hint { font-weight: 500; }

/* 5. Mobil */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .3s var(--ease); width: 280px; }
  .side.is-open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: block; margin-left: -10px; }
  .top { padding: 0 16px; }
  .top-user { display: none; }
  .content { padding: 18px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .mapgrid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } .top-title { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* Lightbox (kayıt sayfasındaki şartlar/gizlilik pencereleri) */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--green-dark); }
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: rgba(11,18,32,.6); backdrop-filter: blur(2px); }
dialog.modal[open] { display: grid; place-items: center; padding: 16px; animation: fadeIn .25s var(--ease); }
.modal-box { background: #fff; border-radius: 20px; width: 100%; max-width: 720px; max-height: min(86vh, 760px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.3); animation: rise .3s var(--ease); font-family: var(--font-body); color: var(--ink); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 800 22px var(--font-display); letter-spacing: -.02em; margin: 0; }
.modal-x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--soft); font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); }
.modal-x:hover { background: var(--line); }
.modal-body { padding: 8px 24px 16px; overflow-y: auto; font-size: 15px; line-height: 1.65; color: var(--text2); }
.modal-body h3 { font: 800 16px var(--font-display); margin: 20px 0 6px; color: var(--ink); }
.modal-body p, .modal-body ul { margin: 0 0 10px; }
.modal-body ul { padding-left: 20px; list-style: disc; }
.modal-body li { margin-bottom: 6px; }
.modal-body .legal-date { color: var(--muted); font-size: 13px; margin-top: 12px; }
.modal-foot { padding: 12px 24px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
