/* ══════════════════════════════════════════
   NaeBank — Design System
   ══════════════════════════════════════════ */

:root {
  --bg:          #030305;
  --surface:     #07080c;
  --card:        #0d0e14;
  --border:      rgba(255,255,255,0.06);
  --primary:     #7c75f0;
  --primary-dim: rgba(124,117,240,0.1);
  --accent:      #4dd8ce;
  --text:        #dcdae8;
  --muted:       #6b6980;
  --success:     #3dd68c;
  --danger:      #f05a6a;
  --warning:     #f0a930;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 8px 32px rgba(0,0,0,0.6);
  --trans:       0.22s ease;
}

[data-theme="light"] {
  --bg:          #f2f3f8;
  --surface:     #ffffff;
  --card:        #ffffff;
  --border:      rgba(0,0,0,0.08);
  --primary:     #6c5fd9;
  --primary-dim: rgba(108,95,217,0.1);
  --accent:      #0da99a;
  --text:        #1a1830;
  --muted:       #6b6a8a;
  --success:     #0da98e;
  --danger:      #e5264b;
  --warning:     #c87d00;
  --shadow:      0 8px 32px rgba(0,0,0,0.1);
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--trans), color var(--trans);
  overflow: hidden;
}

/* ── Typography ─────────────────────────────── */
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
p { line-height: 1.6; }
.text-muted { color: var(--muted); font-size: 0.875rem; }
.text-center { text-align: center; }

/* ── Glass ──────────────────────────────────── */
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

/* ── View layout ────────────────────────────── */
.view { min-height: 100vh; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════ */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

#view-login::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% -5%, rgba(124,117,240,0.1) 0%, transparent 65%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.login-logo img { height: 56px; object-fit: contain; }

.login-title {
  font-size: 2.2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-height: 2.8rem;
  margin-bottom: 1.75rem;
}

/* Floating label fields */
.field-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.field-input {
  width: 100%;
  padding: 1rem 0.875rem 0.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--trans), background var(--trans);
  outline: none;
}

.field-input:focus {
  border-color: var(--primary);
  background: var(--bg);
}

.field-label {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: all 0.2s ease;
}

.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label {
  top: 0.3rem;
  font-size: 0.72rem;
  color: var(--primary);
}

.field-select {
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--trans);
}
.field-select:focus { border-color: var(--primary); }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5a54d4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,117,240,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,117,240,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(124,117,240,0.4);
}
.btn-ghost:hover { background: var(--primary-dim); border-color: var(--primary); }

.btn-burn {
  color: var(--danger);
  border-color: rgba(240,90,106,0.4);
}
.btn-burn:hover { background: rgba(240,90,106,0.1); border-color: var(--danger); }

.btn-danger {
  background: rgba(240,90,106,0.12);
  color: var(--danger);
  border: 1.5px solid rgba(240,90,106,0.3);
}
.btn-danger:hover { background: rgba(240,90,106,0.22); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color var(--trans);
}
.btn-icon:hover { color: var(--primary); }

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 100;
  transition: background var(--trans);
}
.theme-toggle:hover { background: var(--surface); }

.error-msg {
  background: rgba(240,90,106,0.1);
  border: 1px solid rgba(240,90,106,0.3);
  color: var(--danger);
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════ */
#view-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.875rem;
  border-right: 1px solid var(--border);
  border-radius: 0;
  overflow-y: auto;
  height: 100vh;
  gap: 0.25rem;
  background: var(--surface) !important;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
}
.sidebar-logo img {
  height: 36px;
  object-fit: contain;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: rgba(124,117,240,0.08);
  border: 1px solid rgba(124,117,240,0.15);
}

.sidebar-username { font-weight: 600; font-size: 0.9rem; }
.sidebar-card {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.875rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
  text-align: left;
}

