* { box-sizing: border-box; }

:root {
  --bg: #1a1a1a;
  --panel: #252525;
  --panel-hover: #2e2e2e;
  --border: #333;
  --text: #e8e8e8;
  --muted: #8a8a8a;
  --accent: #9b7bff;
  --accent-hover: #b095ff;
  --danger: #ff5a5a;
  --success: #5ad27a;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

/* ---- LOGIN ---- */

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

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card h1 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card button {
  width: 100%;
  padding: 12px 14px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button:hover { background: var(--accent-hover); }
.login-card button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

/* ---- APP ---- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); background: var(--panel); }

/* ---- BOARD ---- */

.board {
  flex: 1;
  padding: 28px;
  position: relative;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 80px 20px;
  font-size: 14px;
}

/* ---- CARDS ---- */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}

.card:hover {
  background: var(--panel-hover);
  border-color: #444;
}

.card.uploading {
  border-color: var(--accent);
  border-style: dashed;
}
.card.error { border-color: var(--danger); }

.card .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.card .name {
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.35;
  margin-bottom: 6px;
  max-height: 3.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card .meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.card .actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover .actions { opacity: 1; }

.card .actions button,
.card .actions a {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.4);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s;
}

.card .actions button:hover,
.card .actions a:hover { background: rgba(0,0,0,0.7); }
.card .actions .delete:hover { background: var(--danger); }

.progress-wrap {
  margin-top: 10px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.15s ease-out;
}

.card .error-msg {
  color: var(--danger);
  font-size: 11px;
  margin-top: 8px;
}

/* ---- DROP OVERLAY ---- */

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(155, 123, 255, 0.1);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}
.drop-inner {
  padding: 40px 60px;
  border: 3px dashed var(--accent);
  border-radius: 16px;
  font-size: 20px;
  color: var(--accent);
  font-weight: 500;
}
