:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e2e6ec;
  --text: #1c2430;
  --muted: #6b7686;
  --primary: #2456d6;
  --primary-dark: #1a3fa8;
  --danger: #d63b3b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.top-bar h1 {
  font-size: 18px;
  margin: 0;
}

.top-bar a.logout {
  color: var(--danger);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.top-bar a.logout:hover { text-decoration: underline; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.login-card p.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 16px;
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

.login-card button {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:hover { background: var(--primary-dark); }

.error-msg {
  background: #fdeaea;
  color: var(--danger);
  border: 1px solid #f4c6c6;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Dashboard */
.category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}

.category-header {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-header span.count {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.file-row:last-child { border-bottom: none; }

.file-info { min-width: 0; }

.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.download-btn {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.download-btn:hover { background: var(--primary-dark); }

.empty-note {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs {
  padding: 10px 2px 16px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs .crumb {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumbs .crumb:hover { text-decoration: underline; }

.breadcrumbs .crumb.current {
  color: var(--text);
  font-weight: 600;
}

.breadcrumbs .crumb-sep {
  margin: 0 6px;
  color: var(--muted);
}

a.folder-row {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.folder-row:hover { background: var(--bg); }

.folder-icon { margin-right: 2px; }

.open-btn {
  flex-shrink: 0;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
