/* ═══════════════════════════════════════════
   POPOPERA CHAT — СТИЛИ
   Корпоративные цвета: глубокий синий + фиолетовый
   Темы: тёмная (по умолчанию) и светлая
   Шрифт: Philosopher (кириллица + латиница)
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Philosopher:ital,wght@0,400;0,700;1,400&display=swap');

@font-face {
  font-family: 'mr_StupidHeadBBG';
  src: url('../fonts/17319.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ══════════════════════════════════════
   ТЁМНАЯ ТЕМА (по умолчанию)
══════════════════════════════════════ */
:root {
  --bg:           #0d0e1a;
  --bg2:          #13152a;
  --bg3:          #181a2e;
  --surface:      #1a1d35;
  --surface2:     #222640;
  --border:       #2e3258;
  --border-light: #3d4270;
  --text:         #e2e4f0;
  --text-muted:   #8890b8;
  --text-faint:   #4a5080;

  --accent:       #6c63ff;
  --accent-light: #8b84ff;
  --accent2:      #2d2680;
  --violet:       #9b5de5;
  --violet-light: #b57aff;

  --my-bubble:    #1e1a4a;
  --their-bubble: #1a1d35;

  --event-bg:     #160f40;
  --event-border: #6c63ff;
  --event-text:   #b8b0ff;

  --crimson:      #7f1d3a;
  --crimson-light:#db2777;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --font-main:  'Philosopher', Georgia, serif;
  --font-brand: 'mr_StupidHeadBBG', serif;
  --transition: 0.2s ease;
}

/* ══════════════════════════════════════
   СВЕТЛАЯ ТЕМА
══════════════════════════════════════ */
[data-theme="light"] {
  --bg:           #f0f1fa;
  --bg2:          #e6e8f5;
  --bg3:          #dde0f0;
  --surface:      #ffffff;
  --surface2:     #eceef8;
  --border:       #c5c8e8;
  --border-light: #a8acda;
  --text:         #1a1d3a;
  --text-muted:   #5558a0;
  --text-faint:   #9095c0;

  --accent:       #4f46e5;
  --accent-light: #4338ca;
  --accent2:      #ede9fe;
  --violet:       #7c3aed;
  --violet-light: #6d28d9;

  --my-bubble:    #ede9fe;
  --their-bubble: #ffffff;

  --event-bg:     #ede9fe;
  --event-border: #7c3aed;
  --event-text:   #4c1d95;

  --crimson:      #be185d;
  --crimson-light:#9d174d;

  --shadow:    0 4px 24px rgba(79,70,229,0.12);
  --shadow-sm: 0 2px 8px rgba(79,70,229,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }

body {
  font-family: var(--font-main);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,14,26,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  transition: background 0.3s ease;
}
[data-theme="light"] .site-header {
  background: rgba(240,241,250,0.93);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand-popopera {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  color: var(--accent-light);
  line-height: 1;
  letter-spacing: 0.01em;
}
[data-theme="light"] .brand-popopera { color: var(--accent); }

.brand-chat {
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--violet-light);
  font-style: italic;
  letter-spacing: 0.03em;
}
[data-theme="light"] .brand-chat { color: var(--violet); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--accent-light); }
[data-theme="light"] .nav-link.active { color: var(--accent); }
.nav-logout { color: var(--crimson-light) !important; }
.nav-logout:hover { background: rgba(190,24,93,0.1) !important; }

/* Переключатель темы */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-main);
  transition: all var(--transition);
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-light); }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-muted); border-radius: 2px;
  transition: var(--transition);
}
.nav-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.active span:nth-child(2) { opacity: 0; }
.nav-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-main { flex: 1; margin-top: 56px; display: flex; flex-direction: column; overflow: hidden; }

