:root {
  --bg: #0f0f1a;
  --bg2: #1a1a2e;
  --bg3: #16213e;
  --accent: #4cc9f0;
  --danger: #e94560;
  --success: #4cc9f0;
  --text: #e0e0e0;
  --text-dim: #aaaaaa;
  --text-muted: #555555;
  --tab-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, sans-serif; overflow: hidden; }

#app { display: flex; flex-direction: column; height: 100%; }

#view-container { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }

#tab-bar {
  display: flex;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #0a0a14;
  border-top: 1px solid #222;
  flex-shrink: 0;
}

.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted); cursor: pointer; gap: 2px;
  font-size: 10px; padding: 8px 0;
}
.tab.active { color: var(--accent); }
.tab-icon { font-size: 20px; }

.hidden { display: none !important; }

/* Bottom sheet */
#bottom-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100;
}
#bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
  background: #0a0a14; border-top: 2px solid var(--accent);
  border-radius: 12px 12px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  transform: translateY(100%); transition: transform 0.3s ease;
}
#bottom-sheet.open { transform: translateY(0); }

.sheet-handle { width: 32px; height: 4px; background: #444; border-radius: 2px; margin: 0 auto 16px; }

/* Cards / fields */
.field { background: var(--bg2); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.field-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.field-value { font-size: 14px; color: var(--text); }

/* Buttons */
.btn-primary {
  width: 100%; padding: 12px; background: var(--accent); color: #000;
  font-weight: 700; font-size: 14px; border: none; border-radius: 6px; cursor: pointer;
}
.btn-danger { background: var(--danger); color: #fff; }

/* Entry list */
.entry-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg2); border-radius: 6px; padding: 12px; margin-bottom: 6px;
  border-left: 3px solid var(--accent);
}
.entry-project { font-size: 13px; color: var(--text); }
.entry-hours { font-size: 16px; font-weight: 700; color: var(--accent); }

/* Status colours */
.status-complete { color: var(--success); }
.status-incomplete { color: var(--danger); }
.status-weekend { color: var(--text-muted); }

/* Day header */
.day-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.day-title { font-size: 16px; font-weight: 700; color: var(--accent); }
.day-hours { font-size: 13px; }

/* Week grid */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 12px 16px; }
.week-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg2); border-radius: 6px; padding: 8px 4px; cursor: pointer;
}
.week-cell.today { border: 1px solid var(--accent); }
.week-cell-day { font-size: 10px; color: var(--text-muted); }
.week-cell-hours { font-size: 12px; font-weight: 700; }

/* FAB */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent);
  color: #000; font-size: 24px; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(76,201,240,0.4); display: flex; align-items: center; justify-content: center;
}

/* Select dropdown */
select.field-select {
  width: 100%; background: none; border: none; color: var(--text); font-size: 14px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}

/* Hours input */
.hours-input { padding: 4px 0; }

.hours-display {
  text-align: center; font-size: 28px; font-weight: 700; color: var(--accent);
  background: #0a0a1a; border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px; margin-bottom: 12px;
}

.slider-wrap { margin-bottom: 8px; }

.slider-track {
  position: relative; height: 6px; background: #0f3460; border-radius: 3px;
  margin-bottom: 4px; cursor: pointer;
}

.slider-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--accent); border-radius: 3px; pointer-events: none;
  width: 50%;
}

.slider-center-mark {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: -4px; width: 2px; height: 14px; background: var(--accent);
  opacity: 0.4; border-radius: 1px; pointer-events: none;
}

.slider-thumb {
  position: absolute; top: 50%; margin-top: -10px;
  width: 20px; height: 20px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 8px rgba(76,201,240,0.6); pointer-events: none;
  left: calc(50% - 10px);
}

.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-muted); padding: 0 2px;
}
.slider-label-center { color: var(--accent); }

.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px;
}
.numpad-key {
  background: var(--bg2); border: none; border-radius: 4px; padding: 10px;
  color: var(--text); font-size: 16px; cursor: pointer; text-align: center;
}
.numpad-key:active { background: var(--bg3); }
