/* ============================================================
   Mighty Temp Mail — Design System v2
   Dark modern SaaS. Indigo accent. Full responsive.
   Proper SVG icons everywhere — no emoji stickers.
   ============================================================ */

:root {
  --bg:           #0a0b10;
  --bg-elev-1:    #12141c;
  --bg-elev-2:    #181b26;
  --bg-elev-3:    #1f2331;
  --border:       #262a3a;
  --border-strong:#333850;

  --text:         #f4f5f8;
  --text-muted:   #9aa0b4;
  --text-dim:     #6b7288;

  --accent:       #6366f1;
  --accent-hover: #7c7ff2;
  --accent-dim:   #4f52c9;
  --accent-glow:  rgba(99,102,241,0.25);

  --success:      #10b981;
  --success-bg:   rgba(16,185,129,0.12);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245,158,11,0.12);
  --danger:       #ef4444;
  --danger-bg:    rgba(239,68,68,0.12);
  --info:         #3b82f6;
  --info-bg:      rgba(59,130,246,0.12);

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --radius-full:  9999px;

  --t-fast:       120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:       200ms cubic-bezier(0.4, 0, 0.2, 1);

  --max-w:        1200px;
  --header-h:     64px;

  --icon-size:    18px;
  --icon-stroke:  2;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.25rem; }

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.text-mono  { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- Icons ---------- */
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }
.icon-2xl { width: 48px; height: 48px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.stack    { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row      { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow     { flex: 1; }
.wrap     { flex-wrap: wrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1.05rem; color: var(--text);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center;
  box-shadow: 0 0 24px var(--accent-glow);
  color: #fff;
}
.brand-mark .icon { width: 16px; height: 16px; stroke-width: 2.5; }
.nav-links { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.9rem;
  transition: all var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn .icon { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 4px 16px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elev-2); color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-elev-3); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elev-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-lg .icon { width: 18px; height: 18px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon .icon { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-lg { padding: 32px; border-radius: var(--radius-lg); }
.card-flush { padding: 0; overflow: hidden; }
.card-interactive { transition: all var(--t-base); cursor: pointer; }
.card-interactive:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
  transform: translateY(-2px);
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all var(--t-fast);
  font-size: 0.95rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder { color: var(--text-dim); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }

.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
}
.input-icon-wrap .input { padding-left: 40px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge .icon { width: 11px; height: 11px; stroke-width: 2.5; }
.badge-free     { background: var(--info-bg);    color: var(--info); }
.badge-paid     { background: var(--success-bg); color: var(--success); }
.badge-pending  { background: var(--warning-bg); color: var(--warning); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg);  color: var(--danger); }
.badge-admin    { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert .icon { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--info-bg);    color: #93c5fd; border-color: rgba(59,130,246,0.25); }
.alert-success { background: var(--success-bg); color: #6ee7b7; border-color: rgba(16,185,129,0.25); }
.alert-warning { background: var(--warning-bg); color: #fcd34d; border-color: rgba(245,158,11,0.25); }
.alert-danger  { background: var(--danger-bg);  color: #fca5a5; border-color: rgba(239,68,68,0.25); }

/* ---------- Toasts ---------- */
#toast-host {
  position: fixed; top: 80px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none; max-width: calc(100vw - 40px);
}
.toast {
  pointer-events: auto;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  font-size: 0.9rem;
  display: flex; align-items: flex-start; gap: 10px;
  animation: toast-in var(--t-base);
}
.toast .icon { flex-shrink: 0; margin-top: 1px; }
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.success .icon { color: #34d399; }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.error .icon { color: #f87171; }
.toast.info    { border-color: rgba(59,130,246,0.4); }
.toast.info .icon { color: #60a5fa; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(5,6,10,0.75);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade-in var(--t-base);
}
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modal-in var(--t-base);
}
.modal-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-elev-3) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line { height: 14px; margin: 8px 0; }
.skel-title { height: 24px; width: 40%; }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 800px 400px at 50% -10%, rgba(99,102,241,0.15), transparent 60%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-title { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 700; margin-bottom: 20px; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--t-base);
}
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.feature-icon .icon { width: 22px; height: 22px; }
.feature-title { font-weight: 600; margin-bottom: 6px; }
.feature-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Pricing ---------- */
.pricing-card {
  max-width: 480px; margin: 0 auto;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.pricing-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pricing-row:last-child { border-bottom: none; }
.pricing-row .icon { color: var(--accent); flex-shrink: 0; }
.pricing-row .pricing-label { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.pricing-row strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left; padding: 18px 0;
  font-weight: 500; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: color var(--t-fast);
}
.faq-q:hover { color: var(--accent); }
.faq-q .chev { transition: transform var(--t-base); color: var(--text-dim); }
.faq-item.open .chev { transform: rotate(180deg); color: var(--accent); }
.faq-a {
  overflow: hidden; max-height: 0;
  transition: max-height var(--t-base), padding var(--t-base);
  color: var(--text-muted); font-size: 0.92rem;
}
.faq-item.open .faq-a { max-height: 400px; padding-bottom: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 80px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: var(--text-muted); }

/* ---------- App shell / dashboard ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--header-h));
}
.sidebar {
  background: var(--bg-elev-1);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-brand {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); padding: 8px 12px 16px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  transition: all var(--t-fast);
  text-decoration: none;
}
.sidebar-link:hover { background: var(--bg-elev-2); color: var(--text); }
.sidebar-link.active { background: rgba(99,102,241,0.12); color: var(--accent); }
.sidebar-link .icon { width: 18px; height: 18px; flex-shrink: 0; }

.app-main { padding: 28px 32px; overflow-x: hidden; }

/* Mobile hamburger */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  align-items: center; justify-content: center;
}
.hamburger .icon { width: 20px; height: 20px; }

/* ---------- Inbox cards ---------- */
.inbox-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--t-base);
  cursor: pointer;
}
.inbox-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}
.inbox-address {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox-meta { font-size: 0.78rem; color: var(--text-dim); margin-top: 3px; }
.inbox-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---------- Message rows ---------- */
.message-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.message-row:hover { background: var(--bg-elev-2); }
.message-row.unread { background: rgba(99,102,241,0.04); }
.message-row.unread .message-from { font-weight: 600; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}
.message-from { font-size: 0.9rem; margin-bottom: 2px; }
.message-subject { font-size: 0.85rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-time { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
table.data th, table.data td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th {
  font-weight: 500; color: var(--text-muted);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-elev-2);
  position: sticky; top: 0;
}
table.data tr:hover td { background: var(--bg-elev-2); }

/* ---------- Stat ---------- */
.stat {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Empty ---------- */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  margin: 0 auto 16px;
  width: 56px; height: 56px;
  color: var(--text-dim);
  opacity: 0.6;
}
.empty-icon .icon { width: 100%; height: 100%; stroke-width: 1.5; }

/* ---------- WhatsApp ---------- */
#wa-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.wa-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37,211,102,0.4), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  position: relative;
}
.wa-btn:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(37,211,102,0.5); }
.wa-btn svg { width: 30px; height: 30px; fill: #fff; }
.wa-close {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-elev-3); border: 1px solid var(--border);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 13px;
}
.wa-close:hover { background: var(--danger); color: #fff; }

/* ---------- Utilities ---------- */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; }  .mt-3 { margin-top: 24px; }  .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------- Animations ---------- */
.fade-in { animation: fade-in var(--t-base); }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-main { padding: 20px 16px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; max-width: 80vw;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t-base);
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* Header — compact, single-row */
  .site-header { height: auto; min-height: 60px; padding: 10px 0; }
  .site-header .container {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
  }
  .brand { font-size: 0.95rem; flex-shrink: 0; gap: 8px; }
  .brand span:not(.brand-mark) {
    display: none; /* hide long name on phones, keep logo */
  }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark .icon { width: 18px; height: 18px; }
  .nav-links { gap: 6px; flex-wrap: nowrap; margin-left: auto; align-items: center; }
  .nav-links .btn { padding: 8px 12px; font-size: 0.78rem; }
  .nav-links .btn .icon { width: 14px; height: 14px; }
  .nav-links .hide-mobile { display: none; }
  .hamburger { width: 36px; height: 36px; }

  /* Cards */
  .card { padding: 18px; }
  .card-lg { padding: 22px; }

  /* Inbox detail: stack */
  #inbox-detail-address { font-size: 0.85rem; word-break: break-all; white-space: normal; }
  #view-inbox .card .row-between { flex-direction: column; align-items: stretch; }
  #view-inbox .card .row.wrap { width: 100%; }
  #view-inbox .card .row.wrap .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }

  /* Message rows */
  .message-row { grid-template-columns: 36px 1fr auto; gap: 10px; padding: 12px 14px; }
  .avatar { width: 36px; height: 36px; font-size: 0.8rem; }
  .message-from { font-size: 0.85rem; }
  .message-subject { font-size: 0.8rem; }

  /* Toasts move to bottom on mobile */
  #toast-host {
    top: auto; bottom: 90px;
    left: 12px; right: 12px;
    align-items: center;
  }
  .toast { min-width: 0; width: 100%; max-width: 100%; }

  /* Tables */
  table.data { font-size: 0.82rem; }
  table.data th, table.data td { padding: 10px 12px; }

  /* Pills */
  .balance-pill, .free-pill { padding: 5px 10px; font-size: 0.72rem; white-space: nowrap; }
  .balance-pill .icon, .free-pill .icon { width: 12px; height: 12px; }

  /* Modal */
  .modal { padding: 20px; }
}
/* Desktop layout hardening — app shell must not stretch beyond viewport */
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
}
.app-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.sidebar {
  width: 240px;
  min-width: 0;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: 260px; max-width: 80vw; }
}