/* ═══════════════════════════════════════════════
   NIST Staff Chat — style.css
   WhatsApp-inspired, Production-grade UI
═══════════════════════════════════════════════ */

:root {
  --dark:    #064010;
  --primary: #0a5c1e;
  --accent:  #25D366;
  --accent2: #128C7E;
  --bg:      #ECE5DD;
  --white:   #ffffff;
  --bubble-out: #DCF8C6;
  --bubble-in:  #ffffff;
  --text:    #111111;
  --muted:   #888888;
  --border:  #e8e8e8;
  --danger:  #c0392b;
  --radius:  12px;
  --shadow:  0 2px 12px rgba(0,0,0,0.12);
}

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

html, body {
  height: 100%; width: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--dark);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#app { height: 100dvh; display: flex; flex-direction: column; }

/* ── Screens ─────────────────────────────────── */
.screen { height: 100dvh; display: flex; flex-direction: column; }

/* ── Animations ──────────────────────────────── */
@keyframes slideUp   { from{transform:translateY(100%);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes fadeIn    { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes bounce    { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-8px)} }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes slideIn   { from{transform:translateX(-100%)} to{transform:translateX(0)} }

/* ════════════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════════════ */
.login-bg {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--dark) 0%, var(--primary) 50%, #1e9e45 100%);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 16px 16px 28px;
  overflow-y: auto;
}

.login-shloka {
  text-align: center;
  color: rgba(255,255,255,.9);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.9;
  margin-bottom: 14px;
  padding-top: 8px;
}
.shloka-sub {
  color: rgba(255,255,255,.45);
  font-size: 10px;
  font-style: italic;
  font-weight: 400;
}

.login-logo-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 18px;
}
.app-title {
  color: #fff;
  font-size: 22px; font-weight: 900;
  letter-spacing: -0.5px;
  margin-top: 10px;
}
.app-sub {
  color: rgba(255,255,255,.55);
  font-size: 12px; margin-top: 3px;
}

