:root {
  --bg: #0f1420;
  --panel: #161d2e;
  --panel-2: #1d2740;
  --border: #2a3550;
  --text: #e8ecf7;
  --text-dim: #93a0c0;
  --accent: #4f7dff;
  --accent-2: #6f97ff;
  --accent-soft: rgba(79, 125, 255, 0.14);
  --danger: #ef5468;
  --success: #35c98f;
}

/* ----------------------------------------------- secilebilir temalar ---
   BrewOn/InsightOn admin panellerindeki 8 temali yapidan tasindi (kullanici
   istegi) - degisken adlari NexusOn'un kendi adlandirmasina eslendi:
   surface->panel, surface2->panel-2, muted->text-dim, green->success,
   red->danger. "night" burada tekrar tanimlanmiyor, zaten yukaridaki
   :root'un varsayilani. Uygulama html[data-theme] uzerinden (bkz.
   dashboard.js), secim localStorage'da tutulur. NexusOn Admin markasi
   (.brand) duz metin oldugu icin - masaustu uygulamadaki logo gorseli gibi -
   acik temalarda okunabilirlik sorunu yok. */
html[data-theme="cream"] {
  --bg: #f6f0e8; --panel: #ffffff; --panel-2: #efe7da; --border: #e2d5c3;
  --accent: #b5502f; --accent-2: #c97753; --accent-soft: rgba(181, 80, 47, 0.12);
  --text: #2b2420; --text-dim: #857a6c;
  --success: #4c8b6b; --danger: #c1443b;
}
html[data-theme="teal"] {
  --bg: #f5f7f6; --panel: #ffffff; --panel-2: #eef2f0; --border: #dde3e0;
  --accent: #0f766e; --accent-2: #1d9a8f; --accent-soft: rgba(15, 118, 110, 0.12);
  --text: #1c2624; --text-dim: #5f6e6a;
  --success: #2e9b5e; --danger: #d64545;
}
html[data-theme="orman"] {
  --bg: #14231e; --panel: #1b2f27; --panel-2: #21382e; --border: #2c4a3d;
  --accent: #34d399; --accent-2: #5eeab3; --accent-soft: rgba(52, 211, 153, 0.14);
  --text: #e6f2ec; --text-dim: #8fafa0;
  --success: #4ade80; --danger: #ef5468;
}
html[data-theme="gunbatimi"] {
  --bg: #fff7ed; --panel: #ffffff; --panel-2: #fceedd; --border: #f3ddbf;
  --accent: #d97706; --accent-2: #f0973a; --accent-soft: rgba(217, 119, 6, 0.12);
  --text: #4a2e12; --text-dim: #9a7350;
  --success: #4c8b6b; --danger: #c1443b;
}
html[data-theme="lavanta"] {
  --bg: #18122b; --panel: #201a37; --panel-2: #282041; --border: #362b54;
  --accent: #8b5cf6; --accent-2: #a78bfa; --accent-soft: rgba(139, 92, 246, 0.16);
  --text: #ede9f7; --text-dim: #a79bc4;
  --success: #34d399; --danger: #f87171;
}
html[data-theme="gulkurusu"] {
  --bg: #fbf7f5; --panel: #ffffff; --panel-2: #f5eae8; --border: #ead9d7;
  --accent: #b85d64; --accent-2: #d08088; --accent-soft: rgba(184, 93, 100, 0.12);
  --text: #3d2a2c; --text-dim: #8c7274;
  --success: #4c8b6b; --danger: #c1443b;
}
html[data-theme="kiraz"] {
  --bg: #1a1618; --panel: #221c1f; --panel-2: #2a2226; --border: #392e32;
  --accent: #e63946; --accent-2: #f16b76; --accent-soft: rgba(230, 57, 70, 0.16);
  --text: #f3e9eb; --text-dim: #b49ca1;
  --success: #34d399; --danger: #ff4d6d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, sans-serif;
  font-size: 14px;
}

.hidden { display: none !important; }

/* --- Login --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 8px 30px #00000040;
}
.login-card h1 { font-size: 18px; margin: 0 0 20px; text-align: center; }
.login-card h1 span { color: var(--accent-2); }

/* --- Shared --- */
.field-row { margin-bottom: 14px; }
.field-row label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 12px; }
.field-row input, .field-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.primary-btn {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.primary-btn:hover { background: var(--accent-2); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.error-text { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { opacity: 0.8; }
.link-btn.danger { color: var(--danger); }

/* --- Dashboard --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 3px solid var(--accent);
}
.brand { font-size: 17px; font-weight: 700; }
.brand span { color: var(--accent-2); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); }
.logout-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

/* --- Tema secici (BrewOn/InsightOn admin panelleriyle ayni desen) --- */
.tema-secici { position: relative; }
.tema-secici-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
  font-family: inherit;
}
.tema-secici-btn:hover { border-color: var(--text-dim); color: var(--text); }
.tema-yuvarlagi {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(127, 127, 127, 0.35);
}
.tema-dropdown {
  position: fixed; z-index: 300; width: 208px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px #00000059; padding: 6px;
}
.tema-secenek {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0;
  padding: 8px 9px; border: none; border-radius: 7px; background: transparent;
  color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background 0.1s;
}
.tema-secenek:hover { background: var(--panel-2); }
.tema-secenek.secili { background: var(--accent-soft); color: var(--accent); }
.tema-secenek .etiket { flex: 1; text-align: left; }
.tema-secenek .onay { font-size: 12px; }

.dashboard-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 54px);
}

