/* ---------- Base ---------- */
:root{
  --bg:#0b0b0f;
  --bg-elev:#12121a;
  --text:#e7e7ef;
  --muted:#9aa0aa;
  --accent:#ff2746;  /* neon red */
  --glow: 0 0 18px rgba(255,39,70,.6), 0 0 44px rgba(255,39,70,.35);
  --radius:20px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  overflow-x:hidden;
}

.top{
  position:sticky;
  top:0;
  z-index:50;
  display:flex;
  align-items:center;
  padding:16px 18px;
  background: linear-gradient(180deg, rgba(11,11,15,.9), rgba(11,11,15,.6) 80%, transparent);
  backdrop-filter: blur(6px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.logo{font-family:Orbitron,Inter,system-ui;font-weight:800;letter-spacing:.5px}
.logo .accent{color:var(--accent); text-shadow: var(--glow);}

.wrap{
  padding:16px;
  padding-bottom:96px; /* leave room for bottom nav */
  max-width:1100px;
  margin:0 auto;
}

/* ---------- Animated tech grid background ---------- */
.bg::before{
  content:"";
  position:fixed; inset:-200px;
  background:
    radial-gradient(1000px 700px at 120% -20%, rgba(255,39,70,.25), transparent 60%),
    radial-gradient(1200px 900px at -10% 120%, rgba(255,39,70,.18), transparent 55%),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size:
    auto, auto,
    40px 40px,
    40px 40px;
  pointer-events:none;
  z-index:-1;
  animation: drift 20s linear infinite;
}
@keyframes drift{
  0%{background-position: 0 0, 0 0, 0 0, 0 0;}
  100%{background-position: 0 0, 0 0, 80px 40px, 40px 80px;}
}

/* ---------- Cards & UI ---------- */
.stats-card, .table-card{
  background: linear-gradient(180deg, rgba(18,18,26,.9), rgba(18,18,26,.7));
  border:1px solid rgba(255,255,255,.07);
  border-radius:var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03) inset;
  padding:16px;
}
.stats-card h1{margin:4px 0 12px;font-size:20px;letter-spacing:.2px}

.stats-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  margin-bottom:12px;
}
.stat{
  background: var(--bg-elev);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
  padding:12px;
}
.stat .label{font-size:12px;color:var(--muted)}
.stat .value{font-size:22px;font-weight:800; letter-spacing:.3px; margin-top:4px}

.shift-form{margin-top:10px; display:grid; gap:10px}
.shift-form .row{display:grid; gap:8px}
.shift-form .row.two{grid-template-columns: 1fr 1fr; gap:10px}
.shift-form label{font-size:12px;color:var(--muted)}
.shift-form input{
  background:#0f0f16;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:12px 12px;
  color:var(--text);
  outline:none;
}
.btn-primary, .btn-outline, .btn-danger{
  font-weight:800; letter-spacing:.3px;
  border-radius:999px; padding:12px 16px; cursor:pointer;
  transition: transform .06s ease, box-shadow .2s ease;
}
.btn-primary{
  background: linear-gradient(180deg, var(--accent), #c5142c);
  border:none; color:white; box-shadow: var(--glow);
}
.btn-primary:active{transform: translateY(1px) scale(.99)}
.btn-outline{
  background: transparent; color:var(--text);
  border:1px solid rgba(255,255,255,.16);
}
.btn-danger{
  background: #2a0d12; color:#ffdbe1; border:1px solid rgba(255,39,70,.4);
}

/* ---------- Dashboard layout ---------- */
.dashboard{
  display:grid;
  grid-template-columns: 1fr 120px;
  gap:16px;
  align-items: stretch;
}
.progress-wrap{
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:10px;
}
.goal-image{
  width:110px; height:110px;
  border-radius:30px;
  padding:8px;
  background: radial-gradient(circle at 30% 30%, rgba(255,39,70,.3), rgba(255,39,70,.05) 60%, transparent 70%);
  box-shadow: var(--glow);
  border:1px solid rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center;
}
.goal-image img{
  width:100%; height:100%; object-fit:cover;
  border-radius:22px;
  filter: contrast(1.05) saturate(1.1);
}
.progress-bar{
  position:relative;
  width:22px; height:56vh; min-height:320px;
  background: linear-gradient(180deg,#12121a,#0c0c12);
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  box-shadow: inset 0 0 18px rgba(255,39,70,.06);
}
.progress-glow{
  position:absolute; inset:0;
  box-shadow: inset 0 0 30px rgba(255,39,70,.25);
  pointer-events:none;
}
.progress-fill{
  position:absolute; bottom:0; left:0; right:0;
  height:0%;
  background: linear-gradient(180deg, rgba(255,39,70,.95), rgba(255,39,70,.6));
  box-shadow: 0 -6px 16px rgba(255,39,70,.7);
  transition: height .9s cubic-bezier(.22,.99,.13,.99);
}

.goal-note{
  font-size:12px; color:var(--muted); text-align:center; min-height:18px;
}

/* ---------- Logs table ---------- */
.table-card{margin-top:16px}
.table-head, .table-row{
  display:grid;
  grid-template-columns: 1.1fr .8fr .8fr .7fr .7fr .5fr;
  gap:10px;
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.table-head{color:var(--muted); font-size:12px}
.table-rows{max-height:52vh; overflow:auto}
.row-actions .del{background:transparent;border:none;color:#ff93a1;cursor:pointer}

.table-actions{display:flex; gap:10px; padding:12px}

/* ---------- Chips ---------- */
.chips{display:flex; gap:8px; flex-wrap:wrap; margin:6px 0 12px}
.chip{
  background:#0f0f16; color:var(--text);
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px; padding:8px 12px; cursor:pointer;
}
.chip.active{border-color: var(--accent); box-shadow: var(--glow)}

/* ---------- Bottom nav ---------- */
.bottom-nav{
  position:fixed; bottom:0; left:0; right:0; z-index:60;
  display:flex; justify-content:space-around; align-items:center;
  background: rgba(10,10,14,.75); backdrop-filter: blur(8px);
  border-top:1px solid rgba(255,255,255,.08);
  padding:10px 0;
}
.nav-link{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color:var(--muted); text-decoration:none; font-weight:700;
}
.nav-link .icon{font-size:18px}
.nav-link.active{color:var(--text)}
.nav-link.active .icon, .nav-link.active{ text-shadow: var(--glow); color:white}

/* ---------- Helpers ---------- */
.hint{color:var(--muted); font-size:12px}
.credits{
  position:fixed; right:10px; bottom:58px; color:var(--muted); font-size:10px; opacity:.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .stats-grid{grid-template-columns: 1fr 1fr 1fr}
}
@media (max-width: 720px){
  .dashboard{grid-template-columns: 1fr 90px}
  .progress-bar{height:50vh}
}
@media (max-width: 480px){
  .stats-grid{grid-template-columns: 1fr 1fr}
  .table-head, .table-row{grid-template-columns: .9fr .7fr .7fr .6fr .6fr .5fr; font-size:14px}
}
