/* ============ Taligencija — mobile-first ============ */

:root {
  --bg: #161512;
  --panel: #1d1b17;
  --panel-2: #242119;
  --raised: #2b2820;
  --border: #383429;
  --text: #edeae2;
  --muted: #a49d8d;
  --faint: #756f61;
  --accent: #d97757;
  --accent-strong: #c96442;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --user-bubble: #33302a;
  --danger: #e5645a;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }

/* ============ Prijava ============ */

.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(217,119,87,0.10), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 26px calc(28px + var(--safe-bottom));
  text-align: center;
}

.auth-logo { font-size: 44px; }

.auth-logo img { width: 76px; height: 76px; border-radius: 19px; }

.auth-title {
  margin: 10px 0 4px;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.auth-sub { margin: 0 0 24px; color: var(--muted); font-size: 14.5px; }

.auth-tabs {
  display: flex;
  background: var(--panel-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
}

.auth-tab.active { background: var(--raised); color: var(--text); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.auth-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  outline: none;
}

.auth-form input:focus { border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.auth-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 14px;
}

/* ============ Raspored aplikacije ============ */

.app {
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

/* Mobile: prikazuje se samo jedan panel, ostali su sakriveni */
.panel-sections, .panel-chats, .panel-chat { width: 100%; }

.app.view-sections .panel-chats,
.app.view-sections .panel-chat { display: none; }

.app.view-chats .panel-sections,
.app.view-chats .panel-chat { display: none; }

.app.view-chat .panel-sections,
.app.view-chat .panel-chats { display: none; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 58px;
}

.app-logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-logo img { width: 30px; height: 30px; border-radius: 8px; }

.btn-back {
  border: none;
  background: var(--panel-2);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 24px;
  line-height: 1;
  padding-bottom: 3px;
  flex-shrink: 0;
}

/* ============ Panel: Sekcije ============ */

.panel-sections { background: var(--panel); }

.sections-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  font-size: 15.5px;
  transition: background 0.12s;
}

.section-item:hover { background: var(--panel-2); }
.section-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.section-item .s-icon {
  font-size: 21px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border-radius: 10px;
  flex-shrink: 0;
}

.section-item.active .s-icon { background: rgba(217,119,87,0.18); }

.section-item .s-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--faint);
}

.user-footer {
  border-top: 1px solid var(--border);
  padding: 12px 14px calc(12px + var(--safe-bottom));
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px;
  margin-left: -8px;
  border-radius: 12px;
  transition: background 0.12s;
}

.user-chip:hover { background: var(--panel-2); }

.user-chip-arrow { margin-left: auto; font-size: 15px; opacity: 0.7; }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-actions { display: flex; gap: 8px; }

.btn-ghost {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.btn-ghost:hover { background: var(--raised); }

/* ============ Panel: Razgovori ============ */

.panel-chats { background: var(--panel); }

.chats-header-title {
  flex: 1;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-new {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.btn-new:hover { background: var(--accent-strong); }

.chats-search { padding: 10px 12px 4px; }

.chats-search input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 14px;
  color: var(--text);
  outline: none;
}

.chats-search input:focus { border-color: var(--accent); }

.chats-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--accent-soft); }

.chat-item-main { flex: 1; min-width: 0; }

