:root {
  --bg: #2a2d32;
  --bg-2: #292c31;
  --card: #2b2e33;
  --text: #e6e9ef;
  --muted: #8b93a1;
  --accent: #2ee6c8;
  --accent-2: #17b7a0;
  --danger: #ff6b6b;
  --danger-2: #e04f4f;
  --shadow-dark: #202226;
  --shadow-light: #34383e;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 650; margin: 0 0 .5rem; }
.muted { color: var(--muted); font-size: .85rem; }
.hidden { display: none !important; }
.inline { display: inline; margin: 0; }

/* ---------- Neumorphic yüzeyler ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 8px 8px 18px var(--shadow-dark),
             -8px -8px 18px var(--shadow-light);
}

/* ---------- Butonlar ---------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: .6rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  box-shadow: 4px 4px 10px var(--shadow-dark),
             -4px -4px 10px var(--shadow-light);
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active {
  box-shadow: inset 3px 3px 7px var(--shadow-dark),
              inset -3px -3px 7px var(--shadow-light);
  transform: translateY(0);
}
.btn.accent { color: #05201c; background: linear-gradient(145deg, var(--accent), var(--accent-2)); }
.btn.danger { color: #2a0d0d; background: linear-gradient(145deg, var(--danger), var(--danger-2)); }
.btn.ghost  { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.tiny { padding: .35rem .6rem; font-size: .78rem; border-radius: 10px; }

/* ---------- Form alanları ---------- */
label { display: block; font-size: .8rem; color: var(--muted); margin: .8rem 0 .3rem; }
.field {
  width: 100%;
  padding: .7rem .9rem;
  border: none;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text);
  font-size: .95rem;
  box-shadow: inset 4px 4px 8px var(--shadow-dark),
              inset -4px -4px 8px var(--shadow-light);
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.field { resize: vertical; }

.alert { padding: .6rem .8rem; border-radius: 10px; font-size: .85rem; margin-top: .6rem; }
.alert.error { background: rgba(255,107,107,.12); color: var(--danger); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 360px; padding: 2rem; text-align: center; }
.login-card h1 { margin-top: .5rem; }
.login-logo { font-size: 2.6rem; }
.login-card label { text-align: left; }
.login-card .btn { width: 100%; margin-top: 1.4rem; }

/* ---------- Topbar ---------- */
.app { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap;
}
.brand { font-size: 1.3rem; font-weight: 700; }
.brand span { letter-spacing: .5px; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.user-chip {
  padding: .4rem .8rem; border-radius: 20px; font-size: .82rem; color: var(--muted);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

/* ---------- Uyarı bandı ---------- */
.banner {
  padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: .9rem;
  text-align: center;
}
.banner.error { background: rgba(255,107,107,.15); color: var(--danger);
  border: 1px solid rgba(255,107,107,.35); }

/* ---------- Kart grid ---------- */
.grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

.sub-card { padding: 1.2rem; display: flex; flex-direction: column; gap: .7rem; }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.sub-title { font-size: 1.1rem; font-weight: 650; }
.sub-title a { color: var(--text); text-decoration: none; }
.sub-title a:hover { color: var(--accent); }
.sub-menu { display: flex; gap: .3rem; }

.field-row {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-2); border-radius: 10px; padding: .5rem .7rem;
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.field-row .label { font-size: .72rem; color: var(--muted); min-width: 58px; }
.field-row .value { flex: 1; font-size: .9rem; word-break: break-all; font-family: ui-monospace, monospace; }
.icon-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1rem; padding: .1rem .25rem; border-radius: 6px;
}
.icon-btn:hover { color: var(--accent); }

.sub-notes { font-size: .82rem; color: var(--muted); }

/* Kod bekle / geri sayım */
.watch-area { margin-top: .3rem; }
.btn-watch { width: 100%; }
.listening {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem; border-radius: 12px; font-size: .9rem; color: var(--accent);
  background: rgba(46,230,200,.08);
}
.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,230,200,.6); }
  70% { box-shadow: 0 0 0 10px rgba(46,230,200,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,230,200,0); }
}

/* Gelen kod */
.code-box {
  position: relative;
  margin-top: .3rem; padding: .9rem; border-radius: 14px; text-align: center;
  background: rgba(46,230,200,.1); border: 1px solid rgba(46,230,200,.4);
  animation: highlight 1s ease;
}
.code-clear {
  position: absolute; top: 4px; right: 6px; font-size: .8rem;
  color: var(--muted); line-height: 1;
}
.code-clear:hover { color: var(--danger); }
.code-value {
  font-size: 2rem; font-weight: 750; letter-spacing: 4px; color: var(--accent);
  font-family: ui-monospace, monospace;
}
.code-box .btn { margin-top: .5rem; }
.code-remaining { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
@keyframes highlight {
  0% { transform: scale(.96); box-shadow: 0 0 0 0 rgba(46,230,200,.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(46,230,200,0); }
}

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 1.6rem; bottom: 1.6rem; width: 60px; height: 60px;
  border: none; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer;
  color: #05201c; background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 6px 6px 16px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
  transition: transform .1s ease;
}
.fab:hover { transform: scale(1.06) rotate(90deg); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; padding: 1rem; z-index: 50;
}
.modal { width: 100%; max-width: 460px; padding: 1.6rem; max-height: 90vh; overflow-y: auto; }
.modal.small { max-width: 380px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.sep { border: none; border-top: 1px solid var(--shadow-dark); margin: 1.2rem 0; }
.checkbox { display: flex; align-items: center; gap: .5rem; color: var(--text); }
.checkbox input { width: auto; }

/* Admin kullanıcı listesi */
.user-list { display: flex; flex-direction: column; gap: .5rem; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem .8rem; border-radius: 10px;
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.user-row .uname { font-weight: 600; }
.user-row .tag { font-size: .7rem; color: var(--accent); margin-left: .4rem; }
.user-row.inactive { opacity: .55; }
.user-form .field { margin-bottom: .5rem; }
.user-controls { display: flex; align-items: center; gap: .4rem; }
.tiny-select { padding: .3rem .4rem; font-size: .75rem; width: auto; }
select.field { appearance: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%);
  background: var(--card); color: var(--text); padding: .7rem 1.2rem; border-radius: 12px;
  box-shadow: 4px 4px 12px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
  z-index: 100; font-size: .88rem;
  animation: toastin .2s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .app { padding: .8rem; }
}
