/* ==========================================================================
   TT Coders Studio - panel arayüzü (admin.html + support.html)
   style.css'in token'larını kullanır; ondan SONRA yüklenmelidir.
   ========================================================================== */

/* ---------- Form öğeleri ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .field-label { font-size: 0.88rem; font-weight: 500; color: var(--text-muted); }
.field .req { color: #f87171; }
.input, .select, .textarea {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); border-radius: 4px;
  padding: 11px 13px; min-height: 44px; color: var(--text-main); transition: border-color .2s, background .2s, box-shadow .2s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center; }
.select option { background: #07111e; color: var(--text-main); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255,255,255,0.2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-blue); background: rgba(79,172,254,0.06); box-shadow: 0 0 0 3px rgba(79,172,254,0.18); }
.input[disabled], .select[disabled], .textarea[disabled] { opacity: .55; cursor: not-allowed; }
.hint { font-size: 0.8rem; color: var(--text-faint); }
.counter { font-size: 0.78rem; color: var(--text-faint); text-align: right; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.form-error { display: none; margin: 0 0 14px; padding: 11px 14px; border-radius: 4px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35); color: #fca5a5; font-size: 0.9rem; }
.form-error.show { display: block; }
.form-ok { display: none; margin: 0 0 14px; padding: 11px 14px; border-radius: 4px; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.35); color: #86efac; font-size: 0.9rem; }
.form-ok.show { display: block; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-purple); }

/* Aç/kapa anahtarı */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: rgba(255,255,255,0.12); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 22px; height: 22px; left: 4px; top: 4px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--danger); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.switch input:checked + span::before { transform: translateX(22px); }

/* ---------- Yüzeyler ---------- */
.card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card + .card { margin-top: 18px; }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.card-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.grow { flex: 1 1 auto; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-flex.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hr { height: 1px; background: var(--glass-border); margin: 18px 0; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

/* ---------- Rozetler ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 2px; font-size: 0.76rem; font-weight: 600; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.chip-ok { background: rgba(34,197,94,0.12); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.chip-warn { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.chip-bad { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.3); }
.chip-info { background: rgba(79,172,254,0.12); color: #7dc0ff; border-color: rgba(79,172,254,0.3); }
.chip-purple { background: rgba(8,210,234,0.12); color: #7be8f5; border-color: rgba(8,210,234,0.35); }
.chip-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); border-color: var(--glass-border); }
.chip-gold { background: rgba(250,204,21,0.12); color: #facc15; border-color: rgba(250,204,21,0.32); }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); flex: none; }

/* ---------- Avatar ---------- */
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #0a2547, #0b6f80); border: 1px solid rgba(8,210,234,0.45); display: inline-grid; place-items: center; flex: none; overflow: hidden; font-size: 0.85rem; }
.avatar b { font-weight: 600; color: #fff; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 0.72rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; }

/* ---------- Sekmeler / süzgeçler ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,0.04); border-radius: 4px; border: 1px solid var(--glass-border); }
.tab { flex: 1; padding: 9px 14px; border-radius: 4px; border: none; background: none; color: var(--text-muted); font-weight: 500; cursor: pointer; transition: .2s; }
.tab:hover { color: var(--text-main); }
.tab[aria-selected="true"] { background: rgba(255,75,11,0.9); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 6px 14px; border-radius: 2px; border: 1px solid var(--glass-border); background: transparent; color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: .2s; }
.filter-btn:hover { color: var(--text-main); border-color: rgba(255,255,255,0.25); }
.filter-btn.on { background: rgba(8,210,234,0.12); border-color: rgba(8,210,234,0.55); color: var(--accent-cyan); }

/* ---------- Modal (<dialog>) ---------- */
dialog.modal { margin: auto; padding: 0; border: 1px solid var(--glass-border); border-radius: 4px; background: #07111e; color: var(--text-main); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
dialog.modal.modal-sm { width: min(440px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-body { padding: 24px; }
.modal-title { font-size: 1.2rem; margin-bottom: 8px; }
.modal-text { color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.icon-btn { width: 38px; height: 38px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-grid; place-items: center; transition: .2s; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-main); }
.icon-btn.danger:hover { background: rgba(239,68,68,0.14); color: #f87171; }

/* ---------- Bildirim ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 4px; background: #041a35; border: 1px solid var(--glass-border); box-shadow: 0 12px 30px rgba(0,0,0,0.5); font-size: 0.92rem; animation: toastIn .25s ease-out; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
.toast-ok { border-color: rgba(34,197,94,0.5); }
.toast-bad { border-color: rgba(239,68,68,0.55); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Yükleniyor / boş durum ---------- */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent-cyan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-muted); }
.empty { text-align: center; padding: 38px 20px; color: var(--text-muted); }
.empty i { font-size: 2rem; color: var(--text-faint); margin-bottom: 12px; display: block; }
.empty strong { display: block; color: var(--text-main); margin-bottom: 4px; font-weight: 600; }

/* ---------- Kimlik doğrulama kartı ---------- */
.auth-card { max-width: 440px; width: 100%; margin: 0 auto; padding: 28px; }
.auth-card h2 { font-size: 1.4rem; margin: 20px 0 6px; }
.auth-card .sub { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }
.link-btn { background: none; border: none; color: var(--accent-blue); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: 0.88rem; }
.link-btn:hover { color: var(--accent-cyan); }

/* ==========================================================================
   DESTEK SAYFASI
   ========================================================================== */
.sp-hero { padding: 48px 0 28px; }
.sp-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; margin-bottom: 10px; }
.sp-hero p { color: var(--text-muted); max-width: 620px; font-size: 1.05rem; }
.sp-guest { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; padding-bottom: 80px; }
.sp-steps { display: grid; gap: 14px; }
.sp-step { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--glass-border); border-radius: 4px; background: var(--glass-bg); }
.sp-step i { width: 40px; height: 40px; border-radius: 4px; display: grid; place-items: center; background: rgba(8,210,234,0.12); color: #08d2ea; flex: none; }
.sp-step h3 { font-size: 1rem; margin-bottom: 2px; }
.sp-step p { color: var(--text-muted); font-size: 0.9rem; }

.sp-userbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--glass-border); border-radius: 4px; background: var(--glass-bg); margin-bottom: 20px; }
.sp-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; padding-bottom: 80px; align-items: start; }
.sp-side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; gap: 12px; }
.sp-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.tk { display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; padding: 14px; border-radius: 4px; border: 1px solid var(--glass-border); background: var(--glass-bg); cursor: pointer; transition: border-color .2s, background .2s; }
.tk:hover { border-color: rgba(255,255,255,0.25); }
.tk[aria-current="true"] { border-color: var(--accent-blue); background: rgba(79,172,254,0.08); }
.tk-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tk-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-faint); }

