:root {
  --bg: #0e0f11;
  --bg2: #16181c;
  --bg3: #1e2026;
  --bg4: #262930;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --text: #f0f0ee;
  --text2: #9b9ea8;
  --text3: #5c5f6b;
  --accent: #6ee7b7;
  --accent2: #34d399;
  --accent-dim: rgba(110, 231, 183, 0.12);
  --accent-dim2: rgba(110, 231, 183, 0.06);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 220px;
  --font: "Sora", sans-serif;
  --mono: "DM Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 2px;
}

/* LAYOUT */
#shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.content {
  padding: 24px 28px;
  flex: 1;
}

/* GRID */
.card-grid {
  display: grid;
  gap: 12px;
}
.grid-2 {
  grid-template-columns: 1fr 1fr;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* UTILS */
.view {
  display: none;
}
.view.active {
  display: block;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.section-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
}
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  transition: all 0.12s;
}
.filter-pill:hover {
  color: var(--text);
  border-color: var(--border2);
}
.filter-pill.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(110, 231, 183, 0.3);
}

/* NOTIFICATION */
#notif {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--accent);
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.25s;
  pointer-events: none;
}
#notif.show {
  transform: translateY(0);
  opacity: 1;
}
#notif.error {
  border-color: var(--red);
  color: var(--red);
}

/* PROGRESS */
.prog-bg {
  background: var(--bg4);
  border-radius: 4px;
  height: 5px;
  margin-top: 6px;
}
.prog-fill {
  height: 5px;
  border-radius: 4px;
  transition: width 0.4s;
}
.prog-ok {
  background: var(--accent);
}
.prog-warn {
  background: var(--amber);
}
.prog-over {
  background: var(--red);
}

/* WEEK BARS */
.week-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.week-day {
  font-size: 11px;
  color: var(--text3);
  width: 24px;
  font-family: var(--mono);
}
.week-bg {
  flex: 1;
  background: var(--bg4);
  border-radius: 3px;
  height: 14px;
}
.week-fill {
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s;
}
.week-val {
  font-size: 11px;
  color: var(--text2);
  width: 36px;
  text-align: right;
  font-family: var(--mono);
}

/* LOG TABLE */
.log-head {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr 80px;
  gap: 12px;
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.log-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr 80px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
  transition: background 0.1s;
}
.log-row:hover {
  background: var(--bg3);
}
.log-row:last-child {
  border-bottom: none;
}

/* TIMER */
.timer-big {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -2px;
  color: var(--text);
  text-align: center;
  padding: 24px 0 8px;
}
.timer-big.running {
  color: var(--accent);
}
.timer-sub {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 20px;
}

/* TASK */
.task-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--bg4);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.task-item:hover {
  border-color: var(--border2);
}
.task-item.todo {
  border-left-color: var(--text3);
}
.task-item.in-progress {
  border-left-color: var(--blue);
}
.task-item.done {
  border-left-color: var(--accent);
}

/* COMMENT */
.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.comment-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* DOC */
.doc-content-display {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text2);
  white-space: pre-wrap;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

@media (max-width: 700px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  aside {
    display: none;
  }
}
