/* ─── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  /* Fixed theme: monokai-solarized */
  --bg: #1e1e1e;
  --surface: #2d2d30;
  --surface2: #3e3e42;
  --border: #555555;
  --accent: #268bd2;
  --accent2: #2aa198;
  --text: #d4d4d4;
  --text-muted: #858585;
  --green: #859900;
  --red: #dc322f;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Navigation ──────────────────────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-brand span { font-size: 1.3rem; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user { color: var(--text-muted); font-size: 0.875rem; }
.nav-user strong { color: var(--text); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s;
  margin-left: 0.5rem;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.nav-admin {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s;
}
.nav-admin:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Layout ───────────────────────────────────────────────────────────── */
.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 2rem 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* ─── Sections ─────────────────────────────────────────────────────────── */
.section { margin-bottom: 2.5rem; }
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── File grid ────────────────────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.file-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-1px);
}
.file-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
}
.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ─── Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-md { background: #1e3a5f; color: #60a5fa; }
.badge-pdf { background: #3b1e1e; color: #f87171; }
.badge-workshop { background: #2f3b1e; color: #a3d63f; }
.badge-folder { background: #3a2a4d; color: #c084fc; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #0f1117; }
.btn-primary:hover { background: #849aff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Date groups ──────────────────────────────────────────────────────── */
.date-group { margin-bottom: 1.75rem; }
.date-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-family: var(--mono);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.date-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── Login ────────────────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2.75rem;
  width: 100%;
  max-width: 400px;
}
.login-logo { font-size: 2.5rem; text-align: center; margin-bottom: 0.5rem; }
.login-title { text-align: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #0f1117;
  border: none;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
  font-family: var(--font);
}
.form-submit:hover { background: #849aff; }
.error-msg {
  background: #2d1515;
  border: 1px solid #7f1d1d;
  color: var(--red);
  padding: 0.6rem 0.9rem;
  border-radius: 7px;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

/* ─── Breadcrumb ───────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ─── Stats bar ────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stat-icon { font-size: 1.4rem; }
.stat-val { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
