/* ============================================================
   SecureChat — Mobile-first CSS
   Design: deep dark + glassmorphism + violet accent
   ============================================================ */

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colours */
  --bg:          #0a0c10;
  --bg2:         #111318;
  --sidebar-bg:  #0e1016;
  --surface:     rgba(255, 255, 255, 0.06);
  --surface-h:   rgba(255, 255, 255, 0.11);
  --border:      rgba(255, 255, 255, 0.12);
  --border-h:    rgba(255, 255, 255, 0.22);
  --accent:      #7c5cbf;
  --accent2:     #a078e0;
  --accent-glow: rgba(124, 92, 191, 0.35);
  --text:        #eeeef5;
  --text-2:      #a0a0c0;
  --muted:       #68688a;
  --danger:      #e05c7c;
  --success:     #5cbf8a;
  --warning:     #e0a050;
  --sent-bg:     #4a2d8a;
  --recv-bg:     rgba(255,255,255,0.07);
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --shadow:      0 8px 32px rgba(0,0,0,0.4);

  /* Sidebar */
  --sidebar-w:   280px;

  /* Timing */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
  overflow: hidden;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; }

/* ── Background gradient ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(124,92,191,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(160,120,224,.12) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.auth-logo h1 { font-size: 1.4rem; font-weight: 700; }
.auth-logo small {
  display: block;
  color: var(--text-2);
  font-size: 0.75rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.auth-footer {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-2);
  text-align: center;
}

/* ── Form elements ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
textarea,
select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder { color: rgba(255,255,255,0.3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-sm {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  margin-top: 0;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c04060);
}

.btn-ghost {
  background: var(--surface-h);
  border: 1px solid var(--border);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.alert-error   { background: rgba(224,92,124,.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: rgba(92,191,138,.15); border: 1px solid var(--success); color: var(--success); }
.alert-warn    { background: rgba(224,160,80,.15); border: 1px solid var(--warning); color: var(--warning); }

/* ── Key status widget ───────────────────────────────────── */
.key-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 1rem;
}

.key-ok    { color: var(--success); }
.key-error { color: var(--danger); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── App layout ───────────────────────────────────────────── */
.app {
  display: flex;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

/* Sidebar overlay on mobile — starts AFTER the sidebar so it never
   intercepts clicks on sidebar items */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);   /* only cover the area to the RIGHT of sidebar */
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.sidebar-overlay.open { display: block; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: var(--sidebar-w);
  background: #2a2d42;          /* clearly lighter than main bg */
  border-right: 2px solid rgba(124, 92, 191, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease);
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.7);
}

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

@media (min-width: 768px) {
  .sidebar {
    position: relative;
    transform: none;
    flex-shrink: 0;
  }

  .sidebar-overlay { display: none !important; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(124, 92, 191, 0.4);
  background: #32365a;
}

.sidebar-header .logo-icon { width: 34px; height: 34px; font-size: 1rem; }
.sidebar-header h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

@media (min-width: 768px) { .sidebar-close { display: none; } }

.sidebar-section {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 600;
}

.contact-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.contact-item:hover    { background: var(--surface-h); }
.contact-item.active   { background: var(--surface); border-left: 3px solid var(--accent); }

.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  position: relative;
}

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 0.95rem; font-weight: 500; }
.contact-hint { font-size: 0.75rem; color: var(--text-2); }

.unread-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(124, 92, 191, 0.4);
  background: #32365a;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-name { font-size: 0.9rem; font-weight: 500; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.sidebar-link:hover { background: var(--surface-h); color: var(--text); text-decoration: none; }

/* ── Main chat area ───────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #111318;
  flex-shrink: 0;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}

.hamburger-btn:hover { background: var(--surface-h); }

.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-status { font-size: 0.75rem; color: var(--text-2); }

.lock-icon { color: var(--success); font-size: 1.1rem; }

/* ── Message list ─────────────────────────────────────────── */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-behavior: smooth;
}

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-2);
  text-align: center;
  padding: 2rem;
}

