* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f8;
  color: #2c3e50;
}
.hidden { display: none !important; }

/* --- Auth --- */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 340px;
}
.auth-card h1 { margin: 0 0 4px; text-align: center; }
.auth-card .subtitle { text-align: center; color: #7f8c8d; margin-bottom: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input {
  padding: 10px 12px;
  border: 1px solid #dcdfe3;
  border-radius: 6px;
  font-size: 14px;
}
.auth-card button {
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #3498db;
  color: white;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
}
.auth-card button:hover { background: #2d80b8; }
.switch { text-align: center; font-size: 13px; margin-top: 16px; }
.message { text-align: center; font-size: 13px; min-height: 18px; margin-top: 10px; }
.message.error { color: #e74c3c; }
.message.success { color: #27ae60; }

/* --- Topbar --- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 14px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
#user-name { font-size: 14px; color: #555; }
.topbar button, .toolbar button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #3498db;
  color: white;
  cursor: pointer;
  font-size: 13px;
}
.topbar button:hover, .toolbar button:hover { background: #2d80b8; }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 24px 0;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #7f8c8d;
  border-bottom: 3px solid transparent;
}
.tab-btn.active { color: #2c3e50; border-bottom-color: #3498db; font-weight: 600; }

.tab-content { padding: 20px 24px; }

/* --- Toolbar --- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #dcdfe3;
  border-radius: 6px;
  font-size: 14px;
}
.toolbar input[type="color"] { width: 44px; height: 40px; border: none; padding: 0; border-radius: 6px; }

/* --- Favoris list --- */
.favoris-list { display: flex; flex-direction: column; gap: 10px; }
.favori-card {
  background: white;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.favori-main { flex: 1; min-width: 0; }
.favori-main a {
  font-weight: 600;
  color: #2980b9;
  text-decoration: none;
  word-break: break-all;
}
.favori-main a:hover { text-decoration: underline; }
.favori-desc { color: #555; font-size: 14px; margin: 4px 0; }
.favori-meta { font-size: 12px; color: #999; }
.favori-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tag-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: white;
}
.favori-actions { display: flex; gap: 6px; flex-shrink: 0; }
.favori-actions button {
  border: none;
  background: #ecf0f1;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.favori-actions button:hover { background: #dfe4e6; }
.favori-actions .btn-delete:hover { background: #f5c6c6; }

/* --- Tags list --- */
.tags-list { display: flex; flex-direction: column; gap: 8px; }
.tag-row {
  background: white;
  padding: 10px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tag-row .tag-pill { font-size: 13px; padding: 4px 12px; }
.tag-row-actions { margin-left: auto; display: flex; gap: 6px; }
.tag-row-actions button {
  border: none;
  background: #ecf0f1;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

/* --- Modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-content {
  background: white;
  padding: 26px;
  border-radius: 10px;
  width: 420px;
  max-width: 90vw;
}
.modal-content h2 { margin-top: 0; }
.modal-content form { display: flex; flex-direction: column; gap: 4px; }
.modal-content label { font-size: 13px; color: #666; margin-top: 8px; }
.modal-content input, .modal-content textarea {
  padding: 9px 11px;
  border: 1px solid #dcdfe3;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.modal-content textarea { resize: vertical; min-height: 60px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions button {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #3498db;
  color: white;
}
.btn-secondary { background: #ecf0f1 !important; color: #333 !important; }