.sp-main { min-height: 420px; }
.back-btn { display: none; margin-bottom: 12px; }
.thread-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--glass-border); }
.thread-head h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.status-note { padding: 11px 14px; border-radius: 4px; font-size: 0.9rem; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); color: var(--text-muted); }
.msgs { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.sys { align-self: center; max-width: 100%; }
.bubble { padding: 11px 14px; border-radius: 4px; background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); min-width: 0; }
.msg.me .bubble { background: rgba(79,172,254,0.14); border-color: rgba(79,172,254,0.3); }
.msg.staff .bubble { background: rgba(8,210,234,0.1); border-color: rgba(8,210,234,0.35); }
.msg.sys .bubble { background: rgba(0,242,254,0.06); border: 1px dashed rgba(0,242,254,0.3); color: var(--text-muted); text-align: center; font-size: 0.92rem; }
.bubble-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-faint); margin-bottom: 4px; }
.bubble-head b { color: var(--text-main); font-weight: 600; }
.bubble-text { overflow-wrap: anywhere; }
.composer { border-top: 1px solid var(--glass-border); padding-top: 16px; }
.composer .textarea { min-height: 90px; }
.closed-note { padding: 14px; text-align: center; color: var(--text-muted); border: 1px dashed var(--glass-border); border-radius: 4px; }

/* ==========================================================================
   ADMIN PANELİ
   ========================================================================== */
