/* ================================================
   TEMPLATE GENERATOR PRO V2 - Main Stylesheet
   Dark Theme | Glassmorphism | SaaS Design
   ================================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-glass: rgba(26, 26, 37, 0.7);
  --bg-glass-hover: rgba(30, 30, 45, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e8ed;
  --text-secondary: #9898a8;
  --text-muted: #686878;
  --accent-primary: #6c5ce7;
  --accent-secondary: #a855f7;
  --accent-gradient: linear-gradient(135deg, #6c5ce7, #a855f7);
  --accent-glow: rgba(108, 92, 231, 0.3);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.1);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- App Layout --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.brand-version {
  font-size: 11px;
  color: var(--accent-secondary);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-secondary);
}

.nav-item.active .nav-icon {
  color: var(--accent-secondary);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.server-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.content-area {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* --- Glass Effect --- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  color: var(--accent-secondary);
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Quick Actions --- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.action-card {
  padding: 24px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform var(--transition), border-color var(--transition);
  display: block;
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-secondary);
}

.action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  color: var(--accent-secondary);
  margin-bottom: 14px;
}

.action-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.action-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-primary:hover:not(:disabled) {
  background: var(--bg-glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-gradient:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-icon-danger:hover {
  background: var(--error-bg);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.form-hint code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.td-name {
  color: var(--text-primary);
  font-weight: 500;
}

.td-desc {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-file code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--accent-secondary);
}

/* --- Editor Table --- */
.editor-table th {
  text-align: center;
}

.editor-table th:first-child,
.editor-table th:nth-child(3) {
  text-align: left;
}

.editor-table td {
  vertical-align: middle;
}

.editor-table .arrow-cell {
  text-align: center;
  color: var(--accent-secondary);
  font-size: 18px;
  font-weight: 700;
}

.editor-table .form-input {
  background: var(--bg-primary);
}

/* --- Template Grid --- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.template-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.template-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  color: var(--accent-secondary);
}

.template-card-actions {
  display: flex;
  gap: 4px;
}

.template-card-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.template-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.template-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

.template-card-meta code {
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}

.template-card-buttons {
  display: flex;
  gap: 8px;
}

/* --- Upload Section --- */
.upload-section {
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

.upload-dropzone {
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  margin: 0;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--accent-secondary);
  background: rgba(108, 92, 231, 0.05);
}

.dropzone-content {
  pointer-events: none;
}

.dropzone-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dropzone-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.browse-link {
  color: var(--accent-secondary);
  cursor: pointer;
  text-decoration: underline;
  pointer-events: all;
}

.dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-progress {
  padding: 20px 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--success);
  font-weight: 500;
}

.upload-error {
  padding: 16px;
  color: var(--error);
  background: var(--error-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 16px;
}

.upload-form {
  padding: 24px;
  border-top: 1px solid var(--border-color);
}

/* --- Analysis Panel --- */
.analysis-panel {
  padding: 20px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.panel-badge {
  font-size: 11px;
  background: var(--accent-glow);
  color: var(--accent-secondary);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.analysis-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border-color);
}

.analysis-item-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.analysis-item-value {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

.analysis-item-value.empty {
  color: var(--text-muted);
  font-style: italic;
}

.analysis-item-array {
  font-size: 12px;
  color: var(--text-secondary);
  max-height: 100px;
  overflow-y: auto;
}

.analysis-item-array span {
  display: block;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* --- Editor Layout --- */
.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 4px;
}

.back-link:hover {
  color: var(--text-primary);
}

.editor-file {
  font-size: 12px;
  color: var(--text-muted);
}

.editor-file code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.editor-section {
  margin-bottom: 28px;
}

/* --- SEO Grid --- */
.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-card {
  padding: 20px;
}

/* --- FAQ --- */
.faq-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
}

.faq-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.faq-item-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.faq-item-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Generate Card --- */
.generate-card {
  padding: 28px;
  text-align: center;
}

.generate-info {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.generate-info h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.generate-info p {
  font-size: 13px;
}

.generate-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--success-bg);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-md);
}

