/* ============================================================
   Yönetim paneli teması — cyber koyu
   ============================================================ */
:root {
  --bg-0: #05080f;
  --bg-1: #0a101f;
  --bg-2: #0e1629;
  --bg-3: #131d36;
  --line: #1c2a4a;
  --green: #00ff9c;
  --green-dim: #00b96f;
  --cyan: #00e5ff;
  --amber: #ffb020;
  --red: #ff3b5c;
  --text: #d7e2f4;
  --text-dim: #8aa0c3;
  --muted: #5c7196;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --sans: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --glow-g: 0 0 12px #00ff9c55;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}
::selection { background: #00ff9c33; }
a { color: var(--cyan); text-decoration: none; }

.input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #00ff9c1f; }
textarea.input { resize: vertical; min-height: 90px; font-family: var(--sans); line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: all .18s; color: var(--text);
}
.btn.primary {
  background: var(--green); color: #02150c;
  box-shadow: var(--glow-g);
  border: none; width: 100%; justify-content: center;
}
.btn.primary:hover { background: #2bffb0; }
.btn.ghost { background: var(--bg-2); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: #ff3b5c14; border-color: #ff3b5c66; color: var(--red); }
.btn.danger:hover { background: #ff3b5c26; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(700px 380px at 70% 10%, #00e5ff0a, transparent 60%),
    radial-gradient(700px 380px at 20% 90%, #00ff9c0a, transparent 60%);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 34px;
  box-shadow: 0 30px 80px #000c;
}
.auth-logo {
  width: 52px; height: 52px; border-radius: 12px;
  background: #00ff9c12; border: 1px solid var(--green-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--green);
  margin-bottom: 18px;
  box-shadow: var(--glow-g);
}
.auth-card h1 { font-size: 24px; margin-bottom: 8px; font-family: var(--mono); }
.auth-card .muted { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-card form { display: grid; gap: 12px; }
.auth-err {
  margin-top: 14px; font-family: var(--mono); font-size: 13px;
  color: var(--red); padding: 10px 12px; border: 1px solid var(--red);
  border-radius: 8px; background: #ff3b5c0d; text-align: center;
}
.form-msg { margin-top: 14px; font-family: var(--mono); font-size: 13px; }
.srv-info {
  margin-top: 16px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

/* ---------- Panel ---------- */
.panel { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sb-brand {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--text); padding: 4px 10px 16px;
  border-bottom: 1px solid var(--line); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.sb-brand .gb { color: var(--green); text-shadow: var(--glow-g); }
.sb-brand small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }

.sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: none; border-radius: 8px;
  color: var(--text-dim); font-family: var(--mono); font-size: 13.5px;
  padding: 10px 12px; cursor: pointer; transition: all .15s;
  margin-bottom: 2px;
}
.sb-item:hover { background: #00ff9c0a; color: var(--text); }
.sb-item.active { background: #00ff9c14; color: var(--green); }
.sb-item .badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; border-radius: 999px; padding: 1px 7px;
}
.sb-foot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Main */
.p-main { flex: 1; padding: 26px 30px 60px; min-width: 0; }
.p-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.p-head h2 { font-family: var(--mono); font-size: 22px; }
.p-head .hint { color: var(--muted); font-size: 13.5px; max-width: 620px; }

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card h3 {
  font-family: var(--mono); font-size: 15px; color: var(--cyan);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
}
.card h3 .card-actions { display: flex; gap: 6px; }

.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-field { display: grid; gap: 6px; }
.f-field.full { grid-column: 1 / -1; }
.f-field label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.f-field .l-flag { color: var(--green-dim); }
.f-row { display: flex; gap: 8px; align-items: center; }
.f-row input[type=checkbox] { accent-color: var(--green); width: 17px; height: 17px; }

/* Liste editörü */
.item-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.item-head .handle { color: var(--muted); cursor: grab; font-family: var(--mono); }
.item-head .t { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.item-head .del {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.item-head .del:hover { color: var(--red); border-color: var(--red); }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item-grid .full { grid-column: 1 / -1; }

.add-btn {
  width: 100%; padding: 10px; margin-top: 4px;
  background: #00ff9c0d; border: 1px dashed var(--green-dim);
  border-radius: 9px; color: var(--green); font-family: var(--mono); font-size: 13px;
  cursor: pointer;
}
.add-btn:hover { background: #00ff9c1a; }

/* Mesajlar */
.msg-item {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 10px;
}
.msg-item.unread { border-left: 3px solid var(--green); }
.msg-item .m-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.msg-item .m-who b { font-size: 15px; }
.msg-item .m-who span { color: var(--muted); font-family: var(--mono); font-size: 12.5px; margin-left: 8px; }
.msg-item .m-date { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.msg-item .m-sub { color: var(--cyan); margin: 8px 0 4px; font-size: 14.5px; }
.msg-item .m-body { color: var(--text-dim); font-size: 14px; white-space: pre-wrap; }
.msg-item .m-act { display: flex; gap: 8px; margin-top: 12px; }

/* Upload */
.upload-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-row img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.file-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; cursor: pointer; color: var(--text-dim); transition: all .15s;
}
.file-label:hover { border-color: var(--cyan); color: var(--cyan); }
.file-label input { display: none; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: var(--bg-1); border: 1px solid var(--green-dim);
  color: var(--green); font-family: var(--mono); font-size: 13.5px;
  padding: 14px 20px; border-radius: 10px;
  box-shadow: 0 10px 40px #000c, var(--glow-g);
}
.toast.bad { border-color: var(--red); color: var(--red); }

/* Kaydet çubuğu */
.save-bar {
  position: sticky; bottom: 18px;
  display: flex; justify-content: flex-end;
  margin-top: 30px;
}
.save-bar .btn.primary { width: auto; padding: 12px 26px; }

.empty-note { color: var(--muted); font-family: var(--mono); font-size: 13px; border: 1px dashed var(--line); border-radius: 9px; padding: 16px; text-align: center; }

/* İki dilli etiket rozeti */
.dl-tag { font-size: 10px; color: var(--amber); font-family: var(--mono); letter-spacing: .5px; }

@media (max-width: 820px) {
  .panel { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .sb-brand { width: 100%; }
  .sb-item { width: auto; }
  .p-main { padding: 20px 16px 50px; }
  .f-grid, .item-grid { grid-template-columns: 1fr; }
}