.login-card {
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  padding: 22px 18px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  margin-bottom: 16px;
}
.login-card h2 {
  color: var(--primary);
  font-size: 18px; font-weight: 800;
  margin-bottom: 2px;
}
.login-hint { color: #bbb; font-size: 12px; margin-bottom: 16px; }

.form-group { margin-bottom: 13px; }
.form-group label {
  display: block;
  font-size: 10px; font-weight: 700;
  color: #999; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 5px;
}
.form-group input {
  width: 100%; padding: 12px 13px;
  border: 2px solid #eee; border-radius: 11px;
  font-size: 14px; outline: none;
  transition: border-color .2s;
}
.form-group input:focus { border-color: var(--accent); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #ccc; padding: 0;
}

.error-box {
  background: #fff0f0; border: 1px solid #ffcccc;
  color: var(--danger); padding: 9px 12px;
  border-radius: 10px; font-size: 12px;
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--dark), var(--accent));
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  transition: opacity .2s; letter-spacing: .3px;
}
.btn-primary:disabled { background: #ccc; cursor: default; }
.btn-primary:hover:not(:disabled) { opacity: .9; }

.btn-secondary {
  width: 100%; padding: 11px;
  background: #f0f0f0; color: #333;
  border: none; border-radius: 11px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-danger {
  width: 100%; padding: 13px;
  background: #fff; color: var(--danger);
  border: 2px solid #fee; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

.login-note {
  margin-top: 12px;
  background: #f0fff4;
  border: 1px solid rgba(37,211,102,.3);
  border-radius: 10px; padding: 10px 12px;
  text-align: center;
  font-size: 11px; color: var(--primary); font-weight: 600;
  line-height: 1.6;
}
.login-note small { color: #aaa; font-weight: 400; }

/* Developer card on login page */
.dev-card {
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(135deg,#1a3a8f,#1a5cb5);
  border-radius: 14px; padding: 11px 14px;
  width: 100%; max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.dev-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 2px solid rgba(255,255,255,.8); flex-shrink: 0;
}
.dev-info { flex: 1; }
.dev-by { font-size: 9px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: 1.5px; }
.dev-name { color: #fff; font-weight: 800; font-size: 13px; }
.dev-role { color: rgba(255,255,255,.55); font-size: 10px; }
.fire { color: #FFB347; font-weight: 700; }
.dev-version { color: rgba(255,255,255,.3); font-size: 10px; text-align: right; flex-shrink: 0; line-height: 1.5; }

/* ════════════════════════════════════════════════
   MAIN APP LAYOUT
════════════════════════════════════════════════ */
#app-screen {
  flex-direction: row;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: 360px; min-width: 280px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100dvh;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .sidebar { width: 100%; min-width: 0; }
  #chat-area { position: fixed; inset: 0; z-index: 100; display: none; }
  #chat-area.mobile-open { display: flex; }
}

.sidebar-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 60%, #1a7a3a 100%);
  padding: 11px 12px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-title { color: #fff; font-weight: 900; font-size: 15px; }
.header-user { color: rgba(255,255,255,.65); font-size: 11px; margin-top: 1px; }
.header-actions { display: flex; align-items: center; gap: 4px; }

.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  margin-right: 4px;
}
.sync-dot.syncing { animation: pulse .8s infinite; background: #f0c000; }
.sync-dot.offline { background: #aaa; box-shadow: none; }

.icon-btn {
  background: rgba(255,255,255,.15); border: none;
  color: #fff; border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.25); }
.logout-btn { background: rgba(255,80,80,.25); }
.logout-btn:hover { background: rgba(255,80,80,.4); }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-icon { color: #ccc; font-size: 15px; }
#search-input {
  flex: 1; border: none; background: transparent;
  font-size: 13px; outline: none;
  font-family: inherit;
}
#search-clear {
  background: none; border: none; color: #bbb;
  font-size: 20px; cursor: pointer; line-height: 1;
}

.notice-banner {
  background: #fffde7; border-bottom: 1px solid #ffe082;
  padding: 8px 14px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #856404; cursor: pointer;
  font-weight: 600; flex-shrink: 0;
}

/* User list */
.user-list { flex: 1; overflow-y: auto; }
.user-list::-webkit-scrollbar { width: 4px; }
.user-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.user-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer; transition: background .15s;
  position: relative;
}
.user-item:hover { background: #f9f9f9; }
.user-item.active { background: #f0fdf4; border-left: 4px solid var(--accent); }
.user-item.admin-user { border-left: 4px solid var(--accent); background: #f0fdf4; }

.user-av-wrap { position: relative; flex-shrink: 0; }
.user-av {
  width: 50px; height: 50px; border-radius: 50%;
  object-fit: cover; display: block;
}
.user-av-text {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  font-family: Georgia, serif; flex-shrink: 0;
}
.online-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 5px var(--accent);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 700; font-size: 14px; color: var(--text); }
.user-last {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.user-last.admin-last { color: var(--primary); font-weight: 600; }

.user-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.user-time { font-size: 11px; color: var(--muted); }
.user-time.unread { color: var(--accent); font-weight: 700; }
.unread-badge {
  background: var(--accent); color: #fff;
  border-radius: 50px; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; padding: 0 5px;
}

/* ── Chat Area ───────────────────────────────── */
.chat-area {
  flex: 1; display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
  background: var(--bg);
}

.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: #aaa;
  background: var(--bg);
}
.chat-empty h3 { color: #777; font-size: 18px; font-weight: 700; }
.chat-empty p { font-size: 13px; }
.chat-empty-sub { font-size: 11px; }

.chat-window {
  flex: 1; display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, var(--dark), var(--primary));
  padding: 10px 13px;
  display: flex; align-items: center; gap: 11px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.back-btn {
  background: rgba(255,255,255,.15); border: none;
  color: #fff; border-radius: 9px;
  width: 36px; height: 36px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-header-av { flex-shrink: 0; }
.chat-header-av .user-av,
.chat-header-av .user-av-text {
  width: 40px; height: 40px; font-size: 15px;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  color: #fff; font-weight: 800; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-header-status { color: rgba(255,255,255,.65); font-size: 11px; }
.chat-header-status.typing { color: var(--accent); font-weight: 600; }
.chat-header-id { font-size: 10px; color: rgba(255,255,255,.4); flex-shrink: 0; }

/* Messages */
.messages-container {
  flex: 1; overflow-y: auto;
  padding: 10px 10px 6px;
  display: flex; flex-direction: column;
  background: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23064010' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

.date-divider {
  text-align: center; margin: 8px 0;
}
.date-divider span {
  background: rgba(255,255,255,.85);
  padding: 3px 12px; border-radius: 14px;
  font-size: 11px; color: #666;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.msg-row {
  display: flex; margin-bottom: 2px;
  animation: fadeIn .2s ease;
}
.msg-row.out { justify-content: flex-end; }
.msg-row.in  { justify-content: flex-start; }

.msg-bubble {
  max-width: 76%;
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  position: relative;
}
.msg-row.out .msg-bubble {
  background: var(--bubble-out);
  border-radius: 16px 4px 16px 16px;
}
.msg-row.in .msg-bubble {
  background: var(--bubble-in);
  border-radius: 4px 16px 16px 16px;
}

.msg-text {
  font-size: 13px; color: var(--text);
  line-height: 1.5; word-break: break-word;
}
.msg-meta {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 3px; margin-top: 3px;
}
.msg-time { font-size: 10px; color: var(--muted); }
.msg-tick { font-size: 11px; color: #ccc; font-weight: 700; }
.msg-tick.seen { color: #34B7F1; }

/* Message media */
.msg-img {
  max-width: 200px; max-height: 200px;
  border-radius: 10px; display: block; cursor: pointer;
  object-fit: cover;
}
.msg-video {
  max-width: 220px; border-radius: 10px; display: block;
}
.msg-file {
  display: flex; gap: 8px; align-items: center;
  padding: 9px 11px; border-radius: 10px;
  min-width: 160px; cursor: pointer;
}
.msg-row.out .msg-file { background: rgba(0,0,0,.06); }
.msg-row.in  .msg-file { background: #f5f5f5; }
.msg-file-icon { font-size: 26px; }
.msg-file-name { font-size: 12px; font-weight: 700; color: #333; word-break: break-all; }
.msg-file-size { font-size: 10px; color: var(--muted); }

/* Typing indicator */
.typing-row { display: flex; margin-bottom: 5px; }
.typing-bubble {
  background: var(--bubble-in);
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  display: flex; gap: 4px; align-items: center;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #bbb;
}
.typing-dot:nth-child(1) { animation: bounce 1.2s 0s infinite; }
.typing-dot:nth-child(2) { animation: bounce 1.2s .2s infinite; }
.typing-dot:nth-child(3) { animation: bounce 1.2s .4s infinite; }

/* Empty chat */
.chat-no-msgs {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #aaa; gap: 8px;
}
.chat-no-msgs .user-av-text {
  width: 64px; height: 64px; font-size: 24px;
}

/* File preview */
.file-preview {
  background: #f0f8f2; border-top: 2px solid #c8f0b0;
  padding: 7px 12px; flex-shrink: 0;
}
.fp-inner { display: flex; align-items: center; gap: 8px; }
#fp-thumb { height: 42px; border-radius: 8px; object-fit: cover; }
.fp-info { flex: 1; min-width: 0; }
.fp-info div:first-child {
  font-size: 12px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-info div:last-child { font-size: 10px; color: var(--muted); }
.fp-inner > button {
  background: #fee; border: none; color: var(--danger);
  border-radius: 50%; width: 25px; height: 25px;
  cursor: pointer; font-size: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Emoji bar */
.emoji-bar {
  background: #f8f8f8; border-top: 1px solid var(--border);
  padding: 4px 10px;
  display: flex; gap: 3px; overflow-x: auto; flex-shrink: 0;
}
.emoji-bar::-webkit-scrollbar { height: 0; }
.emoji-bar button {
  background: none; border: none; font-size: 21px;
  cursor: pointer; padding: 2px 5px; flex-shrink: 0;
  border-radius: 8px; transition: background .15s;
}
.emoji-bar button:hover { background: rgba(0,0,0,.07); }

/* Input bar */
.input-bar {
  background: #f0f0f0; padding: 7px 9px;
  display: flex; align-items: flex-end; gap: 7px;
  border-top: 1px solid var(--border); flex-shrink: 0;
  position: relative;
}
.att-wrap { position: relative; flex-shrink: 0; }
.att-btn {
  background: rgba(0,0,0,.09); border: none;
  border-radius: 50%; width: 40px; height: 40px;
  cursor: pointer; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  color: #666; transition: background .2s;
}
.att-btn.open { background: var(--accent); color: #fff; }

.att-menu {
  position: absolute; bottom: 50px; left: 0;
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  padding: 8px; min-width: 160px;
  z-index: 50; animation: fadeIn .15s ease;
}
.att-menu button {
  display: flex; gap: 10px; align-items: center;
  width: 100%; padding: 9px 10px;
  background: none; border: none; cursor: pointer;
  border-radius: 10px; font-size: 13px; color: #222;
  font-weight: 600; font-family: inherit;
  transition: background .15s;
}
.att-menu button:hover { background: #f5f5f5; }

#msg-input {
  flex: 1; padding: 10px 13px;
  border-radius: 21px; border: none;
  font-size: 13px; outline: none;
  resize: none; max-height: 110px;
  line-height: 1.5; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  font-family: inherit;
  overflow-y: auto;
}
.send-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none; border-radius: 50%;
  width: 40px; height: 40px; color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .2s;
}
.send-btn:disabled { background: #ddd; cursor: default; }

/* ════════════════════════════════════════════════
   IMAGE VIEWER
════════════════════════════════════════════════ */
.img-viewer {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.97);
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.iv-header {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: rgba(0,0,0,.5);
}
.iv-hint { color: rgba(255,255,255,.6); font-size: 12px; }
.iv-header button {
  background: rgba(255,255,255,.15); border: none;
  color: #fff; border-radius: 50%; width: 36px; height: 36px;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#iv-img {
  max-width: 100vw; max-height: 80vh;
  object-fit: contain; border-radius: 4px;
}
.iv-actions {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 12px; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.5);
}
.iv-actions button {
  background: var(--accent); border: none; color: #fff;
  border-radius: 22px; padding: 10px 22px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.iv-actions button:last-child {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
}

/* ════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
}
.modal-box {
  position: relative; background: #fff;
  border-radius: 21px 21px 0 0;
  width: 100%; max-width: 480px;
  max-height: 85dvh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.3);
  animation: slideUp .35s ease;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-header button {
  background: #f5f5f5; border: none; color: #666;
  border-radius: 50%; width: 30px; height: 30px;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* Notices */
.notices-list { padding: 12px; flex: 1; }
.notice-item {
  background: #fff; border-radius: 14px;
  padding: 13px; margin-bottom: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  border-left: 5px solid var(--primary);
  position: relative;
}
.notice-item.pinned { border-left-color: #f0c000; }
.notice-item.high   { border-left-color: #e74c3c; }
.notice-pin { font-size: 10px; color: #f0a000; font-weight: 800; margin-bottom: 3px; }
.notice-title { font-weight: 800; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.notice-body { font-size: 12px; color: #555; line-height: 1.65; }
.notice-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.notice-time { font-size: 10px; color: #ccc; }
.notice-del {
  background: #fee; border: none; color: var(--danger);
  border-radius: 7px; padding: 3px 10px;
  font-size: 11px; cursor: pointer; font-weight: 600;
}

.notice-form {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.notice-form input, .notice-form textarea {
  border: 1.5px solid #ddd; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; outline: none;
  font-family: inherit;
}
.notice-form textarea { resize: none; line-height: 1.6; }
.notice-opts { display: flex; gap: 10px; align-items: center; }
.notice-opts label { display: flex; gap: 5px; align-items: center; font-size: 12px; cursor: pointer; }
.notice-opts select { flex: 1; padding: 6px 8px; border-radius: 8px; border: 1px solid #ddd; font-size: 12px; }

/* Profile */
.profile-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px; background: linear-gradient(135deg, var(--dark), var(--primary));
  flex-shrink: 0;
}
.profile-av-wrap { position: relative; margin-bottom: 10px; }
.profile-av {
  width: 82px; height: 82px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  font-family: Georgia, serif;
  border: 3px solid var(--accent);
  overflow: hidden;
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.av-edit-btn {
  position: absolute; bottom: 0; right: -4px;
  background: var(--accent); border: 2px solid #fff;
  color: #fff; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.profile-name { color: #fff; font-weight: 800; font-size: 16px; }
.profile-role { color: rgba(255,255,255,.65); font-size: 11px; margin-top: 2px; }

.profile-rows { padding: 4px 16px; }
.profile-row {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid #f5f5f5; align-items: center;
}
.profile-row-icon { font-size: 18px; width: 24px; text-align: center; }
.profile-row-label { font-size: 10px; color: #bbb; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.profile-row-value { font-size: 13px; color: var(--text); margin-top: 2px; }
.profile-row-value.empty { color: #ddd; font-style: italic; }

.edit-form { padding: 12px 16px; }

/* Admin */
.admin-box { max-height: 90dvh; }
.admin-tabs {
  display: flex; gap: 4px; padding: 8px 12px;
  background: #f5f5f5; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atab {
  flex: 1; padding: 7px 4px;
  background: transparent; border: none;
  border-radius: 9px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #bbb;
  transition: all .2s; font-family: inherit;
}
.atab.active { background: #fff; color: var(--primary); }
.atab-content { padding: 12px; overflow-y: auto; flex: 1; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-card {
  background: linear-gradient(135deg, var(--dark), var(--primary));
  border-radius: 13px; padding: 13px; color: #fff; text-align: center;
}
.stat-icon { font-size: 22px; }
.stat-val { font-size: 26px; font-weight: 900; margin-top: 2px; }
.stat-label { font-size: 10px; opacity: .7; }

.admin-user-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid #f5f5f5;
}
.admin-user-item .user-av-text { width: 36px; height: 36px; font-size: 13px; }
.admin-user-name { font-size: 13px; font-weight: 600; }
.admin-user-sub  { font-size: 10px; color: var(--muted); }
.admin-reset-btn {
  background: #fee; border: none; color: var(--danger);
  border-radius: 7px; padding: 3px 7px; font-size: 10px;
  cursor: pointer; font-weight: 700; flex-shrink: 0;
}

.admin-msg-item {
  background: #fff; border-radius: 11px; padding: 9px 12px;
  margin-bottom: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; gap: 8px;
}
.admin-msg-from { font-size: 11px; font-weight: 700; color: var(--primary); }
.admin-msg-text { font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-msg-time { font-size: 10px; color: #bbb; flex-shrink: 0; }

/* ── Dev float button ─────────────────────────── */
.dev-float-btn {
  position: fixed; bottom: 72px; right: 14px;
  background: rgba(6,64,16,.92);
  border: 2px solid var(--accent);
  border-radius: 50%; width: 42px; height: 42px;
  cursor: pointer; z-index: 8000; font-size: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.dev-float-btn:hover { transform: scale(1.1); }

.dev-modal-box {
  align-items: center; padding: 22px 18px;
  gap: 12px; border-radius: 20px;
}
.dev-modal-header {
  font-size: 10px; color: rgba(0,0,0,.45);
  text-transform: uppercase; letter-spacing: 2.5px;
  font-weight: 700;
}
.dev-modal-card {
  background: linear-gradient(135deg,#1a3a8f,#1a5cb5);
  border-radius: 16px; padding: 14px;
  display: flex; align-items: center; gap: 14px;
  width: 100%; border: 1px solid rgba(255,255,255,.15);
}
.dev-modal-photo {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 3px solid rgba(255,255,255,.9); flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.dev-modal-name  { color: #fff; font-weight: 900; font-size: 17px; }
.dev-modal-role  { color: rgba(255,255,255,.65); font-size: 11px; margin-top: 4px; }
.dev-modal-fire  {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,120,0,.25); border: 1px solid rgba(255,150,0,.4);
  border-radius: 20px; padding: 4px 12px;
  color: #FFB347; font-weight: 800; font-size: 13px;
}
.dev-modal-version { font-size: 11px; color: rgba(0,0,0,.4); }
.dev-modal-shloka {
  font-family: Georgia, serif; font-style: italic;
  font-size: 12px; color: rgba(0,0,0,.5);
  text-align: center; line-height: 1.8;
}

/* ── Toast ───────────────────────────────────── */
.toast {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: 30px;
  z-index: 9999; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  white-space: nowrap; max-width: 90vw;
  animation: fadeIn .2s ease;
}
.toast.error { background: var(--danger); }

/* ── Utilities ───────────────────────────────── */
.hidden { display: none !important; }

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}

/* ── Dev Photo Initials Fallback ──────────────────────────── */
.dev-photo-wrap { position: relative; width: 64px; height: 64px; }
.dev-photo-wrap-sm { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.dev-modal-initials {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #064010, #1a9e3a);
  color: #fff; font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,0.3);
}
.dev-initials-sm {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #064010, #1a9e3a);
  color: #fff; font-size: 16px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
}

/* ── WhatsApp Forward Modal ───────────────────────────────── */
.wa-modal-body { padding: 0 4px; }
.wa-desc { font-size: 13px; color: #555; margin-bottom: 14px; line-height: 1.6; }
.wa-modal-body .form-group { margin-bottom: 14px; }
.wa-modal-body textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #ddd;
  border-radius: 10px; font-size: 14px; resize: vertical;
  font-family: inherit; min-height: 70px;
}
.wa-modal-body textarea:focus { border-color: #25D366; outline: none; }
.wa-recipients-list {
  max-height: 160px; overflow-y: auto;
  border: 1.5px solid #eee; border-radius: 10px; padding: 8px;
}
.wa-recipient-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; cursor: pointer; border-radius: 6px;
  font-size: 13px; transition: background 0.15s;
}
.wa-recipient-item:hover { background: #f0fdf4; }
.wa-recipient-item input[type=checkbox] { width: 16px; height: 16px; accent-color: #25D366; }
.wa-file-preview {
  margin-top: 6px; padding: 7px 10px;
  background: #f0fdf4; border-radius: 8px;
  font-size: 12px; color: #25D366; font-weight: 600;
}
.wa-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: #92400e; margin-bottom: 16px; line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   NIST v4.1 — UI/UX Fixes
═══════════════════════════════════════════════ */

/* Login real logo */
.login-logo-real {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 28px rgba(0,0,0,.45), 0 0 0 3px rgba(255,255,255,0.2);
  display: block;
  margin-bottom: 4px;
  animation: fadeIn 0.6s ease;
}

/* Header logo image — properly sized, no cutoff */
.header-logo-img {
  width: 38px !important; height: 38px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
  display: block !important;
}

/* Sidebar header — prevent logo cutoff */
.sidebar-header {
  padding: 10px 12px !important;
  min-height: 58px;
  flex-wrap: nowrap;
  overflow: visible !important;
}

.header-logo {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: visible !important;
  flex-shrink: 0;
}

.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-shrink: 0;
}

/* Admin — ensure all user items clickable */
.user-item {
  pointer-events: auto !important;
  cursor: pointer !important;
}
.user-item:hover {
  background: #f0fff4 !important;
}

/* Admin buttons — visible and clickable */
#admin-btn, #wa-btn {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

/* Dev photo in login card — always visible */
.dev-avatar {
  width: 44px !important; height: 44px !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255,255,255,0.85) !important;
  flex-shrink: 0;
  display: block !important;
}

/* Dev modal photo */
.dev-modal-photo {
  width: 80px !important; height: 80px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center top !important;
  display: block !important;
}

/* Chat empty logo */
#chat-empty-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 16px rgba(0,0,0,.15);
  margin-bottom: 12px;
}

/* Icon buttons — always pointer */
.icon-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
}


/* ═══════════════════════════════════════════════
   NIST v4.1 — Critical UI Fixes (Cloudflare deploy)
   Fix: Login shows first, Logo alignment, Admin buttons
═══════════════════════════════════════════════ */

/* ── Login screen: always on top, never skip ── */
#login-screen {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
}
#login-screen.hidden-by-js {
  display: none !important;
}

/* ── Header logo — no cutoff, proper alignment ── */
.sidebar-header {
  padding: 10px 12px !important;
  min-height: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  gap: 8px !important;
}

.header-logo {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.header-logo-img {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 2px solid rgba(255,255,255,0.4) !important;
  display: block !important;
}

.header-title {
  color: #fff !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}

.header-user {
  color: rgba(255,255,255,0.7) !important;
  font-size: 11px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 120px !important;
}

.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

/* ── Icon buttons — always clickable ── */
.icon-btn {
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  border-radius: 8px !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  font-size: 16px !important;
  transition: background 0.15s !important;
  -webkit-tap-highlight-color: transparent !important;
}
.icon-btn:hover, .icon-btn:active {
  background: rgba(255,255,255,0.28) !important;
}

/* Admin & WA buttons explicitly visible */
#admin-btn, #wa-btn {
  display: flex !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

/* ── Dev photo in login card — always visible ── */
#dev-photo {
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center top !important;
  border: 2.5px solid rgba(255,255,255,0.9) !important;
  flex-shrink: 0 !important;
}
#dev-initials-sm { display: none !important; }

/* ── Login logo — properly sized ── */
.login-logo-real, #login-logo-img {
  width: 110px !important;
  height: 110px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto 6px !important;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 0 3px rgba(255,255,255,0.2) !important;
}

/* ── User list items — always clickable ── */
.user-item {
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: background 0.15s !important;
}
.user-item:hover { background: #f0fff4 !important; }
.user-item:active { background: #d4f5e2 !important; }

/* ── Dev modal photo ── */
.dev-modal-photo, #dev-modal-photo {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center top !important;
  display: block !important;
  border: 3px solid #25D366 !important;
}
#dev-modal-initials { display: none !important; }

/* ── Chat empty state logo ── */
#chat-empty-logo {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto 12px !important;
}

/* ── Admin panel — ensure tabs and content work ── */
.atab {
  cursor: pointer !important;
  pointer-events: auto !important;
}
.admin-user-item {
  cursor: default !important;
}
.admin-reset-btn {
  cursor: pointer !important;
  pointer-events: auto !important;
}