.nav-item:hover { background: var(--primary-dim); color: var(--text); }
.nav-item.active { background: var(--primary-dim); color: var(--primary); }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.nav-logout { color: var(--danger) !important; }
.nav-logout:hover { background: rgba(240,90,106,0.1) !important; }

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  margin-left: auto;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-theme {
  position: static;
  width: 100%;
  padding: 0.7rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans);
  font-family: inherit;
}
.sidebar-theme:hover { background: var(--primary-dim); color: var(--text); }

/* ── Main Content ───────────────────────────── */
.main-content {
  overflow-y: auto;
  height: 100vh;
  padding: 2rem;
  background: var(--bg);
}

.tab-section { animation: fadeIn 0.2s ease; max-width: 860px; }

.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.6rem; }

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 0.75rem;
}
.section-title { font-size: 1rem; font-weight: 600; }

/* ── Card Display ─────────────────────────── */
.card-display {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(124,117,240,0.15), rgba(77,216,206,0.07)) !important;
  border: 1px solid rgba(124,117,240,0.2) !important;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.card-display::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(124,117,240,0.12), transparent 70%);
  pointer-events: none;
}

.card-display-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.card-owner { font-weight: 600; font-size: 0.9rem; }
.card-type { font-size: 0.72rem; color: var(--muted); }

.card-number-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 1rem;
}

.card-balance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.balance-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 99px;
  padding: 0.3rem 0.875rem;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}
.balance-chip .symbol { color: var(--accent); font-weight: 700; }

.card-actions { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }

/* ── Avatar ─────────────────────────────── */
.avatar {
  border-radius: var(--radius-sm);
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid var(--border);
  background: var(--surface);
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 56px;  height: 56px; border-radius: 10px; }

/* ── Special Accounts ───────────────────── */
.special-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.special-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.special-card--savings {
  border-color: rgba(61,214,140,0.25);
  background: linear-gradient(135deg, var(--card), rgba(61,214,140,0.04));
}

.special-card--treasury {
  border-color: rgba(240,169,48,0.35);
  background: linear-gradient(135deg, var(--card), rgba(240,169,48,0.06));
  box-shadow: var(--shadow), 0 0 0 1px rgba(240,169,48,0.1);
}

.special-header {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.special-header-info { flex: 1; }

.special-treasury-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(240,169,48,0.3);
  flex-shrink: 0;
}

.special-signature {
  font-size: 0.75rem;
  color: var(--warning);
  font-style: italic;
  margin-top: 0.25rem;
}

.special-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.special-card--treasury .special-name { color: var(--warning); }
.special-card--savings  .special-name { color: var(--success); }

.special-desc { font-size: 0.8rem; color: var(--muted); }
.special-balances { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.special-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Type badges ────────────────────────── */
.type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.badge-savings  { background: rgba(61,214,140,0.15);  color: var(--success); }
.badge-treasury { background: rgba(240,169,48,0.15);  color: var(--warning); }

/* ── Empty state ─────────────────────────── */
.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }

/* ══════════════════════════════════════════
   TRANSFERS
   ══════════════════════════════════════════ */
.transfer-form { display: flex; flex-direction: column; gap: 0; }
.transfer-row { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1.25rem; }
.flex-1 { flex: 1; }

.exchange-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.exchange-arrow { font-size: 1.4rem; color: var(--muted); padding-bottom: 0.5rem; }
.rate-info { font-size: 0.85rem; margin-bottom: 1rem; }

/* Transfer history */
.transfers-list { display: flex; flex-direction: column; gap: 0.5rem; }

.transfer-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--trans);
}
.transfer-item:hover { border-color: rgba(124,117,240,0.25); }

.transfer-dir-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.dir-sent   { background: rgba(240,90,106,0.12); }
.dir-recv   { background: rgba(61,214,140,0.12); }
.dir-system { background: rgba(124,117,240,0.12); }

.transfer-info { flex: 1; min-width: 0; }
.transfer-peer { font-weight: 500; font-size: 0.875rem; }
.transfer-meta { font-size: 0.78rem; color: var(--muted); }

