:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-border: #262b36;
  --text: #e8eaed;
  --text-dim: #9aa1ac;
  --accent: #4f8cff;
  --accent-dim: #2b3a5c;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.topbar .who {
  font-size: 13px;
  color: var(--text-dim);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.login-card {
  max-width: 380px;
  margin: 80px auto;
}

.login-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.login-card p {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  margin-top: 16px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #10131a;
  color: var(--text);
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  transition: opacity 0.15s ease;
}

button:hover { opacity: 0.88; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 22px;
}

.btn-checkin {
  background: var(--green);
  color: #06281c;
}

.btn-checkout {
  background: var(--red);
  color: #2b0a0a;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-in { background: rgba(52,211,153,0.15); color: var(--green); }
.status-out { background: rgba(248,113,113,0.15); color: var(--red); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.clock {
  text-align: center;
  padding: 20px 0;
}

.clock .time {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 1px;
}

.clock .date {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.actions button {
  flex: 1;
  max-width: 220px;
  padding: 14px 20px;
  font-size: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
}

th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }

.error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

a.link, .link-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #10131a;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px;
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .summary-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions button { max-width: none; }
}

/* Monitoring dashboard additions */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.select-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.select-row .field { flex: 1; min-width: 160px; }
.select-row label { margin-top: 0; }

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #10131a;
  color: var(--text);
  font-size: 14px;
}

.progress-bar {
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  background: #10131a;
  margin: 10px 0;
  border: 1px solid var(--card-border);
}

.progress-seg { height: 100%; }
.seg-productive { background: var(--green); }
.seg-unproductive { background: var(--red); }
.seg-neutral { background: var(--amber); }
.seg-uncategorized { background: #4b5563; }
.seg-idle { background: #2a2e38; }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.bar-row .bar-label {
  width: 160px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row .bar-track {
  flex: 1;
  height: 10px;
  background: #10131a;
  border-radius: 5px;
  overflow: hidden;
}

.bar-row .bar-fill { height: 100%; }
.bar-row .bar-value { width: 60px; text-align: right; color: var(--text-dim); flex-shrink: 0; }

.label-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.tag-productive { background: rgba(52,211,153,0.15); color: var(--green); }
.tag-unproductive { background: rgba(248,113,113,0.15); color: var(--red); }
.tag-neutral { background: rgba(251,191,36,0.15); color: var(--amber); }
.tag-uncategorized { background: rgba(107,114,128,0.2); color: #9ca3af; }

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.screenshot-card {
  background: #10131a;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.screenshot-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #000;
}

.screenshot-card .meta {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}

.category-row .cat-name { flex: 1; }
.category-row .cat-type { color: var(--text-dim); width: 60px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form .field { flex: 1; min-width: 140px; }
.inline-form label { margin-top: 0; }
.inline-form button { white-space: nowrap; }
