/* ================================================
   JARVIS V4 — style.css — modern redesign
   ================================================ */

:root {
  --bg0: #f8fafc;
  --bg1: #ffffff;
  --bg2: #f4f5f7;
  --bg3: #e5e7eb;
  --bg4: #d1d5db;
  --bg5: #cbd5e1;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: rgba(255, 255, 255, 1);
  --surface-soft: rgba(248, 250, 252, 0.88);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.16);
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --ac: #111827;
  --ac-soft: rgba(17, 24, 39, 0.10);
  --ac-strong: #475569;
  --text: #111827;
  --text-muted: #475569;
  --text-soft: #6b7280;
  --error: #b91c1c;
  --success: #16a34a;
  --radius: 20px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.33,.01,.26,1);
}

/* ================================================
   JARVIS V5 — premium interface and mobile layer
   ================================================ */

body {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(237, 242, 247, 0.92)),
    radial-gradient(circle at 16% 18%, rgba(0, 212, 255, 0.12), transparent 24%),
    radial-gradient(circle at 82% 8%, rgba(212, 175, 55, 0.14), transparent 20%),
    radial-gradient(circle at 84% 86%, rgba(16, 185, 129, 0.10), transparent 22%);
}

.auth-screen {
  padding: clamp(14px, 3vw, 34px);
  background:
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 48%, #ffffff 100%);
}

.auth-bg::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 32px;
  background:
    linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, black, transparent 82%);
}

.auth-center {
  width: min(1120px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.78fr);
  align-content: center;
  column-gap: clamp(24px, 4vw, 64px);
  padding: clamp(26px, 4vw, 58px);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.94), rgba(248,250,252,0.86)),
    radial-gradient(circle at 30% 18%, rgba(0,212,255,0.11), transparent 28%);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.14);
}

.auth-logo,
.auth-intro,
.auth-footer {
  grid-column: 1;
}

.auth-tabs,
.auth-form {
  grid-column: 2;
}

.auth-logo {
  align-self: end;
  margin-bottom: 32px;
}

.logo-hex-wrap {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(17,24,39,0.96), rgba(30,41,59,0.92));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 20px 40px rgba(15,23,42,0.16);
}

.logo-name {
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  color: #111827;
}

.logo-ver {
  color: #64748b;
  letter-spacing: 0.22em;
}

.auth-intro {
  max-width: 560px;
}

.auth-title {
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
}

.auth-description {
  max-width: 520px;
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.8;
  color: #475569;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.auth-badges span {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15,23,42,0.08);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.auth-tabs,
.auth-form {
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.auth-tabs {
  padding: 5px;
  border-radius: 18px;
  background: rgba(15,23,42,0.06);
  border-color: rgba(15,23,42,0.08);
}

.auth-tab.active {
  background: #111827;
  color: #ffffff;
  border-radius: 14px;
}

.auth-form {
  padding: 24px;
  border-radius: 26px;
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(15,23,42,0.09);
  box-shadow: 0 18px 50px rgba(15,23,42,0.10);
}

.auth-form-title {
  color: #111827;
  letter-spacing: 0.08em;
}

.auth-input,
.modal-input,
.chat-search {
  letter-spacing: 0;
}

.auth-input {
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(15,23,42,0.10);
}

.auth-input:focus {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12);
}

.auth-btn {
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, #334155 52%, #0f766e);
  box-shadow: 0 18px 32px rgba(15,23,42,0.18);
}

.auth-footer {
  align-self: end;
  justify-self: start;
  margin-top: 30px;
  color: #64748b;
}

.app {
  background:
    radial-gradient(circle at 22% 12%, rgba(0,212,255,0.10), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(212,175,55,0.12), transparent 22%),
    linear-gradient(135deg, #f8fafc, #eef2f7 55%, #ffffff);
}

.sidebar {
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(15,23,42,0.08);
}

.sb-new,
.sb-news,
.sb-mini {
  border-radius: 16px;
}

.v5-sidebar-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 18px;
}

.sb-mini {
  padding: 10px 8px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(248,250,252,0.86);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.sb-mini:hover {
  color: var(--text);
  background: var(--ac-soft);
}

.chat {
  padding: 20px 24px 0;
}

.chat-header {
  margin-bottom: 10px;
  background: rgba(255,255,255,0.74);
}

.v5-command-deck {
  position: relative;
  z-index: 5;
  max-width: 980px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.v5-command-deck::before {
  content: attr(data-project) " · " attr(data-tasks) " açık görev";
  position: absolute;
  right: 0;
  top: -28px;
  font-size: 11px;
  color: var(--text-soft);
}

.v5-command-deck button {
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.78);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15,23,42,0.05);
}

.v5-command-deck button span {
  display: block;
  font-weight: 800;
}

.v5-command-deck button small {
  display: block;
  color: var(--text-soft);
  margin-top: 4px;
}

.msgs {
  padding-top: 10px;
}

.msg-body {
  border-radius: 22px;
}

.input-zone {
  margin: 0 -24px;
  padding: 14px 24px 22px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(18px);
}

.input-wrap {
  max-width: 980px;
  margin: 0 auto;
  box-shadow: 0 16px 36px rgba(15,23,42,0.08);
}

.v5-split {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 20px;
}

.v5-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.v5-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248,250,252,0.88);
  border: 1px solid rgba(15,23,42,0.08);
}