.empty-state .icon { font-size: 3rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); }
.empty-state p  { font-size: 0.85rem; max-width: 280px; }

/* No contact selected */
.no-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
  color: var(--text-2);
}

.no-chat .icon { font-size: 4rem; opacity: 0.3; }
.no-chat h2    { font-size: 1.3rem; color: var(--text); }
.no-chat p     { font-size: 0.9rem; max-width: 320px; }

/* ── Message bubbles ──────────────────────────────────────── */
.message {
  display: flex;
  flex-direction: column;
  max-width: min(78%, 520px);
  animation: msgIn 0.2s var(--ease);
}

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

.message.sent     { align-self: flex-end; align-items: flex-end; }
.message.received { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: 0.7rem 1rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.sent     .bubble {
  background: var(--sent-bg);
  border-bottom-right-radius: 4px;
  color: #e8e0ff;
}

.received .bubble {
  background: var(--recv-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

.decryption-error {
  font-size: 0.8rem;
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  background: rgba(224,92,124,.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
}

/* Date divider */
.date-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-2);
  font-size: 0.75rem;
  text-align: center;
  margin: 0.5rem 0;
}

.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Message input ────────────────────────────────────────── */
.message-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.message-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.message-input-wrap {
  flex: 1;
  position: relative;
}

.message-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  resize: none;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.message-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.1s;
}

.send-btn:hover  { opacity: 0.85; }
.send-btn:active { transform: scale(0.93); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.e2e-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-2);
  padding-top: 0.4rem;
}

/* ── Admin body ───────────────────────────────────────────── */
.admin-body { overflow: auto; }

/* ── Admin mobile top nav (visible only on mobile) ─────────── */
.admin-mobile-nav {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #2a2d42;
  border-bottom: 1px solid rgba(124, 92, 191, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-mobile-back {
  color: var(--accent2);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  background: rgba(124, 92, 191, 0.2);
  border-radius: var(--radius-xs);
}
.admin-mobile-back:hover { background: rgba(124, 92, 191, 0.35); text-decoration: none; }

.admin-mobile-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-mobile-links {
  display: flex;
  gap: 0.5rem;
}

.admin-mobile-links a {
  font-size: 1.1rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
  text-decoration: none;
}
.admin-mobile-links a:hover,
.admin-mobile-links a.active {
  background: rgba(124, 92, 191, 0.3);
}

@media (max-width: 767px) {
  .admin-mobile-nav { display: flex; }
}

/* ── Admin panel ──────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100dvh;
  overflow: auto;
}

.admin-sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-sidebar .logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.admin-sidebar .logo-wrap h2 { font-size: 1rem; }
.admin-sidebar .logo-wrap small { color: var(--text-2); font-size: 0.7rem; }

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: var(--surface-h);
  color: var(--text);
  text-decoration: none;
}

.admin-nav-link.active { color: var(--accent2); }

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.admin-content h1 {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
}

/* ── Cards / tables ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent2); }
.stat-label { font-size: 0.8rem; color: var(--text-2); margin-top: 0.25rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-2); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-h); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-green  { background: rgba(92,191,138,.15); color: var(--success); }
.badge-purple { background: rgba(124,92,191,.2);  color: var(--accent2); }
.badge-red    { background: rgba(224,92,124,.15); color: var(--danger); }
.badge-grey   { background: var(--surface); color: var(--text-2); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.modal-footer .btn { width: auto; margin-top: 0; }

/* ── Toast notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s var(--ease);
  white-space: nowrap;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

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

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Utility ──────────────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted { color: var(--text-2); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Install wizard ─────────────────────────────────────── */
/* (install.php uses inline styles for standalone experience) */

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 767px) {
  .admin-sidebar {
    display: none; /* mobile admin uses a different nav approach */
  }

  .admin-content {
    padding: 1rem;
  }

  .card { padding: 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }

  .messages-area { padding: 0.75rem; }
  .message { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