.dashboard-nav {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  padding: 20px 12px;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.nav-item {
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

.dashboard {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px;
  max-width: 1400px;
}

.dashboard-page.hidden { display: none; }

.section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.section-card h2 { margin: 0 0 4px; font-size: 15px; }
.section-card .section-desc { color: var(--text-dim); font-size: 12.5px; margin: 0 0 16px; }

.item-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.item-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--panel-2);
}
.item-thumb {
  width: 56px; height: 40px; border-radius: 6px; object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.item-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 10px; text-align: center;
}
.item-text { flex: 1; font-size: 13px; }
.media-type-badge {
  font-size: 10px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 100px;
  padding: 2px 8px; flex-shrink: 0;
}
.item-delete {
  background: none; border: 1px solid var(--border); color: var(--danger);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 14px;
  flex-shrink: 0;
}
.item-delete:hover { background: #3a1a20; }
.item-edit {
  background: none; border: 1px solid var(--border); color: var(--accent);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px;
  flex-shrink: 0;
}
.item-edit:hover { background: #1a2440; }
.item-view {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px;
  flex-shrink: 0;
}
.item-view:hover { background: #1e2230; color: var(--text); }
.edit-text-row { flex: 1; min-width: 160px; margin-bottom: 0; }
.edit-image { max-width: 200px; font-size: 12px; }
.empty-hint { color: var(--text-dim); font-size: 12.5px; margin: 0 0 12px; }

.slide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.slide-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); overflow: hidden;
  display: flex; flex-direction: column;
}
.slide-card-thumb-wrap {
  position: relative; width: 100%; aspect-ratio: 1.91 / 1; background: var(--bg);
  flex-shrink: 0;
}
.slide-card-thumb-wrap img, .slide-card-thumb-wrap video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.slide-card-thumb-wrap .item-thumb.placeholder {
  position: absolute; inset: 0; border-radius: 0;
}
.slide-card-order {
  position: absolute; top: 6px; left: 6px;
  background: #0009; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px; line-height: 1.4;
}
.slide-card-badge { position: absolute; top: 6px; right: 6px; }
.slide-card-foot {
  display: flex; align-items: center; gap: 6px; padding: 8px 9px;
}
.slide-card-foot .item-text {
  flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0;
}
.slide-card-edit {
  display: flex; flex-direction: column; gap: 8px; padding: 9px;
}
.slide-card-edit input[type="text"], .slide-card-edit .edit-text {
  width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12.5px; font-family: inherit;
}
.slide-card-edit .edit-image { width: 100%; max-width: none; }
.slide-card-edit-actions { display: flex; gap: 6px; }
.slide-card-edit-actions .primary-btn { width: auto; flex: 1; padding: 7px; font-size: 12.5px; }

.agent-row {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 110px 1.3fr 60px 26px;
  align-items: center;
  gap: 12px;
}
.agent-list-header {
  padding: 0 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.agent-row .item-text { flex: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-list-row {
  display: grid;
  grid-template-columns: 1fr 140px 60px 26px;
  align-items: center;
  gap: 12px;
}
.admin-list-header {
  padding: 0 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.admin-list-row .item-text { flex: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field-row { flex: 1; min-width: 180px; margin-bottom: 0; }
.inline-form .primary-btn { width: auto; padding: 10px 18px; }

.build-status { margin-top: 14px; font-size: 13px; }
.build-status.status-running { color: #e8b93b; }
.build-status.status-success { color: var(--success); }
.build-status.status-error { color: var(--danger); }
.build-log {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.download-link {
  display: inline-block; margin-top: 10px; color: var(--success);
  font-weight: 600; font-size: 13px;
}

/* --- Destek kayitlari --- */
.ticket-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ticket-stat-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.ticket-stat-chip b { color: var(--accent-2); }

.table-wrap { overflow-x: auto; }
.ticket-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ticket-table th {
  text-align: left; color: var(--text-dim); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ticket-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.status-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.status-pill.cozuldu { background: #123d2c; color: var(--success); }
.status-pill.devam_ediyor { background: #3a2f0f; color: #e8b93b; }
.status-pill.yonlendirildi { background: #1d2c55; color: var(--accent-2); }