.v5-item.active {
  border-color: rgba(0,212,255,0.45);
  box-shadow: inset 0 0 0 1px rgba(0,212,255,0.15);
}

.v5-item.done {
  opacity: .62;
}

.v5-item strong,
.v5-item span {
  display: block;
}

.v5-item span {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.v5-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.v5-row-actions button,
.v5-tool-grid button {
  border: 1px solid rgba(15,23,42,0.08);
  background: #ffffff;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
}

.v5-empty {
  padding: 18px;
  color: var(--text-soft);
  border-radius: 18px;
  background: rgba(248,250,252,0.82);
  border: 1px dashed rgba(15,23,42,0.14);
}

.v5-progress {
  position: relative;
  height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15,23,42,0.06);
  color: var(--text-muted);
  font-size: 12px;
}

.v5-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(0,212,255,0.25), rgba(16,185,129,0.24));
}

.v5-progress span {
  position: relative;
  z-index: 1;
}

.v5-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.v5-tool-grid button {
  min-height: 110px;
  text-align: left;
  padding: 16px;
  background: rgba(248,250,252,0.92);
}

.v5-tool-grid strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
}

.v5-tool-grid span {
  color: var(--text-soft);
  line-height: 1.5;
}

.v5-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3000;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(15,23,42,.20);
  transform: translateY(12px);
  opacity: 0;
  transition: .22s ease;
}

.v5-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .auth-center {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 18px;
  }

  .auth-logo,
  .auth-intro,
  .auth-tabs,
  .auth-form,
  .auth-footer {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
  }

  .auth-title {
    font-size: 34px;
  }

  .v5-command-deck,
  .v5-tool-grid,
  .v5-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    align-items: flex-start;
    overflow-y: auto;
  }

  .auth-bg::before {
    inset: 10px;
    border-radius: 22px;
  }

  .auth-center {
    padding: 20px;
    border-radius: 24px;
    min-height: auto;
  }

  .auth-logo {
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }

  .logo-hex-wrap {
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  .logo-name {
    font-size: 34px;
  }

  .auth-title {
    font-size: 26px;
  }

  .auth-description {
    font-size: 14px;
  }

  .auth-badges {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-form {
    padding: 18px;
    border-radius: 22px;
  }

  .mobile-topbar {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(18px);
  }

  .chat {
    padding: 72px 10px 0;
  }

  .chat-header {
    padding: 10px;
    gap: 8px;
  }

  .chat-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-action-btn {
    padding: 10px;
    font-size: 12px;
    border-radius: 14px;
  }

  .v5-command-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .v5-command-deck::before {
    position: static;
    grid-column: 1 / -1;
    order: -1;
    text-align: center;
    margin-bottom: 2px;
  }

  .v5-command-deck button {
    padding: 12px;
    border-radius: 16px;
  }

  .empty {
    position: relative;
    min-height: calc(100vh - 300px);
    bottom: auto;
    padding-top: 12px;
  }

  .jarvis-core {
    width: 92px;
    height: 92px;
  }

  .chips {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .chip {
    padding: 14px;
    border-radius: 18px;
  }

  .input-zone {
    margin: 0 -10px;
    padding: 10px 10px max(14px, env(safe-area-inset-bottom));
  }

  .input-wrap {
    border-radius: 18px;
  }

  #msg-input {
    font-size: 15px;
  }

  .v5-item {
    grid-template-columns: 1fr;
  }

  .v5-row-actions {
    justify-content: flex-start;
  }

  .modal-box.v5-modal {
    width: calc(100vw - 16px);
    max-height: 88vh;
    overflow-y: auto;
  }

  .v5-toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

body[data-theme='cyan'] {
  --ac: #00d4ff;
  --ac-soft: rgba(0, 212, 255, 0.16);
  --ac-strong: #8df0ff;
}

body[data-theme='gold'] {
  --ac: #d4af37;
  --ac-soft: rgba(212, 175, 55, 0.16);
  --ac-strong: #f1d96e;
}

body[data-theme='green'] {
  --ac: #22c55e;
  --ac-soft: rgba(34, 197, 94, 0.16);
  --ac-strong: #86efac;
}

body[data-theme='red'] {
  --ac: #ef4444;
  --ac-soft: rgba(239, 68, 68, 0.16);
  --ac-strong: #fda4af;
}

body[data-theme='pink'] {
  --ac: #ec4899;
  --ac-soft: rgba(236, 72, 153, 0.16);
  --ac-strong: #f9a8d4;
}

body[data-theme='purple'] {
  --ac: #8b5cf6;
  --ac-soft: rgba(139, 92, 246, 0.16);
  --ac-strong: #c4b5fd;
}

body[data-theme='emerald'] {
  --ac: #10b981;
  --ac-soft: rgba(16, 185, 129, 0.16);
  --ac-strong: #6ee7b7;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top left, rgba(17, 24, 39, 0.04), transparent 18%),
              radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.03), transparent 18%),
              linear-gradient(180deg, #f8fafc 0%, #f1f5f9 45%, #ffffff 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-screen.hidden,
.app.hidden,
.modal-overlay.hidden {
  display: none !important;
}

body.modal-open,
body.mobile-nav-open {
  overflow: hidden;
}

/* AUTH SCREEN */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(248,250,252,0.98) 0%, rgba(255,255,255,0.98) 100%);
}

