/* Yönetim paneli stilleri (yalnızca admin.html) — masaüstü odaklı, mobilde temel işlemler */
body.admin { background: var(--bg); }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; gap: 6px; }
.btn-lg { min-height: 48px; }
.btn-ghost-danger { color: var(--err); }
.btn-ghost-danger:hover { border-color: var(--err); }
.adm-header .hdr-in { max-width: 1500px; gap: 8px; }
@media (max-width: 760px) { .hide-sm { display: none; } }

.login { position: fixed; inset: 0; z-index: 5000; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.login-card img { align-self: center; height: 44px; width: auto; margin-bottom: 6px; }
.login-card h1 { font-size: 1.2rem; text-align: center; margin: 0 0 10px; }
.login-card .btn { margin-top: 12px; }
.login-card .link-btn { align-self: center; text-decoration: none; }
.form-error { color: var(--err); margin: 6px 0 0; font-size: .92rem; }

.adm-main { max-width: 1500px; margin: 18px auto 60px; padding: 0 14px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .adm-main { grid-template-columns: 1fr; } }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.adm-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.adm-card-head h2 { font-size: 1.12rem; margin: 0; display: flex; gap: 8px; align-items: center; min-width: 0; }
.dirty { font-size: .78rem; font-weight: 700; color: var(--warn); background: #fff4e5; border: 1px solid #f3cf9f; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
[data-theme="dark"] .dirty { background: #3a2a15; border-color: #5b4020; color: #ffd9a8; }

.admin label { display: block; font-weight: 650; font-size: .88rem; color: var(--ink-2); margin: 12px 0 5px; }
.admin input[type="text"], .admin input[type="email"], .admin input[type="password"], .admin input[type="url"], .admin input[type="number"], .admin input[type="search"], .admin select, .admin textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; font: inherit; font-size: 16px; min-height: 44px;
}
.admin input:focus, .admin select:focus, .admin textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.admin input.invalid { border-color: var(--err); }
.req { color: var(--err); }
.hint { display: block; color: var(--ink-2); font-size: .8rem; margin-top: 4px; }
.hint.bad { color: var(--err); font-weight: 600; }
.hint.good { color: var(--ok); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; align-items: start; }
.fld-wide { grid-column: span 1; }
.details-body.grid-3 .fld-wide { grid-column: 1 / -1; }
.fld-check { padding-top: 34px; }
.check { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; font-size: 1rem !important; margin: 0 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .fld-check { padding-top: 14px; } }

.adm-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.adm-details > summary { padding: 12px 14px; cursor: pointer; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-details > summary::-webkit-details-marker { display: none; }
.adm-details > summary:hover { background: var(--surface-2); }
.details-body { padding: 4px 14px 14px; }
.editor-area { margin-top: 16px; }
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important; font-size: 14px !important; line-height: 1.5; background: #1e1e1e !important; color: #d4d4d4 !important; min-height: 360px; tab-size: 4; resize: vertical; white-space: pre; }
#pythonCode { color: #7ee2a1 !important; } #jsCode { color: #7fe3df !important; } #cssCode { color: #c4bcff !important; } #jsonCode { color: #fdd98a !important; }
.link-input { font-size: 1.05rem !important; }
.note-editor.note-frame { border-color: var(--line) !important; }
.note-toolbar { background: var(--surface-2) !important; border-bottom: 1px solid var(--line) !important; }
[data-theme="dark"] .note-editable { background-color: #1b232a; color: #e4e9ee; }
.note-editable { min-height: 300px; }

.visual-editor-container { background: var(--surface-2); border: 1px solid var(--line); padding: 14px; border-radius: 10px; margin-top: 10px; }
.ve-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--accent); }
.ve-empty { display: flex; gap: 10px; flex-wrap: wrap; }
.smart-btn { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; flex: 1; min-width: 140px; }
.smart-btn:hover { border-color: var(--accent); color: var(--accent); }
.json-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.json-row .row-del { background: var(--err); color: #fff; border: 0; border-radius: 8px; min-width: 44px; min-height: 44px; cursor: pointer; }
.section-title { font-weight: 700; margin: 14px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.add-row { display: inline-flex; margin-bottom: 12px; }
@media (max-width: 760px) { .json-row { flex-direction: column; align-items: stretch; border-bottom: 1px dashed var(--line); padding-bottom: 8px; } }

.check-panel { margin-top: 16px; border-radius: 10px; padding: 12px 16px; border: 1px solid; }
.check-panel.err { background: #fdecea; border-color: #f2b8b0; color: #7d1d12; }
.check-panel.warn { background: #fff4e5; border-color: #f3cf9f; color: #6b3a07; }
[data-theme="dark"] .check-panel.err { background: #3b1a16; border-color: #6b2a22; color: #ffc7bf; }
[data-theme="dark"] .check-panel.warn { background: #3a2a15; border-color: #5b4020; color: #ffd9a8; }
.check-panel ul { margin: 6px 0 0; padding-left: 20px; }
.action-btn-group { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.action-btn-group .btn { flex: 1; min-width: 150px; }
.kbd-in { background: rgba(255, 255, 255, .2); color: inherit; border-color: rgba(255, 255, 255, .35); }

/* Arşiv */
.archive-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.archive-tools input { flex: 1; }
.archive-tools select { width: auto; }
.catalog-state { font-size: .82rem; color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.catalog-state .ok { color: var(--ok); } .catalog-state .bad { color: var(--err); }
.cat-group { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cat-group > summary { padding: 10px 12px; cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 10px; background: var(--surface); }
.cat-group > summary::-webkit-details-marker { display: none; }
.cat-group > summary:hover { background: var(--surface-2); }
.cat-group > summary .cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-group > summary .spine { width: 6px; align-self: stretch; border-radius: 3px; background: var(--spine); }
.count-badge { background: var(--accent); color: var(--accent-ink); padding: 1px 9px; border-radius: 999px; font-size: .78rem; }
.add-cat-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 1.15rem; width: 36px; height: 36px; border-radius: 8px; }
.add-cat-btn:hover { background: var(--accent-soft); }
.list-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.list-item.off { background: var(--surface-2); }
.list-item.off .item-title { color: var(--ink-2); }
.list-item.editing { box-shadow: inset 3px 0 0 var(--accent); }
.item-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.type-icon { color: var(--ink-2); width: 22px; text-align: center; flex-shrink: 0; }
.item-title { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.slug-badge { font-size: .72rem; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.off-badge { color: var(--err); font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.actions { display: flex; gap: 2px; flex-shrink: 0; }
.actions button, .actions a { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); border-radius: 8px; cursor: pointer; font-size: 1rem; text-decoration: none; }
.actions button:hover, .actions a:hover { background: var(--surface-2); color: var(--accent); }
.actions .del:hover { color: var(--err); }
.trash-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.trash-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Onay penceresi */
.dlg { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; width: min(520px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); }
.dlg::backdrop { background: rgba(10, 16, 22, .5); }
.dlg h3 { margin: 0 0 10px; }
.dlg ul { padding-left: 20px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.v-spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: vspin .9s linear infinite; }

/* Sekmeler */
.adm-tabs { max-width: 1500px; margin: 14px auto 0; padding: 0 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.adm-tabs[hidden] { display: none; }
.adm-tab { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 42px; font-weight: 700; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.adm-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.adm-single { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.busy { opacity: .6; pointer-events: none; }
.pr-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.pr-row:first-child { border-top: 0; }
.pr-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex-shrink: 0; overflow: hidden; }
.pr-ic img { width: 100%; height: 100%; object-fit: cover; }
.pr-main { flex: 1; min-width: 0; }
.pr-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-main small { color: var(--ink-2); }
.asset-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: .88rem; }
.asset-list li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.asset-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-state { font-size: .85rem; margin-top: 6px; }
.gh-state.ok { color: var(--ok); } .gh-state.bad { color: var(--err); }
.du-pre { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; margin-top: 10px; }
/* Kod kutuları: genel textarea kuralını (.admin textarea) geçersiz kılar */
.admin textarea.code-editor { min-height: 360px; }
.admin textarea#jsCode, .admin textarea#cssCode { min-height: 160px; }
.admin textarea#pythonCode, .admin textarea#jsonCode { min-height: 200px; }
