:root {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-hover: #eef0f4;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e0e2e8;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ─── HEADER ──────────────────────────────────────────────────────────── */

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
}

.logo-img {
  height: 36px;
  width: auto;
}

.header-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-size: 1.1rem;
  text-transform: uppercase;
}

/* ─── MAIN ────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* ─── TABS ────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.tab-icon { margin-right: 0.2rem; }

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ─── FILE TABLE ──────────────────────────────────────────────────────── */

.file-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.file-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.file-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.file-table tbody tr:last-child td {
  border-bottom: none;
}

.file-table tbody tr:hover {
  background: var(--bg-hover);
}

.file-name {
  font-weight: 500;
  word-break: break-all;
}

.file-size, .file-date {
  color: var(--text-muted);
  white-space: nowrap;
}

.file-action {
  text-align: center;
  width: 50px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-download:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── EMPTY STATE ─────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.empty-state .hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

.empty-state code {
  background: var(--bg-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text);
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── ERROR ───────────────────────────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* ─── FOOTER ──────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .header-title { display: none; }
  .header-inner { justify-content: flex-start; }
  .logo { position: static; }
  .file-date { display: none; }
  .tab-btn { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
}