.auth-screen.hidden {
  display: none;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.08), transparent 18%),
                    radial-gradient(circle at 80% 15%, rgba(212, 175, 55, 0.06), transparent 14%),
                    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.05), transparent 18%);
  opacity: 0.8;
}

.auth-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  filter: blur(28px);
}

.auth-glow-1 {
  top: -40px;
  left: -30px;
  background: rgba(0, 212, 255, 0.16);
}

.auth-glow-2 {
  bottom: -30px;
  right: -20px;
  background: rgba(212, 175, 55, 0.14);
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  opacity: 0.35;
}

.auth-center {
  position: relative;
  width: min(100%, 560px);
  padding: 36px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.auth-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 560px) {
  .auth-row {
    grid-template-columns: 1fr;
  }
}

.auth-logo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}

.logo-hex-wrap {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.logo-name {
  font-size: 28px;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.04em;
  color: var(--ac);
  text-transform: none;
  margin: 0;
}

.sb-logo svg text {
  fill: var(--ac) !important;
}

.logo-ver {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.18em;
  margin-top: 6px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: background 0.3s ease, color 0.3s ease;
}

.auth-tab.active,
.auth-tab:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.14), rgba(212, 175, 55, 0.12));
  transform: translateY(-1px);
}

.auth-form-title {
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--text);
  margin-bottom: 22px;
}