.chat-item-title {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item.active .chat-item-title { color: var(--accent); }

.chat-item-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

.chat-item-actions { display: flex; gap: 2px; flex-shrink: 0; }

.btn-icon {
  border: none;
  background: transparent;
  color: var(--faint);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 15px;
}

.btn-icon:hover { background: var(--raised); color: var(--text); }

.chats-empty {
  text-align: center;
  color: var(--faint);
  padding: 40px 20px;
  font-size: 14.5px;
  white-space: pre-line;
}

/* ============ Panel: Razgovor ============ */

.panel-chat { background: var(--bg); }

.chat-header { background: var(--panel); }

.chat-header-info { flex: 1; min-width: 0; }

.chat-header-name {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-actions { display: flex; gap: 2px; flex-shrink: 0; }

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.messages {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg { display: flex; flex-direction: column; }

.msg-user { align-items: flex-end; }

.msg-user .msg-bubble {
  background: var(--user-bubble);
  border-radius: 18px 18px 4px 18px;
  padding: 11px 15px;
  max-width: 88%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-assistant { align-items: stretch; }

.msg-assistant .msg-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.msg-assistant .msg-head .a-icon { font-size: 15px; }

.msg-assistant .msg-bubble {
  max-width: 100%;
  overflow-wrap: break-word;
}

.typing {
  display: inline-flex;
  gap: 5px;
  padding: 6px 2px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

.typing-status {
  color: var(--faint);
  font-size: 13px;
  margin-top: 2px;
  animation: toast-in 0.3s ease;
}

/* Markdown sadržaj */
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 16px 0 8px; line-height: 1.3; }
.md h1 { font-size: 20px; }
.md h2 { font-size: 18px; }
.md h3 { font-size: 16.5px; }
.md ul, .md ol { margin: 8px 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md blockquote {
  margin: 10px 0;
  padding: 6px 14px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}
.md code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5px 6px;
  font-size: 13.5px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.md pre {
  background: #12110e;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  overflow-x: auto;
  margin: 10px 0;
}
.md pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.5; }
.md table { border-collapse: collapse; margin: 10px 0; width: 100%; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 11px; font-size: 14px; text-align: left; }
.md th { background: var(--panel-2); }
.md a { color: var(--accent); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md img { max-width: 100%; border-radius: 10px; }

/* Dobrodošlica */
.welcome {
  max-width: 640px;
  margin: 0 auto;
  padding: 46px 22px 20px;
  text-align: center;
}

.welcome-icon { font-size: 52px; }

.welcome-title { margin: 12px 0 6px; font-size: 23px; letter-spacing: -0.4px; }

.welcome-desc { margin: 0 0 26px; color: var(--muted); font-size: 15px; }

.welcome-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestion-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14.5px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.suggestion-chip:hover { border-color: var(--accent); background: var(--panel-2); }

/* Unos poruke */
.composer-wrap {
  flex-shrink: 0;
  padding: 10px 12px calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}

.composer {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 8px 8px 8px 16px;
  transition: border-color 0.15s;
}

.composer:focus-within { border-color: var(--accent); }

.composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 150px;
  padding: 7px 0;
}

.composer textarea::placeholder { color: var(--faint); }

.btn-send {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.btn-send:hover { background: var(--accent-strong); }
.btn-send:disabled { opacity: 0.4; cursor: default; }

.btn-attach {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -8px;
  transition: color 0.15s, background 0.15s;
}

.btn-attach:hover { color: var(--accent); background: var(--panel-2); }

/* Pregled priloženih slika prije slanja */
.attach-preview {
  max-width: 780px;
  margin: 0 auto 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
}

.attach-thumb {
  position: relative;
  flex-shrink: 0;
}

.attach-thumb img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}

.attach-thumb .rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PDF prilozi */
.pdf-tile {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  gap: 2px;
}

.pdf-tile span { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }

.pdf-chip {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pdf-chip:hover { border-color: var(--accent); }

/* Mikrofon */
.btn-mic { margin-left: 0; }

.btn-mic.rec {
  color: #fff;
  background: var(--danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 100, 90, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(229, 100, 90, 0); }
}

/* Pamćenje u profilu */
.memory-card .admin-card-title { display: flex; justify-content: space-between; align-items: center; }
.memory-content {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13.5px;
  margin: 6px 0;
  line-height: 1.5;
}

/* Slike unutar poruka */
.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  justify-content: flex-end;
}

.msg-assistant .msg-images { justify-content: flex-start; }

.msg-images img {
  max-width: min(46vw, 230px);
  max-height: 230px;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

/* ============ Admin ============ */

.admin {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

.admin-title { font-weight: 700; font-size: 17px; }

.admin-tabs { display: flex; gap: 6px; margin-left: auto; }

.admin-tab {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 600;
}

.admin-tab.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px calc(20px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.admin-view { max-width: 860px; margin: 0 auto; }

.admin-view h3 { margin: 18px 0 10px; font-size: 17px; }
.admin-view h3:first-child { margin-top: 0; }

.admin-note { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }

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

.admin-field input, .admin-field select {
  flex: 1;
  min-width: 200px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--text);
  outline: none;
}

.admin-field input:focus, .admin-field select:focus { border-color: var(--accent); }

.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.admin-card:hover { border-color: var(--accent); }
.admin-card.static { cursor: default; }
.admin-card.static:hover { border-color: var(--border); }

.admin-card-title { font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-card-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.admin-badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
}

.badge-deleted {
  background: rgba(229, 100, 90, 0.15);
  color: var(--danger);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
}

.grid-4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}

.stat-hero {
  background: linear-gradient(150deg, rgba(217,119,87,0.16), var(--panel) 65%);
  border-color: rgba(217,119,87,0.35);
}

.stat-value { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Kartice s avatarom (korisnici, aktivnost) */
.admin-card-row {
  display: flex;
  align-items: center;
  gap: 13px;
}

.admin-card-body { flex: 1; min-width: 0; }

.admin-card-arrow { color: var(--faint); font-size: 22px; flex-shrink: 0; }

.admin-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-avatar.small { background: var(--panel-2); font-size: 21px; }

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

.admin-search {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
}

.admin-search:focus { border-color: var(--accent); }

/* Barovi po sekcijama */
.bar-row { padding: 7px 0; }
.bar-row + .bar-row { border-top: 1px solid rgba(56,52,41,0.5); }

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 5px;
}

.bar-nums { color: var(--faint); font-size: 12px; white-space: nowrap; }

.bar-track {
  height: 8px;
  background: var(--panel-2);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #B84A28, var(--accent), #F0A480);
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.admin-breadcrumb button {
  border: none;
  background: var(--panel-2);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 600;
}

/* Admin pregled poruka koristi iste stilove poruka */
.admin-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============ Profil ============ */

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 38px;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar-btns { display: flex; flex-direction: column; gap: 8px; }
.profile-avatar-btns .btn-ghost { flex: none; }

.profile-about {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 110px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.profile-about:focus { border-color: var(--accent); }

.profile-pass {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.profile-pass input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
}

.profile-pass input:focus { border-color: var(--accent); }

/* ============ Toast ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14.5px;
  max-width: min(90vw, 420px);
  z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============ Scrollbar (desktop) ============ */

@media (hover: hover) {
  ::-webkit-scrollbar { width: 9px; height: 9px; }
  ::-webkit-scrollbar-thumb { background: var(--raised); border-radius: 99px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--border); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ============ Desktop raspored ============ */

@media (min-width: 1000px) {
  .app.view-sections .panel-chats,
  .app.view-sections .panel-chat,
  .app.view-chats .panel-sections,
  .app.view-chats .panel-chat,
  .app.view-chat .panel-sections,
  .app.view-chat .panel-chats { display: flex; }

  .panel-sections {
    width: 265px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
  }

  .panel-chats {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
  }

  .panel-chat { flex: 1; }

  /* Na desktopu sakrij samo navigaciju između panela —
     dugmad za izlaz iz admina i profila moraju ostati vidljiva */
  #btn-back-sections, #btn-back-chats { display: none; }

  .messages { padding: 24px 24px 10px; }

  .composer-wrap { padding: 12px 20px 18px; }

  .welcome { padding-top: 70px; }

  .welcome-suggestions { max-width: 520px; margin: 0 auto; }
}
