/* Wizvest - Styles communs */
:root {
  --bg: #0f1115;
  --fg: #e7eaf0;
  --muted: #a7b0c0;
  --accent: #6ea8fe;
  --ok: #3bc67d;
  --warn: #f6c343;
  --err: #ff6b6b;
  --card: #161a22;
  --border: #242b38;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, Arial, sans-serif;
  padding: 0;
}

/* Header / Navigation */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav {
  display: flex;
  gap: 8px;
  flex: 1;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}

.header-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--fg);
}

.header-nav a.active {
  background: var(--accent);
  color: #0b1020;
  font-weight: 600;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.header-user-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.header-user-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--fg);
}

.header-admin-link {
  color: var(--warn);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  transition: all .2s;
}

.header-admin-link:hover {
  background: rgba(246, 195, 67, 0.15);
}

/* Main container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Page title */
.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}

.page-title h1 {
  font-weight: 700;
  letter-spacing: .3px;
  margin: 0;
  font-size: 28px;
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms */
label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 6px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg);
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

select option {
  background: #0c0f14;
  color: var(--fg);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--fg);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #0b1020;
}

.btn.success {
  background: var(--ok);
  border-color: transparent;
  color: #0b1020;
}

.btn.danger {
  background: var(--err);
  border-color: transparent;
  color: #0b1020;
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

/* Grid layouts */
.row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: end;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Status indicators */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.idle { background: #666; }
.dot.run { background: var(--warn); }
.dot.done { background: var(--ok); }
.dot.err { background: var(--err); }

/* Progress bar */
.progress-wrap {
  margin: 10px 0 0;
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.progress {
  height: 12px;
  background: linear-gradient(90deg, var(--accent), #9ad0ff);
  width: 0%;
  transition: width .3s ease;
}

/* Pills / Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111620;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .1px;
}

.pill.secondary {
  color: var(--muted);
  border-color: #2f3745;
  background: #0c0f14;
}

.pill.pending { background: #332800; color: var(--warn); border-color: var(--warn); }
.pill.analyzing { background: #002233; color: var(--accent); border-color: var(--accent); }
.pill.done { background: #003320; color: var(--ok); border-color: var(--ok); }
.pill.error { background: #330000; color: var(--err); border-color: var(--err); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: #0c0f14;
  cursor: pointer;
  transition: all .2s;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: #161a22;
}

.upload-zone.dragover {
  border-color: var(--ok);
  background: #161a22;
}

.file-input {
  display: none;
}

/* Logs */
.log {
  white-space: pre-wrap;
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  max-height: 180px;
  overflow: auto;
  line-height: 1.6;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Offers list */
.offers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer-row {
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all .2s;
}

.offer-row:hover {
  border-color: var(--accent);
  background: #161a22;
}

.offer-row.selected {
  border-color: var(--ok);
  background: #0c1510;
}

.offer-icon {
  font-size: 32px;
  width: 48px;
  text-align: center;
}

.offer-info {
  flex: 1;
  min-width: 0;
}

.offer-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.offer-actions {
  display: flex;
  gap: 8px;
}

/* Offer card (detail view) */
.offer-card {
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.offer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.offer-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
}

/* Economic analysis */
.economic-summary {
  background: linear-gradient(135deg, #1a2332 0%, #0c0f14 100%);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 20px;
}

.economic-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.economic-summary-date {
  font-size: 12px;
  color: var(--muted);
}

.economic-summary-content {
  line-height: 1.6;
  font-size: 14px;
}

/* Indicators grid */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.indicator-card {
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.indicator-category {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.indicator-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.indicator-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

.indicator-trend {
  font-size: 14px;
  margin-left: 8px;
}

.indicator-trend.up { color: var(--ok); }
.indicator-trend.down { color: var(--err); }
.indicator-trend.stable { color: var(--muted); }

/* Indicator comparison (vs previous snapshot) */
.indicator-comparison {
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: help;
}

.indicator-comparison.up {
  color: var(--ok);
  background: rgba(59, 198, 125, 0.15);
}

.indicator-comparison.down {
  color: var(--err);
  background: rgba(255, 107, 107, 0.15);
}

.indicator-comparison.stable {
  color: var(--muted);
  background: rgba(167, 176, 192, 0.1);
}

/* Historical indicator card */
.indicator-card.historical {
  border-left: 3px solid var(--warn);
}

/* Recommendations */
.recommendations {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  line-height: 1.6;
}

.recommendations h2, .recommendations h3 {
  color: var(--accent);
  margin-top: 20px;
}

.recommendations h2 { font-size: 20px; }
.recommendations h3 { font-size: 16px; }
.recommendations ul { margin: 10px 0; padding-left: 20px; }
.recommendations li { margin: 6px 0; }

/* Checkbox for offers selection */
.offer-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
}

.offer-checkbox:checked {
  accent-color: var(--ok);
}

/* Small utility classes */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.text-muted { color: var(--muted); }
.text-success { color: var(--ok); }
.text-warning { color: var(--warn); }
.text-danger { color: var(--err); }
.text-accent { color: var(--accent); }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* Loading spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

/* Homepage / Hero section */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  transition: all .3s;
  text-decoration: none;
  color: inherit;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.feature-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  padding: 24px;
  background: var(--card);
  border-radius: 12px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .header { padding: 0 16px; gap: 16px; }
  .header-nav { gap: 4px; }
  .header-nav a { padding: 6px 10px; font-size: 13px; }
}

@media (max-width: 600px) {
  .container { padding: 16px; }
  .card { padding: 16px; }
  .header-logo span:last-child { display: none; }
  .hero-title { font-size: 32px; }
  .cards-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; gap: 24px; }
}