.auth-intro {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.auth-description {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  max-width: 100%;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.auth-note {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-btn {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, rgba(0,212,255,0.95), rgba(212,175,55,0.90));
  color: #040b13;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 20px 45px rgba(0, 212, 255, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

@media (max-width: 560px) {
  .auth-screen {
    padding: 18px;
  }

  .auth-center {
    width: 100%;
    padding: 24px 18px;
    border-radius: 28px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
  }

  .auth-logo {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 16px;
  }

  .logo-hex-wrap {
    width: 64px;
    height: 64px;
  }

  .logo-name {
    font-size: 24px;
  }

  .logo-ver {
    font-size: 10px;
  }

  .auth-intro {
    gap: 14px;
  }

  .auth-title {
    font-size: 16px;
  }

  .auth-description {
    font-size: 12px;
  }

  .auth-badges {
    justify-content: center;
  }

  .auth-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .auth-tab {
    padding: 12px 14px;
    font-size: 11px;
  }

  .auth-form-title {
    font-size: 13px;
    margin-bottom: 18px;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .auth-input {
    font-size: 15px;
  }

  .auth-note {
    font-size: 10px;
    padding: 12px 14px;
  }

  .auth-btn {
    padding: 14px;
  }
}

.auth-err {
  min-height: 20px;
  margin-top: 12px;
  color: var(--error);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 11px;
  color: var(--text-soft);
}

.auth-footer-txt,
.auth-sep {
  color: var(--text-soft);
}

/* APP LAYOUT */
.app {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.mobile-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
  line-height: 1.1;
}

.mobile-brand small {
  font-size: 10px;
  color: var(--text-soft);
}

.mobile-menu-btn,
.mobile-profile-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  display: grid;
  place-items: center;
}

@media (min-width: 761px) {
  .mobile-topbar { display: none !important; }
}

.sidebar {
  width: 320px;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  gap: 16px;
}

.sb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sb-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(212, 175, 55, 0.10);
}

.sb-name {
  font-size: 16px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.18em;
  color: var(--text);
}

.sb-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.sb-new,
.sb-news {
  width: auto;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sb-new:hover,
.sb-news:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.22);
  transform: translateY(-1px);
}

.sb-news {
  margin-top: 8px;
}

.sb-section {
  font-size: 10px;
  color: var(--text-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-top: 10px;
}

.conv-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.conv-item {
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: auto;
  font-size: 13px;
  line-height: 1.35;
}

.conv-item:hover {
  transform: translateX(2px);
  border-color: rgba(212, 175, 55, 0.20);
  background: rgba(212, 175, 55, 0.08);
}

.conv-item.active {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.26);
}

.conv-item:hover {
  transform: translateX(4px);
  border-color: rgba(212, 175, 55, 0.20);
}

.conv-item.active {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.26);
}

.sb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}
.sb-credit {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  padding: 10px 0 0;
  letter-spacing: 0.12em;
}

.sb-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
  border-radius: 18px;
  padding: 10px 8px;
  transition: background 0.2s ease;
}

.sb-user-info:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sb-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(51, 214, 255, 0.18), rgba(10, 18, 34, 0.88));
  color: var(--text);
}

.sb-uname {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.sb-urole {
  font-size: 9px;
  color: var(--text-soft);
  letter-spacing: 0.14em;
}

.sb-footer-btns {
  display: flex;
  gap: 8px;
}

.sidebar-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  border: none;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  z-index: 16;
}

.sidebar-close-btn.hidden {
  display: none !important;
}

.sb-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: grid;
  place-items: center;
  color: var(--text-soft);
}

.sb-icon-btn:hover {
  color: var(--text);
  background: rgba(212, 175, 55, 0.14);
}

.sb-logout:hover {
  background: rgba(251, 107, 107, 0.14) !important;
  color: var(--error) !important;
}

/* CHAT */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding: 24px;
}

