/* ============================================================
   QR Information Hub — Style
   Dark Mode · Glassmorphism · Mobile First · SPA Shell
   ============================================================ */

/* ----- CSS Custom Properties ----- */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --accent: #6c63ff;
  --accent-hover: #857dff;
  --accent-glow: rgba(108, 99, 255, 0.25);
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 56px;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(52, 211, 153, 0.05) 0%, transparent 50%);
}

.hidden { display: none !important; }

/* ----- Navigation ----- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav-brand svg { color: var(--accent); }

.nav-links { display: flex; gap: 0.25rem; }

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ----- Page Container ----- */
.page {
  min-height: calc(100vh - var(--nav-h));
  animation: fadeIn 0.3s ease;
}

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

.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-container-dash {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-container-mgr {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.gen-layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 800px) {
  .gen-layout {
    grid-template-columns: 220px 1fr 320px;
    align-items: start;
  }
}

/* ----- Card ----- */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: cardIn 0.5s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ LANDING PAGE STYLES ============ */

.card-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent);
}
.card-icon svg { width: 32px; height: 32px; }

.card-title {
  font-size: 1.4rem; font-weight: 700;
  text-align: center; margin-bottom: 1.5rem;
  color: var(--text-primary); letter-spacing: -0.02em;
}

.card-body { display: flex; flex-direction: column; gap: 0.75rem; }

.card-meta { margin-top: 1.25rem; text-align: center; }

.type-badge {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent);
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; color: #fff;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary { background: var(--accent); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-secondary { background: rgba(255,255,255,0.06); border: 1px solid var(--border-glass); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-success { background: var(--success); color: #0f0f1a; }
.btn-warning { background: var(--warning); color: #0f0f1a; }
.btn-outline { background: transparent; border: 1px solid var(--border-glass); color: var(--text-primary); }
.btn-outline:hover { background: rgba(255,255,255,0.05); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; border-radius: 8px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-row .btn { flex: 1 1 auto; min-width: 0; }
.btn-row.two-col .btn { flex: 1 1 calc(50% - 0.25rem); }

/* ============ INFO ROW ============ */

.info-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03); border-radius: var(--radius-sm);
  transition: var(--transition);
}
.info-row:hover { background: rgba(255,255,255,0.05); }

.info-row-icon {
  flex-shrink: 0; width: 40px; height: 40px;
  border-radius: 10px; background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.info-row-icon svg { width: 20px; height: 20px; }

.info-row-content { flex: 1; min-width: 0; }
.info-row-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.info-row-value { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); word-break: break-all; }

.text-content { font-size: 1rem; line-height: 1.7; color: var(--text-secondary); text-align: center; padding: 0.5rem 0; }

/* ============ MEDIA ============ */

.media-image {
  width: 100%; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); cursor: pointer;
  transition: var(--transition);
}
.media-image:hover { transform: scale(1.02); }
.media-image.error { display: none; }

.media-fallback {
  display: none; padding: 2rem; text-align: center;
  color: var(--text-muted); background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm); font-size: 0.9rem;
}
.media-fallback.visible { display: block; }

.embed-container {
  position: relative; width: 100%; padding-bottom: 56.25%;
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow);
}
.embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.audio-player { width: 100%; border-radius: var(--radius-sm); background: rgba(255,255,255,0.03); }
.video-player { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow); background: #000; }
.pdf-preview { width: 100%; height: 400px; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); background: rgba(255,255,255,0.02); }

/* ============ EVENT & PRODUCT ============ */

.event-detail {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
}
.event-detail-icon { flex-shrink: 0; color: var(--accent); }
.event-detail-icon svg { width: 20px; height: 20px; }
.event-detail-text { font-size: 0.95rem; color: var(--text-primary); }

.product-image-wrap {
  position: relative; width: 100%; padding-bottom: 75%;
  border-radius: var(--radius-sm); overflow: hidden;
  background: rgba(255,255,255,0.03); margin-bottom: 0.5rem;
}
.product-image-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

.product-price { font-size: 1.5rem; font-weight: 700; color: var(--accent); text-align: center; margin: 0.5rem 0; }
.product-desc { font-size: 0.9rem; color: var(--text-secondary); text-align: center; line-height: 1.6; }

/* ============ PASSWORD TOGGLE ============ */

.password-field {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.03); border-radius: var(--radius-sm);
  overflow: hidden; font-family: monospace;
}
.password-field .info-row-content { padding: 0.75rem 1rem; }

.password-toggle {
  flex-shrink: 0; padding: 0.75rem 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); transition: var(--transition);
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle svg { width: 20px; height: 20px; }

/* ============ FIELDS LIST ============ */

.fields-list { display: flex; flex-direction: column; gap: 0.5rem; }

