@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-alt: #1d212a;
  --border: #262b36;
  --text: #e7e9ee;
  --text-muted: #838a9c;
  --accent: #4fd1ae;
  --accent-dim: #2e5e51;
  --warn: #e8a353;
  --danger: #e2645f;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* --- Rail boczny z zakladkami --- */
.rail {
  width: 210px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 10px 18px;
  letter-spacing: 0.02em;
}

.rail-title strong { color: var(--text); }

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  font-size: 14px;
  user-select: none;
}

.tab:hover { color: var(--text); background: var(--panel-alt); }

.tab.active {
  color: var(--text);
  background: var(--panel-alt);
  border-left: 2px solid var(--accent);
}

.rail-spacer { flex: 1; }

.tab-settings {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px 12px;
}
.tab-settings:hover { color: var(--text); }

/* --- Glowna zawartosc --- */
main {
  flex: 1;
  padding: 32px 40px;
  max-width: 640px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 28px;
}

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

/* --- Formularze --- */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
textarea {
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

textarea { resize: vertical; min-height: 60px; }

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

.row { display: flex; gap: 12px; }
.row > .field { flex: 1; }

button {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

button:hover { background: var(--accent); color: #0f1115; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
button.ghost:hover { background: var(--panel-alt); color: var(--text); }

button.small { padding: 5px 10px; font-size: 12px; }

/* --- Listy --- */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }

.item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.item.due { border-left-color: var(--warn); }
.item.done { opacity: 0.45; }

.item-content { flex: 1; min-width: 0; }
.item-message { font-size: 14px; }
.item-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.checkbox {
  width: 18px; height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}

.empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
  font-style: italic;
}

/* --- Ustawienia (modal) --- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay.active { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 340px;
}

.modal h2 { font-size: 15px; margin: 0 0 16px; }

.status-bar {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 6px;
}
.status-dot.ok { background: var(--accent); }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .rail {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px;
  }
  .rail-title, .rail-spacer { display: none; }
  main { padding: 20px; max-width: 100%; }
}
