:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --radius: 10px;
  --max-w: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Górny pasek nagłówka */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand p {
  margin: 2px 0 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Główny układ strony */
.page-wrapper {
  max-width: var(--max-w);
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

/* Nagłówki sekcji */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Listy materiałów */
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background-color 140ms ease;
}

.resource-link:last-child,
.resource-group:last-child {
  border-bottom: none;
}

.resource-link:hover {
  background-color: var(--surface-hover);
}

/* Grupa wielu plików w jednym laboratorium */
.resource-group {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.group-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.sub-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 52px; /* wyrównanie pod tytułem (36px ikona + 16px gap) */
}

.sub-file-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.sub-file-link:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}

.file-ext {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.sub-file-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.item-num {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.item-num.rules {
  background: var(--danger-soft);
  color: var(--danger);
}

.item-body {
  min-width: 0;
  flex: 1;
}

.item-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.item-desc {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
}

.item-arrow {
  color: #94a3b8;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 140ms ease, color 140ms ease;
}

.resource-link:hover .item-arrow,
.sub-file-link:hover .item-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Panele w kolumnie bocznej */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 14px;
}

.info-box h3 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-list li {
  color: var(--muted);
}

.info-list strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

.info-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.info-list a:hover {
  text-decoration: underline;
}

code {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

/* Wyróżnienie ogłoszenia dla Lab 2 */
.notice-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 14px;
  color: var(--warning-text);
}

.notice-box h3 {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
}

.notice-box ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Stopka */
.site-footer {
  max-width: var(--max-w);
  margin: 48px auto 24px;
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Skalowanie na mniejsze ekrany */
@media (max-width: 860px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    margin-top: 24px;
    gap: 24px;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 16px;
  }

  .page-wrapper {
    padding: 0 16px;
  }

  .resource-link,
  .resource-group {
    padding: 12px 14px;
  }

  .sub-files {
    padding-left: 0;
  }
}

/* Osobne kontenery dla każdego laboratorium */
.labs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lab-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}

.lab-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.lab-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.lab-files-list {
  display: flex;
  flex-direction: column;
}

.lab-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background-color 140ms ease;
}

.lab-file-row:last-child {
  border-bottom: none;
}

.lab-file-row:hover {
  background: var(--bg);
}

.lab-file-row:hover .item-arrow {
  transform: translateX(3px);
  color: var(--accent);
}