.field-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03); border-radius: var(--radius-sm);
}
.field-key { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.field-value { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; text-align: right; word-break: break-all; }

/* ============ SPINNER ============ */

#loading-state { text-align: center; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border-glass); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 0.9rem; }

/* ============ SKELETON ============ */

.skeleton-card { animation: none; }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-icon { width: 64px; height: 64px; border-radius: var(--radius-sm); margin: 0 auto 1rem; }
.skeleton-title { width: 60%; height: 24px; margin: 0 auto 1.25rem; }
.skeleton-line { width: 100%; height: 16px; margin-bottom: 0.75rem; }
.skeleton-line.short { width: 70%; }
.skeleton-btn { width: 100%; height: 48px; border-radius: var(--radius-sm); margin-top: 0.75rem; }

/* ============ ERROR STATE ============ */

.error-card { text-align: center; }
.error-icon { width: 72px; height: 72px; margin: 0 auto 1rem; color: var(--error); }
.error-icon svg { width: 100%; height: 100%; }
.error-title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.error-message { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ============ TOAST ============ */

.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary); border: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem; border-radius: 100px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200; backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ============ ZOOM OVERLAY ============ */

.zoom-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 2rem; cursor: zoom-out;
}
.zoom-overlay img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: var(--radius-sm); cursor: default; }
.zoom-close {
  position: absolute; top: 1rem; right: 1.5rem;
  font-size: 2rem; background: none; border: none;
  color: #fff; cursor: pointer; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: var(--transition);
}
.zoom-close:hover { background: rgba(255,255,255,0.1); }

/* ============ MODAL ============ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 2rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { margin-bottom: 0.75rem; }
.modal-card p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* ============ DASHBOARD ============ */

.section-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 1rem;
  color: var(--text-primary); letter-spacing: -0.01em;
}

.dash-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}

.dash-stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1rem;
  text-align: center;
}

.dash-stat-num {
  font-size: 1.75rem; font-weight: 800;
  color: var(--accent); letter-spacing: -0.03em;
}
.dash-stat-num.skeleton { width: 60%; height: 32px; margin: 0 auto 0.4rem; border-radius: 8px; }

.dash-stat-label {
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}

.dash-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}

.dash-action-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.25rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; color: var(--text-primary);
  font-size: 0.8rem; font-weight: 500; font-family: var(--font);
}
.dash-action-card:hover { border-color: var(--border-glass); background: rgba(255,255,255,0.06); transform: translateY(-2px); }

.dash-action-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.dash-recent { display: flex; flex-direction: column; gap: 0.5rem; }

.dash-recent-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px; cursor: pointer;
  transition: var(--transition); text-decoration: none; color: inherit;
}
.dash-recent-item:hover { background: rgba(255,255,255,0.04); }

.dash-recent-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow); color: var(--accent);
  flex-shrink: 0;
}
.dash-recent-icon svg { width: 18px; height: 18px; }
.dash-recent-info { flex: 1; min-width: 0; }
.dash-recent-title { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-recent-meta { font-size: 0.72rem; color: var(--text-muted); }
.dash-recent-kind { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 6px; background: rgba(255,255,255,0.05); color: var(--text-muted); flex-shrink: 0; }

/* ============ GENERATOR ============ */

.gen-type-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 0.4rem; max-height: 360px; overflow-y: auto;
}
@media (min-width: 800px) { .gen-type-grid { grid-template-columns: 1fr; } }

.gen-type-btn {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.75rem; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); cursor: pointer;
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  transition: var(--transition); text-align: left; width: 100%;
}
.gen-type-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.gen-type-btn.active { background: var(--accent-glow); color: var(--accent); border-color: rgba(108,99,255,0.3); }

.gen-type-btn-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
}
.gen-type-btn.active .gen-type-btn-icon { background: rgba(108,99,255,0.2); }
.gen-type-btn-icon svg { width: 16px; height: 16px; }

.gen-type-btn-label { font-size: 0.8rem; }

/* Form */
.gen-form { display: flex; flex-direction: column; gap: 0.75rem; }

.gen-field { display: flex; flex-direction: column; gap: 0.3rem; }
.gen-field label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.gen-field input,
.gen-field select,
.gen-field textarea {
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font); font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.gen-field input:focus,
.gen-field select:focus,
.gen-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}
.gen-field textarea { min-height: 80px; resize: vertical; }
.gen-field select { cursor: pointer; }
.gen-field input[type="color"] {
  padding: 0.3rem; height: 40px; width: 60px; cursor: pointer;
}
.gen-field input[type="range"] { padding: 0; accent-color: var(--accent); }

.gen-range-val {
  font-size: 0.75rem; color: var(--text-muted);
  font-weight: 500; font-variant-numeric: tabular-nums;
}

/* Key-Value editor */
.gen-kv-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.gen-kv-row { display: flex; gap: 0.4rem; align-items: center; }
.gen-kv-row input { flex: 1; min-width: 0; }
.gen-kv-row button {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.04); color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.gen-kv-row button:hover { color: var(--error); border-color: var(--error); }
.gen-kv-add {
  padding: 0.5rem; background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border-glass);
  border-radius: 10px; color: var(--text-muted);
  cursor: pointer; font-family: var(--font); font-size: 0.82rem;
  transition: var(--transition);
}
.gen-kv-add:hover { color: var(--accent); border-color: var(--accent); }

