/* === HEIROS THEME === */
:root {
  --bg: #13111c;
  --bg-surface: #1c1a26;
  --bg-elevated: #242232;
  --fg: #f0ebe3;
  --fg-muted: #8a8699;
  --fg-dim: #5c586f;
  --accent: #c4a35a;
  --accent-dim: rgba(196, 163, 90, 0.12);
  --accent-border: rgba(196, 163, 90, 0.25);
  --border: rgba(240, 235, 227, 0.08);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(19, 17, 28, 0.85);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.logo-mark { font-size: 20px; color: var(--accent); }
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 40px; }
.nav-links a { color: var(--fg-muted); text-decoration: none; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; transition: color 0.2s; }
.nav-links a:hover { color: var(--fg); }

/* SECTION LABELS */
.section-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px; font-weight: 400;
}

/* LAYOUT */
.page { padding-top: 64px; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 48px 40px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; font-weight: 400;
  text-decoration: none; cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #d4b36a; }
.btn-secondary { background: var(--bg-elevated); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent-border); }
.btn-danger { background: transparent; color: #e07070; border: 1px solid rgba(224, 112, 112, 0.3); }
.btn-danger:hover { background: rgba(224, 112, 112, 0.1); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 8px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; font-weight: 300;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }

/* STATS BAR */
.stats-bar {
  display: flex; gap: 32px; padding: 20px 28px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 32px;
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 28px; font-family: var(--font-display); color: var(--fg); }
.stat-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }

/* SEARCH & FILTER */
.filter-bar {
  display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 1; min-width: 220px;
  padding: 10px 16px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  padding: 10px 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg);
  font-family: var(--font-body); font-size: 14px;
  cursor: pointer; appearance: none;
}

/* ACCOUNT CARDS */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.account-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 12px;
}
.account-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-name { font-size: 16px; font-weight: 400; color: var(--fg); }
.card-type-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.type-financial { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.type-social { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.type-subscription { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.type-crypto { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.type-documents { background: rgba(196, 163, 90, 0.15); color: var(--accent); }

.card-url { font-size: 13px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-action-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.action-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; letter-spacing: 0.06em;
  background: var(--bg-elevated); color: var(--fg-muted);
}
.action-memorialize { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.action-transfer { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.action-close { background: rgba(224, 112, 112, 0.12); color: #e07070; }
.action-pass_credentials { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.action-undecided { background: var(--bg-elevated); color: var(--fg-muted); }

/* PAGE HEADER */
.page-header { margin-bottom: 32px; }
.page-title { font-family: var(--font-display); font-size: 36px; font-weight: 500; letter-spacing: 0.02em; margin-bottom: 8px; }
.page-subtitle { color: var(--fg-muted); font-size: 15px; }

/* DETAIL PAGE */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
.detail-main { display: flex; flex-direction: column; gap: 24px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 20px; }
.detail-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.detail-card h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 12px; }
.detail-value { font-size: 15px; color: var(--fg); word-break: break-all; }
.detail-value.muted { color: var(--fg-muted); }
.detail-field { margin-bottom: 16px; }
.detail-field:last-child { margin-bottom: 0; }
.detail-field-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 4px; }
.detail-field-value { font-size: 14px; color: var(--fg); }

.credentials-value {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--fg);
}
.credentials-masked { font-family: monospace; letter-spacing: 2px; color: var(--fg-muted); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state-icon { font-size: 48px; color: var(--fg-dim); margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.empty-state p { color: var(--fg-muted); margin-bottom: 24px; }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 20px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg);
  font-size: 14px; z-index: 999;
  display: none; animation: slideIn 0.2s ease-out;
}
@keyframes slideIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#toast.show { display: block; }
#toast.success { border-color: rgba(52, 211, 153, 0.4); }
#toast.error { border-color: rgba(224, 112, 112, 0.4); }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; max-width: 420px; width: 90%;
}
.modal h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 12px; }
.modal p { color: var(--fg-muted); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* FORM PAGE */
.form-page { max-width: 640px; margin: 0 auto; padding: 80px 40px; }
.form-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.form-title { font-family: var(--font-display); font-size: 28px; margin-bottom: 28px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }

/* 404 PAGE */
.not-found { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.not-found-content { text-align: center; }
.not-found-content h1 { font-family: var(--font-display); font-size: 80px; color: var(--accent); margin-bottom: 8px; }
.not-found-content p { color: var(--fg-muted); margin-bottom: 24px; }

/* LOADING */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* RESPONSIVE */
@media (max-width: 768px) {
  .container { padding: 24px 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; gap: 16px; }
  .filter-bar { flex-direction: column; }
  .search-input { min-width: unset; }
}