.transfer-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.amount-sent { color: var(--danger); }
.amount-recv { color: var(--success); }

/* ── Transfer Receipt Overlay ───────────── */
.receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.receipt-paper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem 1.5rem;
  min-width: 320px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: receiptDrop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.receipt-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success), var(--accent));
}

.receipt-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.receipt-logo {
  width: 56px;
  height: 56px;
  background: rgba(61,214,140,0.15);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--success);
  margin: 0 auto 0.75rem;
  animation: scalePop 0.3s 0.15s ease both;
}

.receipt-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.receipt-row:last-of-type { border-bottom: none; }

.receipt-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.receipt-value {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.receipt-amount-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  color: var(--success);
}

.receipt-divider {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 0.5rem 0;
}

.receipt-tap {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1rem;
}

@keyframes receiptDrop {
  from { opacity: 0; transform: translateY(-40px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

@keyframes scalePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ══════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════ */
.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - 4rem);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.contacts-panel {
  border-right: 1px solid var(--border);
  border-radius: 0 !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.contacts-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.contacts-list { flex: 1; overflow-y: auto; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background var(--trans);
  position: relative;
}
.contact-item:hover { background: var(--primary-dim); }
.contact-item.active { background: var(--primary-dim); }

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 500; font-size: 0.875rem; }
.contact-preview { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-time { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-left: 0.4rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  border-radius: 0 !important;
  background: var(--bg) !important;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chat-active {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 65%;
  padding: 0.6rem 0.875rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble-mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), #5a54d4);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-theirs {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble-time {
  display: block;
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 0.25rem;
  text-align: right;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input { flex: 1; padding: 0.65rem 0.875rem; border-radius: var(--radius-sm); }

/* ══════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.admin-tab {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans);
}
.admin-tab.active { background: var(--primary); color: #fff; }

/* Generic table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--primary-dim); }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green  { background: rgba(61,214,140,0.12); color: var(--success); }
.badge-red    { background: rgba(240,90,106,0.12); color: var(--danger); }
.badge-yellow { background: rgba(240,169,48,0.12); color: var(--warning); }

/* ── Minecraft Color Editor ─────────────── */
.mc-editor { margin-bottom: 0.75rem; }
.mc-editor-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.mc-palette {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
  align-items: center;
}
.mc-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  transition: transform 0.1s;
}
.mc-swatch:hover { transform: scale(1.25); z-index: 1; }
.mc-fmt-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background var(--trans);
  user-select: none;
}
.mc-fmt-btn.mc-italic { font-style: italic; }
.mc-fmt-btn:hover { background: var(--primary-dim); }

.mc-code-input { font-size: 0.85rem !important; }

.mc-preview {
  min-height: 1.5rem;
  padding: 0.4rem 0.75rem;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #fff;
  line-height: 1.5;
  word-break: break-all;
}
.mc-lore-preview { font-size: 0.8rem; }

/* ══════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal {
  width: 100%;
  max-width: 520px;
  padding: 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  position: relative;
  animation: fadeUp 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color var(--trans);
}
.modal-close:hover { color: var(--text); }
.modal h3 { margin-bottom: 1.25rem; }
.modal .field-group { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ══════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
  border-left: 3px solid;
  background: var(--card);
}
.toast-success { border-color: var(--success); color: var(--success); }
.toast-error   { border-color: var(--danger);  color: var(--danger);  }
.toast-info    { border-color: var(--primary); color: var(--text);    }

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  #view-app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar {
    flex-direction: row;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    border-right: none;
    overflow-x: auto;
    gap: 0;
  }
  .sidebar-user, .sidebar-bottom { display: none; }
  .sidebar-nav { flex-direction: row; gap: 0; }
  .nav-item { flex-direction: column; font-size: 0.65rem; gap: 0.2rem; padding: 0.5rem; flex: 1; justify-content: center; text-align: center; }
  .main-content { padding: 1rem; padding-bottom: 80px; }
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .contacts-panel { height: 200px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