/* URL preview */
.gen-url-preview {
  margin-top: 0.75rem; padding: 0.6rem 0.85rem;
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: 10px;
  font-size: 0.75rem; color: var(--accent);
  word-break: break-all; font-family: monospace;
  display: none;
}
.gen-url-preview.visible { display: block; }
.gen-url-preview-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 0.15rem;
}

/* Preview */
.gen-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.gen-preview-header .section-title { margin-bottom: 0; }
.gen-dl-btns { display: flex; gap: 0.35rem; }

.gen-preview-canvas-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}
.gen-preview-canvas-wrap canvas {
  max-width: 100%; height: auto;
  border-radius: var(--radius-sm);
}

/* Customize */
.gen-customize { margin-top: 1rem; }
.gen-customize summary {
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; padding: 0.4rem 0;
}
.gen-customize-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem; margin-top: 0.75rem;
}

/* ============ MANAGER ============ */

.mgr-toolbar {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: center;
}

.mgr-search-wrap {
  flex: 1; min-width: 180px; position: relative;
}
.mgr-search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.mgr-search-input {
  width: 100%; padding: 0.6rem 0.85rem 0.6rem 2.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px; color: var(--text-primary);
  font-family: var(--font); font-size: 0.85rem; outline: none;
  transition: var(--transition);
}
.mgr-search-input:focus { border-color: var(--accent); }

.mgr-filter-wrap { min-width: 140px; }
.mgr-filter-select {
  width: 100%; padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px; color: var(--text-primary);
  font-family: var(--font); font-size: 0.85rem; cursor: pointer; outline: none;
}
.mgr-stats { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* Table */
.mgr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mgr-table { min-width: 600px; }
.mgr-row { display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.04); }

.mgr-header { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.6rem 0; }
.mgr-header .mgr-cell { padding: 0.25rem 0.5rem; }

.mgr-row:not(.mgr-header) {
  padding: 0.5rem 0;
  transition: var(--transition);
  border-radius: 10px;
}
.mgr-row:not(.mgr-header):hover { background: rgba(255,255,255,0.02); }
.mgr-row:not(.mgr-header) .mgr-cell { padding: 0.4rem 0.5rem; }

.mgr-cell { overflow: hidden; }

.mgr-cell-type { width: 130px; display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.mgr-cell-id { width: 150px; flex-shrink: 0; }
.mgr-cell-id code { font-size: 0.72rem; background: rgba(255,255,255,0.04); padding: 0.15rem 0.4rem; border-radius: 4px; }
.mgr-cell-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem; }
.mgr-cell-kind { width: 120px; flex-shrink: 0; }
.mgr-cell-actions { width: 170px; flex-shrink: 0; display: flex; gap: 0.2rem; }

.mgr-type-icon { width: 28px; height: 28px; border-radius: 6px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mgr-type-icon svg { width: 14px; height: 14px; }
.mgr-type-label { font-size: 0.8rem; font-weight: 500; }

.mgr-badge {
  font-size: 0.68rem; padding: 0.2rem 0.45rem; border-radius: 6px;
  font-weight: 500; display: inline-flex; align-items: center; gap: 0.25rem;
}
.mgr-badge svg { width: 12px; height: 12px; }
.badge-lp { background: rgba(108,99,255,0.15); color: var(--accent); }
.badge-direct { background: rgba(251,191,36,0.15); color: var(--warning); }

.mgr-btn-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.mgr-btn-icon:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: var(--border-glass); }
.mgr-btn-danger:hover { color: var(--error); border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }
.sort-arrow { display: inline-flex; vertical-align: middle; margin-left: 2px; }
.sort-arrow svg { width: 12px; height: 12px; }

.mgr-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.mgr-empty-icon { width: 56px; height: 56px; margin: 0 auto 1rem; opacity: 0.4; }
.mgr-empty p { font-size: 0.95rem; font-weight: 500; }
.mgr-empty-sub { font-size: 0.8rem; margin-top: 0.3rem; opacity: 0.6; }
.mgr-empty-sub a { color: var(--accent); }

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

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(15,15,26,0.95); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.5rem 1rem 1rem;
  }
  .nav-links.open .nav-link { padding: 0.7rem 1rem; }

  .dash-stats { grid-template-columns: repeat(3, 1fr); }
  .dash-actions { grid-template-columns: repeat(3, 1fr); }
  .dash-stat-num { font-size: 1.3rem; }

  .mgr-cell-id { width: 100px; }
  .mgr-cell-type { width: 90px; }
  .mgr-cell-kind { display: none; }
  .mgr-cell-actions { width: 140px; }

  .gen-customize-grid { grid-template-columns: 1fr; }
}

@media (min-width: 601px) and (max-width: 799px) {
  .gen-layout {
    grid-template-columns: 1fr;
  }
  .gen-type-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem;
    max-height: none; overflow-y: visible;
  }
}

@media (min-width: 900px) {
  .app-container { max-width: 520px; }
}

/* ============ FOCUS & SELECTION ============ */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-glow); color: #fff; }

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