/* JundaSoft Yönetim Paneli — sade, koyu, işlevsel */
:root {
  --bg: #0d1017;
  --panel: #141821;
  --panel-2: #1a1f2a;
  --line: #232937;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --dim: #5d6579;
  --accent: #7c83ff;
  --accent-soft: rgba(124, 131, 255, 0.14);
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --cyan: #22d3ee;
  --r: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.logo { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #0d1017; border: 1px solid var(--line); flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { border-color: #323a4c; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6a72f5; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--rose); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { color: var(--accent); font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* Giriş */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 50% 0%, rgba(124,131,255,.12), transparent), var(--bg); z-index: 100; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 20px; margin-top: 10px; }
.login-card p { color: var(--muted); font-size: 13px; }
.login-card .err { color: var(--rose); font-size: 13px; min-height: 18px; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

/* Yerleşim */
.layout { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 22px; }
.side .brand { padding: 0 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav:hover { background: var(--panel-2); color: var(--text); }
.nav.active { background: var(--accent-soft); color: #c3c7ff; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.live.on i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.live b { font-weight: 500; }

.main { overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: rgba(13,16,23,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.head h1 { font-size: 18px; font-weight: 600; }
.head-actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; }
.view { display: none; padding: 24px 28px 40px; }
.view.active { display: block; }

/* Kartlar */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat strong { display: block; font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.stat small { color: var(--dim); font-size: 12px; }
.stat.hl strong { color: var(--amber); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-side { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }

.rows { display: flex; flex-direction: column; }
.r { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.r:first-child { border-top: 0; }
button.r:hover { background: var(--panel-2); }
.r .grow { flex: 1; min-width: 0; }
.r .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .m { color: var(--dim); font-size: 12px; white-space: nowrap; }
.empty { color: var(--dim); text-align: center; padding: 24px 10px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.b-open { background: rgba(251,191,36,.13); color: var(--amber); }
.b-answered { background: rgba(52,211,153,.13); color: var(--green); }
.b-closed { background: rgba(139,147,167,.13); color: var(--muted); }
.b-on { background: rgba(52,211,153,.13); color: var(--green); }
.b-accent { background: var(--accent-soft); color: #c3c7ff; }

/* Formlar */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form small, .note { color: var(--dim); font-size: 12px; font-weight: 400; }
.file input { padding: 7px; }

/* Tablolar */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--dim); font-size: 12px; }
td.mono, .mono { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); margin-right: 6px; }
.dot.on { background: var(--green); }

/* Talepler */
.inbox { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 69px - 48px); min-height: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tab b { font-weight: 600; color: var(--dim); margin-left: 3px; }
.tab.active { background: var(--panel-2); color: var(--text); }
.tlist { overflow-y: auto; flex: 1; }
.ti { display: block; width: 100%; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); transition: background .12s; }
.ti:hover { background: var(--panel-2); }
.ti.active { background: var(--accent-soft); }
.ti-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.ti-top .when { margin-left: auto; }
.ti-subj { font-weight: 600; margin: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-last { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti.unread .ti-subj::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: middle; }

.inbox-detail { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.placeholder { margin: auto; text-align: center; color: var(--dim); }
.placeholder [data-icon] svg { width: 36px; height: 36px; stroke-width: 1.5; }
.placeholder p { margin-top: 8px; }
.d-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.d-head .grow { flex: 1; min-width: 0; }
.d-head h2 { font-size: 16px; font-weight: 600; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.d-actions { display: flex; gap: 6px; }
.d-thread { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; padding: 10px 13px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.admin { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg time { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.d-reply { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.d-reply textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; }
.d-closed { border-top: 1px solid var(--line); padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.back-list { display: none; }

/* Toast */
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel-2); border: 1px solid var(--line); padding: 11px 16px; border-radius: 9px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: none; }
.toast.err { border-color: rgba(251,113,133,.4); color: var(--rose); }

/* Mobil / tablet */
@media (max-width: 1100px) {
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  .menu-btn { display: inline-flex; }
  .head, .view { padding-left: 16px; padding-right: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 69px - 40px); }
  .inbox.detail-open .inbox-list { display: none; }
  .inbox:not(.detail-open) .inbox-detail { display: none; }
  .back-list { display: inline-flex; }
  .msg { max-width: 88%; }
}

/* ================= VERİTABANI YÖNETİCİSİ (phpMyAdmin Stili) ================= */
.db-shell { display: grid; grid-template-columns: 270px 1fr; gap: 14px; align-items: start; min-height: calc(100vh - 125px); }
.db-sidebar { display: flex; flex-direction: column; gap: 10px; padding: 14px; max-height: calc(100vh - 125px); overflow: hidden; }
.db-meta { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.db-meta strong { font-size: 13.5px; color: #c3c7ff; }
.db-meta small { font-size: 11.5px; color: var(--muted); }
.db-filter-inp { padding: 7px 10px; font-size: 12.5px; }
.db-table-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 3px; padding-right: 2px; }
.db-group-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 8px 6px 3px; }
.db-tbtn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; text-align: left; font-size: 12.5px; color: var(--muted); transition: background .12s, color .12s; }
.db-tbtn:hover { background: var(--panel-2); color: var(--text); }
.db-tbtn.active { background: var(--accent-soft); color: #c3c7ff; font-weight: 600; }
.db-tbtn .tname { font-family: ui-monospace, 'JetBrains Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-tbtn .tcount { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); color: var(--dim); flex-shrink: 0; }
.db-tbtn.active .tcount { background: rgba(124, 131, 255, 0.25); color: #fff; }

.db-content { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: calc(100vh - 125px); }
.db-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.db-active-title { display: flex; align-items: center; gap: 10px; }
.db-active-title h2 { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; }
.db-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.db-tab { padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--line); transition: .15s; }
.db-tab:hover { color: var(--text); border-color: #323a4c; }
.db-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.db-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.db-toolbar-left, .db-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-search-inp { width: 260px; padding: 7px 11px; font-size: 12.5px; }
.db-limit-sel { width: auto; padding: 6px 10px; font-size: 12.5px; }

.db-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); max-height: calc(100vh - 280px); }
.db-grid th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; cursor: pointer; user-select: none; padding: 9px 11px; font-family: ui-monospace, 'JetBrains Mono', monospace; text-transform: none; font-size: 12px; color: var(--text); }
.db-grid th:hover { background: #222836; }
.db-grid th .pk-tag { color: var(--amber); font-size: 10px; margin-right: 4px; }
.db-grid th .col-type { display: block; font-size: 10px; color: var(--dim); font-weight: 400; }
.db-grid td { padding: 8px 11px; font-size: 12.5px; font-family: ui-monospace, 'JetBrains Mono', monospace; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.db-grid tr:hover td { background: rgba(124, 131, 255, 0.05); }
.db-grid td.null-val { color: var(--dim); font-style: italic; }
.db-grid td.act-col { max-width: none; cursor: default; width: 1%; white-space: nowrap; }

.db-sql-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.db-sql-box { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 13px; min-height: 130px; background: #090b10; color: #a5b4fc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

.db-modal-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 11, 0.78); backdrop-filter: blur(4px); z-index: 150; display: grid; place-items: center; padding: 20px; }
.db-modal-card { width: 100%; max-width: 680px; max-height: 88vh; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.6); }
.db-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.db-modal-head h3 { font-size: 15px; font-weight: 600; font-family: ui-monospace, 'JetBrains Mono', monospace; }
.db-modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.db-field-grid { display: grid; grid-template-columns: 180px 1fr; gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.db-field-lbl { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); word-break: break-all; }
.db-field-lbl small { display: block; color: var(--dim); font-size: 10.5px; margin-top: 2px; }

@media (max-width: 960px) {
  .db-shell { grid-template-columns: 1fr; }
  .db-sidebar { max-height: 240px; }
  .db-field-grid { grid-template-columns: 1fr; }
}

/* ================= CİHAZ ÇAPRAZ EŞLEME (KATEGORİ & UYGULAMA AĞACI) ================= */
.dev-cross-row td { background: rgba(15, 19, 28, 0.72); padding: 12px 18px 16px 34px; border-bottom: 1px solid var(--line); }
.dev-cross-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.dev-cat-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dev-cat-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #c3c7ff; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.dev-cat-items { display: flex; flex-direction: column; gap: 6px; }
.dev-chip-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.dev-chip-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dev-chip-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: #c3c7ff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.dev-chip-meta { display: flex; flex-direction: column; min-width: 0; }
.dev-chip-meta b { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-chip-meta small { font-size: 11px; color: var(--muted); font-family: ui-monospace, 'JetBrains Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-hub-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: rgba(124, 131, 255, 0.16); color: #c3c7ff; border: 1px solid rgba(124, 131, 255, 0.3); font-weight: 600; margin-left: 6px; }