.chat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(17, 24, 39, 0.04), transparent 22%),
              radial-gradient(circle at bottom, rgba(15, 23, 42, 0.03), transparent 18%);
  pointer-events: none;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chat-search-bar {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.chat-search-bar svg {
  color: var(--text-soft);
}

.chat-search {
  border: none;
  background: transparent;
  color: var(--text);
  width: 100%;
  outline: none;
  font-size: 14px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-action-btn {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-action-btn:hover {
  background: rgba(212, 175, 55, 0.14);
  transform: translateY(-1px);
}

.chat-action-btn.secondary {
  background: rgba(212, 175, 55, 0.16);
}

.search-results {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.search-header {
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.search-result {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result:hover {
  background: rgba(212, 175, 55, 0.12);
}

.search-label {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.search-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.search-meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

.search-empty,
.news-empty {
  color: var(--text-soft);
  font-size: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.news-headline {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.news-summary {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.news-loading,
.news-error {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
}

.news-error {
  border: 1px solid rgba(251, 107, 107, 0.18);
  color: var(--error);
}

.news-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.news-note {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.empty {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 140px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 18px 0;
  text-align: center;
}

.chips {
  grid-template-columns: 1fr;
  gap: 10px;
}

.chips button:nth-child(n+5) {
  display: none;
}


.input-zone {
  position: relative;
  z-index: 4;
}

.jarvis-core {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
}

.empty-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text);
  margin: 0;
}

.empty-title em {
  font-style: normal;
  color: var(--ac);
}

.empty-sub {
  max-width: 680px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.8;
}

.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(680px, 100%);
}

.chip {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.chip:hover {
  transform: translateY(-2px);
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.18);
}

.chip-ico {
  font-size: 18px;
  margin-top: 2px;
  opacity: 0.7;
}

.chip-lbl {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.chip-dsc {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}

.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 20px;
  z-index: 1;
}

.msg-group {
  max-width: 860px;
  margin: 0 auto 22px;
  padding: 0 16px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.msg-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}

.msg-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.msg-group.user .msg-ava {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(10, 18, 34, 0.90));
}

.msg-group.assistant .msg-ava {
  background: rgba(212, 175, 55, 0.14);
  color: var(--ac-strong);
}

.msg-who {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.msg-group.user .msg-who,
.msg-group.assistant .msg-who {
  color: var(--text-soft);
}

.msg-ts {
  margin-left: auto;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
}

.msg-body {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
  line-height: 1.85;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.msg-group.user .msg-body {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.msg-image {
  max-width: 100%;
  border-radius: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 28px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.msg-group:hover .copy-btn {
  opacity: 1;
  transform: translateY(0);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: var(--text-soft);
  font-size: 11px;
}

.copy-btn.copied {
  color: var(--success);
  border-color: rgba(58,208,162,0.25);
}

.msg-body p {
  margin: 0 0 14px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body code {
  background: rgba(255,255,255,0.08);
  padding: 4px 8px;
  border-radius: 10px;
  color: var(--ac-strong);
}

.msg-body pre {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: auto;
  margin: 16px 0;
}

.msg-body pre code {
  display: block;
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text);
}

.msg-body h1,
.msg-body h2,
.msg-body h3 {
  margin: 18px 0 10px;
  color: var(--text);
}

.msg-body h1 { font-size: 24px; }
.msg-body h2 { font-size: 20px; }
.msg-body h3 { font-size: 16px; }

.msg-body ul,
.msg-body ol {
  margin: 12px 0 14px 20px;
}

.msg-body li {
  margin-bottom: 8px;
}

.msg-body blockquote {
  border-left: 3px solid rgba(212, 175, 55, 0.30);
  padding-left: 16px;
  color: var(--text-soft);
  margin: 14px 0;
}

.msg-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.msg-body th,
.msg-body td {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  text-align: left;
}

.msg-body th {
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
}

.msg-body td {
  color: var(--text);
}

.dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.65);
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.12s; }
.dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes bounce {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

.err-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(251, 107, 107, 0.12);
  border: 1px solid rgba(251, 107, 107, 0.18);
  border-radius: 20px;
  padding: 14px 16px;
  color: var(--error);
}

.input-zone {
  padding: 18px 24px 28px;
  background: var(--surface);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 22px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  #msg-input {
    flex: 1;
    min-height: 48px;
    max-height: 220px;
    border: none;
    background: transparent;
    color: var(--text);
    resize: none;
    outline: none;
  }
  flex: 0 0 auto;
  width: auto;
  margin-right: 12px;
}

.img-preview-inner {
  position: relative;
  display: inline-flex;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  max-width: 180px;
}

.img-preview-inner img {
  display: block;
  max-height: 96px;
}

.img-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(251, 107, 107, 0.85);
  color: #fff;
}

.admin-user-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-user-av {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 800;
}

.admin-user-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-info {
  display: grid;
  gap: 8px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-action-btn,
.admin-del-btn {
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.admin-action-btn:hover,
.admin-del-btn:hover {
  background: rgba(212,175,55,0.14);
  transform: translateY(-1px);
}

.admin-del-btn {
  background: rgba(251,107,107,0.12);
  color: var(--error);
}

.admin-user-badge {
  align-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-user-badge.kurucu { background: rgba(212,175,55,0.14); color: #f3e39a; }
.admin-user-badge.admin { background: rgba(44,150,255,0.12); color: #c9e8ff; }
.admin-user-badge.moderator { background: rgba(120,89,255,0.12); color: #d4c7ff; }
.admin-user-badge.silver { background: rgba(255,255,255,0.08); color: #e0e0e0; }

.admin-user-row {
  min-width: 0;
  overflow: hidden;
}

.admin-user-info,
.admin-user-actions {
  min-width: 0;
}

.admin-user-meta {
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-settings-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-fullwidth {
  grid-column: 1 / -1;
}

.admin-settings-panel .modal-label {
  margin-bottom: 12px;
}

.input-btns {
  display: flex;
  gap: 8px;
}

.attach-btn,
.send {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  color: var(--text);
}

.attach-btn:hover,
.send:hover {
  background: rgba(212, 175, 55, 0.16);
}

.send {
  background: linear-gradient(135deg, var(--ac), #b78d29);
  color: #040b13;
  border: none;
}

.send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.input-footer {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.hint {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.key {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px 8px;
}

.status-bar {
  height: 0;
  overflow: hidden;
  transition: height 0.25s ease;
  justify-content: center;
  gap: 10px;
}

.status-bar.visible {
  height: 30px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: auto;
}

.modal-box {
  position: relative;
  z-index: 10000;
  width: min(100%, 720px);
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.modal-box * {
  pointer-events: auto;
}

.modal-header {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-title {
  font-size: 12px;
  color: var(--ac);
  letter-spacing: 0.16em;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: none;
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.modal-body {
  padding: 22px 24px 24px;
  overflow-y: auto;
  min-height: 260px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-search,
.admin-filter {
  flex: 1;
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.admin-search::placeholder,
.admin-filter {
  color: var(--text-soft);
}

.admin-user-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 12px;
}

.admin-user-av {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(212,175,55,0.12);
  color: var(--text);
  font-weight: 700;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-action-btn,
.admin-del-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 11px;
  cursor: pointer;
}

.admin-action-btn:hover,
.admin-del-btn:hover {
  background: rgba(212,175,55,0.14);
}

.admin-user-badge {
  justify-self: end;
  align-self: start;
}

.admin-empty {
  color: var(--text-soft);
  padding: 22px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  text-align: center;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212,175,55,0.16);
  color: var(--ac);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.modal-wide {
  width: min(100%, 900px);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-height: 120px;
}

.admin-users {
  min-height: 140px;
}

.modal-field {
  margin-bottom: 18px;
}

.modal-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.modal-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.modal-btn {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--ac), #b78d29);
  color: #040b13;
  font-weight: 700;
}

.modal-btn.secondary {
  margin-top: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
}

.admin-loading,
.admin-error,
.admin-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  text-align: center;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.profile-av-wrap {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.profile-av-edit {
  width: 34px;
  height: 34px;
  border-radius: 16px;
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--ac);
  color: #040b13;
  display: grid;
  place-items: center;
}

.profile-av-hint {
  color: var(--text-soft);
  font-size: 11px;
}

.color-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
}

.color-swatch.active {
  border-color: rgba(255,255,255,0.24);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-stat {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-stat-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--ac);
}

.admin-stat-lbl {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.admin-user-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-user-av {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(212, 175, 55, 0.14);
}

.admin-user-info {
  display: grid;
  gap: 6px;
}

.admin-user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.admin-user-meta {
  font-size: 11px;
  color: var(--text-soft);
}

.admin-user-badge {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.admin-user-badge.admin {
  color: var(--text);
  background: rgba(251,107,107,0.16);
}

.admin-user-badge.user {
  color: var(--text);
  background: rgba(212, 175, 55, 0.14);
}

.admin-del-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: var(--text-soft);
  border-radius: 14px;
  padding: 8px 12px;
}

.admin-del-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* Responsive */
@media (max-width: 1100px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .sb-header { flex-wrap: wrap; gap: 12px; }
  .sb-new { width: auto; }
  .chat { padding: 20px; }
  .input-zone { padding: 16px 20px 24px; }
  .msg-group { padding: 0 12px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {

  body {
    overflow-y: auto;
  }

  .app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(78vw, 280px);
    height: 100vh;
    min-width: auto;
    padding: 18px 14px 18px;
    border-right: none;
    border-bottom: none;
    border-radius: 0 24px 24px 0;
    transform: translateX(-108%);
    transition: transform 0.28s ease;
    box-shadow: 24px 0 60px rgba(0,0,0,0.20);
    z-index: 16;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 14;
    background: rgba(0,0,0,0.55);
    transition: opacity 0.2s ease;
  }

  .mobile-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-close-btn {
    display: grid;
  }

  .chat {
    width: 100%;
    padding: 70px 12px 16px;
    min-height: 56vh;
  }

  .msgs {
    padding-bottom: 110px;
  }

  .input-zone {
    padding: 10px 12px 16px;
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(15,23,42,0.08);
    backdrop-filter: blur(12px);
  }

  .input-wrap {
    gap: 8px;
    flex-wrap: nowrap;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  .chat-input {
    min-width: 0;
    width: 100%;
    font-size: 15px;
    background: transparent;
    color: var(--text);
  }

  .send,
  .attach-btn {
    flex-shrink: 0;
    min-width: 42px;
    min-height: 42px;
  }

  .empty-title {
    font-size: 22px;
  }

  .empty-sub {
    font-size: 14px;
    padding: 0 10px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-user-row,
  .admin-stat {
    padding: 12px 14px;
  }

  .modal {
    width: calc(100% - 14px);
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-box {
    width: 100%;
    max-width: 100%;
  }
}

.msg-bubble {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Avatar img fix */
.sb-avatar,
.profile-av-wrap {
  overflow: hidden;
}

.sb-avatar img,
.profile-av-wrap img,
#profile-av-img,
#sb-av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* PWA/admin polish */
.auth-center,
.modal-box,
.input-zone,
.sidebar,
.mobile-topbar {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.chat-header,
.search-results,
.admin-settings-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(14px);
}

.chat-header {
  position: relative;
  z-index: 5;
}

.empty {
  background: radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.08), transparent 28%);
}

.jarvis-core {
  background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(248,250,252,0.82));
  border-color: rgba(212, 175, 55, 0.18);
}

.chip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: rgba(255,255,255,0.82);
  border-color: rgba(15, 23, 42, 0.08);
}

.chip span {
  min-width: 0;
}

.chip-lbl,
.chip-dsc {
  display: block;
}

.modal-wide {
  width: min(100%, 1040px);
}

.admin-toolbar {
  padding: 14px;
  border-radius: 22px;
  background: rgba(248,250,252,0.76);
  border: 1px solid rgba(15,23,42,0.08);
}

.admin-settings-panel {
  margin-top: 18px;
}

.admin-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-plugins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plugin-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.72);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.plugin-card:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.24);
}

.plugin-card.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.24);
}

.plugin-switch {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  position: relative;
  margin-top: 1px;
}

.plugin-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15,23,42,0.16);
  transition: transform 0.18s ease;
}

.plugin-card.active .plugin-switch {
  background: var(--ac);
}

.plugin-card.active .plugin-switch::after {
  transform: translateX(16px);
}

.plugin-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.plugin-card small {
  display: block;
  color: var(--text-soft);
  line-height: 1.55;
}

.admin-maintenance {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-error-log {
  display: grid;
  gap: 10px;
}

.admin-error-item {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248,250,252,0.78);
  border: 1px solid rgba(15,23,42,0.08);
}

.admin-error-item strong {
  font-size: 12px;
  color: var(--error);
}

.admin-error-item span {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-error-item small {
  color: var(--text-soft);
}

.admin-user-row {
  grid-template-columns: auto minmax(0, 1fr);
  position: relative;
}

.admin-user-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.admin-user-badge {
  position: absolute;
  top: 14px;
  right: 14px;
}

.admin-action-btn,
.admin-del-btn {
  min-height: 36px;
}

@media (max-width: 900px) {
  .admin-settings-grid,
  .admin-plugins {
    grid-template-columns: 1fr;
  }
}

/* V5 final overrides: keep these last so the refreshed interface wins. */
.auth-center {
  width: min(1120px, 100%) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .78fr) !important;
  gap: clamp(22px, 4vw, 64px) !important;
  padding: clamp(26px, 4vw, 58px) !important;
  border-radius: 34px !important;
}
.auth-logo,
.auth-intro,
.auth-footer { grid-column: 1 !important; }
.auth-tabs,
.auth-form { grid-column: 2 !important; justify-self: end; width: 100%; max-width: 420px; }
.auth-form { background: rgba(255,255,255,.92) !important; border: 1px solid rgba(15,23,42,.09) !important; box-shadow: 0 18px 50px rgba(15,23,42,.10) !important; }
.auth-tab.active { background: #111827 !important; color: white !important; border-radius: 14px !important; }
.logo-name { font-size: clamp(34px, 5vw, 68px) !important; letter-spacing: 0 !important; }
.auth-title { font-size: clamp(28px, 4vw, 54px) !important; line-height: 1.02 !important; letter-spacing: 0 !important; }
.auth-btn { background: linear-gradient(135deg, #111827, #334155 52%, #0f766e) !important; color: #fff !important; }
.v5-sidebar-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 18px; }
.sb-mini { padding: 10px 8px; border: 1px solid rgba(15,23,42,.08); background: rgba(248,250,252,.86); color: var(--text-muted); border-radius: 16px; font-size: 12px; font-weight: 700; }
.v5-command-deck { position: relative; z-index: 5; max-width: 980px; margin: 0 auto 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.v5-command-deck::before { content: attr(data-project) " · " attr(data-tasks) " açık görev"; position: absolute; right: 0; top: -28px; font-size: 11px; color: var(--text-soft); }
.v5-command-deck button { text-align: left; padding: 14px; border-radius: 18px; border: 1px solid rgba(15,23,42,.08); background: rgba(255,255,255,.78); color: var(--text); box-shadow: 0 10px 22px rgba(15,23,42,.05); }
.v5-command-deck button span,
.v5-command-deck button small { display: block; }
.v5-command-deck button span { font-weight: 800; }
.v5-command-deck button small { color: var(--text-soft); margin-top: 4px; }
.v5-split { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 20px; }
.v5-list { display: grid; gap: 10px; max-height: 420px; overflow: auto; }
.v5-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: rgba(248,250,252,.88); border: 1px solid rgba(15,23,42,.08); }
.v5-item.active { border-color: rgba(0,212,255,.45); box-shadow: inset 0 0 0 1px rgba(0,212,255,.15); }
.v5-item.done { opacity: .62; }
.v5-item strong,
.v5-item span { display: block; }
.v5-item span { margin-top: 4px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.v5-row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.v5-row-actions button,
.v5-tool-grid button { border: 1px solid rgba(15,23,42,.08); background: #fff; color: var(--text-muted); border-radius: 12px; padding: 8px 10px; font-size: 12px; }
.v5-empty { padding: 18px; color: var(--text-soft); border-radius: 18px; background: rgba(248,250,252,.82); border: 1px dashed rgba(15,23,42,.14); }
.v5-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.v5-tool-grid button { min-height: 110px; text-align: left; padding: 16px; background: rgba(248,250,252,.92); }
.v5-tool-grid strong { display: block; color: var(--text); margin-bottom: 8px; }
.v5-tool-grid span { color: var(--text-soft); line-height: 1.5; }
.v5-progress { position: relative; height: 34px; padding: 8px 12px; border-radius: 999px; overflow: hidden; background: rgba(15,23,42,.06); color: var(--text-muted); font-size: 12px; }
.v5-progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(0,212,255,.25), rgba(16,185,129,.24)); }
.v5-progress span { position: relative; z-index: 1; }
.v5-toast { position: fixed; right: 18px; bottom: 18px; z-index: 3000; max-width: 340px; padding: 12px 14px; border-radius: 16px; background: #111827; color: #fff; box-shadow: 0 18px 44px rgba(15,23,42,.20); transform: translateY(12px); opacity: 0; transition: .22s ease; }
.v5-toast.visible { transform: translateY(0); opacity: 1; }
@media (max-width: 980px) {
  .auth-center { grid-template-columns: 1fr !important; min-height: auto !important; }
  .auth-logo, .auth-intro, .auth-footer, .auth-tabs, .auth-form { grid-column: 1 !important; justify-self: stretch !important; max-width: none !important; }
  .v5-command-deck, .v5-tool-grid, .v5-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-screen { align-items: flex-start !important; overflow-y: auto !important; }
  .auth-center { width: min(334px, calc(100vw - 56px)) !important; max-width: min(334px, calc(100vw - 56px)) !important; padding: 16px !important; border-radius: 24px !important; overflow: hidden !important; margin-left: auto !important; margin-right: auto !important; }
  .auth-intro,
  .auth-form,
  .auth-tabs,
  .logo-text-wrap { min-width: 0 !important; }
  .auth-title { max-width: 100% !important; font-size: 21px !important; line-height: 1.14 !important; overflow-wrap: anywhere !important; word-break: normal !important; }
  .auth-description { max-width: 100% !important; font-size: 12.5px !important; overflow-wrap: anywhere !important; }
  .auth-tabs { display: grid !important; grid-template-columns: 1fr 1fr !important; }
  .chat-header-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v5-command-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v5-command-deck::before { position: static; grid-column: 1 / -1; order: -1; text-align: center; margin-bottom: 2px; }
  .v5-item { grid-template-columns: 1fr; }
  .v5-row-actions { justify-content: flex-start; }
  .modal-box.v5-modal { width: calc(100vw - 16px); max-height: 88vh; overflow-y: auto; }
  .v5-toast { left: 12px; right: 12px; bottom: 12px; }
}
