:root {
  --bg: #0f1116;
  --panel: #181b23;
  --panel-2: #1f232d;
  --line: #2b303c;
  --text: #e7e9ee;
  --muted: #98a0b0;
  --accent: #4c8dff;
  --danger: #ff6b6b;
  --ok: #46d29a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

#login { display: grid; place-items: center; min-height: 100vh; }
#login .card { width: min(380px, 92vw); }

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

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 14px; }

label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }

input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.ghost, button.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 500;
}

button.tab.active { color: var(--text); border-color: var(--accent); }
button.small { padding: 5px 10px; font-size: 13px; }
button.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}

header h1 { margin: 0; flex: 0 0 auto; }
header nav { display: flex; gap: 8px; flex: 1; }

main { max-width: 960px; margin: 24px auto; padding: 0 20px; }

.list { display: grid; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .meta { color: var(--muted); font-size: 13px; }

.badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #24304a;
  color: #cfe0ff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.lesson { display: grid; gap: 6px; }

.attachments {
  display: grid;
  gap: 6px;
  margin: 0 0 6px 18px;
  padding: 10px 12px;
  border-left: 2px solid var(--line);
}

.attachment { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.attachment .grow { flex: 1; min-width: 0; }

.kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 5px;
  background: #2c3446;
  color: #b9c6e0;
}

.attachments input[type='file'] { font-size: 12px; padding: 6px; }

.hint { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.error { color: var(--danger); min-height: 18px; margin: 8px 0 0; font-size: 13px; }
.success { color: var(--ok); min-height: 18px; margin: 4px 0 0; font-size: 13px; }
progress { width: 100%; margin-top: 10px; }
