/* Viides.ai–inspired: deep space blue, crisp cyan accent, calm typography */
:root {
  --bg: #070d14;
  --bg-elev: #0f1729;
  --bg-card: #121c30;
  --border: #db0eb7;
  --text: #e8eef7;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --accent-2: #818cf8;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 0;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(129, 140, 248, 0.1), transparent), var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.brand-viides {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), rgba(129, 140, 248, 0.12));
  border: 1px solid var(--border);
}

.brand-viides:hover {
  border-color: #f472d8;
  text-decoration: none;
}

.brand-sep {
  width: 1px;
  height: 1.1rem;
  background: var(--border);
}

.brand-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-elev);
  border: none;
  border-radius: var(--radius);
}

.nav-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-user-name {
  font-size: 0.88rem;
}

a.nav-logout:hover {
  text-decoration: none;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), #67e8f9);
}

.main {
  min-height: 40vh;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.stat {
  text-align: left;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #042f2e;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.flash-ok {
  border-color: var(--border);
  background: rgba(74, 222, 128, 0.08);
  color: #bbf7d0;
}

.flash-err {
  border-color: var(--border);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

table.data {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

table.data th,
table.data td {
  padding: 0.55rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sort-link {
  color: inherit;
  text-decoration: none;
}

.sort-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

.sort-ind {
  color: var(--accent);
  font-size: 0.85em;
  white-space: nowrap;
}

table.data tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

.pager {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer p {
  margin: 0.25rem 0;
}

.footer-muted {
  opacity: 0.75;
}

.upload-box {
  border: 1px dashed var(--border);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
}

label.file-label input {
  margin-top: 0.5rem;
}

.input-text {
  width: 100%;
  max-width: 22rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.input-text--sm {
  max-width: 11rem;
  width: auto;
  min-width: 0;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.login-form label {
  display: block;
}

/* --- Asiakas-dashboard --- */
.shell.shell-wide {
  max-width: 100%;
}

.dash-header h1 {
  margin-bottom: 0.25rem;
}

.dash-meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.dash-kpis {
  margin-bottom: 1rem;
}

.dash-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.dash-big {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.25rem;
}

.dash-trend-up {
  color: var(--ok);
}

.dash-trend-down {
  color: var(--danger);
}

.dash-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 900px) {
  .dash-charts {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.chart-box {
  position: relative;
  height: 240px;
  margin-top: 0.5rem;
}

.chart-box--tall {
  height: 320px;
}

.dash-pills {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-pills li {
  padding: 0.35rem 0.65rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.dash-row-up td:last-child {
  color: var(--ok);
}

.dash-row-down td:last-child {
  color: var(--danger);
}

.dash-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.dash-list li {
  margin-bottom: 0.35rem;
}

.small {
  font-size: 0.85rem;
}

a.dash-cust-link {
  color: var(--text);
  font-weight: 600;
}

a.dash-cust-link:hover {
  color: var(--accent);
}
