/* ═══════════════════════════════════════════════════════════════════════════
   Admin Panel — Premium Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout Shell ────────────────────────────────────────────────────────── */
.admin-panel {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #e0e0e0;
	height: 100%;
	overflow: hidden;
}

/* Make the Wt layout container and content stack scrollable */
.admin-panel > .Wt-hboxlayout,
.admin-panel > .Wt-vboxlayout {
	height: 100%;
	overflow: hidden;
}

.admin-panel .Wt-stack {
	overflow-y: auto !important;
	overflow-x: hidden !important;
	-webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for admin content */
.admin-panel .Wt-stack::-webkit-scrollbar {
	width: 6px;
}
.admin-panel .Wt-stack::-webkit-scrollbar-track {
	background: #131313;
}
.admin-panel .Wt-stack::-webkit-scrollbar-thumb {
	background: #444;
	border-radius: 3px;
}
.admin-panel .Wt-stack::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* ── Sidebar Menu ────────────────────────────────────────────────────────── */
.admin-sidebar .nav-pills > li > a {
	color: #99a3b0;
	padding: 11px 18px;
	margin: 2px 0;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 500;
	letter-spacing: 0.01em;
	transition: all 0.2s ease;
	border-left: 3px solid transparent;
	background: transparent;
}

.admin-sidebar .nav-pills > li > a:hover {
	color: #d0d8e0;
	background: rgba(255, 255, 255, 0.04);
	border-left-color: rgba(100, 160, 255, 0.3);
}

.admin-sidebar .nav-pills > li.active > a,
.admin-sidebar .nav-pills > li.active > a:hover,
.admin-sidebar .nav-pills > li.active > a:focus {
	color: #fff;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(56, 189, 248, 0.08));
	border-left-color: #3b82f6;
	box-shadow: 0 0 12px rgba(59, 130, 246, 0.08);
}

/* Mobile top menu */
.admin-mobile-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 8px;
	border-bottom: 1px solid #2a2a2a;
	margin-bottom: 12px;
}

.admin-mobile-menu > li > a {
	padding: 8px 14px !important;
	font-size: 12.5px !important;
	border-left: none !important;
	border-bottom: 2px solid transparent !important;
	border-radius: 6px !important;
}

.admin-mobile-menu > li.active > a {
	border-bottom-color: #3b82f6 !important;
}

/* ── Content Area ────────────────────────────────────────────────────────── */
.admin-panel .Wt-stack > div {
	padding: 4px 20px 20px 20px;
}

/* ── Section Headers ─────────────────────────────────────────────────────── */
.admin-section-title {
	font-size: 22px;
	font-weight: 700;
	color: #eee;
	margin: 0 0 20px 0;
	padding-bottom: 14px;
	border-bottom: 1px solid #2a2a2a;
	letter-spacing: -0.02em;
}

.admin-section-desc {
	color: #888;
	font-size: 13px;
	line-height: 1.5;
	margin: -12px 0 18px 0;
}

/* ── Tabs (eşit genişlik + kompakt) ─────────────────────────────────────────
   WMenu tek bir <ul class="nav nav-tabs admin-tabs"> uretir; yani .admin-tabs
   ile ul.nav-tabs AYNI elemandir. Bu yuzden AYNI-eleman (.admin-tabs.nav-tabs)
   ve dogrudan-cocuk (> li) selektorleri sart — eski descendant ".admin-tabs
   ul.nav-tabs" hicbir zaman eslesmiyordu, dolayisiyla ne esit-genislik ne de
   compact padding uygulaniyordu. Wt-tabs varyantlari geriye-donuk birakildi.
   Tab bar uzerinde absolute + butonu yok; tablar TUM genisligi esit bolusur. */
