/* =========================================================================
   IRONLOG - design system
   Everything visual lives here. Change the tokens below and the whole site
   follows; nothing is loaded from a CDN and there is no framework to fight.
   ========================================================================= */

:root {
  /* surfaces, darkest to lightest */
  --bg:        #0A0C0F;
  --surface:   #12161C;
  --raised:    #1A2029;
  --hover:     #212936;
  --border:    #262E3A;
  --border-hi: #36404F;

  /* type */
  --text:      #F3F6FA;
  --muted:     #8A98A8;
  --faint:     #5C6877;

  /* accents */
  --volt:      #C6FF3D;
  --volt-dim:  #93C020;
  --hot:       #FF6B35;
  --good:      #3DDC97;
  --bad:       #FF5A5F;

  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1180px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { padding-bottom: 84px; }          /* room for the mobile tab bar */
@media (min-width: 860px) { body { padding-bottom: 0; } }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 .8rem; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ------------------------------------------------------------------ layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 12, 15, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  font-weight: 800; font-size: 1.05rem; letter-spacing: .16em;
  text-transform: uppercase; white-space: nowrap;
}
.brand span { color: var(--volt); }

.nav { display: none; gap: 4px; flex: 1; }
@media (min-width: 860px) { .nav { display: flex; } }
.nav a {
  padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  color: var(--muted); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--raised); color: var(--text); }
.nav a.on { background: var(--volt); color: #0A0C0F; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--border-hi);
  display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; color: var(--volt);
}

/* mobile tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(14, 17, 22, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 860px) { .tabbar { display: none; } }
.tabbar a {
  padding: 10px 4px 12px; text-align: center;
  font-size: .66rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}
.tabbar a.on { color: var(--volt); }
.tabbar .ic { display: block; font-size: 1.15rem; margin-bottom: 2px; line-height: 1; }

main { padding: 26px 0 40px; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}

.eyebrow {
  font-size: .7rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* -------------------------------------------------------------- stat tiles */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px;
}
.stat .label {
  font-size: .68rem; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.stat .value {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1;
}
.stat .value.volt { color: var(--volt); }
.stat .value.hot  { color: var(--hot); }
.stat .unit { font-size: .95rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .sub { margin-top: 6px; font-size: .78rem; color: var(--faint); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px; border-radius: 999px; border: 1px solid var(--border-hi);
  background: var(--raised); color: var(--text);
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--hover); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--volt); border-color: var(--volt); color: #0A0C0F;
}
.btn-primary:hover { background: #d4ff63; border-color: #d4ff63; }
.btn-danger { color: var(--bad); border-color: #46262b; background: #1d1416; }
.btn-danger:hover { background: #2a1a1d; border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* ------------------------------------------------------------------ inputs */
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block; margin-bottom: 6px;
  font-size: .72rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 11px 13px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-hi); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--volt);
  box-shadow: 0 0 0 3px rgba(198, 255, 61, .13);
}
textarea { min-height: 80px; resize: vertical; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.checkline { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.checkline input { width: 17px; height: 17px; accent-color: var(--volt); }
.checkline span { font-size: .88rem; color: var(--muted); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label.field { margin-bottom: 0; flex: 1 1 110px; }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th {
  text-align: left; padding: 9px 10px;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------- lists */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--raised); border: 1px solid var(--border);
}
.row + .row { margin-top: 8px; }
.row:hover { border-color: var(--border-hi); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; }
.row .meta { font-size: .78rem; color: var(--faint); margin-top: 2px; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--hover); color: var(--muted); border: 1px solid var(--border);
}
.chip.volt { background: rgba(198,255,61,.12); color: var(--volt); border-color: rgba(198,255,61,.3); }
.chip.hot  { background: rgba(255,107,53,.12); color: var(--hot);  border-color: rgba(255,107,53,.3); }
.chip.good { background: rgba(61,220,151,.12); color: var(--good); border-color: rgba(61,220,151,.3); }
.chip.bad  { background: rgba(255,90,95,.12);  color: var(--bad);  border-color: rgba(255,90,95,.3); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; height: auto; display: block; }
.chart .area { fill: url(#voltFade); }
.chart .line { fill: none; stroke: var(--volt); stroke-width: 2.5;
               stroke-linejoin: round; stroke-linecap: round; }
.chart .dot  { fill: var(--bg); stroke: var(--volt); stroke-width: 2; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-legend {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--faint); margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.bar-row { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.bar-row .bl { width: 78px; font-size: .78rem; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 9px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--volt-dim), var(--volt)); border-radius: 999px; }
.bar-row .bv { width: 74px; text-align: right; font-size: .78rem; color: var(--faint);
               font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ------------------------------------------------------------------ alerts */
.flash { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 14px;
         font-size: .9rem; font-weight: 600; border: 1px solid; }
.flash.success { background: rgba(61,220,151,.1);  border-color: rgba(61,220,151,.35); color: var(--good); }
.flash.error   { background: rgba(255,90,95,.1);   border-color: rgba(255,90,95,.35);  color: var(--bad); }

.empty { text-align: center; padding: 40px 20px; color: var(--faint); }
.empty .big { font-size: 2.4rem; margin-bottom: 10px; opacity: .5; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between;
             gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: 4px; }

.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--border);
       border-radius: 999px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700;
         color: var(--muted); }
.seg a.on { background: var(--volt); color: #0A0C0F; }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.pw-reveal {
  font-family: var(--mono); font-size: 1.15rem; letter-spacing: .06em;
  background: var(--bg); border: 1px dashed var(--volt); color: var(--volt);
  padding: 13px 16px; border-radius: var(--radius-sm); margin: 10px 0;
  word-break: break-all;
}

/* auth screens */
.auth-wrap { min-height: 88vh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .mark {
  font-size: 1.6rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.auth-logo .mark span { color: var(--volt); }
.auth-logo .tag { color: var(--faint); font-size: .8rem; letter-spacing: .1em;
                  text-transform: uppercase; margin-top: 6px; }

/* set logging */
.set-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 11px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); font-variant-numeric: tabular-nums;
  font-size: .85rem; font-weight: 650;
}
.set-pill.warm { opacity: .55; }
.set-pill .x { color: var(--faint); font-weight: 500; }
.set-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.exercise-block { border: 1px solid var(--border); border-radius: var(--radius);
                  background: var(--surface); padding: 15px; }
.exercise-block + .exercise-block { margin-top: 12px; }
.exercise-block.done { border-color: rgba(198,255,61,.28); }
.exercise-head { display: flex; align-items: center; justify-content: space-between;
                 gap: 10px; margin-bottom: 11px; }
.target { font-size: .78rem; color: var(--faint); }
.prev { font-size: .74rem; color: var(--faint); margin-top: 3px; }