.flash-messages { padding: 0.75rem 1.25rem 0; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; font-size: 0.9rem; }
.flash-error { background: rgba(190,24,93,0.12); border: 1px solid var(--crimson); color: #f9a8d4; }
.flash-success { background: rgba(108,99,255,0.12); border: 1px solid var(--accent); color: var(--accent-light); }

/* ══════════════════════════════════════
   LANDING
══════════════════════════════════════ */
.landing { flex: 1; display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 56px); overflow: hidden; position: relative; }

.landing-hero { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100vh; padding: 2rem; }

.curtain-left, .curtain-right {
  position: absolute; top: 0; bottom: 0; width: 200px;
  background: linear-gradient(to right, var(--violet) 0%, transparent 100%);
  opacity: 0.07; pointer-events: none;
}
.curtain-right { right: 0; left: auto; background: linear-gradient(to left, var(--accent) 0%, transparent 100%); }

.landing-content { text-align: center; z-index: 1; animation: fadeUp 0.8s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.landing-logo { margin-bottom: 1rem; animation: fadeUp 0.8s 0.1s ease both; }
.landing-logo .brand-popopera {
  font-size: clamp(3rem, 8vw, 6rem);
  background: linear-gradient(135deg, var(--accent-light), var(--violet-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(108,99,255,0.35));
  display: block;
}
[data-theme="light"] .landing-logo .brand-popopera {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
}
.landing-logo .brand-chat { font-size: clamp(1.2rem, 3vw, 1.8rem); display: block; margin-top: -0.4rem; }

.landing-subtitle { font-size: 1.1rem; color: var(--text-muted); font-style: italic; margin-bottom: 3rem; animation: fadeUp 0.8s 0.3s ease both; }

.landing-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; animation: fadeUp 0.8s 0.4s ease both; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.5rem; border-radius: var(--radius);
  font-family: var(--font-main); font-size: 0.95rem;
  cursor: pointer; transition: all var(--transition); border: none; white-space: nowrap; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,99,255,0.4); filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 1rem; transition: background var(--transition); color: var(--text-muted); }
.btn-icon:hover { background: var(--surface2); }
.btn-del:hover { background: rgba(190,24,93,0.15) !important; }

/* ══════════════════════════════════════
   AUTH
══════════════════════════════════════ */
.auth-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }

.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 100%; max-width: 440px; box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.auth-back { display: inline-block; color: var(--text-muted); text-decoration: none; font-size: 0.875rem; margin-bottom: 1.5rem; transition: color var(--transition); }
.auth-back:hover { color: var(--accent-light); }
.auth-icon { font-size: 2.5rem; text-align: center; margin-bottom: 0.75rem; }
.auth-title { font-family: var(--font-main); font-size: 1.8rem; color: var(--accent-light); text-align: center; margin-bottom: 1.5rem; font-weight: 700; }
[data-theme="light"] .auth-title { color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-alt { margin-top: 1.25rem; text-align: center; font-size: 0.875rem; color: var(--text-muted); }
.auth-alt a { color: var(--accent-light); text-decoration: none; }
[data-theme="light"] .auth-alt a { color: var(--accent); }
.auth-alt a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   FORMS
══════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.82rem; color: var(--text-muted); font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], textarea, select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.65rem 0.9rem;
  color: var(--text); font-family: var(--font-main); font-size: 0.95rem;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition); width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238890b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 2rem; }

/* ══════════════════════════════════════
   CHAT
══════════════════════════════════════ */
.chat-layout { flex: 1; display: flex; flex-direction: column; height: calc(100vh - 56px); max-width: 900px; width: 100%; margin: 0 auto; position: relative; }

.chat-search-bar { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg); display: flex; gap: 0.5rem; align-items: center; }
.chat-search-bar input { flex: 1; background: var(--surface); border-color: transparent; padding: 0.5rem 0.9rem; }
.chat-search-bar input:focus { border-color: var(--border); box-shadow: none; }
.search-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 6px; }
.search-clear:hover { background: var(--surface2); }

