/* === Custom Properties === */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #ca8a04;
  --color-info: #2563eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

/* === Layout === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  box-shadow: var(--shadow);
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .brand { font-size: 1.25rem; font-weight: 700; color: var(--color-text); display: flex; align-items: center; gap: 0.4rem; }
.brand-logo { width: 24px; height: 24px; }
.beta-badge { background: #e53e3e; color: #fff; font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1; vertical-align: middle; }
.beta-badge-lg { font-size: 0.75rem; padding: 0.15rem 0.45rem; }
nav .nav-links { display: flex; align-items: center; gap: 1rem; }
nav .nav-links a { color: var(--color-text-muted); font-size: 0.9rem; }
nav .user-info { display: flex; align-items: center; gap: 0.5rem; }
nav .user-info img { width: 28px; height: 28px; border-radius: 50%; }

main { padding: 2rem 0; }

/* === Grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* === Card === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.5rem; }
.card .meta { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.card .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.card-link { text-decoration: none; color: inherit; display: block; cursor: pointer; }
.card-link:hover h3 { color: var(--color-primary); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-outline { background: #fff; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; }

/* === Icon Buttons === */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--color-border); background: #fff;
  color: var(--color-text-light); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.icon-btn:hover { background: #f1f5f9; color: var(--color-text); border-color: #94a3b8; }
.icon-btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.icon-btn-primary:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
.icon-btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.icon-btn-success:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.icon-btn-danger { color: var(--color-error); }
.icon-btn-danger:hover { background: var(--color-error); color: #fff; border-color: var(--color-error); }

/* === Status Badges === */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-running { background: #dcfce7; color: var(--color-success); }
.badge-stopped { background: #f1f5f9; color: var(--color-text-muted); }
.badge-error   { background: #fee2e2; color: var(--color-error); }
.badge-creating { background: #fef9c3; color: var(--color-warning); }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-channel { background: #e0e7ff; color: #4338ca; text-transform: capitalize; }
.badge-workspace { background: #fef3c7; color: #92400e; }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: var(--color-success); }
.alert-error   { background: #fee2e2; color: var(--color-error); }
.alert-info    { background: #dbeafe; color: var(--color-info); }

/* === Hero / Landing === */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}
.hero-logo { width: 80px; height: 80px; margin-bottom: 1rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.hero p { font-size: 1.15rem; color: var(--color-text-muted); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero .auth-buttons { display: flex; gap: 1rem; justify-content: center; }

/* === Landing Sections === */
.landing-section {
  padding: 4rem 1rem;
}
.landing-section.alt-bg {
  background: var(--color-bg);
}

/* === Landing Features === */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.landing-features .feature {
  text-align: center;
}
.landing-features .feature-icon {
  display: flex;
  justify-content: center;
}
.landing-section-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.landing-section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === How It Works === */
.steps {
  display: flex;
  justify-content: center;
  gap: 3rem;
  max-width: 800px;
  margin: 0 auto;
}
.step {
  text-align: center;
  flex: 1;
  max-width: 220px;
}
.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}
.step h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.step p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* === Bottom CTA === */
.bottom-cta {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--color-bg);
}
.bottom-cta h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.bottom-cta p {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.footer-links a { color: var(--color-text-muted); }
.footer-links a:hover { color: var(--color-text); }
.footer-sep { color: var(--color-text-muted); }

/* === Legal Pages === */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  line-height: 1.7;
}
.legal-page h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}
.legal-updated {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.legal-page h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.legal-page p {
  margin-bottom: 0.75rem;
  color: var(--color-text);
  font-size: 0.95rem;
}
.legal-page ul {
  margin: 0 0 0.75rem 1.5rem;
  font-size: 0.95rem;
}
.legal-page li {
  margin-bottom: 0.4rem;
}

/* === Dashboard Header === */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.dash-header h1 { font-size: 1.5rem; }

/* === Onboard / Settings Form === */
.form-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.form-card h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }

/* === Admin Nav Link === */
.nav-admin {
  background: var(--color-primary);
  color: #fff !important;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
}
.nav-admin:hover { background: var(--color-primary-hover); text-decoration: none; }

/* === Admin Layout === */
.admin-nav {
  background: #1e293b;
  border-bottom: none;
  padding: 0.75rem 0;
  box-shadow: var(--shadow);
}
.admin-nav .container { display: flex; align-items: center; justify-content: space-between; }
.admin-nav .brand { font-size: 1.25rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 0.4rem; }
.admin-nav .brand-logo { filter: invert(1); }
.admin-nav .nav-links { display: flex; align-items: center; gap: 1rem; }
.admin-nav .nav-links a { color: #94a3b8; font-size: 0.9rem; }
.admin-nav .nav-links a:hover { color: #fff; text-decoration: none; }
.admin-nav .user-info { display: flex; align-items: center; gap: 0.5rem; color: #e2e8f0; }
.admin-nav .user-info img { width: 28px; height: 28px; border-radius: 50%; }

.admin-container {
  display: flex;
  min-height: calc(100vh - 56px);
}

.admin-sidebar {
  width: 200px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1rem 0;
  flex-shrink: 0;
}
.sidebar-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.sidebar-link:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.sidebar-link.active { color: var(--color-primary); background: #eff6ff; border-right: 3px solid var(--color-primary); }

.admin-main {
  flex: 1;
  padding: 1.5rem 2rem;
}
.admin-main h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.admin-main h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }

/* === Admin Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card h3 { font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-value.running { color: var(--color-success); }
.stat-value.stopped { color: var(--color-text-muted); }
.stat-value.error { color: var(--color-error); }
.stat-sub { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* === Admin Table === */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border);
}
.admin-table th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }

/* === Admin Toolbar === */
.admin-toolbar {
  margin-bottom: 1rem;
}
.admin-toolbar input[type="search"] {
  max-width: 320px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

/* === Admin Filter Tabs === */
.filter-tabs { display: flex; gap: 0.25rem; }
.tab {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}
.tab:hover { background: var(--color-bg); text-decoration: none; }
.tab.active { background: var(--color-primary); color: #fff; }

/* === Admin Detail Card === */
.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.detail-row { padding: 0.4rem 0; font-size: 0.9rem; }
.detail-row strong { color: var(--color-text-muted); min-width: 120px; display: inline-block; }
.detail-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

/* === Settings Page (wide layout + tabs) === */
.settings-wide {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.settings-wide h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.settings-wide h2 { margin-bottom: 1rem; font-size: 1.2rem; }

.finger-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.finger-tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.finger-tab:hover { color: var(--color-text); }
.finger-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.finger-panel { display: none; }
.finger-panel.active { display: block; }

.finger-panel .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Model tab two-column layout */
.model-columns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
}
.model-left { min-width: 0; }
.model-right { width: 200px; }
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tool-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.tool-item input[type="checkbox"] { width: auto; margin: 0; }

textarea.system-prompt {
  width: 100%;
  min-height: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  resize: vertical;
}
textarea.system-prompt:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.settings-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}
.tools-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
}
.tools-grid input[type="checkbox"] { width: auto; }

/* === Empty State (no hands) === */
.empty-state {
  text-align: center;
  padding: 3rem 1rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}
.empty-state-logo { width: 72px; height: 72px; margin-bottom: 1.25rem; }
.empty-state h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.empty-state-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.empty-state-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  text-align: left;
}
.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature-icon {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.feature h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.feature p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* === HugeIcons === */
.icon-btn i { font-size: 18px; line-height: 1; }
.feature-icon i { font-size: 24px; line-height: 1; }
.btn i { vertical-align: middle; line-height: 1; }
.btn .btn-label { vertical-align: middle; }
.nav-admin i { vertical-align: middle; line-height: 1; }

/* === File Explorer === */
.files-breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}
.files-breadcrumb a {
  color: var(--color-primary);
  font-weight: 500;
}
.files-breadcrumb a:hover {
  text-decoration: underline;
}

.files-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.files-dropzone {
  position: relative;
  min-height: 200px;
}

.files-dropzone-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 1.1rem;
  color: var(--color-primary);
  font-weight: 600;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
}
.files-table th,
.files-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border);
}
.files-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-bg);
}
.files-table tr:last-child td {
  border-bottom: none;
}

.files-row:hover td {
  background: #f8fafc;
}
.files-row-dir a {
  color: var(--color-text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.files-row-dir a:hover {
  color: var(--color-primary);
}
.files-row-file td:first-child {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.files-row-file td:first-child i {
  color: var(--color-text-muted);
}

.files-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.icon-btn-sm i {
  font-size: 14px !important;
}

.files-upload-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}
.files-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.files-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.2s;
  width: 0%;
}

/* File Viewer Modal */
.file-viewer-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.file-viewer-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.file-viewer-title {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-viewer-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}
.file-viewer-body {
  flex: 1;
  overflow: auto;
  min-height: 200px;
}
.file-viewer-code {
  margin: 0;
  padding: 1rem;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  background: var(--color-bg);
  color: var(--color-text);
  border: none;
  border-radius: 0;
}
.file-viewer-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 200px;
}
.file-viewer-image img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 6px;
}
.file-viewer-pdf {
  width: 100%;
  height: 80vh;
  border: none;
}
.file-viewer-md {
  padding: 1.25rem;
  line-height: 1.6;
}
.file-viewer-md h1, .file-viewer-md h2, .file-viewer-md h3 {
  margin: 1em 0 0.5em;
}
.file-viewer-md h1 { font-size: 1.5rem; }
.file-viewer-md h2 { font-size: 1.25rem; }
.file-viewer-md h3 { font-size: 1.1rem; }
.file-viewer-md p { margin: 0.5em 0; }
.file-viewer-md pre {
  background: var(--color-bg);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 0.5em 0;
}
.file-viewer-md code {
  background: var(--color-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.file-viewer-md pre code {
  background: none;
  padding: 0;
}
.file-viewer-table-wrap {
  overflow-x: auto;
  padding: 0.5rem;
}
.file-viewer-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  width: 100%;
}
.file-viewer-table th, .file-viewer-table td {
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}
.file-viewer-table th {
  background: var(--color-bg);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.file-viewable {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
}
.file-viewable:hover {
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 640px) {
  .btn .btn-label { display: none; }
  .btn i { margin-right: 0; }
  .nav-admin .btn-label { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .hero .auth-buttons { flex-direction: column; align-items: center; }
  .dash-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .admin-container { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); display: flex; padding: 0.5rem; gap: 0.25rem; overflow-x: auto; }
  .sidebar-link { padding: 0.4rem 0.75rem; white-space: nowrap; }
  .sidebar-link.active { border-right: none; border-bottom: 3px solid var(--color-primary); }
  .admin-main { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .empty-state-features { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .steps { flex-direction: column; align-items: center; gap: 2rem; }
}
