:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(80% 60% at 50% 0%, #eef2ff 0%, var(--bg) 60%);
  line-height: 1.5;
}

/* Header */
.app-header {
  padding: 32px 16px 16px;
  text-align: center;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0.3px;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.hint {
  color: var(--muted);
  margin-top: 8px;
  font-size: 14px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* Scroll containers */
.scroll {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 340px;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.charts-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  min-height: 260px;
}

/* Actions */
.actions button {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  margin-right: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 600;
}

.actions button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.actions button:hover:not(:disabled) {
  background: var(--primary-600);
}

/* Inputs */
input[type="file"] {
  display: inline-block;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

/* Footer */
.app-footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px 40px;
  font-size: 13px;
}

/* Small screens */
@media (max-width: 640px) {
  .app-header h1 {
    font-size: 22px;
  }
  .card {
    padding: 12px;
  }
  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
}