.search-results { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.search-results-header { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 700; }

.messages-feed { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; scroll-behavior: smooth; }
.messages-loading { text-align: center; color: var(--text-faint); font-style: italic; margin: auto; }

.chat-input-area { padding: 0.75rem 1rem; border-top: 1px solid var(--border); background: var(--bg); }

.chat-input-wrap {
  display: flex; align-items: flex-end; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.12); }
.chat-input-wrap textarea { flex: 1; background: none; border: none; padding: 0.45rem 0; max-height: 140px; overflow-y: auto; resize: none; font-size: 0.95rem; font-family: var(--font-main); box-shadow: none !important; }

.send-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.send-btn:hover { transform: scale(1.05); filter: brightness(1.15); }
.send-btn:active { transform: scale(0.95); }

/* ══════════════════════════════════════
   СООБЩЕНИЯ
══════════════════════════════════════ */
.message-wrap { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 80%; animation: fadeUp 0.2s ease both; }
.message-wrap.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-wrap.theirs { align-self: flex-start; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; text-transform: uppercase; font-family: var(--font-main);
}
.mine .msg-avatar { background: linear-gradient(135deg, var(--accent2), var(--violet)); color: #fff; }

.msg-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mine .msg-body { align-items: flex-end; }

.msg-author { font-size: 0.72rem; color: var(--text-muted); padding: 0 6px; font-weight: 700; }
.mine .msg-author { display: none; }

.msg-bubble {
  background: var(--their-bubble); border: 1px solid var(--border);
  border-radius: var(--radius); border-bottom-left-radius: 4px;
  padding: 0.55rem 0.85rem;
}
.mine .msg-bubble {
  background: var(--my-bubble); border-color: rgba(108,99,255,0.3);
  border-radius: var(--radius); border-bottom-right-radius: 4px;
}

/* Сообщение-событие */
.msg-bubble.is-event-bubble {
  background: var(--event-bg) !important;
  border-color: var(--event-border) !important;
  box-shadow: 0 0 16px rgba(108,99,255,0.18);
}
.msg-text { font-size: 0.95rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg-text.is-event { color: var(--event-text); font-weight: 700; }

.msg-footer { display: flex; align-items: center; gap: 0.5rem; margin-top: 4px; padding: 0 4px; }
.mine .msg-footer { flex-direction: row-reverse; }
.msg-time { font-size: 0.7rem; color: var(--text-faint); }

.msg-actions { display: flex; align-items: center; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.message-wrap:hover .msg-actions { opacity: 1; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 0.75rem; color: var(--text-faint); padding: 2px 5px; border-radius: 5px; transition: all var(--transition); display: flex; align-items: center; gap: 3px; font-family: var(--font-main); }
.action-btn:hover { background: var(--surface2); color: var(--text-muted); }
.like-btn.liked { color: var(--accent-light) !important; }
.like-btn { position: relative; }
.del-btn:hover { color: var(--crimson-light) !important; }

.like-tooltip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 0.7rem; color: var(--text);
  white-space: nowrap; pointer-events: none; display: none; z-index: 10; box-shadow: var(--shadow-sm);
}
.like-btn:hover .like-tooltip { display: block; }

/* ══════════════════════════════════════
   ТРЕД
══════════════════════════════════════ */
.thread-overlay { position: fixed; inset: 56px 0 0 0; z-index: 50; display: flex; justify-content: flex-end; pointer-events: none; }
.thread-panel {
  pointer-events: all; width: 400px; max-width: 100%; height: 100%;
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  animation: slideInRight 0.25s ease both;
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.thread-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.thread-header h3 { font-family: var(--font-main); color: var(--accent-light); font-size: 1.1rem; font-weight: 700; }
[data-theme="light"] .thread-header h3 { color: var(--accent); }
.thread-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 6px; }
.thread-close:hover { background: var(--surface2); }
.thread-parent { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.thread-replies { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.thread-input-area { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════
   CALENDAR
══════════════════════════════════════ */
.calendar-page { max-width: 800px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.page-title { font-family: var(--font-main); font-size: 1.6rem; color: var(--accent-light); font-weight: 700; }
[data-theme="light"] .page-title { color: var(--accent); }

.events-list { display: flex; flex-direction: column; gap: 0.75rem; }
.event-card { display: flex; align-items: flex-start; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; transition: border-color var(--transition), transform var(--transition); }
.event-card:hover { border-color: var(--accent); transform: translateX(2px); }

.event-date-badge { flex-shrink: 0; width: 52px; background: linear-gradient(135deg, var(--accent), var(--violet)); border-radius: var(--radius-sm); text-align: center; padding: 6px 4px; display: flex; flex-direction: column; }
.event-day { font-family: var(--font-main); font-size: 1.6rem; font-weight: 700; color: #fff; line-height: 1; }
.event-month { font-size: 0.72rem; color: rgba(255,255,255,0.85); text-transform: lowercase; }

.event-info { flex: 1; }
.event-title { font-family: var(--font-main); font-size: 1.15rem; color: var(--text); margin-bottom: 0.3rem; font-weight: 700; }
.event-meta { display: flex; gap: 0.75rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; flex-wrap: wrap; }
.event-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.event-actions { display: flex; gap: 4px; align-items: center; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-faint); }
.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 480px; box-shadow: var(--shadow); animation: fadeUp 0.25s ease both; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-family: var(--font-main); font-size: 1.2rem; color: var(--accent-light); font-weight: 700; }
[data-theme="light"] .modal-header h3 { color: var(--accent); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--surface2); }
.modal-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════
   ADMIN
══════════════════════════════════════ */
.admin-page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 0.9rem; font-family: var(--font-main); font-weight: 700; padding: 0.6rem 1rem; cursor: pointer; transition: all var(--transition); margin-bottom: -1px; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }
[data-theme="light"] .admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-section { display: none; }
.admin-section.active { display: block; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.section-header h3 { font-family: var(--font-main); font-size: 1.1rem; color: var(--text); font-weight: 700; }

.code-banner { display: flex; align-items: center; gap: 0.75rem; background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.3); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--accent-light); }
.code-banner strong { font-family: monospace; font-size: 1rem; letter-spacing: 0.05em; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-family: var(--font-main); }
.admin-table th { text-align: left; padding: 0.6rem 0.75rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface); }
.admin-table code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.85rem; color: var(--accent-light); letter-spacing: 0.04em; }
.role-select { background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 3px 24px 3px 6px; border-radius: 6px; font-size: 0.85rem; font-family: var(--font-main); }

