/* FIT4gym aamunäkymä. Värit fit4gym.fi:n mukaan, puhelin ensin. Fontit: OFL, mukana imagessa. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700.woff2") format("woff2"); }

:root {
  --olive: #182019;
  --olive-text: #4b5a34;
  --olive-soft: #a9b48f;
  --black: #050505;
  --paper: #f5f5f3;
  --card: #ffffff;
  --yellow: #ffd200;
  --line: #e2e2dc;
  --muted: #6b6f66;
  --pos: #1f7a3a;
  --neg: #b42318;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--black); font: 400 15px/1.45 var(--sans); }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; margin: 0; }
h1 { font-size: 30px; line-height: 1.05; }
h2 { font-size: 17px; color: var(--olive-text); margin-bottom: 6px; }
.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.small { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* Yläpalkki */
.top { background: var(--olive); color: #fff; border-bottom: 3px solid var(--yellow); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.brand { font: 700 24px/1 var(--display); letter-spacing: .04em; text-decoration: none; }
.brand span { color: var(--yellow); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.nav a { text-decoration: none; opacity: .85; padding: 4px 0; }
.nav a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--yellow); }
.logout { margin: 0; }
.logout button { background: none; border: 1px solid #ffffff55; color: #fff; border-radius: 4px; padding: 3px 8px; font: inherit; font-size: 13px; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 14px 16px 40px; }
.head { margin: 4px 0 12px; }
.sub { margin: 2px 0 0; color: var(--muted); }
.alert { background: #fff4c2; border-left: 4px solid var(--yellow); padding: 10px 12px; margin: 0 0 12px; border-radius: 4px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }

/* Pääluvut 2 × 2 */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.kpi h2 { font-size: 15px; margin-bottom: 2px; }
.big { font: 700 34px/1.05 var(--display); margin: 2px 0 4px; letter-spacing: .01em; white-space: nowrap; }
.big-sm { font: 700 28px/1.1 var(--display); margin: 0 0 6px; }
.chg { display: block; font-size: 13px; font-weight: 600; }
.chg .muted, .chg.muted { font-weight: 400; }

/* Kaavio */
.chart { width: 100%; height: auto; display: block; }
.bar-rec { fill: var(--olive); }
.bar-ar { fill: var(--olive-soft); }
.chart .base { stroke: var(--line); }
.chart .axis { font: 400 11px var(--sans); fill: var(--muted); }
.legend { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: -1px; }
.sw:first-child { margin-left: 0; }
.sw-rec { background: var(--olive); }
.sw-ar { background: var(--olive-soft); }
.facts { margin: 0; padding-left: 18px; font-size: 14px; }
.facts li { margin: 3px 0; }

/* Asiakasliike */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; margin: 0; }
.stats div { min-width: 0; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font: 700 26px/1.1 var(--display); }
.stats dd.muted { font: 400 12px var(--sans); }

/* Tänään hoidettavat */
.todo { border: 2px solid var(--yellow); background: #fffbea; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { border-top: 1px solid #f0e3a8; }
.todo-list li:first-child { border-top: 0; }
.todo-list a, .todo-list li > span { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; text-decoration: none; }
.todo-list a:hover span:first-child { text-decoration: underline; }
.todo-list b { font: 700 18px/1.2 var(--display); white-space: nowrap; }

.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; padding: 4px 2px; }

/* Taulukot */
.table-wrap { overflow-x: auto; margin: 8px -14px 0; padding: 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tfoot th { color: var(--black); font-size: 14px; border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.name { display: block; font-weight: 600; }
.code { display: block; font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; background: #fff4c2; border-radius: 3px; padding: 1px 4px; }

/* Puhelimen kortit (alle 600 px), tietokoneella taulukko */
.cards { list-style: none; margin: 8px 0 0; padding: 0; display: none; }
.rcard { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rcard:first-child { border-top: 0; }
.rcard .name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rcard-amount { font: 700 18px/1.2 var(--display); text-align: right; white-space: nowrap; }
.rcard-meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
@media (max-width: 599px) {
  .cards { display: block; }
  .wide-only { display: none; }
}

/* Kirjautuminen */
.login { max-width: 380px; margin: 40px auto; }
.login h1 { margin-bottom: 12px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.login input { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.primary { width: 100%; padding: 11px; border: 0; border-radius: 6px; background: var(--olive); color: #fff; font: 700 18px var(--display); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; border-bottom: 3px solid var(--yellow); }

/* Tietokone: kaksi saraketta */
@media (min-width: 900px) {
  h1 { font-size: 36px; }
  .layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
  .big { font-size: 40px; }
}
@media (max-width: 360px) {
  .big { font-size: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