body.admin { display: block; }
.ad-app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.ad-side { position: fixed; z-index: 1100; left: 0; top: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(290px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .25s, visibility .25s; }
.ad-side .logo { padding: 4px 8px 18px; }
.ad-side.open, body.ad-menu-open .ad-side { transform: none; visibility: visible; box-shadow: 12px 0 40px rgba(0,0,0,0.6); }
.ad-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ad-nav-label { font-size: 0.75rem; color: var(--text-faint); padding: 14px 12px 6px; }
.ad-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 4px; border: none; background: none; color: var(--text-muted); font-weight: 500; font-size: 0.93rem; cursor: pointer; text-align: left; transition: .15s; }
.ad-link i { width: 20px; text-align: center; }
.ad-link:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.ad-link[aria-current="page"] { background: rgba(255,75,11,0.2); color: #fff; box-shadow: inset 2px 0 0 #ff4b0b; }
.ad-link .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 2px; font-size: 0.74rem; text-align: center; background: rgba(255,255,255,0.1); }
.ad-link .count.hot { background: var(--accent-purple); color: #fff; }
.ad-me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--glass-border); margin-top: 12px; }
.ad-me .who { min-width: 0; flex: 1; }
.ad-me .who b { display: block; font-size: 0.9rem; }
.ad-me .who span { font-size: 0.78rem; color: var(--text-faint); }
.ad-top { display: none; }
.ad-main { padding: 32px clamp(16px, 3vw, 40px) 64px; min-width: 0; max-width: 1240px; width: 100%; }
.ad-h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 4px; }
.ad-lead { color: var(--text-muted); margin-bottom: 24px; }
.ad-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ad-head .ad-lead { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; border-radius: 4px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.stat span { color: var(--text-muted); font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.stat strong { display: block; font-family: var(--font-head); font-size: 2rem; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.two-col > .card + .card { margin-top: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .search { flex: 1 1 220px; }

.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--glass-border); }
.list-item:last-child { border-bottom: none; }
.list-item .info { min-width: 0; flex: 1; }
.list-item .info b { display: block; }
.list-item .info small { color: var(--text-faint); }
.list-actions { display: flex; gap: 4px; flex: none; }

.task { padding: 18px; border: 1px solid var(--glass-border); border-radius: 4px; background: var(--glass-bg); display: flex; flex-direction: column; gap: 10px; }
.task.overdue { border-color: rgba(239,68,68,0.45); }
.task h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.report { padding: 12px 14px; border-radius: 4px; background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.25); }
.attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-blue); text-decoration: none; overflow-wrap: anywhere; }
.attach-list a:hover { text-decoration: underline; }
.attach-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }

.ad-tickets { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ad-tickets .sp-list { max-height: calc(100vh - 250px); }
.ticket-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Sohbet */
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; padding: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 10px; max-width: 82%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .bubble-head { margin-bottom: 3px; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--glass-border); background: rgba(0,0,0,0.25); align-items: flex-end; }
.chat-form .textarea { min-height: 46px; max-height: 140px; resize: none; }

.staff-card { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--glass-border); border-radius: 4px; background: var(--glass-bg); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.staff-card .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.staff-card p { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; overflow-wrap: anywhere; }

.log-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--glass-border); font-size: 0.9rem; }
.log-row:last-child { border-bottom: none; }
.log-row time { color: var(--text-faint); flex: none; width: 150px; font-size: 0.82rem; }

.notice { padding: 14px 16px; border-radius: 4px; font-size: 0.92rem; border: 1px solid rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); color: #fcd34d; }
.notice.bad { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); color: #fca5a5; }
.notice.info { border-color: rgba(79,172,254,0.35); background: rgba(79,172,254,0.08); color: #93c5fd; }

@media (max-width: 1000px) {
  .sp-guest { grid-template-columns: 1fr; }
  .sp-layout { grid-template-columns: 1fr; }
  .sp-side { position: static; max-height: none; }
  .sp-layout.show-detail .sp-side { display: none; }
  .sp-layout:not(.show-detail) .sp-main { display: none; }
  .back-btn { display: inline-flex; }
  .ad-tickets { grid-template-columns: 1fr; }
  .ad-tickets.show-detail .ad-tk-list { display: none; }
  .ad-tickets:not(.show-detail) .ad-tk-detail { display: none; }
  .ad-tickets .sp-list { max-height: none; }
}
@media (max-width: 860px) {
  .ad-app { grid-template-columns: 1fr; }
  .ad-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; position: sticky; top: 0; z-index: 900; background: rgba(3,13,23,0.96); border-bottom: 1px solid var(--glass-border); }
  .ad-side { position: fixed; z-index: 1100; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .25s, visibility .25s; }
  .ad-side.open { transform: none; visibility: visible; box-shadow: 12px 0 40px rgba(0,0,0,0.6); }
  .ad-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1050; }
  .attach-row { grid-template-columns: 1fr; }
  .log-row { flex-direction: column; gap: 2px; }
  .chat-msg { max-width: 94%; }
}
