:root {
  --bg: #f2f6f5;
  --ink: #12202e;
  --muted: #5b6b7d;
  --dark: #0b1824;
  --card: #ffffff;
  --teal: #0e9f8e;
  --teal-dark: #0b7d70;
  --gold: #e8b44a;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(11, 24, 36, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", sans-serif; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}

/* Header */
.adm-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  background: linear-gradient(135deg, #0d2938, #0b1824);
  color: #fff; border-bottom: 3px solid var(--gold); flex: 0 0 auto;
}
.adm-logo {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--gold)); font-weight: 700; font-size: 1.2rem;
}
.adm-head strong { display: block; font-family: "Playfair Display", serif; font-size: 1.1rem; }
.adm-sub { font-size: .78rem; color: #b9e4dd; }
.adm-status { margin-left: auto; font-size: .85rem; font-weight: 600; color: #e8b44a; }
.adm-signout { margin-left: 12px; font-size: .8rem; }

/* Lock screen */
.adm-lock {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--bg); padding: 24px;
}
.adm-lock-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 38px; width: min(380px, 100%); text-align: center;
}
.adm-lock-ico { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.adm-lock-card h2 { font-family: "Playfair Display", serif; font-size: 1.6rem; margin-bottom: 6px; }
.adm-lock-card p { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.adm-lock-card input[type="email"] { margin-bottom: 12px; }
.adm-pass-wrap { position: relative; margin-bottom: 12px; }
.adm-lock-card input {
  width: 100%; padding: 12px 42px 12px 14px; border: 1px solid rgba(11,24,36,.15); border-radius: 10px;
  font: inherit; font-size: 1rem; margin-bottom: 0; outline: none;
}
.adm-lock-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,159,142,.15); }
.adm-pass-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 30px; height: 100%; max-height: 38px; border: 0; background: transparent;
  cursor: pointer; font-size: 1.05rem; color: #5b7586; display: grid; place-items: center;
  transition: color .2s, transform .2s; border-radius: 8px;
}
.adm-pass-eye:hover { color: var(--teal); transform: translateY(-50%) scale(1.1); }
.adm-lock-err { color: #d9534f; font-size: .85rem; font-weight: 600; margin-top: 10px; }

/* Buttons */
.adm-btn {
  border: 0; cursor: pointer; font: inherit; font-weight: 600; border-radius: 10px;
  padding: 11px 18px; transition: transform .2s, background .2s, opacity .2s;
}
.adm-btn:active { transform: scale(.97); }
.adm-btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
  box-shadow: 0 8px 20px rgba(14,159,142,.3);
}
.adm-btn-primary:hover { opacity: .92; }
.adm-btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 6px 10px; }
.adm-btn-ghost:hover { background: rgba(255,255,255,.1); }

/* Layout */
.adm-layout { display: flex; flex: 1 1 auto; min-height: 0; }
.adm-sidebar {
  width: 300px; flex: 0 0 300px; background: var(--card); border-right: 1px solid rgba(11,24,36,.08);
  display: flex; flex-direction: column; min-height: 0;
}
.adm-side-head {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid rgba(11,24,36,.08); font-weight: 700; flex: 0 0 auto;
}
.adm-convs { overflow-y: auto; flex: 1 1 auto; }
.adm-empty { color: var(--muted); text-align: center; padding: 30px 16px; font-size: .9rem; }
.adm-conv {
  position: relative; padding: 14px 44px 14px 16px; border-bottom: 1px solid rgba(11,24,36,.06); cursor: pointer;
  transition: background .15s;
}
.adm-conv:hover { background: #f0f6f4; }
.adm-conv.is-active { background: rgba(14,159,142,.1); border-left: 3px solid var(--teal); }
.adm-conv strong { display: block; font-size: .98rem; margin-bottom: 3px; }
.adm-conv span { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-conv small { display: block; color: #9aa9b3; font-size: .75rem; margin-top: 4px; }
.adm-conv-del {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%) scale(.9);
  width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; font-size: .95rem; color: #9aa9b3; opacity: 0;
  transition: opacity .18s, transform .18s, background .18s, color .18s;
}
.adm-conv:hover .adm-conv-del, .adm-conv-del:focus-visible { opacity: 1; transform: translateY(-50%) scale(1); }
.adm-conv-del:hover { background: rgba(217,83,79,.12); color: #d9534f; }
.adm-conv.is-deleting {
  animation: admOut .45s cubic-bezier(.55,0,.55,.2) forwards;
  pointer-events: none;
}
@keyframes admOut {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(-60px) scale(.9); }
}

.adm-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.adm-thread {
  flex: 1 1 auto; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px;
  background: #eef4f2;
}
.adm-thread-empty { color: var(--muted); text-align: center; margin: auto; font-size: .95rem; }
.adm-msg { max-width: 72%; align-self: flex-start; background: #fff; padding: 10px 14px; border-radius: 14px 14px 14px 4px;
  box-shadow: 0 4px 12px rgba(11,24,36,.05); }
.adm-msg p { font-size: .95rem; line-height: 1.45; }
.adm-msg small { display: block; color: #9aa9b3; font-size: .72rem; margin-top: 5px; }
.adm-msg.is-admin { align-self: flex-end; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff; border-radius: 14px 14px 4px 14px; }
.adm-msg.is-admin small { color: #d9f0ec; }

.adm-reply {
  background: var(--card); border-top: 1px solid rgba(11,24,36,.08); padding: 14px 18px; flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 10px;
}
.adm-reply-meta { font-size: .82rem; color: var(--muted); }
.adm-reply textarea {
  border: 1px solid rgba(11,24,36,.15); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: .95rem;
  resize: none; outline: none; transition: border-color .2s, box-shadow .2s;
}
.adm-reply textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,159,142,.15); }
.adm-reply .adm-btn { align-self: flex-end; }

@media (max-width: 720px) {
  .adm-sidebar { width: 100%; flex: 0 0 auto; max-height: 40%; border-right: 0; border-bottom: 1px solid rgba(11,24,36,.08); }
  .adm-layout { flex-direction: column; }
}