.generate-result a {
  color: var(--success);
  font-weight: 600;
  text-decoration: none;
}

.generate-result a:hover {
  text-decoration: underline;
}

/* --- Generate Summary --- */
.generate-summary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
}

.generate-summary h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.summary-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

.summary-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-stats strong {
  color: var(--text-primary);
}

.summary-confirm {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.summary-actions {
  display: flex;
  gap: 10px;
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 20px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.4);
}

/* --- Notifications --- */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.notification {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-success {
  background: #0d2818;
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.notification-error {
  background: #2d1010;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--error);
}

.notification-info {
  background: #0d1d2d;
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: var(--info);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state.full-width {
  grid-column: 1 / -1;
}

.empty-icon {
  margin-bottom: 12px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

.empty-state-sm {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* --- Documentation --- */
.docs-container {
  max-width: 800px;
}

.docs-card {
  padding: 24px;
  margin-bottom: 20px;
}

.docs-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.docs-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.docs-version {
  font-size: 13px;
  color: var(--accent-secondary);
  margin-bottom: 12px;
}

.docs-list {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.docs-list li {
  margin-bottom: 4px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.docs-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.docs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
}

.docs-badge {
  background: var(--accent-glow);
  color: var(--accent-secondary);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.docs-check {
  color: var(--success);
  font-weight: 700;
}

.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Upload Page --- */
.upload-page .upload-section {
  margin-bottom: 24px;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .seo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding: 0 16px;
  }

  .content-area {
    padding: 16px;
  }

  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-grid-3 { grid-template-columns: 1fr; }
  .editor-header { flex-direction: column; }
  .form-row { flex-direction: column; }

  .mobile-menu-btn {
    display: flex;
  }
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-glass);
  border-top-color: var(--accent-secondary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ================================================
   HERO SECTION - Dashboard Entry Points
   ================================================ */

.hero-section {
  margin-bottom: 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.hero-card {
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent-secondary);
}

.hero-card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  color: var(--accent-secondary);
  margin-bottom: 16px;
}

.hero-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.hero-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Hero Dropzone */
.hero-dropzone {
  margin-top: auto;
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.hero-dropzone:hover,
.hero-dropzone.drag-over {
  border-color: var(--accent-secondary);
  background: rgba(108, 92, 231, 0.05);
}

.hero-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.hero-dropzone-inner svg {
  opacity: 0.5;
}

.hero-dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

.hero-upload-progress {
  padding: 10px 0;
}

.hero-upload-error {
  padding: 12px;
  color: var(--error);
  background: var(--error-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 8px;
}

/* Hero Template List */
.hero-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: auto;
}

.hero-template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.hero-template-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition);
  border: 1px solid transparent;
}

.hero-template-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.hero-template-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  color: var(--accent-secondary);
  flex-shrink: 0;
}

.hero-template-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hero-template-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-template-file {
  font-size: 11px;
  color: var(--text-muted);
}

.hero-template-more {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--accent-secondary);
  text-decoration: none;
}

.hero-template-more:hover {
  text-decoration: underline;
}

/* ================================================
   WORKFLOW STEPS
   ================================================ */

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.workflow-step {
  flex: 1;
  min-width: 160px;
  padding: 20px;
  text-align: center;
}

.workflow-step-num {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.workflow-step h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.workflow-step p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.workflow-arrow {
  font-size: 20px;
  color: var(--accent-secondary);
  font-weight: 700;
  flex-shrink: 0;
}

/* ================================================
   PAGE DESCRIPTION
   ================================================ */

.page-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.page-description a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.page-description a:hover {
  text-decoration: underline;
}

/* ================================================
   RESPONSIVE HERO
   ================================================ */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    flex-direction: column;
  }

  .workflow-arrow {
    transform: rotate(90deg);
  }

  .workflow-step {
    min-width: 100%;
  }
}