.admin-event-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.admin-event-row-info { flex: 1; }
.admin-event-row-title { font-weight: 700; font-size: 0.95rem; }
.admin-event-row-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.admin-event-row-actions { display: flex; gap: 4px; }

.search-result-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; cursor: pointer; transition: border-color var(--transition); }
.search-result-item:hover { border-color: var(--accent); }
.search-result-author { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 3px; font-weight: 700; }
.search-result-text { font-size: 0.9rem; line-height: 1.45; }
.search-highlight { background: rgba(108,99,255,0.2); color: var(--accent-light); border-radius: 2px; padding: 0 2px; }
.search-result-time { font-size: 0.7rem; color: var(--text-faint); margin-top: 4px; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-burger { display: flex; }
  .site-nav { position: absolute; top: 56px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 0.75rem; gap: 0.25rem; transform: translateY(-100%); opacity: 0; pointer-events: none; transition: all var(--transition); }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-link { width: 100%; padding: 0.6rem 0.9rem; }
  .chat-layout { height: calc(100vh - 56px); }
  .message-wrap { max-width: 92%; }
  .thread-panel { width: 100%; border-left: none; }
  .auth-card { padding: 2rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .landing-actions { flex-direction: column; align-items: stretch; }
  .event-card { flex-wrap: wrap; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 0.9rem; }
  .brand-popopera { font-size: 1.2rem; }
  .messages-feed { padding: 0.75rem; }
  .chat-input-area { padding: 0.5rem 0.75rem; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th, .admin-table td { padding: 0.5rem; }
}