.admin-tabs.nav-tabs,
ul.admin-tabs,
.admin-tabs ul.nav-tabs,
.admin-tabs > ul.Wt-tabs,
.admin-tabs > .Wt-tabs > ul {
	display: flex;
	width: 100%;
	padding: 0;
}
.admin-tabs.nav-tabs > li,
ul.admin-tabs > li,
.admin-tabs ul.nav-tabs > li,
.admin-tabs ul.Wt-tabs > li,
.admin-tabs .Wt-tabs > ul > li {
	flex: 1 1 0;
	text-align: center;
}
.admin-tabs.nav-tabs > li > a,
ul.admin-tabs > li > a,
.admin-tabs ul.nav-tabs > li > a,
.admin-tabs ul.Wt-tabs > li > a,
.admin-tabs .Wt-tabs > ul > li > a {
	display: block;
	width: 100%;
	padding: 8px 12px;
	min-height: 34px;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
}

/* ── Add (+) butonu — yeşil, tab bar'ın sağ üstünde ───────────────────────── */
.admin-page {
	position: relative;
}
.admin-add-btn {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.admin-page > .admin-add-btn {
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 10;
}

/* ── Toolbar Row ─────────────────────────────────────────────────────────── */
.admin-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.admin-toolbar > span {
	display: inline-flex !important;
	align-items: center;
}
.admin-toolbar > .admin-add-btn {
	margin-left: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.admin-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 7px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.18s ease;
	line-height: 1.4;
}

.admin-btn-primary {
	background: #2a9fd6;
	color: #fff;
	border-color: #2a9fd6;
}

.admin-btn-primary:hover {
	background: #2180ac;
	border-color: #2180ac;
}

.admin-btn-success {
	background: linear-gradient(135deg, #10b981, #059669);
	color: #fff;
	border-color: rgba(16, 185, 129, 0.3);
	box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.admin-btn-success:hover {
	background: linear-gradient(135deg, #34d399, #10b981);
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
	transform: translateY(-1px);
}

.admin-btn-danger {
	background: rgba(239, 68, 68, 0.12);
	color: #f87171;
	border-color: rgba(239, 68, 68, 0.2);
}

.admin-btn-danger:hover {
	background: rgba(239, 68, 68, 0.2);
	color: #fca5a5;
	box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.admin-btn-ghost {
	background: rgba(255, 255, 255, 0.04);
	color: #aaa;
	border-color: rgba(255, 255, 255, 0.08);
}

.admin-btn-ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #ccc;
}

.admin-btn-sm {
	padding: 4px 10px;
	font-size: 12px;
	border-radius: 5px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.admin-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #2a2a2a;
	background: #131313;
}

.admin-table th {
	background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
	color: #aaa;
	font-size: 11.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #2a2a2a;
	white-space: nowrap;
}

.admin-table td {
	padding: 10px 14px;
	font-size: 13.5px;
	border-bottom: 1px solid #222;
	color: #ccc;
	vertical-align: middle;
}

.admin-table tr:last-child td {
	border-bottom: none;
}

.admin-table tr:hover td {
	background: rgba(59, 130, 246, 0.04);
}

.admin-table .admin-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.admin-card {
	background: #131313;
	border: 1px solid #2a2a2a;
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 10px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-card:hover {
	border-color: #444;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.admin-card-accent-green {
	border-left: 3px solid #10b981;
}

.admin-card-accent-blue {
	border-left: 3px solid #3b82f6;
}

.admin-card-accent-amber {
	border-left: 3px solid #f59e0b;
}

.admin-card-header {
	font-size: 11px;
	color: #888;
	margin-bottom: 6px;
	line-height: 1.4;
}

.admin-card-body {
	color: #ccc;
	font-size: 13.5px;
	white-space: pre-wrap;
	line-height: 1.5;
}

.admin-card-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

/* ── Form Fields ─────────────────────────────────────────────────────────── */
.admin-field-group {
	display: flex;
	flex-direction: column;
	margin-bottom: 14px;
}

.admin-field-label {
	font-size: 12px;
	color: #888;
	margin-bottom: 5px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

/* Canli log paneli (aktif processing sekmeleri + Loglar sayfasi sistem/process
   log goruntuleyici). Yalnizca gorsel: monospace + satir koruma + tema rengi;
   overflow/yukseklik/padding Wt C++ ile ayarlanir. */
.log-view {
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	color: #c9d1d9;
	background: #0d1117;
	border-radius: 4px;
}

.admin-input,
.admin-panel input[type="text"],
.admin-panel input[type="password"],
.admin-panel textarea,
.admin-panel select {
	background: #2a2a2a;
	color: #e0e0e0;
	border: 1px solid #444;
	border-radius: 7px;
	padding: 8px 12px;
	font-size: 13.5px;
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.admin-panel input[type="text"]:focus,
.admin-panel input[type="password"]:focus,
.admin-panel textarea:focus,
.admin-panel select:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
	outline: none;
}

.admin-panel textarea {
	font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
	font-size: 13px;
	line-height: 1.5;
}

.admin-panel .Wt-spinbox,
.admin-panel input[type="number"] {
	background: #2a2a2a;
	color: #e0e0e0;
	border: 1px solid #444;
	border-radius: 7px;
	padding: 6px 10px;
}

/* Wt combos inside admin panel */
.admin-panel .form-control {
	background-color: #2a2a2a;
	border-color: #444;
	color: #e0e0e0;
	border-radius: 7px;
}

.admin-panel .form-control:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ── Status Messages ─────────────────────────────────────────────────────── */
.admin-status {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	padding: 6px 0;
}

.admin-status-ok {
	color: #34d399;
}

.admin-status-err {
	color: #f87171;
}

/* ── Badge / Pill ────────────────────────────────────────────────────────── */
.admin-badge {
	display: inline-block;
	padding: 2px 9px;
	font-size: 11.5px;
	font-weight: 600;
	border-radius: 100px;
	letter-spacing: 0.02em;
}

.admin-badge-public {
	background: rgba(16, 185, 129, 0.12);
	color: #34d399;
}

.admin-badge-early {
	background: rgba(245, 158, 11, 0.12);
	color: #fbbf24;
}

.admin-badge-private {
	background: rgba(239, 68, 68, 0.12);
	color: #f87171;
}

.admin-badge-level {
	background: rgba(56, 189, 248, 0.12);
	color: #7dd3fc;
}

/* ── Dividers ────────────────────────────────────────────────────────────── */
.admin-divider {
	border: none;
	border-top: 1px solid #2a2a2a;
	margin: 18px 0;
}

/* ── Upload Areas ────────────────────────────────────────────────────────── */
.admin-upload-card {
	background: #131313;
	border: 1px solid #2a2a2a;
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 16px;
}

.admin-upload-card h4 {
	margin: 0 0 10px 0;
	font-size: 15px;
	font-weight: 600;
	color: #e0e0e0;
}

.admin-upload-preview {
	max-width: 300px;
	max-height: 200px;
	display: block;
	margin-bottom: 10px;
	border: 1px solid #444;
	border-radius: 8px;
}

/* ── Checkbox ────────────────────────────────────────────────────────────── */
.admin-panel input[type="checkbox"] {
	accent-color: #3b82f6;
	width: 16px;
	height: 16px;
}

/* ── Dialog Overrides ────────────────────────────────────────────────────── */
.admin-panel .Wt-dialog .modal-content {
	background: #131313;
	border: 1px solid #2a2a2a;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.admin-panel .Wt-dialog .modal-header {
	border-bottom-color: #2a2a2a;
}

.admin-panel .Wt-dialog .modal-footer {
	border-top-color: #2a2a2a;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.admin-empty {
	text-align: center;
	padding: 40px 20px;
	color: #555;
	font-size: 14px;
}

/* ── Git Diff ────────────────────────────────────────────────────────────── */
.git-diff-ins {
	background: rgba(34, 197, 94, 0.15);
	border-radius: 2px;
	padding: 0 2px;
}

.git-diff-del {
	background: rgba(239, 68, 68, 0.15);
	text-decoration: line-through;
	border-radius: 2px;
	padding: 0 2px;
}

.git-diff-raw {
	font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
	font-size: 12px;
	white-space: pre-wrap;
	background: #0d1117;
	padding: 16px;
	border-radius: 8px;
	border: 1px solid #2a2a2a;
	overflow-x: auto;
	line-height: 1.6;
}

.git-diff-raw .diff-add {
	color: #3fb950;
	background: rgba(46, 160, 67, 0.15);
}

.git-diff-raw .diff-del {
	color: #f85149;
	background: rgba(248, 81, 73, 0.15);
}

.git-diff-raw .diff-hunk {
	color: #79c0ff;
}

.git-diff-side-by-side {
	display: flex;
	gap: 12px;
}

.git-diff-side-by-side > div {
	flex: 1;
	overflow-y: auto;
	max-height: 70vh;
	border: 1px solid #2a2a2a;
	border-radius: 8px;
	padding: 12px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes admin-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.admin-panel .Wt-stack > div {
	animation: admin-fade-in 0.25s ease;
}

/* ── Git Progress Bar ───────────────────────────────────────────────────── */
.git-progress-wrap {
	position: relative;
	width: 100%;
	height: 32px;
	background: #1a1a2e;
	border: 1px solid #333;
	border-radius: 6px;
	overflow: hidden;
}

.git-progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: linear-gradient(90deg, #2563eb, #3b82f6);
	border-radius: 6px 0 0 6px;
	transition: width 0.3s ease;
}

.git-progress-fill.git-progress-pulse {
	width: 100% !important;
	background: linear-gradient(90deg, #1a1a2e 0%, #2563eb 50%, #1a1a2e 100%);
	background-size: 200% 100%;
	animation: git-pulse 1.5s ease-in-out infinite;
}

.git-progress-fill.git-progress-ok {
	width: 100% !important;
	background: linear-gradient(90deg, #16a34a, #22c55e);
	border-radius: 6px;
}

.git-progress-fill.git-progress-err {
	width: 100% !important;
	background: linear-gradient(90deg, #dc2626, #ef4444);
	border-radius: 6px;
}

@keyframes git-pulse {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.git-progress-label {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 500;
	color: #e0e0e0;
	text-shadow: 0 1px 2px rgba(0,0,0,0.5);
	z-index: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 8px;
}

/* ── Settings Page Layout ───────────────────────────────────────────────── */
.settings-layout {
	display: flex;
	gap: 16px;
	min-height: 0;
}

.settings-menu-container {
	min-width: 150px;
	max-width: 150px;
	flex-shrink: 0;
}

.settings-nav {
	position: sticky;
	top: 0;
}

.settings-nav > li > a {
	color: #aaa;
	background: transparent;
	border-radius: 4px;
	padding: 8px 14px;
	margin-bottom: 2px;
	font-size: 13px;
}

.settings-nav > li > a:hover {
	color: #fff;
	background: rgba(255,255,255,0.06);
}

.settings-nav > li.active > a,
.settings-nav > li.active > a:hover {
	color: #fff;
	background: #2a6496;
}

.settings-content {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
}

/* ── Score Badges ───────────────────────────────────────────────────────── */
.score-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	margin-right: 4px;
}
.score-badge.score-green {
	background: rgba(16,185,129,0.15);
	color: #10b981;
}
.score-badge.score-yellow {
	background: rgba(234,179,8,0.15);
	color: #eab308;
}
.score-badge.score-orange {
	background: rgba(249,115,22,0.15);
	color: #f97316;
}
.score-badge.score-red {
	background: rgba(239,68,68,0.15);
	color: #ef4444;
}

/* ── Search Result Cards ────────────────────────────────────────────────── */
.result-card {
	padding: 12px 16px;
	margin-bottom: 8px;
	border-radius: 8px;
}
.result-card.score-green {
	background: rgba(16,185,129,0.06);
}
.result-card.score-yellow {
	background: rgba(234,179,8,0.06);
}
.result-card.score-orange {
	background: rgba(249,115,22,0.06);
}
.result-card.score-red {
	background: rgba(239,68,68,0.06);
}

/* ── Preset Bar ─────────────────────────────────────────────────────────── */
.preset-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 0;
	margin-bottom: 12px;
}
.preset-btn {
	border-radius: 12px;
	font-size: 11px;
	padding: 3px 10px;
}

/* ── Management page topbar ── */
.admin-topbar {
	display: flex;
	flex-direction: row;
	/* flex-end: etiketli esik filtreleri (label ustte + input) cipak input/dropdown/+
	   butonundan uzun; center hizada input KUTULARI ayni hatta oturmuyordu. Alt hizada
	   tum input kutulari ayni satira oturur, etiketler ustte yuzer. */
	align-items: flex-end;
	gap: 10px;
	width: 100%;
	padding: 10px 0 14px 0;
	box-sizing: border-box;
}
.admin-topbar .admin-topbar-filter {
	flex: 1 1 auto;
	min-width: 0;
	height: 38px;
	font-size: 14px;
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.16);
	color: #f1f5f9;
}
.admin-topbar .admin-topbar-filter:focus {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(40, 167, 69, 0.75);
	color: #fff;
	box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.18);
}
.admin-topbar .admin-topbar-filter::placeholder {
	color: rgba(241, 245, 249, 0.58);
}
.admin-topbar .admin-topbar-add {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	font-weight: 700;
	border-radius: 6px;
}

/* ── Tier badge ── */
.admin-tier-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	background: rgba(125, 125, 125, 0.18);
	color: var(--bs-body-color, #ddd);
}
.admin-tier-starter    { background: rgba(108, 117, 125, 0.25); }
.admin-tier-pro        { background: rgba(40, 167, 69, 0.25);  color: #4caf50; }
.admin-tier-studio     { background: rgba(23, 162, 184, 0.25); color: #17a2b8; }
.admin-tier-enterprise { background: rgba(255, 153, 0, 0.25);  color: #ff9900; }
.admin-tier-demo       { background: rgba(108, 117, 125, 0.2); color: #adb5bd; }

/* ─── LogsPage yerlesimi: ayar adasi dogal yukseklik, log okuma adasi sayfanin
   kalan viewport yuksekligini doldurur ───
   .content-area'da height YOK (yalniz min/max-height: calc(100vh-53px)); CSS'te
   yuzde-yukseklik parent'in EXPLICIT height'i olmadan cozulmez, bu yuzden
   .logs-page{height:100%} auto'ya duser ve flex zinciri cokerdi. Cozum: logs
   sayfasinda content-area'yi flex column yap, .logs-page'i flex:1 ile cocuk olarak
   strech et (flex, min/max-height'i kullanir; yuzde-yukseklik gotcha'sina takilmaz).
   Ilk admin-card (ayar) dogal, son admin-card (viewer) flex:1 ile kalani alir. */
.content-area:has(> .logs-page) {
	display: flex;
	flex-direction: column;
}
.logs-page {
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.logs-page > .admin-card:last-child {
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.logs-page > .admin-card:last-child > .Wt-stack {
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
/* Aktif tab container = Wt-stack'in flex item'i → flex:1 ile yuksekligi kalan
   alana SINIRLI. (display:flex DENENMEZ: WStackedWidget aktif sekmeye inline
   display:block basar ve onu ezer; bu yuzden ic .log-view flex:1 alamaz.) Scroll
   bu yuzden DOGRUDAN sekme container'ina verilir — overflow:Auto Wt C++ tarafinda
   (LogsPage make_log_panel: parent->setOverflow(Auto)); flex-item'da display'den
   bagimsiz calisir. .log-view icerik kadar buyur, sekme container'i scroll eder. */
.logs-page > .admin-card:last-child > .Wt-stack > * {
	flex: 1 1 0;
	min-height: 0;
}
